-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.graphql
460 lines (320 loc) · 10.5 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
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
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
type Media @entity {
"The tokenId on the Zora Media Contract"
id: ID!
"The transaction hash the media was created at"
transactionHash: String!
"The current owner of the Media"
owner: User!
"The creator of the Media"
creator: User!
"The previous owner of the Zora Media's Market"
prevOwner: User!
"The approved user of the Media"
approved: User
"The sha256 hash of the media's content"
contentHash: Bytes!
"The sha256 hash of the media's metadata"
metadataHash: Bytes!
"The uri of the content"
contentURI: String!
"The uri of the metadata"
metadataURI: String!
"The bid share for the current owner of the Media"
ownerBidShare: BigInt!
"The bid share for the creator of the Media"
creatorBidShare: BigInt!
"The bid share for the previous owner of the Media's market"
prevOwnerBidShare: BigInt!
"The timestamp of the block the Media was minted in"
createdAtTimestamp: BigInt!
"The number of the block the Media was minted in"
createdAtBlockNumber: BigInt!
"The timestamp of the block the Media was burned in"
burnedAtTimeStamp: BigInt
"The number of the block the Media was burned in"
burnedAtBlockNumber: BigInt
"The current Ask of the Media"
currentAsk: Ask @derivedFrom(field: "media")
"The current Bids on the Media"
currentBids: [Bid!] @derivedFrom(field: "media")
"The InactiveAsks of the Media"
inactiveAsks: [InactiveAsk!] @derivedFrom(field: "media")
"The InactiveBids of the Media"
inactiveBids: [InactiveBid!] @derivedFrom(field: "media")
"The transfers of the Media"
transfers: [Transfer!] @derivedFrom(field: "media")
"The ReserveAuctions of the Media"
reserveAuctions: [ReserveAuction!] @derivedFrom(field: "media")
}
type User @entity {
"Ethereum Address"
id: ID!
"Users that have been granted `ApprovalForAll` Media of the User's Collection"
authorizedUsers: [User!]
"The Media the User owns"
collection: [Media!]! @derivedFrom(field: "owner")
"The Media the User created"
creations: [Media!]! @derivedFrom(field: "creator")
"The active Bids made by the User"
currentBids: [Bid!] @derivedFrom(field: "bidder")
}
type Ask @entity {
"<tokenId>-<ownerAddress>"
id: ID!
"The Media associated with the Ask"
media: Media!
"Transaction hash the ask was created at"
transactionHash: String!
"The Currency of the Ask"
currency: Currency!
"The amount of Currency of the Ask"
amount: BigInt!
"The owner of the Ask"
owner: User!
"The timestamp of the block the Ask was created in"
createdAtTimestamp: BigInt!
"The number of the block the Ask created in"
createdAtBlockNumber: BigInt!
}
type Bid @entity {
"<token-id>-<bidderAddress>"
id: ID!
"Transaction hash the bid was created at"
transactionHash: String!
"The Media associated with the Bid"
media: Media!
"The Currency of the Bid"
currency: Currency!
"The amount of Currency of the Bid"
amount: BigInt!
"The sellOnShare of the Bid"
sellOnShare: BigInt!
"The bidder of the Bid"
bidder: User!
"The recipient of Media if the Bid is accepted"
recipient: User!
"The timestamp of the block the Bid was created in"
createdAtTimestamp: BigInt!
"The number of the block the Bid was created in"
createdAtBlockNumber: BigInt!
}
"The Types for MarketEvents (Asks, Bids)"
enum MarketEventType {
Finalized
Removed
}
type InactiveBid @entity {
"<tokenId>-<transactionHash>-<logIndex>"
id: ID!
"Transaction hash the bid was created at"
transactionHash: String!
"The Media associated with the InactiveBid"
media: Media!
"The reason why this Bid is Inactive"
type: MarketEventType!
"The Currency of the InactiveBid"
currency: Currency!
"The amount of Currency of the InactiveBid"
amount: BigInt!
"The sellOnShare of the InactiveBid"
sellOnShare: BigInt!
"The bidder of the InactiveBid"
bidder: User!
"The recipient of the InactiveBid"
recipient: User!
"The timestamp of the block the original Bid was created in"
createdAtTimestamp: BigInt!
"The number of the block the original Bid was created in"
createdAtBlockNumber: BigInt!
"The timestamp of the block the original Bid was inactivated in"
inactivatedAtTimestamp: BigInt!
"The number of the block the original Bid was inactivated in"
inactivatedAtBlockNumber: BigInt!
}
type InactiveAsk @entity {
"<tokenId>-<transactionHash>-<logIndex>"
id: ID!
"Transaction hash the ask was created at"
transactionHash: String!
"The Media associated with the InactiveAsk"
media: Media!
"The why this Ask is Inactive"
type: MarketEventType!
"The Currency of the InactiveAsk"
currency: Currency!
"The amount of Currency of the InactiveAsk"
amount: BigInt!
"The owner of the InactiveAsk"
owner: User!
"The timestamp of the block the original Ask was created in"
createdAtTimestamp: BigInt!
"The number of the block the original Ask was created in"
createdAtBlockNumber: BigInt!
"The timestamp of the block the original Ask was inactivated in"
inactivatedAtTimestamp: BigInt!
"The number of the block the original Ask was inactivated in"
inactivatedAtBlockNumber: BigInt!
}
type Currency @entity {
"The address of the Currency"
id: ID!
"The name of the Currency"
name: String!
"The symbol of the Currency"
symbol: String!
"The decimals of the Currency"
decimals: Int
"Total Bid Liquidity of the Currency on all Zora Media"
liquidity: BigInt!
"The active Bids denominated in the Currency"
activeBids: [Bid!] @derivedFrom(field: "currency")
"The active Asks denominated in the Currency"
activeAsks: [Ask!] @derivedFrom(field: "currency")
"The InactiveBids denominated in the Currency"
inactiveBids: [InactiveBid!] @derivedFrom(field: "currency")
"The InactiveAsks denominated in the Currency"
inactiveAsks: [InactiveAsk!] @derivedFrom(field: "currency")
}
type Transfer @entity {
"<tokenId>-<transactionHash>-<logIndex>"
id: ID!
"Transaction hash for the transfer"
transactionHash: String!
"The Media associated with the Transfer"
media: Media!
"The User transferring the Media"
from: User!
"The User receiving the Media"
to: User!
"The timestamp of the block the Transfer was created in"
createdAtTimestamp: BigInt!
"The number of the block the Transfer was created in"
createdAtBlockNumber: BigInt!
}
"The Types of URI Updates"
enum URIUpdateType {
Content
Metadata
}
type URIUpdate @entity {
"<tokenId>-<transactionHash>-<logIndex>"
id: ID!
"The transaction has the uri update happened at"
transactionHash: String!
"The Type of URIUpdate"
type: URIUpdateType!
"The previous uri"
from: String!
"The new uri"
to: String!
"The Media associated with the URIUpdate"
media: Media!
"The owner of the Media"
owner: User!
"The updater of the Media's URI"
updater: User!
"The timestamp of the block the URIUpdate was created in"
createdAtTimestamp: BigInt!
"The number of the block the URIUpdate was created in"
createdAtBlockNumber: BigInt!
}
enum ReserveAuctionBidType {
Active
Refunded
Final
}
type ReserveAuctionBid @entity {
"<auctionId>-<txHash>-<logIndex>"
id: ID!
"The transaction hash the reserve auction big was created at"
transactionHash: String!
"The Reserve auction associated with the Bid"
reserveAuction: ReserveAuction!
"The amount of the Bid"
amount: BigInt!
"The bidder of the Bid"
bidder: User!
"The type of bid (active, refunded, final)"
bidType: ReserveAuctionBidType!
"The timestamp of the block the Bid was created in"
createdAtTimestamp: BigInt!
"The number of the block the Bid was created in"
createdAtBlockNumber: BigInt!
}
type InactiveReserveAuctionBid @entity {
"<auctionId>-<txHash>-<logIndex>"
id: ID!
"The transaction hash the reserve auction big was created at"
transactionHash: String!
"The Reserve auction associated with the Bid"
reserveAuction: ReserveAuction!
"The amount of the Bid"
amount: BigInt!
"The bidder of the Bid"
bidder: User!
"The type of bid (active, refunded, final)"
bidType: ReserveAuctionBidType!
"The timestamp of the block the bid was inactivated at (via outbid, cancellation, winning bid)"
bidInactivatedAtTimestamp: BigInt!
"The number of the block the bid was inactivated at (via outbid, cancellation, winning bid)"
bidInactivatedAtBlockNumber: BigInt!
"The timestamp of the block the Bid was created in"
createdAtTimestamp: BigInt!
"The number of the block the Bid was created in"
createdAtBlockNumber: BigInt!
}
enum ReserveAuctionStatus {
Pending
Active
Canceled
Finished
}
type ReserveAuction @entity {
"ID of the auction from contract, autoincrementing int"
id: ID!
"Transaction hash where the reserve auction was created"
transactionHash: String!
"The originating token contract for this auction"
tokenContract: String!
"The token ID for this auction"
tokenId: BigInt!
"<tokenContract>-<tokenId>"
token: String!
"The media for the auction, if it is a zora NFT"
media: Media
"Whether or not the auction has been approved by the curator"
approved: Boolean!
"The length of time the auction is intended to run for, after the first bid is made"
duration: BigInt!
"The expected end of auction timestamp, which can change if bids were placed within the last 15 minutes, and is not set until the first bid is placed"
expectedEndTimestamp: BigInt
"The time the first bid was placed"
firstBidTime: BigInt
"The minimum price of the first bid"
reservePrice: BigInt!
"The sale percentage to send to the curator"
curatorFeePercentage: Int!
"The address that should receive the funds once the NFT is sold"
tokenOwner: User!
"The address of the auction's curator"
curator: User!
"The address of the ERC-20 currency to run the auction with, or 0x0 for ETH"
auctionCurrency: Currency!
status: ReserveAuctionStatus!
"The current bid on this auction"
currentBid: ReserveAuctionBid
"The previous bids on this auction"
previousBids: [InactiveReserveAuctionBid!] @derivedFrom(field: "reserveAuction")
"The time the auction was approved"
approvedTimestamp: BigInt
"The number of the block the auction was Approved"
approvedBlockNumber: BigInt
"The timestamp of the block the Transfer was created in"
createdAtTimestamp: BigInt!
"The number of the block the Transfer was created in"
createdAtBlockNumber: BigInt!
"The timestamp at which the auction end function was called"
finalizedAtTimestamp: BigInt
"The block number at which the auction end function was called"
finalizedAtBlockNumber: BigInt
}