forked from AcalaNetwork/acala-subql
-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.graphql
208 lines (179 loc) · 3.38 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 Block @entity {
id: ID!
number: BigInt
timestamp: Date
parentHash: String
specVersion: Int
extrinsics: [Extrinsic] @derivedFrom(field: "block")
events: [Event] @derivedFrom(field: "block")
}
type Extrinsic @entity {
id: ID!
method: String
section: String
args: String
signer: Account #create relation to account
nonce: BigInt
timestamp: Date
signature: String
tip: BigInt
isSigned: Boolean
isSuccess: Boolean
block: Block #create relation to block
events: [Event] @derivedFrom(field: "extrinsic")
calls: [Call] @derivedFrom(field: "extrinsic")
}
type Event @entity {
id: ID!
index: Int!
section: String!
method: String!
data: String!
block: Block #create relation to block
extrinsic: Extrinsic #create relation to extrins
}
type Call @entity {
id: ID!
section: String
method: String
args: String
timestamp: Date
isSuccess: Boolean
signer: Account #create ration to account
extrinsic: Extrinsic #create relation to extrinsic
parentCall: Call #create relation to call
calls: [Call] @derivedFrom(field: "parentCall")
}
type Account @entity {
id: ID!
extrinsics: [Extrinsic] @derivedFrom(field: "signer")
calls: [Call] @derivedFrom(field: "signer")
transferIn: [Transfer] @derivedFrom(field: "to")
transferOut: [Transfer] @derivedFrom(field: "from")
position: [LoanPosition] @derivedFrom(field: "account")
}
type Token @entity {
id: ID!
decimal: Int
name: String
}
type Transfer @entity {
id: ID!
from: Account
to: Account
token: Token
amount: BigInt
extrinsic: Extrinsic #create relation to extrinsic
call: Call #create relation to call
timestamp: Date
isSuccess: Boolean
}
#
#type LoanDayData @entity {
# id: ID!
#
# token: String!
# timestamp: Date!
#
# collateral: BigInt!
# debit: BigInt!
#}
#
type LoanPosition @entity {
id: ID!
account: Account
token: Token
debit: BigInt
collateral: BigInt
}
type LoanAction @entity {
id: ID!
account: Account
token: Token
collateral: BigInt
debit: BigInt
exchangeRate: BigInt
extrinsic: Extrinsic #create relation to extrinsic
call: Call #create relation to call
timestamp: Date
isSuccess: Boolean
}
#type Pair @entity {
# id: ID!
#
# token0: String!
# token1: String!
# totalSupply: BigInt!
#
# token0Volume: BigInt!
# token1Volume: BigInt!
#
# token0USD: BigInt!
# token1USD: BigInt!
#
# token0Price: BigInt!
# token1Price: BigInt!
#
# txCount: BigInt!
#}
#
#type SwapAction @entity {
# id: ID!
# isBatch: Int!
# isSudo: Int!
# isSuccess: Int!
#
# block: String!
# extrinsicHash: String!
# timestamp: Date!
#
# account: String!
# type: String!
# path: String!
# token0: String!
# token1: String!
# token0Input: String!
# token1Input: String!
# result: String!
#}
#
#type AddLiquidityHistory @entity {
# id: ID!
# isBatch: Int!
# isSudo: Int!
# isSuccess: Int!
#
# block: String!
# extrinsicHash: String!
# timestamp: Date!
#
# account: String!
# token0: String!
# token1: String!
#
# token0Input: BigInt!
# token1Input: BigInt!
#
# token0Amount: BigInt!
# token1Amount: BigInt!
# receivedShare: BigInt!
#}
#
#type RemoveLiquidityHistoryEntity @entity {
# id: ID!
# isBatch: Int!
# isSudo: Int!
# isSuccess: Int!
#
# block: String!
# timestamp: Date!
#
# account: String!
# token0: String!
# token1: String!
# removedShare: BigInt!
#
# token0Amount: BigInt!
# token1Amount: BigInt!
#}
#