This repository has been archived by the owner on Dec 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
schema.graphql
102 lines (95 loc) · 2.21 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
type Artist @entity {
id: ID!
uri: String!
artistId: BigInt!
name: String!
symbol: String!
totalSupply: BigInt!
owner: Account!
creator: Account!
editions: [Edition!]! @derivedFrom(field: "artist")
tokens: [Token!]! @derivedFrom(field: "artist")
sales: [Sale!]! @derivedFrom(field: "artist")
transfers: [Transfer!]! @derivedFrom(field: "artist")
}
type Edition @entity {
id: ID!
uri: String!
artist: Artist!
editionId: BigInt!
fundingRecipient: Bytes!
price: BigInt!
numSold: BigInt!
quantity: BigInt!
royaltyBPS: BigInt!
startTime: BigInt!
endTime: BigInt!
tokens: [Token!]! @derivedFrom(field: "edition")
sales: [Sale!]! @derivedFrom(field: "edition")
transfers: [Transfer!]! @derivedFrom(field: "edition")
}
type Token @entity {
id: ID!
uri: String!
artist: Artist!
edition: Edition!
tokenId: BigInt!
owner: Account!
creator: Account!
sales: [Sale!]! @derivedFrom(field: "token")
transfers: [Transfer!]! @derivedFrom(field: "token")
}
interface Event {
id: ID!
artist: Artist!
edition: Edition!
token: Token!
blockNumber: BigInt!
blockHash: Bytes!
txHash: Bytes!
timestamp: BigInt!
}
type Sale implements Event @entity {
id: ID!
artist: Artist!
edition: Edition!
token: Token!
blockNumber: BigInt!
blockHash: Bytes!
txHash: Bytes!
timestamp: BigInt!
currency: Bytes!
amount: BigInt!
seller: Account!
buyer: Account!
}
type Transfer implements Event @entity {
id: ID!
artist: Artist!
edition: Edition!
token: Token!
blockNumber: BigInt!
blockHash: Bytes!
txHash: Bytes!
timestamp: BigInt!
from: Account!
to: Account!
}
type Balance @entity {
id: ID!
artist: Artist!
account: Account!
amount: BigInt!
}
type Account @entity {
id: ID!
ownedArtists: [Artist!]! @derivedFrom(field: "owner")
createdArtists: [Artist!]! @derivedFrom(field: "owner")
ownedTokens: [Token!]! @derivedFrom(field: "owner")
createdTokens: [Token!]! @derivedFrom(field: "creator")
balances: [Balance!]! @derivedFrom(field: "account")
bought: [Sale!]! @derivedFrom(field: "buyer")
sold: [Sale!]! @derivedFrom(field: "seller")
sent: [Transfer!]! @derivedFrom(field: "from")
received: [Transfer!]! @derivedFrom(field: "to")
}