-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathschema.graphql
633 lines (506 loc) · 12.9 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
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
type AavegotchiOption @entity {
"AavegotchiOption id is composed by <PORTAL-ID>-<GOTCHI-OPTION>"
id: ID!
portalOptionId: Int!
owner: User!
portal: Portal!
randomNumber: BigInt!
numericTraits: [Int!]!
collateralType: Bytes!
minimumStake: BigInt!
baseRarityScore: Int!
}
type Aavegotchi @entity {
id: ID!
gotchiId: BigInt!
owner: User
originalOwner: User
portal: Portal! @derivedFrom(field: "gotchi")
hauntId: BigInt!
name: String!
nameLowerCase: String!
randomNumber: BigInt!
status: BigInt!
numericTraits: [Int!]!
modifiedNumericTraits: [Int!]!
withSetsNumericTraits: [Int!]
equippedWearables: [Int!]!
equippedDelegatedWearables: [Int!]
equippedSetID: BigInt
equippedSetName: String
possibleSets: BigInt
# equippedSetName: String
# equippedSetTraitBonuses:[Int!]
# rarityScoreWithSet:BigInt!
# numericTraitsWithSet:[Int!]
collateral: Bytes!
escrow: Bytes!
stakedAmount: BigInt!
minimumStake: BigInt!
kinship: BigInt! #The kinship value of this Aavegotchi. Default is 50.
lastInteracted: BigInt!
experience: BigInt! #How much XP this Aavegotchi has accrued. Begins at 0.
toNextLevel: BigInt!
usedSkillPoints: BigInt! #number of skill points used
level: BigInt! #the current aavegotchi level
baseRarityScore: BigInt!
modifiedRarityScore: BigInt!
withSetsRarityScore: BigInt
locked: Boolean!
listings: [ERC721Listing!]! @derivedFrom(field: "gotchi")
"Block in which the Aavegotchi entity was created"
createdAt: BigInt
"Block in which the Aavegotchi was claimed. Should coincide with createdAt"
claimedAt: BigInt
claimedTime: BigInt
timesTraded: BigInt!
historicalPrices: [BigInt!]
activeListing: BigInt
lending: BigInt
baseEnergy: Int!
baseAggression: Int!
baseSpookiness: Int!
baseBrain: Int!
eyeShape: Int!
eyeColor: Int!
modifiedEnergy: Int!
modifiedAggression: Int!
modifiedSpookiness: Int!
modifiedBrain: Int!
}
enum PortalStatus {
Bought
Opened
Claimed
}
type Portal @entity {
id: ID!
gotchiId: BigInt
buyer: User
hauntId: BigInt!
owner: User!
options: [AavegotchiOption!]! @derivedFrom(field: "portal")
gotchi: Aavegotchi
status: PortalStatus!
boughtAt: BigInt
openedAt: BigInt
claimedAt: BigInt
claimedTime: BigInt
timesTraded: BigInt!
historicalPrices: [BigInt!]
activeListing: BigInt
}
type User @entity {
id: ID!
portalsBought: [Portal!]! @derivedFrom(field: "buyer")
gotchisOwned: [Aavegotchi!]! @derivedFrom(field: "owner")
gotchisOriginalOwned: [Aavegotchi!]! @derivedFrom(field: "originalOwner")
portalsOwned: [Portal!]! @derivedFrom(field: "owner")
parcelsOwned: [Parcel!]! @derivedFrom(field: "owner")
gotchisLentOut: [BigInt!]!
gotchisBorrowed: [BigInt!]!
# borrowedGotchis: [GotchiLending!]! @derivedFrom(field: "borrower")
# lendGotchis: [GotchiLending!]! @derivedFrom(field: "originalOwner")
fakeGotchiCardBalances: [FakeGotchiCardBalance!]!
@derivedFrom(field: "account")
fakeGotchiNFTTokens: [FakeGotchiNFTToken!]! @derivedFrom(field: "owner")
fakeGotchis: String! # from array
amountFakeGotchis: Int!
currentUniqueFakeGotchisOwned: Int!
totalUniqueFakeGotchisOwned: Int!
currentUniqueFakeGotchisOwnedArray: String! # from array
totalUniqueFakeGotchisOwnedArray: String! # from array
totalFakeGotchisOwnedArray: String! # from array
}
type ERC721Listing @entity {
id: ID!
category: BigInt! # 0 = Closed Portal, 1 = VRF Pending, 2 = Open Portal, 3 = Aavegotchi
erc721TokenAddress: Bytes! # The token address of the NFT
tokenId: BigInt! # The token ID of the NFT
seller: Bytes! # The creator of the listing
buyer: Bytes
recipient: Bytes
timeCreated: BigInt! # Time at which listed was created
timePurchased: BigInt # Time when the listing was purchased
cancelled: Boolean # If the listing is cancelled
priceInWei: BigInt! # How much the listing is (in GHST)
gotchi: Aavegotchi # If the listing is for a gotchi, this will be populated
portal: Portal # If the listing is for a portal, this will be populated
parcel: Parcel # if the listing is for a parcel, this will be populated
hauntId: BigInt
kinship: BigInt
experience: BigInt
collateral: Bytes
baseRarityScore: BigInt
modifiedRarityScore: BigInt
equippedWearables: [Int!]
blockCreated: BigInt!
fudBoost: BigInt # boost of parcels
fomoBoost: BigInt # boost of parcels
alphaBoost: BigInt # boost of parcels
kekBoost: BigInt # boost of parcels
district: BigInt # district of parcel
coordinateX: BigInt # coordinate x of parcel
coordinateY: BigInt # coordinate y of parcel
size: BigInt # size of parcel
parcelHash: String # address/hash of parcel
nameLowerCase: String
amountEquippedWearables: Int
soldBefore: Boolean
claimedAt: BigInt
# Traits of Gotchi
nrgTrait: BigInt
aggTrait: BigInt
spkTrait: BigInt
brnTrait: BigInt
eysTrait: BigInt
eycTrait: BigInt
whitelist: Whitelist
priceUpdatedAt: BigInt
fakeGotchi_name: String
fakeGotchi_publisher: User
fakeGotchi_publisherName: String
fakeGotchi_description: String
fakeGotchi_artist: User
fakeGotchi_artistName: String
fakeGotchi_editions: Int
}
type ERC1155Listing @entity {
id: ID!
category: BigInt! # 0 = Wearable, #1 = Badge, #2 = Consumable, #3 = Ticket
erc1155TokenAddress: Bytes!
erc1155TypeId: BigInt!
seller: Bytes!
priceInWei: BigInt!
quantity: BigInt!
cancelled: Boolean!
timeCreated: BigInt! # Time at which listed was created
timeLastPurchased: BigInt! # Time when the listing was purchased
sold: Boolean!
rarityLevel: BigInt
rarityScoreModifier: BigInt
nrgTraitModifier: BigInt
aggTraitModifier: BigInt
spkTraitModifier: BigInt
brnTraitModifier: BigInt
eysTraitModifier: BigInt
eycTraitModifier: BigInt
whitelist: Whitelist
priceUpdatedAt: BigInt
}
type ERC1155Purchase @entity {
id: ID!
listingID: BigInt!
category: BigInt! # 0 = Wearable, #1 = Badge, #2 = Consumable, #3 = Ticket
erc1155TokenAddress: Bytes!
erc1155TypeId: BigInt!
seller: Bytes!
buyer: Bytes!
recipient: Bytes
priceInWei: BigInt!
quantity: BigInt!
#cancelled: Boolean!
# timeCreated: BigInt! # Time at which listed was created
timeLastPurchased: BigInt! # Time when the listing was purchased
#sold: Boolean!
rarityLevel: BigInt
}
type Statistic @entity {
"There will be a single Statistic entity with id = '0'"
id: ID!
"Total amount of portals that have been bought."
portalsBought: BigInt!
"Total amount of portals that have been opened"
portalsOpened: BigInt!
"Total amount of Aavegotchis claimed"
aavegotchisClaimed: BigInt!
"Total amount of Aavegotchis sacrificed"
aavegotchisSacrificed: BigInt!
"Total amount of Aavegotchis borrowed"
aavegotchisBorrowed: BigInt!
erc721ActiveListingCount: BigInt! #Total # of active ERC721 Listings
erc1155ActiveListingCount: BigInt! #Total # of active ERC1155 Listings
erc721TotalVolume: BigInt! #Total traded volume in GHST
erc1155TotalVolume: BigInt! #Total traded volume in GHST
#new
totalWearablesVolume: BigInt!
totalConsumablesVolume: BigInt!
totalTicketsVolume: BigInt!
totalFakeGotchiOwners: Int
totalFakeGotchiOwnersArray: [Bytes!]!
totalFakeGotchiPieces: Int
totalNFTs: Int
totalNFTsArray: String!
burnedNFTs: Int
burnedCards: Int
tokenIdCounter: Int
totalEditionsMinted: Int!
totalEditionsCirculating: Int!
totalEditionsCirculatingArray: String!
}
type ItemType @entity {
id: ID!
svgId: BigInt!
name: String!
desc: String
author: String
traitModifiers: [Int!]
slotPositions: [Boolean!]
ghstPrice: BigInt!
maxQuantity: BigInt!
totalQuantity: BigInt!
rarityScoreModifier: Int!
canPurchaseWithGhst: Boolean!
minLevel: Int
canBeTransferred: Boolean!
category: Int!
kinshipBonus: Int
experienceBonus: BigInt
consumed: BigInt!
}
type WearableSet @entity {
id: ID!
name: String!
allowedCollaterals: [Int!]
wearableIds: [Int!]
traitBonuses: [Int!]
}
type Parcel @entity {
id: ID!
tokenId: BigInt!
parcelId: String!
owner: User!
coordinateX: BigInt!
coordinateY: BigInt!
district: BigInt!
parcelHash: String!
fudBoost: BigInt!
fomoBoost: BigInt!
alphaBoost: BigInt!
kekBoost: BigInt!
size: BigInt!
auctionId: String
timesTraded: BigInt!
historicalPrices: [BigInt!]
activeListing: BigInt
}
### lending
type GotchiLending @entity {
id: ID!
rentDuration: BigInt!
upfrontCost: BigInt!
period: BigInt!
gotchi: Aavegotchi!
# gotch filter attributes
gotchiBRS: BigInt
gotchiTokenId: BigInt!
gotchiKinship: BigInt
# profit split
splitOwner: BigInt
splitBorrower: BigInt
splitOther: BigInt
# tokens to share
tokensToShare: [Bytes!]!
whitelist: Whitelist
whitelistMembers: [Bytes!]!
whitelistId: BigInt
thirdPartyAddress: Bytes
borrower: Bytes
lender: Bytes
originalOwner: Bytes
cancelled: Boolean!
completed: Boolean!
lastClaimed: BigInt
timeAgreed: BigInt
timeCreated: BigInt
timeEnded: BigInt
claimed: [ClaimedToken!]! @derivedFrom(field: "lending")
channellingAllowed: Boolean!
}
type ClaimedToken @entity {
id: ID!
lending: GotchiLending!
token: Bytes!
amount: BigInt!
}
type Whitelist @entity {
id: ID!
name: String!
members: [Bytes!]!
owner: User!
ownerAddress: Bytes!
"Access Right for max borrowed Gotchis, default 1"
maxBorrowLimit: Int
}
#type Upgrade @entity {
# id: ID!
# calldata:
#}
## buy order
type ERC721BuyOrder @entity {
id: ID!
buyer: Bytes!
seller: Bytes
erc721TokenAddress: Bytes!
erc721TokenId: BigInt!
category: BigInt!
priceInWei: BigInt!
duration: BigInt!
validationHash: Bytes!
createdAt: BigInt!
executedAt: BigInt
canceledAt: BigInt
canceled: Boolean
}
type ERC1155BuyOrder @entity {
id: ID!
buyer: Bytes!
seller: Bytes
erc1155TokenAddress: Bytes!
erc1155TokenId: BigInt!
category: BigInt!
priceInWei: BigInt!
quantity: BigInt!
duration: BigInt!
createdAt: BigInt!
executedQuantity: BigInt!
lastExecutedAt: BigInt
completedAt: BigInt
canceledAt: BigInt
canceled: Boolean
executions: [ERC1155BuyOrderExecution!]! @derivedFrom(field: "buyOrder")
}
type ERC1155BuyOrderExecution @entity {
id: ID!
buyOrder: ERC1155BuyOrder!
buyer: Bytes!
seller: Bytes
erc1155TokenAddress: Bytes!
erc1155TokenId: BigInt!
category: BigInt!
priceInWei: BigInt!
executedQuantity: BigInt!
executedAt: BigInt
}
# Cards
type FakeGotchiCardBalance @entity {
id: ID!
contract: Bytes!
token: BigInt!
account: User
value: BigDecimal!
valueExact: BigInt!
}
# NFT 721
type FakeGotchiNFTToken @entity {
id: ID!
contract: Bytes!
identifier: BigInt!
owner: User!
approval: User!
uri: String
metadata: MetadataActionLog
fileHash: String
name: String
publisher: User
publisherName: String
externalLink: String
description: String
artist: User
artistName: String
editions: Int
thumbnailHash: String
thumbnailType: String
}
type MetadataActionLog @entity {
id: ID!
emitter: User!
timestamp: BigInt!
sender: User
minted: Boolean
fileHash: String
name: String
publisher: User
publisherName: String
externalLink: String
description: String
artist: User
artistName: String
royalty: [Int!]
createdAt: BigInt
editions: Int
fileType: String
thumbnailHash: String
thumbnailType: String
flagCount: Int
likeCount: Int
status: Int
}
type Generation @entity {
"a generation is a series"
id: ID!
amount: Int
}
type FakeGotchiStatistic @entity {
id: ID!
metadata: MetadataActionLog
holders: [FakeGotchiHolder!]! @derivedFrom(field: "fakeGotchiStats")
burned: Int
amountHolder: Int
totalSupply: Int
tokenIds: [BigInt!]!
}
type FakeGotchiHolder @entity {
id: ID!
fakeGotchiStats: FakeGotchiStatistic
holder: User
amount: Int
}
type FakeGotchiNFTTransfer @entity {
id: ID!
transaction: Bytes!
timestamp: BigInt!
token: FakeGotchiNFTToken!
from: User!
to: User!
}
# ItemsRolesRegistry
type RolesRegistry @entity {
id: ID! # contractAddress
roles: [Role!] @derivedFrom(field: "rolesRegistry")
}
type Role @entity {
id: ID! # rolesRegistryAddress + depositId + roleHash
rolesRegistry: RolesRegistry!
roleHash: Bytes!
tokenAddress: String!
tokenId: BigInt!
tokenCommitment: TokenCommitment
roleAssignments: [RoleAssignment!] @derivedFrom(field: "role")
}
type RoleAssignment @entity {
id: ID! # rolesRegistryAddress + depositId + granteeAddress + roleHash
role: Role!
tokenAddress: String!
tokenId: BigInt!
grantor: User!
grantee: User!
expirationDate: BigInt!
revocable: Boolean!
data: Bytes!
createdAt: BigInt!
updatedAt: BigInt!
tokenCommitment: TokenCommitment
}
type TokenCommitment @entity {
id: ID! # rolesRegistryAddress + depositId
rolesRegistry: RolesRegistry!
depositId: BigInt!
grantor: User!
tokenAddress: String!
tokenId: BigInt!
amount: BigInt!
isReleased: Boolean!
usedBalance: BigInt!
roleAssignments: [RoleAssignment!] @derivedFrom(field: "tokenCommitment")
}