-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.graphql
94 lines (72 loc) · 1.64 KB
/
schema.graphql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
type Account @entity {
id: ID!
address: String! @index @unique
tokens: [TokenBalance!]! @derivedFrom(field: "account")
}
type TokenBalance @entity {
id: ID!
account: Account!
token: Token!
value: BigInt!
}
enum TokenStandard {
ERC20
ERC721
ERC1155
}
type Contract @entity {
id: ID!
address: String! @index @unique
totalSupply: BigInt!
interfaces: [TokenStandard!]!
tokens: [Token!]! @derivedFrom(field: "contract")
transfers: [Transfer!]! @derivedFrom(field: "contract")
}
type Token @entity {
id: ID!
contract: Contract!
type: TokenStandard! @index
index: BigInt @index
supply: BigInt!
holders: [TokenBalance!]! @derivedFrom(field: "token")
mints: [Mint!]! @derivedFrom(field: "token")
transfers: [Transfer!]! @derivedFrom(field: "token")
burns: [Burn!]! @derivedFrom(field: "token")
}
interface Action @query {
id: ID!
blockNumber: Int!
timestamp: DateTime!
txnHash: String
contract: Contract!
token: Token!
}
type Transfer implements Action @entity {
id: ID!
blockNumber: Int! @index
timestamp: DateTime! @index
txnHash: String
contract: Contract!
token: Token!
from: Account!
to: Account!
amount: BigInt!
}
type Mint implements Action @entity {
id: ID!
blockNumber: Int! @index
timestamp: DateTime! @index
txnHash: String
contract: Contract!
token: Token!
amount: BigInt!
}
type Burn implements Action @entity {
id: ID!
blockNumber: Int! @index
timestamp: DateTime! @index
txnHash: String
contract: Contract!
token: Token!
amount: BigInt!
}