erc20-subgraph/schema.graphql

109 lines
1.6 KiB
GraphQL

#
# Main entities
#
type Token @entity {
id: ID! # Same as token address
" Token address "
address: Bytes!
" Number of decimals the token uses "
decimals: Int!
" Human-readable name of the token "
name: String!
" Symbol of the token "
symbol: String!
" Token description "
description: String
" Image URL "
imageUrl: String
" Token flags"
flags: [String!]!
# TODO: Number of token holders
# holderCount: BigInt!
# TODO: Total token supply
# totalSupply: BigDecimal!
# TODO:
# totalMinted: BigDecimal
# TODO:
# totalBurned: BigDecimal
events: [TokenEvent!]! @derivedFrom(field: "token")
}
#
# Events
#
interface TokenEvent @entity {
id: ID!
token: Token!
amount: BigInt!
sender: Bytes!
}
type BurnEvent implements TokenEvent @entity {
id: ID!
" Token address "
token: Token!
" Quantity of tokens nurned "
amount: BigInt!
" Transaction sender address "
sender: Bytes!
" Address of burner account "
burner: Bytes!
}
type MintEvent implements TokenEvent @entity {
id: ID!
" Token address "
token: Token!
" Quantity of tokens minted "
amount: BigInt!
" Transaction sender address "
sender: Bytes!
" Address of minter account "
minter: Bytes!
" Address of destination account "
destination: Bytes!
}
type TransferEvent implements TokenEvent @entity {
id: ID!
" Token address "
token: Token!
" Quantity of tokens transferred "
amount: BigInt!
" Transaction sender address "
sender: Bytes!
" Address of source account "
source: Bytes!
" Address of destination account "
destination: Bytes!
}