erc20-subgraph/schema.graphql

142 lines
2.1 KiB
GraphQL
Raw Normal View History

#
# 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!
# Information about to event itself
token: Token!
amount: BigInt!
sender: Bytes!
# Information about block and transaction
block: BigInt!
transaction: Bytes!
timestamp: BigInt!
}
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!
" Block number "
block: BigInt!
" Transaction hash "
transaction: Bytes!
" Event timestamp "
timestamp: BigInt!
}
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!
" Block number "
block: BigInt!
" Transaction hash "
transaction: Bytes!
" Event timestamp "
timestamp: BigInt!
}
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!
" Block number "
block: BigInt!
" Transaction hash "
transaction: Bytes!
" Event timestamp "
timestamp: BigInt!
}