-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.graphql
208 lines (185 loc) · 4.74 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
type Erc20PriceOracleVaultFactory @entity {
id: ID!
address: Bytes!
childrenCount: BigInt!
children: [Erc20PriceOracleVault!] @derivedFrom(field: "erc20PriceOracleVaultFactory")
}
type TwoPriceOracleFactory @entity {
id: ID!
address: Bytes!
children: [TwoPriceOracle!]
childrenCount: BigInt!
}
type Erc20PriceOracleVault @entity{
id: ID!
deployBlock: BigInt!
erc20PriceOracleVaultFactory: Erc20PriceOracleVaultFactory!
priceOracle: TwoPriceOracle
name: String
symbol: String
decimals: Int
totalSupply: BigInt!
accounts: [Account!] @derivedFrom(field: "erc20PriceOracleVault")
balances: [ERC20Balance!] @derivedFrom(field: "contract")
approvals: [ERC20Approval!] @derivedFrom(field: "contract")
transfers: [ERC20Transfer!] @derivedFrom(field: "contract")
}
type TwoPriceOracle @entity{
id: ID!
value: BigInt
deployBlock: BigInt!
factory: TwoPriceOracleFactory!
}
type Account @entity {
id: ID!
erc20PriceOracleVault: Erc20PriceOracleVault!
address: Bytes!
ERC20balances: [ERC20Balance!] @derivedFrom(field: "account")
ERC20approvalsOwner: [ERC20Approval!] @derivedFrom(field: "owner")
ERC20approvalsSpender: [ERC20Approval!] @derivedFrom(field: "spender")
ERC20transferFromEvent: [ERC20Transfer!] @derivedFrom(field: "from")
ERC20transferToEvent: [ERC20Transfer!] @derivedFrom(field: "to")
Deposits: [Deposit!] @derivedFrom(field: "owner")
asERC1155: ERC1155Contract
ERC1155balances: [ERC1155Balance!] @derivedFrom(field: "account")
ERC1155operatorOwner: [ERC1155Operator!] @derivedFrom(field: "owner")
ERC1155operatorOperator: [ERC1155Operator!] @derivedFrom(field: "operator")
ERC1155transferFromEvent: [ERC1155Transfer!] @derivedFrom(field: "from")
ERC1155transferToEvent: [ERC1155Transfer!] @derivedFrom(field: "to")
ERC1155transferOperatorEvent: [ERC1155Transfer!] @derivedFrom(field: "operator")
events: [Event!] @derivedFrom(field: "emitter")
}
type erc20Contract @entity {
id: ID!
asAccount: Account!
name: String
symbol: String
decimals: Int!
totalSupply: ERC20Balance!
}
type ERC20Balance @entity {
id: ID!
contract: Erc20PriceOracleVault!
account: Account
value: BigDecimal!
valueExact: BigInt!
transfersFrom: [ERC20Transfer!]! @derivedFrom(field: "fromBalance")
transfersTo: [ERC20Transfer!]! @derivedFrom(field: "toBalance")
}
type ERC20Approval @entity {
id: ID!
contract: Erc20PriceOracleVault!
owner: Account!
spender: Account!
value: BigDecimal!
valueExact: BigInt!
}
type ERC20Transfer implements Event @entity {
id: ID!
emitter: Account!
transaction: Transaction!
timestamp: BigInt!
contract: Erc20PriceOracleVault!
from: Account
fromBalance: ERC20Balance
to: Account
toBalance: ERC20Balance
value: BigDecimal!
valueExact: BigInt!
}
type ERC1155Approval @entity {
id: ID!
contract: ERC1155Contract!
owner: Account!
spender: Account!
}
type ERC1155Contract @entity {
id: ID!
address: Bytes!
tokens: [ERC1155Token!] @derivedFrom(field: "contract")
balances: [ERC1155Balance!] @derivedFrom(field: "contract")
operators: [ERC1155Operator!] @derivedFrom(field: "contract")
transfers: [ERC1155Transfer!] @derivedFrom(field: "contract")
approvals: [ERC1155Approval!] @derivedFrom(field: "contract")
}
type ERC1155Token @entity {
id: ID!
contract: ERC1155Contract!
tokenId: BigInt!
uri: String!
totalSupply: BigInt!
balances: [ERC1155Balance!]! @derivedFrom(field: "token")
transfers: [ERC1155Transfer!]! @derivedFrom(field: "token")
}
type ERC1155Balance @entity {
id: ID!
contract: ERC1155Contract!
token: ERC1155Token!
account: Account!
value: BigInt!
transferFromEvent: [ERC1155Transfer!]! @derivedFrom(field: "fromBalance")
transferToEvent: [ERC1155Transfer!]! @derivedFrom(field: "toBalance")
}
type ERC1155Operator @entity {
id: ID!
contract: ERC1155Contract!
owner: Account!
operator: Account!
approved: Boolean!
}
type ERC1155Transfer implements Event @entity {
id: ID!
emitter: Account!
transaction: Transaction!
timestamp: BigInt!
contract: ERC1155Contract!
token: ERC1155Token!
operator: Account!
from: Account!
fromBalance: ERC1155Balance!
to: Account!
toBalance: ERC1155Balance!
value: BigInt!
}
interface Event {
id: ID!
transaction: Transaction!
emitter: Account!
timestamp: BigInt!
}
type Transaction @entity {
id: ID!
timestamp: BigInt!
blockNumber: BigInt!
events: [Event!] @derivedFrom(field: "transaction")
}
type Deposit @entity {
id: ID!
owner: Account!
shares: BigInt!
caller: Account!
assets: BigInt!
}
type Withdraw @entity {
id: ID!
assets: BigInt!
caller: Account!
owner: Account!
receiver: Account!
shares: BigInt!
}
type Construction @entity{
id: ID!
sender: Bytes!
name: String
symbol: String
uri: String
asset: Bytes
}
type Block @entity {
id: ID!
hash: Bytes
parentHash: Bytes
priceValue: BigInt
number: BigInt
}