-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.graphql
253 lines (201 loc) · 6.41 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
type NftContract @entity {
"ID of the contract (Account ID)"
id: ID!
"Metadata of the contract"
metadata: NftContractMetadata! @derivedFrom(field: "contract")
# Stats
"Contract created date and time in Unix epoch milliseconds"
timestamp: BigInt!
"Contract last updated date and time in Unix epoch milliseconds"
updated_at: BigInt!
"Total number of NFTs in the contract"
total_supply: BigInt!
# Relationships
nfts: [Nft!]! @derivedFrom(field: "contract")
}
type NftContractMetadata @entity {
"Metadata ID (Contract ID)"
id: ID!
"Contract ID of the particular metadata"
contract: NftContract!
# NEP-177
"Current version of the contract"
spec: String!
"Name of the contract"
name: String!
"Short symbol phrase of the contract"
symbol: String!
"Data URL which contains icon of the contract"
icon: String
"Centralized gateway known to have reliable access to decentralized storage assets referenced by `reference` or `media` URLs"
base_uri: String
"URL to a JSON file contains more info about the contract"
reference: String
# Extra
"Mint price of the NFTs in contract"
mint_price: String!
"Maximum number of copies for each NFT that contract generate"
max_copies: Int
"Maximum number of royalties that can payout for each NFT in the contract"
default_max_len_payout: Int
"Number of mints allowed for an account"
mints_per_address: Int
"Address that receives the full minting payment"
mint_payee_id: User
"Account that is set to receive perpetual royalty amount"
mint_royalty_id: User
"Amount of royalty, in (percentage * 100) format, that is set on each minted token"
mint_royalty_amount: BigInt
"Minimum amount of a bid that can be placed to a token in contract"
min_bid_amount: BigInt!
"Base64-encoded string of packages script of the contract if there is any"
packages_script: String
"Base64-encoded string of the render script of the contract if there is any"
render_script: String
"Base64-encoded string of CSS styles of the contract if there is any"
style_css: String
"Base64-encoded string of Parameters of the contract if there is any"
parameters: String
}
type Nft @entity {
"NFT ID"
id: ID!
# Relationships
"Contract that particular NFT is stored"
contract: NftContract!
"Metadata object of the NFT that describes the NFT"
metadata: NftMetadata! @derivedFrom(field: "nft")
"NFT history"
history: [Activity!]! @derivedFrom(field: "nft")
# Ownership
"Current owner who owns the NFT"
owner: User!
"Creator who created or minted this NFT, this could be the artist or collective in case of a generative art project"
creator: User!
"Previous owner of the NFT"
prev_owner: User
# Market
## royalties
"Royalties of the respective NFT"
royalties: [User!]
"Percentage of the balance to be divided to the royalties"
royalties_percentage: Int
## ask
askedPrice: Int
## shares
"Share value of the current owner"
owner_share: Int
"Share value of the creator"
creator_share: Int
"Share value of the previous owner"
prev_owner_share: Int
## bids
"Bids made for the NFT"
bids: [Bid!] @derivedFrom(field: "nft")
}
type NftMetadata @entity {
"Metadata ID (NFT ID)"
id: ID!
"NFT of the particular metadata"
nft: Nft!
"Title of the NFT"
title: String!
"NFT description"
description: String
"URL to associated media for the NFT. Preferably to decentralized, content-addressed storage"
media: String!
"Base64-encoded sha256 hash of content referenced by the `media` field if the media has an animation."
media_animation: String
"Base64-encoded sha256 hash of content referenced by the `media` field. Required if `media` is included."
media_hash: String
"Number of copies of this set of metadata in existence when NFT was minted."
copies: Int
"Anything extra that the NFT wants to store on-chain. Can be stringified JSON."
extra: String
"A link to a valid JSON file containing various keys offering supplementary details on the NFT"
reference: String
"Base64-encoded sha256 hash of the JSON file contained in the reference field"
reference_hash: String
"NFT issue or mint date and time in Unix epoch milliseconds"
issued_at: String
"NFT starts to being valid date and time in Unix epoch milliseconds"
starts_at: String
"NFT last updated date and time in Unix epoch milliseconds"
updated_at: String
"NFT expiring date and time in Unix epoch milliseconds"
expires_at: String
}
type User @entity {
"User ID"
id: ID!
# Relationships
"Owned NFTs"
ownedNfts: [Nft!] @derivedFrom(field: "owner")
"Created NFTs"
createdNfts: [Nft!] @derivedFrom(field: "creator")
"Bids made by the user"
bids: [Bid!] @derivedFrom(field: "bidder")
# Stats
"Number of NFTs owned by the user"
total_owned: BigInt!
"Number of NFTs minted by the owner"
total_minted: BigInt!
}
type Activity @entity {
"Activity ID"
id: ID!
"NFT which is associated with this action"
nft: Nft!
"Type of the action"
type: ActivityType!
"The date and time of this action in Unix epoch milliseconds"
timestamp: BigInt!
"Account which initiated the activity transaction"
sender: User!
"Account which received the NFT if the event is related to the transfer or accept_bid"
recipient: User
"Amount associated with the transaction if the event is related to the bid or mint"
amount: BigInt
"Transaction hash which is associated with this action"
transaction_hash: String!
"Receipt id of the action"
receipt_id: String!
"Base 58 hash of block number where tx with relevant receipt id has been executed"
block_hash_58: String!
}
enum ActivityType @entity {
"NFT was minted"
mint
"NFT was burned"
burn
"NFT was transferred to another account"
transfer
"Bid was set for a NFT"
set_bid
"Bid was accepted"
accept_bid
"Bid was updated"
update_bid
"Bid was removed"
remove_bid
}
type Bid @entity {
"Bid ID"
id: ID!
"NFT which is associated with the Bid"
nft: Nft!
"Bid made date and time in Unix epoch milliseconds"
timestamp: BigInt!
"Amount of the Bid"
amount: BigInt!
"User who made the Bid"
bidder: User!
"NFT which is associated with the Bid"
recipient: User!
"Percentage of the amount that, on the next sale, goes to current owner, which after accepting bid becomes previous owner"
sell_on_share: Int!
"Currency used to bid"
currency: String!
"Whether the Bid is accepted by the owner or not"
accepted: Boolean!
}