-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.graphql
95 lines (87 loc) · 1.98 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
enum TokenType {
ETH
ERC20
ERC721
}
type Depositor @entity {
id: ID!
address: Bytes! # address
biggestETHWon: BigInt! # uint256
biggestROI: BigInt! # uint256
totalRoundsWon: BigInt! # uint256
totalRoundsPlayed: BigInt! # uint256
lastRoundPlayed: BigInt!
}
type Participant @entity {
id: ID!
round: Round! # uint256
depositor: Bytes! # address
totalNumberOfEntries: BigInt!
deposits: [Deposit!]! @derivedFrom(field: "participant")
}
type Deposit @entity {
id: ID!
round: Round!
entriesCount: BigInt! # uint256
depositor: Bytes! # address
tokenAddress: Bytes! # address
tokenAmount: BigInt! # uint256
tokenId: BigInt! # uint256
tokenType: TokenType!
indice: BigInt!
claimed: Boolean!
participant: Participant!
transaction: Transaction!
claimedHash: Bytes
}
type Transaction @entity(immutable: true) {
id: ID!
hash: Bytes!
round: Round!
depositor: Bytes!
deposits: [Deposit!]! @derivedFrom(field: "transaction")
totalNumberOfEntries: BigInt!
gasLimit: BigInt!
gasPrice: BigInt!
block: BigInt!
timestamp: BigInt!
}
type Round @entity {
id: ID!
roundId: BigInt! # uint256roundId
status: Int! # uint8
cutoffTime: BigInt!
lastStatusUpdate: BigInt
statusLog: [RoundStatusLog!]! @derivedFrom(field: "round")
maximumNumberOfDeposits: BigInt!
maximumNumberOfParticipants: BigInt!
valuePerEntry: BigInt! #uint256
numberOfEntries: BigInt!
numberOfParticipants: BigInt!
duration: BigInt!
winner: Bytes
drawnAt: BigInt
drawnHash: Bytes
protocolFeeBp: Int! # uint16
protocolFeeOwed: BigInt!
deposits: [Deposit!]! @derivedFrom(field: "round")
transactions: [Transaction!]! @derivedFrom(field: "round")
}
type RoundStatusLog @entity(immutable: true) {
id: ID!
round: Round!
status: Int!
transaction: Bytes!
timestamp: BigInt!
block: BigInt!
}
type Fortune @entity {
id: ID!
totalRounds: BigInt!
currentRound: Round
}
type Currency @entity {
id: ID!
address: Bytes! # address
isAllowed: Boolean! # bool
}