generated from okp4/template-oss
-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.graphql
306 lines (295 loc) Β· 6.76 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
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
"""
AnyJSON is the type of a JSON object that can contain any valid JSON value.
"""
type AnyJSON @jsonField {
"""
Any other field of the message.
"""
_: String
}
"""
A JSON object that represents a Cosmos SDK message, with typeUrl being the type of the message.
"""
type MessageJSON @jsonField {
"""
Type of the message.
"""
typeUrl: String
"""
Any other field of the message.
"""
_: String
}
"""
A Cosmos SDK block in the blockchain.
"""
type Block @entity {
"""
Unique identifier of t he block and hash of the block.
"""
id: ID!
"""
Chain identifier of the blockchain.
"""
chainId: String! @index
"""
Height of the block in the blockchain.
"""
height: BigInt! @index
"""
Time at which the block was committed to the blockchain.
"""
timestamp: String!
"""
List of transactions contained in the block.
"""
transactions: [Transaction] @derivedFrom(field: "block")
"""
List of messages contained in the block transactions.
"""
messages: [Message] @derivedFrom(field: "block")
}
"""
A Cosmos SDK coin.
"""
type Coin @jsonField {
"""
Denomination of the coin.
"""
denom: String!
"""
Amount of the coin.
"""
amount: String!
}
"""
A Cosmos SDK transaction in the blockchain.
"""
type Transaction @entity {
"""
Unique identifier of the transaction and hash of the transaction.
"""
id: ID!
"""
Index of the transaction in the block.
"""
index: Int! @index
"""
Block that transaction belongs to.
"""
block: Block!
"""
Gas used by the transaction.
"""
gasUsed: BigInt!
"""
Gas wanted by the transaction.
"""
gasWanted: BigInt!
"""
List of fees paid by the transaction.
"""
fees: [Coin]!
"""
A memo that can be attached to the transaction.
"""
memo: String @index
"""
Log of the transaction.
"""
log: AnyJSON!
"""
Timeout height of the transaction.
"""
timeoutHeight: BigInt @index
"""
List of messages contained in the transaction.
"""
messages: [Message] @derivedFrom(field: "transaction")
}
"""
A Cosmos SDK message in the blockchain.
"""
type Message @entity {
"""
Unique identifier of the message and hash of the message.
"""
id: ID!
"""
The decoded message in JSON format.
"""
message: MessageJSON!
"""
Transaction that message belongs to.
"""
transaction: Transaction!
"""
Block that message belongs to.
"""
block: Block!
"""
Objectarium that message relates to (for a message which concerns an objectarium smart contract).
"""
objectarium: Objectarium
"""
Object that message relates to (for a message which concerns an object).
"""
objectariumObject: ObjectariumObject
"""
Smart contract from which smart contract instances are created.
"""
contract: Contract
}
"""
Type of an object stored in the Objectarium smart contract instance.
"""
type ObjectariumObject @entity {
"""
Identifier of an object in the smart contract instance (aka bucket).
It is the hash of the object's content using the hash algorithm configured for the bucket.
"""
id: ID!
"""
Address of the user who stored the object.
"""
sender: String! @index
"""
The smart contract instance (aka bucket) where the object is stored.
"""
objectarium: Objectarium!
"""
Addresses that have pinned the object.
"""
pins: [String!]!
"""
List of messages that concern the object.
"""
messages: [Message]! @derivedFrom(field: "objectariumObject")
}
"""
BucketConfig is the type of the configuration of a bucket.
"""
type BucketConfig @jsonField {
"""
The algorithm used to hash the content of the objects to generate the id of the objects.
"""
hashAlgorithm: String
"""
The acceptable compression algorithms for the objects in the bucket.
"""
acceptedCompressionAlgorithms: [String!]
}
"""
BucketLimits is the type of the limits of a Objectarium bucket.
The limits are optional and if not set, there is no limit.
"""
type BucketLimits @jsonField {
"""
The maximum total size of the objects in the bucket.
"""
maxTotalSize: BigInt
"""
The maximum number of objects in the bucket.
"""
maxObjects: BigInt
"""
The maximum size of the objects in the bucket.
"""
maxObjectSize: BigInt
"""
The maximum number of pins in the bucket for an object.
"""
maxObjectPins: BigInt
}
"""
Objectarium smart contract instance (aka bucket).
"""
type Objectarium @entity {
"""
Identifier of the smart contract instance.
It is the address of the smart contract instance.
"""
id: ID!
"""
The owner of the bucket.
"""
owner: String!
"""
Label of the bucket.
"""
label: String!
"""
The name of the bucket.
"""
name: String!
"""
The configuration of the bucket.
"""
config: BucketConfig
"""
The limits of the bucket.
"""
limits: BucketLimits
"""
List of objects contained within the Objectarium instance.
"""
objectariumObjects: [ObjectariumObject] @derivedFrom(field: "objectarium")
"""
List of messages that concern the entity.
"""
messages: [Message]! @derivedFrom(field: "objectarium")
"""
Smart contract from which the bucket instance were created.
"""
contract: Contract!
}
"""
An object describing the permissions of a smart contract.
"""
type AccessConfig @jsonField {
# TODO: Change permission type to Enum for better value representaion.
# Explanation: As of date (12/09/2023) SubQuery does not support Enum fields in jsonFields
# See function "processFields" in https://github.com/subquery/subql/blob/main/packages/cli/src/controller/codegen-controller.ts.
"""
AccessType permission type.
"""
permission: String!
"""
Address concerned by permission.
"""
address: String!
"""
List of addresses included in the permission.
"""
addresses: [String]!
}
"""
COSMWASM smart contract.
"""
type Contract @entity {
"""
Identifier of the smart contract.
Corresponds to the code id of the contract.
"""
id: ID!
"""
The sha256sum hash of the contract.
"""
dataHash: String!
"""
The creator of the smart contract.
"""
creator: String!
"""
Contract creation permissions.
"""
instantiatePermission: AccessConfig
"""
List of messages that concern the smart contract.
"""
messages: [Message]! @derivedFrom(field: "contract")
"""
List of objectarium smart contracts instantiated from contract.
"""
objectariums: [Objectarium] @derivedFrom(field: "contract")
}