erc20-subgraph/schema.graphql

155 lines
2.3 KiB
GraphQL
Raw Normal View History

#
# Main entities
#
2019-07-26 17:33:31 +00:00
type Account @entity {
id: ID!
address: Bytes!
}
type AccountBalance @entity {
id: ID!
account: Account!
token: Token!
amount: BigDecimal!
# TODO: timestamp: BigInt
}
type Token @entity {
2019-07-26 17:33:31 +00:00
id: ID!
" 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: BigDecimal!
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 burned "
amount: BigDecimal!
" 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: BigDecimal!
" 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: BigDecimal!
" 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!
}