forked from ArweaveTeam/gateway
-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.graphql
334 lines (321 loc) · 6.86 KB
/
types.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
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
type Query {
"""
Get a transaction by its id
"""
transaction(id: ID!): Transaction
"""
Get a paginated set of matching transactions using filters.
"""
transactions(
"""
Find transactions from a list of ids.
"""
ids: [ID!]
"""
Find transactions from a list of owner wallet addresses, or wallet owner public keys.
"""
owners: [String!]
"""
Find transactions from a list of recipient wallet addresses.
"""
recipients: [String!]
"""
Find transactions using tags.
"""
tags: [TagFilter!]
"""
Find data items from the given data bundles.
See: https://github.com/ArweaveTeam/arweave-standards/blob/master/ans/ANS-102.md
"""
bundledIn: [ID!]
"""
Find transactions within a given block height range.
"""
block: BlockFilter
"""
Result page size (max: 100)
"""
first: Int = 10
"""
A pagination cursor value, for fetching subsequent pages from a result set.
"""
after: String
"""
Optionally specify the result sort order.
"""
sort: SortOrder = HEIGHT_DESC
): TransactionConnection!
block(id: String): Block
blocks(
"""
Find blocks from a list of ids.
"""
ids: [ID!]
"""
Find blocks within a given block height range.
"""
height: BlockFilter
"""
Result page size (max: 100)
"""
first: Int = 10
"""
A pagination cursor value, for fetching subsequent pages from a result set.
"""
after: String
"""
Optionally specify the result sort order.
"""
sort: SortOrder = HEIGHT_DESC
): BlockConnection!
}
"""
Optionally reverse the result sort order from `HEIGHT_DESC` (default) to `HEIGHT_ASC`.
"""
enum SortOrder {
"""
Results are sorted by the transaction block height in ascending order, with the oldest transactions appearing first, and the most recent and pending/unconfirmed appearing last.
"""
HEIGHT_ASC
"""
Results are sorted by the transaction block height in descending order, with the most recent and unconfirmed/pending transactions appearing first.
"""
HEIGHT_DESC
}
"""
Find transactions with the folowing tag name and value
"""
input TagFilter {
"""
The tag name
"""
name: String!
"""
An array of values to match against. If multiple values are passed then transactions with _any_ matching tag value from the set will be returned.
e.g.
\`{name: "app-name", values: ["app-1"]}\`
Returns all transactions where the \`app-name\` tag has a value of \`app-1\`.
\`{name: "app-name", values: ["app-1", "app-2", "app-3"]}\`
Returns all transactions where the \`app-name\` tag has a value of either \`app-1\` _or_ \`app-2\` _or_ \`app-3\`.
"""
values: [String!]!
"""
The operator to apply to to the tag filter. Defaults to EQ (equal).
"""
op: TagOperator = EQ
}
"""
Find blocks within a given range
"""
input BlockFilter {
"""
Minimum block height to filter from
"""
min: Int
"""
Maximum block height to filter to
"""
max: Int
}
"""
Paginated result set using the GraphQL cursor spec,
see: https://relay.dev/graphql/connections.htm.
"""
type BlockConnection {
pageInfo: PageInfo!
edges: [BlockEdge!]!
}
"""
Paginated result set using the GraphQL cursor spec.
"""
type BlockEdge {
"""
The cursor value for fetching the next page.
Pass this to the \`after\` parameter in \`blocks(after: $cursor)\`, the next page will start from the next item after this.
"""
cursor: String!
"""
A block object.
"""
node: Block!
}
"""
Paginated result set using the GraphQL cursor spec,
see: https://relay.dev/graphql/connections.htm.
"""
type TransactionConnection {
pageInfo: PageInfo!
edges: [TransactionEdge!]!
}
"""
Paginated result set using the GraphQL cursor spec.
"""
type TransactionEdge {
"""
The cursor value for fetching the next page.
Pass this to the \`after\` parameter in \`transactions(after: $cursor)\`, the next page will start from the next item after this.
"""
cursor: String!
"""
A transaction object.
"""
node: Transaction!
}
"""
Paginated page info using the GraphQL cursor spec.
"""
type PageInfo {
hasNextPage: Boolean!
}
type Transaction {
id: ID!
anchor: String!
signature: String!
recipient: String!
owner: Owner!
fee: Amount!
quantity: Amount!
data: MetaData!
tags: [Tag!]!
"""
Transactions with a null block are recent and unconfirmed, if they aren't mined into a block within 60 minutes they will be removed from results.
"""
block: Block
"""
Transactions with parent are Bundled Data Items as defined in the ANS-102 data spec. https://github.com/ArweaveTeam/arweave-standards/blob/master/ans/ANS-102.md
"""
parent: Parent @deprecated(reason: "Use `bundledIn`")
"""
For bundled data items this references the containing bundle ID.
See: https://github.com/ArweaveTeam/arweave-standards/blob/master/ans/ANS-102.md
"""
bundledIn: Bundle
}
"""
The parent transaction for bundled transactions,
see: https://github.com/ArweaveTeam/arweave-standards/blob/master/ans/ANS-102.md.
"""
type Parent {
id: ID!
}
"""
The data bundle containing the current data item.
See: https://github.com/ArweaveTeam/arweave-standards/blob/master/ans/ANS-102.md.
"""
type Bundle {
"""
ID of the containing data bundle.
"""
id: ID!
}
type Block {
"""
The block ID.
"""
id: ID!
"""
The block timestamp (UTC).
"""
timestamp: Int!
"""
The block height.
"""
height: Int!
"""
The previous block ID.
"""
previous: ID!
# """
# The block size (sum of all transaction data contained in this block).
# """
# size: String!
# """
# The reward address and current reward pool size.
# """
# reward: BlockReward!
}
# type BlockReward {
# """
# Miner address.
# """
# address: String!
# """
# Size of the reward pool.
# """
# pool: String!
# }
"""
Basic metadata about the transaction data payload.
"""
type MetaData {
"""
Size of the associated data in bytes.
"""
size: String!
"""
Type is derrived from the \`content-type\` tag on a transaction.
"""
type: String
}
"""
Representation of a value transfer between wallets, in both winson and ar.
"""
type Amount {
"""
Amount as a winston string e.g. \`"1000000000000"\`.
"""
winston: String!
"""
Amount as an AR string e.g. \`"0.000000000001"\`.
"""
ar: String!
}
"""
Representation of a transaction owner.
"""
type Owner {
"""
The owner's wallet address.
"""
address: String!
"""
The owner's public key as a base64url encoded string.
"""
key: String!
}
type Tag {
"""
UTF-8 tag name
"""
name: String!
"""
UTF-8 tag value
"""
value: String!
}
"""
The operator to apply to a tag value.
"""
enum TagOperator {
"""
Equal
"""
EQ
"""
Not equal
"""
NEQ
}
# """
# Transaction statuses
# """
# enum Status {
# """
# Transaction is included in a block
# """
# CONFIRMED
# """
# Transaction is not yet included in a block
# """
# PENDING
# }