-
Notifications
You must be signed in to change notification settings - Fork 2
/
schema.graphql
160 lines (148 loc) · 3.48 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
type Attribute @jsonField {
# display_type field of metadata attributes
displayType: String
# trait_type field of metadata attributes
traitType: String!
value: String!
}
# these values come from the fetched metadata object from the token URI
type Metadata @entity {
id: ID!
name: String @index
description: String
image: String
# external_url field of metadata
externalUrl: String
attributes: [Attribute!]
type: String @index
composite: Boolean
layers: [String!]
artist: String @index
# artist_url field of metadata
artistUrl: String
}
type ERC1155Token @entity {
# {tokenID}
id: ID!
numericId: BigInt! @index
owners: [ERC1155TokenOwner!]! @derivedFrom(field: "token")
# tokenURI of contract
tokenUri: String
# timestamp when the token URIs were updated last
updatedAt: BigInt! @index
createdAt: BigInt! @index
transfers: [ERC1155Transfer!]! @derivedFrom(field: "token")
contractId: ID!
contract: ERC1155Contract!
totalSupply: BigInt
metadataId: ID
metadata: Metadata
}
type ERC1155Owner @entity {
# {owner address}
id: ID!
ownedTokens: [ERC1155TokenOwner!]! @derivedFrom(field: "owner")
}
type ERC1155TokenOwner @entity {
# ${owner.id}-${token.id}
id: ID!
ownerId: ID!
owner: ERC1155Owner!
tokenId: ID!
token: ERC1155Token!
balance: BigInt!
}
type ERC1155Contract @entity {
# {contract address}
id: ID!
name: String @index
symbol: String @index
#updated on each mint/burn
totalSupply: BigInt
mintedTokens: [ERC1155Token!]! @derivedFrom(field: "contract")
# contract URI updated once e.g. a day
contractURI: String
# timestamp when the contract URI was updated last
contractURIUpdated: BigInt @index
decimals: Int
address: String
startBlock: Int! @index
#metadata
metadataName: String @index
description: String
image: String
externalLink: String
artist: String @index
artistUrl: String
}
type ERC1155Transfer @entity {
# {txhash}-{tokenID}-{txlogindex}-{batchindex}
id: ID!
tokenId: ID!
token: ERC1155Token!
fromId: ID!
from: ERC1155Owner!
toId: ID!
to: ERC1155Owner!
value: BigInt!
timestamp: BigInt! @index
block: BigInt! @index
transactionHash: String! @index
}
type ERC721Token @entity {
id: ID!
numericId: BigInt! @index
ownerId: ID!
owner: ERC721Owner!
# tokenURI of contract
tokenUri: String
# timestamp when the token URIs were updated last
updatedAt: BigInt! @index
createdAt: BigInt! @index
transfers: [ERC721Transfer!]! @derivedFrom(field: "token")
contractId: ID!
contract: ERC721Contract!
metadataId: ID
metadata: Metadata
}
type ERC721Owner @entity {
id: ID!
ownedTokens: [ERC721Token!]! @derivedFrom(field: "owner")
balance: BigInt! @index
}
type ERC721Contract @entity {
# 1
id: ID!
name: String @index
symbol: String @index
#updated on each mint/burn
totalSupply: BigInt
mintedTokens: [ERC721Token!]! @derivedFrom(field: "contract")
# contract URI updated once e.g. a day
contractURI: String
address: String
# timestamp when the contract URI was updated last
contractURIUpdated: BigInt @index
decimals: Int
startBlock: Int! @index
#metadata
metadataName: String @index
description: String
image: String
externalLink: String
artist: String @index
artistUrl: String
}
type ERC721Transfer @entity {
# {txhash}-{txlogindex}
id: ID!
tokenId: ID!
token: ERC721Token!
fromId: ID!
from: ERC721Owner!
toId: ID!
to: ERC721Owner!
timestamp: BigInt! @index
block: BigInt! @index
transactionHash: String! @index
}