-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.graphql
68 lines (62 loc) · 1.17 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
type Config @entity {
id: String!
feeToken: Bytes!
feeAmount: BigInt!
feesReleased: BigInt!
feesPaid: BigInt!
feesRefunded: BigInt!
feesInEscrow: BigInt!
paused: Boolean!
treasury: Bytes!
accepted: BigInt!
rejected: BigInt!
canceled: BigInt!
created: BigInt!
}
type User @entity {
id: Bytes!
feesReleased: BigInt!
feesPaid: BigInt!
feesRefunded: BigInt!
feesInEscrow: BigInt!
received: BigInt!
accepted: BigInt!
rejected: BigInt!
canceled: BigInt!
created: BigInt!
completed: BigInt!
partyTrades: [Trade!]! @derivedFrom(field: "party")
counterpartyTrades: [Trade!]! @derivedFrom(field: "counterparty")
}
enum Status {
Open
Accepted
Rejected
Canceled
}
enum AssetType {
ERC20
ERC1155
ERC721
}
type Asset @entity(immutable: true) {
id: Bytes!
tradeOffered: Trade
tradeDesired: Trade
address: Bytes!
user: User!
kind: AssetType!
tokenId: BigInt
amount: BigInt
}
type Trade @entity {
id: Bytes!
fee: BigInt!
time: Int!
status: Status!
party: User!
counterparty: User!
chain: String!
offered: [Asset!]! @derivedFrom(field: "tradeOffered")
desired: [Asset!]! @derivedFrom(field: "tradeDesired")
}