This example shows how to create a GraphQL API for an ERC20 token using Ponder. It uses the Adventure Gold token contract.
{
account(id: "0x1337f7970E8399ccbc625647FCE58a9dADA5aA66") {
balance
approvals {
spender
amount
}
}
}
{
accounts(first: 10, orderBy: "balance", orderDirection: "desc") {
id
balance
}
}
{
accounts(where: { isOwner: true }) {
id
}
}
{
account(id: "0x1337f7970E8399ccbc625647FCE58a9dADA5aA66") {
transferEventsTo {
from
amount
}
transferEventsFrom {
to
amount
}
}
}