Data Providers
Use a Data Provider
In a GroupGenerator
, users can query data. We have developed dataProviders
to facilitate querying. We currently support the following dataProviders
:
AlchemyProvider
: allows retrieving all holders of a specific NFT (ERC721 and ERC1155) on Ethereum mainnetAnkrProvider
: allows all holders of a specific token (ERC20 and ERC721) on specific networkAttestationStationProvider
: allows you to query any attestation on Optimism's AttestationStation using a SubgraphBigQueryProvider
: allows launching arbitrary BigQuery queries on the Ethereum mainnet and Polygon datasetDegenScoreProvider
: allows retrieving all holders of a beacon above a min score and with a specific traitGithubProvider
: allows you to quickly retrieve user information from GitHub (commiters, organization members, stargazers...)GitPoapProvider
: allows retrieving all Ethereum Addresses which have received a GitPoap with a given eventIdGraphQLProvider
: allows launching arbitrary graphQL queriesGuildProvider
: allows easily retrieving data from Guild.xyzHiveProvider
: allows you to easily retrieve data about Twitter influencersLensProvider
: allows retrieving social information on Lens Protocol (profiles, followers...)PoapSubgraphProvider
: allows retrieving all attendees of any eventsRestProvider
: allows launching arbitrary REST queriesSafeProvider
: allows retrieving all owners of given Safe wallet on the Ethereum mainnet.SnapshotProvider
: allows querying all voters for a proposal or for an entire spaceSubgraphHostedServiceProvider
: allows launching arbitrary queries on any subGraphTransposeProvider
: allows you to launch arbitrary SQL requests on the Ethereum mainnet with Transpose (token holders, smart contracts interactions...)WiwBadgeProvider
: allows you to query WIW badge holders
Let's use the SnapshotProvider
provider to create your group:
The above information displays how to use data from external sources. Below, you can see how to combine groups with each other using Data Operators.
You can find here a complete tutorial describing all the Data Provider creation process steps:
Sismo Hub Guide: Add a Data Provider to the Sismo FactoryCreate a new Data Provider
If you want to create a group by fetching accounts from an API for example, you can of course do it manually and put the hardcoded list of addresses in your group. But now if you want your group to be regularly updated (monthly, weekly, ord daily), you'll also have to manually update the group monthly, weekly or daily.
This is where Data Providers come in, they will allow you to fetch data (addresses or web2 accounts) in order to update your group.
Moreover creating your own Data Provider allow you or anyone to use it in the future to create a group.
Setup the Data Provider
First, you'll need to create a new directory with the name of your data provider here: ./group-generators/helpers/data-providers/<DATA_PROVIDER_NAME>
In this directory, you will have to create 2 different files:
index.ts
: It defines the API you want to use and the queries you want to add.interface-schema.json
: This file is very important because it will allow you to make your Data Provider usable in the Sismo Factory.
Make your Data Provider usable in the Sismo Factory
Building a Data Provider is good, but making it usable for everyone in the Sismo Factory is even better 🙌
Here's where the different Data Providers elements will be displayed on the Factory:
And here is how to setup this:
First, create the
interface-schema.json
file with this format:
Now, go to group-generators/helpers/data-providers/index.ts
file:
Import your schema:
Add it to the
dataProvidersInterfacesSchemas
:
Finally, as you can see, there is a black box at the bottom of the picture above. It allows users to see how many accounts your request will fetch (in real-time). It makes it easier for users to estimate their group size. So to set up this, add your Count Functions in the
dataProvidersAPIEndpoints
object :
You can explore the different Data Providers index.ts
files to see some Count Functions examples.
Do not hesitate to explore the different existing Data Providers and consider them as models. It will surely help you with building yours! 🙌
In addition, if you want to create a Data Provider that uses a GraphQL or a REST API, you can use the already existing GraphQL and REST Data Providers.
Want to contribute but don't have any ideas of Data Providers to add? Check out the Sismo GitHub's current issues https://github.com/sismo-core/sismo-hub/issues and our Contributing guide.
If you have any questions or you need help regarding Data Providers, do not hesitate to join our Discord and ask us in #dev-support. We will be glad to answer you 🤗
Last updated