-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathschema.graphql
65 lines (52 loc) · 1.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
type All @entity {
id: ID! # "all"
numLands: BigInt!
numAssets: BigInt!
numAssetCollections: BigInt!
numLandOwners: BigInt!
numAssetOwners: BigInt!
lastUpdate: BigInt!
}
type LandToken @entity {
id: ID! # tokenId
owner: Owner!
x: Int!
y: Int!
tokenURI: String!
timestamp: BigInt!
# topCornerId: Int # null = not set yet, waiting for LandSale PurchaseEvent, -1 = 1x1 , else id of the group whose is the id of the top corner land
}
type AssetCollection @entity {
id: ID! # tokenId
tokenURI: String!
timestamp: BigInt!
supply: BigInt! # this include token extracted as EIP721 tokens
# numOwners: BigInt! # TODO
tokens: [AssetToken!]! @derivedFrom(field: "collection")
numTokenTypes: BigInt!
}
type AssetToken @entity {
id: ID! # tokenId
collection: AssetCollection!
timestamp: BigInt!
supply: BigInt!
# numOwners: BigInt! # TODO
rarity: Int!# TODO move into collection
isNFT: Boolean
owner: Owner # only set for dual EIP-721/ EIP-1155 tokens
owners: [AssetTokenOwned!]! @derivedFrom(field: "token")
}
type AssetTokenOwned @entity {
id: ID! # owner_tokenId
owner: Owner!
token: AssetToken!
quantity: BigInt!
}
type Owner @entity {
id: ID! # address
assetTokens: [AssetTokenOwned!]! @derivedFrom(field: "owner")
landTokens: [LandToken!]! @derivedFrom(field: "owner")
numAssets: BigInt!
numLands: BigInt!
timestamp: BigInt!
}