This repository has been archived by the owner on Jul 1, 2024. It is now read-only.
generated from subsquid-labs/squid-substrate-template
-
Notifications
You must be signed in to change notification settings - Fork 11
/
schema.graphql
200 lines (184 loc) · 3.46 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
type CollectionEntity @entity {
id: ID!
blockNumber: BigInt @index
burned: Boolean!
createdAt: DateTime! @index
currentOwner: String!
distribution: Int!
events: [CollectionEvent!] @derivedFrom(field: "collection")
floor: BigInt! @index
highestSale: BigInt! @index
image: String
issuer: String!
lewd: Boolean!
meta: MetadataEntity
metadata: String
media: String
name: String @index
nfts: [NFTEntity!] @derivedFrom(field: "collection")
ownerCount: Int!
updatedAt: DateTime! @index
nftCount: Int! @index
supply: Int! @index
type: CollectionType!
volume: BigInt! @index
}
type NFTEntity @entity {
id: ID!
blockNumber: BigInt @index
burned: Boolean!
collection: CollectionEntity!
createdAt: DateTime!
currentOwner: String! @index
events: [Event!] @derivedFrom(field: "nft")
offers: [Offer!] @derivedFrom(field: "nft")
hash: String! @index
image: String
issuer: String!
lewd: Boolean!
meta: MetadataEntity
media: String
metadata: String
name: String @index
price: BigInt @index
royalty: Float
recipient: String
sn: String! @index
updatedAt: DateTime! @index
# type: ClassType!
}
type MetadataEntity @entity {
id: ID!
name: String
description: String
image: String
attributes: [Attribute!]
animationUrl: String
type: String
}
type Attribute @jsonField {
display: String
trait: String
value: String!
}
interface EventType {
id: ID!
blockNumber: BigInt
timestamp: DateTime!
caller: String!
currentOwner: String
interaction: Interaction!
meta: String!
}
type Event implements EventType @entity {
id: ID!
blockNumber: BigInt
timestamp: DateTime!
caller: String!
currentOwner: String! # currentOwner
interaction: Interaction!
meta: String!
nft: NFTEntity!
}
type CollectionEvent implements EventType @entity {
id: ID!
blockNumber: BigInt
timestamp: DateTime!
caller: String!
currentOwner: String # currentOwner
interaction: Interaction!
meta: String!
collection: CollectionEntity!
}
type OfferEvent @entity {
id: ID!
blockNumber: BigInt
caller: String!
currentOwner: String # currentOwner
interaction: OfferInteraction!
meta: String!
offer: Offer!
timestamp: DateTime!
}
type Offer @entity {
id: ID! # should be addr-id-amount?
blockNumber: BigInt!
caller: String!
createdAt: DateTime!
events: [OfferEvent!] @derivedFrom(field: "offer")
expiration: BigInt!
nft: NFTEntity!
price: BigInt!
status: OfferStatus!
updatedAt: DateTime
}
enum Interaction {
MINT
MINTNFT
LIST
UNLIST
BUY
SEND
CONSUME
DESTROY
OFFER # ACCEPT OFFER
PAY_ROYALTY
ROYALTY
}
enum CollectionType {
Marketplace
LiquidityMining
Redeemable
Auction
HydraHeads
}
enum OfferInteraction {
CREATE
ACCEPT
CANCEL
}
enum OfferStatus {
ACTIVE
ACCEPTED
EXPIRED
WITHDRAWN
}
type AssetEntity @entity {
id: ID!
name: String
symbol: String
decimals: Int
deposit: BigInt
}
# Implement in the later stages
type Series @entity {
id: ID!
issuer: String
unique: Int!
uniqueCollectors: Int!
sold: Int! @index
total: Int!
averagePrice: Float
floorPrice: BigInt
highestSale: BigInt
buys: Int
volume: BigInt
name: String! @index
metadata: String
image: String
emoteCount: Int
}
type Spotlight @entity {
id: ID!
collections: Int!
uniqueCollectors: Int!
unique: Int!
sold: Int! @index
total: Int!
average: Float
volume: BigInt
}
type CacheStatus @entity {
id: ID!
lastBlockTimestamp: DateTime!
}