forked from kodadot/snek
-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.graphql
176 lines (161 loc) · 3.04 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
type CollectionEntity @entity {
id: ID!
blockNumber: BigInt
createdAt: DateTime!
currentOwner: String!
burned: Boolean!
events: [CollectionEvent!] @derivedFrom(field: "collection")
issuer: String!
meta: MetadataEntity
metadata: String
name: String @index
nfts: [NFTEntity!] @derivedFrom(field: "collection")
updatedAt: DateTime!
type: CollectionType!
}
type NFTEntity @entity {
id: ID!
blockNumber: BigInt
burned: Boolean!
collection: CollectionEntity!
createdAt: DateTime!
currentOwner: String! @index
events: [Event!] @derivedFrom(field: "nft")
offers: [Offer!] @derivedFrom(field: "nft")
hash: String! @index
issuer: String!
meta: MetadataEntity
metadata: String
name: String @index
price: BigInt
royalty: Int
recipient: String
sn: String!
updatedAt: DateTime!
# 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
}
# Implement in the later stages
# type Series @entity {
# id: ID!
# unique: Int!
# uniqueCollectors: Int!
# sold: Int! @index
# total: Int!
# averagePrice: Float
# floorPrice: BigInt
# buys: Int
# volume: BigInt
# name: String! @index
# metadata: String
# image: String
# }
# 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!
# }