-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.graphql
88 lines (78 loc) · 2.91 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
type Account @entity {
id: ID!
balances: [Balance!]! @derivedFrom(field: "account")
transfersOperator: [Transfer!]! @derivedFrom(field: "operator")
transfersFrom: [Transfer!]! @derivedFrom(field: "from")
transfersTo: [Transfer!]! @derivedFrom(field: "to")
approvalsOwner: [Approval!]! @derivedFrom(field: "owner")
approvalsSpender: [Approval!]! @derivedFrom(field: "spender")
}
type TokenRegistry @entity {
id: ID!
tokens: [Token!]! @derivedFrom(field: "registry")
}
type Token @entity {
id: ID!
registry: TokenRegistry!
identifier: BigInt!
URI: String
totalSupply: BigInt!
balances: [Balance!]! @derivedFrom(field: "token")
transfers: [Transfer!]! @derivedFrom(field: "token")
approvals: [Approval!]! @derivedFrom(field: "token")
}
type Balance @entity {
id: ID!
token: Token!
account: Account!
registry: TokenRegistry!
value: BigInt!
transfersFrom: [Transfer!]! @derivedFrom(field: "fromBalance")
transfersTo: [Transfer!]! @derivedFrom(field: "toBalance")
}
type Transfer implements Event @entity {
id: ID!
transaction: Transaction!
timestamp: BigInt!
token: Token!
operator: Account!
from: Account!
fromBalance: Balance
to: Account!
toBalance: Balance
value: BigInt!
}
type Approval implements Event @entity {
id: ID!
transaction: Transaction!
timestamp: BigInt!
token: Token!
owner: Account!
spender: Account!
value: BigInt!
}
type DecimalValue @entity {
id: ID!
value: BigDecimal!
exact: BigInt!
decimals: Int!
}
interface Event {
id: ID!
transaction: Transaction!
timestamp: BigInt!
}
type Transaction @entity {
id: ID!
timestamp: BigInt!
blockNumber: BigInt!
events: [Event!]! @derivedFrom(field: "transaction")
}
type PersistentStringArray @entity {
id: ID!
values: [String!]!
}
type PersistentString @entity {
id: ID!
value: String!
}