This repository has been archived by the owner on Dec 25, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathschema.graphql
136 lines (119 loc) · 2.44 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
interface Event {
id: ID!
collection: Collection
nft: Nft
eventType: EventType!
txHash: Bytes!
blockHash: Bytes!
timestamp: BigInt!
logNumber: BigInt!
blockNumber: BigInt!
}
enum EventType {
SALE
FEE
AUCTION
}
# enum NetworkType{
# MAINNET
# POLYGON
# }
type Account @entity {
id: ID!
numberOfSales: BigInt!
numberOfPurchases: BigInt!
totalSpent: BigDecimal!
totalEarned: BigDecimal!
#nftOwnedAndCollection: [String!]!
sales: [Sale!]! @derivedFrom(field: "buyer")
}
type Contract @entity {
id: ID!
version: String
codename: String
}
type Collection @entity {
id: ID!
nft: Nft
totalSupply: BigInt
numberOfSales: BigInt!
totalSales: BigDecimal!
owner: Account!
event: [Event!]! @derivedFrom(field: "collection")
sales: [Sale!]! @derivedFrom(field: "collection")
feesReceived: [Fee!]! @derivedFrom(field: "feeRecipient")
}
type Nft @entity {
id: ID! #Collection + Token ID
collection: Collection
symbol: String
sale: Sale
numberOfSales: BigInt!
totalSales: BigInt
tokenID: BigInt
owner: Account!
"All events"
events: [Event!]! @derivedFrom(field: "nft")
}
type Sale implements Event @entity {
id: ID!
sellHash: Bytes!
buyHash: Bytes!
buyer: Account!
seller: Account!
price: BigDecimal!
paymentToken: PaymentToken
collection: Collection
nft: Nft
eventType: EventType!
logNumber: BigInt!
txHash: Bytes!
blockHash: Bytes!
timestamp: BigInt!
blockNumber: BigInt!
}
type Fee implements Event @entity {
id: ID!
takerRelayerFee: BigInt
makerRelayerFee: BigInt
takerProtocolFee: BigInt
makerProtocolFee: BigInt
feeRecipient: Collection!
collection: Collection #Check if this is to a collection
nft: Nft
eventType: EventType!
txHash: Bytes!
blockHash: Bytes!
timestamp: BigInt!
logNumber: BigInt!
blockNumber: BigInt!
}
type Auction implements Event @entity {
id: ID!
listingTime: BigInt
expirationTime: BigInt
basePrice: BigInt
paymentToken: PaymentToken
staticTarget: Bytes
staticExtraData: Bytes
collection: Collection
nft: Nft
extra: BigInt
hash: Bytes
orderbook: Boolean!
eventType: EventType!
txHash: Bytes!
blockHash: Bytes!
timestamp: BigInt!
logNumber: BigInt!
blockNumber: BigInt!
}
type PaymentToken @entity {
id: ID! #Payment token e.g USDC, ETH, DAI
symbol: String
name: String
address: String!
decimals: BigInt
numberOfSales: BigInt!
sales: [Sale!]! @derivedFrom(field: "paymentToken")
}