2019-07-03 14:19:54 +00:00
|
|
|
#
|
|
|
|
# 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!
|
2019-07-29 12:00:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
# This entity is used to provide information about evolution of account balances
|
2019-08-02 14:38:57 +00:00
|
|
|
type AccountBalanceLog @entity {
|
2019-07-29 12:00:32 +00:00
|
|
|
id: ID!
|
|
|
|
account: Account!
|
|
|
|
token: Token!
|
|
|
|
amount: BigDecimal!
|
|
|
|
|
|
|
|
event: TokenEvent
|
|
|
|
|
|
|
|
block: BigInt!
|
|
|
|
transaction: Bytes!
|
|
|
|
timestamp: BigInt!
|
2019-07-26 17:33:31 +00:00
|
|
|
}
|
|
|
|
|
2019-07-03 14:19:54 +00:00
|
|
|
type Token @entity {
|
2019-07-26 17:33:31 +00:00
|
|
|
id: ID!
|
2019-07-03 14:19:54 +00:00
|
|
|
|
|
|
|
" 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
|
|
|
|
|
2019-07-17 19:49:26 +00:00
|
|
|
" Token flags"
|
|
|
|
flags: [String!]!
|
2019-07-03 14:19:54 +00:00
|
|
|
|
2019-07-17 19:49:26 +00:00
|
|
|
# TODO: Number of token holders
|
2019-07-03 14:19:54 +00:00
|
|
|
# holderCount: BigInt!
|
|
|
|
|
2019-07-17 19:49:26 +00:00
|
|
|
# TODO: Total token supply
|
2019-07-03 14:19:54 +00:00
|
|
|
# totalSupply: BigDecimal!
|
|
|
|
|
2019-07-17 19:49:26 +00:00
|
|
|
# TODO:
|
2019-07-03 14:19:54 +00:00
|
|
|
# totalMinted: BigDecimal
|
|
|
|
|
2019-07-17 19:49:26 +00:00
|
|
|
# TODO:
|
2019-07-03 14:19:54 +00:00
|
|
|
# totalBurned: BigDecimal
|
|
|
|
|
2019-07-17 02:36:40 +00:00
|
|
|
events: [TokenEvent!]! @derivedFrom(field: "token")
|
2019-07-03 14:19:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#
|
|
|
|
# Events
|
|
|
|
#
|
|
|
|
|
2019-07-17 02:36:40 +00:00
|
|
|
interface TokenEvent @entity {
|
|
|
|
id: ID!
|
|
|
|
token: Token!
|
2019-07-19 04:32:06 +00:00
|
|
|
amount: BigDecimal!
|
2019-07-17 02:36:40 +00:00
|
|
|
sender: Bytes!
|
2019-08-07 19:43:15 +00:00
|
|
|
|
|
|
|
block: BigInt!
|
|
|
|
timestamp: BigInt!
|
|
|
|
transaction: Bytes!
|
2019-07-03 14:19:54 +00:00
|
|
|
}
|
|
|
|
|
2019-08-02 14:38:57 +00:00
|
|
|
type BurnEvent implements TokenEvent @entity {
|
2019-07-03 14:19:54 +00:00
|
|
|
id: ID!
|
2019-07-17 02:36:40 +00:00
|
|
|
|
|
|
|
" Token address "
|
|
|
|
token: Token!
|
|
|
|
|
2019-07-19 04:32:06 +00:00
|
|
|
" Quantity of tokens burned "
|
|
|
|
amount: BigDecimal!
|
2019-07-17 02:36:40 +00:00
|
|
|
|
2019-07-17 19:49:26 +00:00
|
|
|
" Transaction sender address "
|
2019-07-17 02:36:40 +00:00
|
|
|
sender: Bytes!
|
|
|
|
|
|
|
|
" Address of burner account "
|
|
|
|
burner: Bytes!
|
2019-07-17 20:15:58 +00:00
|
|
|
|
|
|
|
" Block number "
|
|
|
|
block: BigInt!
|
|
|
|
|
|
|
|
" Event timestamp "
|
|
|
|
timestamp: BigInt!
|
2019-08-07 19:43:15 +00:00
|
|
|
|
|
|
|
" Transaction hash "
|
|
|
|
transaction: Bytes!
|
2019-07-03 14:19:54 +00:00
|
|
|
}
|
|
|
|
|
2019-08-02 14:38:57 +00:00
|
|
|
type MintEvent implements TokenEvent @entity {
|
2019-07-03 14:19:54 +00:00
|
|
|
id: ID!
|
2019-07-17 02:36:40 +00:00
|
|
|
|
|
|
|
" Token address "
|
|
|
|
token: Token!
|
|
|
|
|
|
|
|
" Quantity of tokens minted "
|
2019-07-19 04:32:06 +00:00
|
|
|
amount: BigDecimal!
|
2019-07-17 02:36:40 +00:00
|
|
|
|
2019-07-17 19:49:26 +00:00
|
|
|
" Transaction sender address "
|
2019-07-17 02:36:40 +00:00
|
|
|
sender: Bytes!
|
|
|
|
|
|
|
|
" Address of minter account "
|
|
|
|
minter: Bytes!
|
|
|
|
|
|
|
|
" Address of destination account "
|
|
|
|
destination: Bytes!
|
2019-07-17 20:15:58 +00:00
|
|
|
|
|
|
|
" Block number "
|
|
|
|
block: BigInt!
|
|
|
|
|
|
|
|
" Event timestamp "
|
|
|
|
timestamp: BigInt!
|
2019-08-07 19:43:15 +00:00
|
|
|
|
|
|
|
" Transaction hash "
|
|
|
|
transaction: Bytes!
|
2019-07-03 14:19:54 +00:00
|
|
|
}
|
|
|
|
|
2019-08-02 14:38:57 +00:00
|
|
|
type TransferEvent implements TokenEvent @entity {
|
2019-07-03 14:19:54 +00:00
|
|
|
id: ID!
|
2019-07-17 02:36:40 +00:00
|
|
|
|
|
|
|
" Token address "
|
|
|
|
token: Token!
|
|
|
|
|
|
|
|
" Quantity of tokens transferred "
|
2019-07-19 04:32:06 +00:00
|
|
|
amount: BigDecimal!
|
2019-07-17 02:36:40 +00:00
|
|
|
|
2019-07-17 19:49:26 +00:00
|
|
|
" Transaction sender address "
|
2019-07-17 02:36:40 +00:00
|
|
|
sender: Bytes!
|
|
|
|
|
|
|
|
" Address of source account "
|
|
|
|
source: Bytes!
|
|
|
|
|
|
|
|
" Address of destination account "
|
|
|
|
destination: Bytes!
|
2019-07-17 20:15:58 +00:00
|
|
|
|
|
|
|
" Block number "
|
|
|
|
block: BigInt!
|
|
|
|
|
|
|
|
" Event timestamp "
|
|
|
|
timestamp: BigInt!
|
2019-08-07 19:43:15 +00:00
|
|
|
|
|
|
|
" Transaction hash "
|
|
|
|
transaction: Bytes!
|
2019-07-03 14:19:54 +00:00
|
|
|
}
|