Skip to main content

GraphQL examples

Use one of the official endpoints from Airdrops Indexers. Address filter inputs must be lowercase.

Get recent campaigns for an asset

This query returns recent campaigns for an ERC-20 asset on a specific chain.

query getCampaignsForAsset($assetAddress: Bytes!, $chainId: BigInt!, $first: Int = 10) {
campaigns(
first: $first
orderBy: timestamp
orderDirection: desc
where: { chainId: $chainId, asset_: { address: $assetAddress } }
) {
id
address
chainId
category
admin
lockup
aggregateAmount
claimedAmount
claimedCount
totalRecipients
asset {
address
symbol
decimals
}
}
}

For larger maintained fixtures, see the Indexers equivalence queries. Schema source: src/schemas/airdrops.graphql.