-
Notifications
You must be signed in to change notification settings - Fork 1
/
schema.graphql
82 lines (71 loc) · 1.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
type Market @entity {
id: ID!
platformPrimaryFee: BigInt!
platformSecondaryFee: BigInt!
artistRoyaltyFee: BigInt!
lastMasterArtwork: Artwork
}
type Artwork @entity {
id: ID!
tokenId: BigInt!
artists: [Account!]!
owner: Account!
uri: String!
isMaster: Boolean!
masterArtwork: Artwork
controlArtworks: [Artwork!] @derivedFrom(field: "masterArtwork")
status: ArtworkStatus!
currentBid: Bid
currentSale: Sale
bids: [Bid!]
sales: [Sale!]
transfers: [Transfer!]
firstTransferPrice: BigInt
lastTransferPrice: BigInt
timeCreated: BigInt!
timeLastTransferred: BigInt
}
enum ArtworkStatus {
Created
Sold
}
type Bid @entity {
id: ID!
bidder: Account!
price: BigInt!
timeRaised: BigInt!
status: BidStatus!
timeCancelled: BigInt
acceptedBy: Account
timeAccepted: BigInt
artwork: Artwork! @derivedFrom(field: "bids")
}
enum BidStatus {
Open
Accepted
Cancelled
}
type Sale @entity {
id: ID!
seller: Account!
price: BigInt!
timeRaised: BigInt!
isSold: Boolean!
buyer: Account
timeSold: BigInt
artwork: Artwork! @derivedFrom(field: "sales")
}
type Account @entity {
id: ID!
address: Bytes!
totalPrimaryIncome: BigInt!
totalRoyalty: BigInt!
createdArtworks: [Artwork!] @derivedFrom(field: "artists")
ownedArtworks: [Artwork!] @derivedFrom(field: "owner")
}
type Transfer @entity {
id: ID!
from: Account!
to: Account!
timestamp: BigInt!
}