-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.graphql
238 lines (214 loc) · 5.06 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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
type Party @entity {
# none / requester / challenger
id: ID!
count: BigInt!
challengesWon: [Challenge!]! @derivedFrom(field: "ruling")
}
type Reason @entity {
# none / incorrectSubmission / identityTheft / sybilAttack / deceased
id: ID!
count: BigInt!
challenges: [Challenge!]! @derivedFrom(field: "reason")
}
type Status @entity {
# vouching / resolving / disputed / resolved / withdrawn
id: ID!
count: BigInt!
requests: [Request!]! @derivedFrom(field: "status")
}
type Contract @entity {
# address
id: Bytes!
baseDeposit: BigInt!
humanityLifespan: BigInt!
renewalPeriodDuration: BigInt!
challengePeriodDuration: BigInt!
requiredNumberOfVouches: BigInt!
latestArbitratorHistory: ArbitratorHistory
}
type ArbitratorHistory @entity {
# arbHistId
id: ID!
arbitrator: Bytes!
extraData: Bytes!
registrationMeta: String!
clearingMeta: String!
updateTime: BigInt!
requests: [Request!]! @derivedFrom(field: "arbitratorHistory")
}
type Registration @entity {
# hash(pohId//claimer)
id: Bytes!
humanity: Humanity!
claimer: Claimer!
expirationTime: BigInt!
}
type Humanity @entity {
# pohId
id: Bytes!
registration: Registration @derivedFrom(field: "humanity")
vouching: Boolean!
usedVouch: VouchInProcess @derivedFrom(field: "voucher")
pendingRevocation: Boolean!
requests: [Request!]! @derivedFrom(field: "humanity")
claimerName: String
nbRequests: BigInt!
nbLegacyRequests: BigInt!
nbPendingRequests: BigInt!
nbBridgedRequests: BigInt!
inTransfer: Boolean!
}
type Claimer @entity {
# address
id: Bytes!
name: String
currentRequest: Request
registration: Registration @derivedFrom(field: "claimer")
vouches: [Vouch!]! @derivedFrom(field: "from")
vouchesReceived: [Vouch!]! @derivedFrom(field: "for")
nbVouchesReceived: BigInt!
}
type Request @entity {
# hash(pohId//i)
id: Bytes!
humanity: Humanity!
index: BigInt!
status: Status!
requester: Bytes!
revocation: Boolean!
claimer: Claimer!
creationTime: BigInt!
resolutionTime: BigInt!
lastStatusChange: BigInt!
challengePeriodEnd: BigInt!
ultimateChallenger: Challenger
winnerParty: Party
arbitratorHistory: ArbitratorHistory!
evidenceGroup: EvidenceGroup!
vouches: [VouchInProcess!]! @derivedFrom(field: "request")
nbChallenges: BigInt!
challenges: [Challenge!]! @derivedFrom(field: "request")
contributors: [Bytes!]!
registrationEvidenceRevokedReq: String!
}
type Challenger @entity {
# address
id: Bytes!
wins: [Request!]! @derivedFrom(field: "ultimateChallenger")
challenges: [Challenge!]! @derivedFrom(field: "challenger")
}
type Challenge @entity {
# hash(request.id//i)
id: Bytes!
index: BigInt!
request: Request!
reason: Reason!
challenger: Challenger
creationTime: BigInt!
disputeId: BigInt!
ruling: Party!
nbRounds: BigInt!
rounds: [Round!]! @derivedFrom(field: "challenge")
}
type Round @entity {
# hash(challenge.id//i)
id: Bytes!
index: BigInt!
creationTime: BigInt!
challenge: Challenge!
requesterFund: RequesterFund!
challengerFund: ChallengerFund
}
interface Fund {
# hash(round.id//party)
id: Bytes!
amount: BigInt!
withdrawn: Boolean!
feeRewards: BigInt!
contributions: [Contribution!]! @derivedFrom(field: "fund")
round: Round!
}
type RequesterFund implements Fund @entity {
id: Bytes!
amount: BigInt!
withdrawn: Boolean!
feeRewards: BigInt!
contributions: [Contribution!]! @derivedFrom(field: "fund")
round: Round! @derivedFrom(field: "requesterFund")
}
type ChallengerFund implements Fund @entity {
id: Bytes!
amount: BigInt!
withdrawn: Boolean!
round: Round! @derivedFrom(field: "challengerFund")
feeRewards: BigInt!
contributions: [Contribution!]! @derivedFrom(field: "fund")
}
type Contribution @entity {
# hash(fund.id//contributor)
id: Bytes!
fund: Fund!
contributor: Bytes!
amount: BigInt!
}
type Vouch @entity {
# hash(claimer.id//pohId//voucher.id)
id: Bytes!
from: Claimer!
humanity: Humanity!
for: Claimer!
}
type VouchInProcess @entity {
# hash(vouch.id)
id: Bytes!
vouch: Vouch!
processed: Boolean!
voucher: Humanity!
request: Request!
}
type EvidenceGroup @entity {
# evidenceGroupId
id: Bytes!
length: BigInt!
request: Request! @derivedFrom(field: "evidenceGroup")
evidence: [Evidence!]! @derivedFrom(field: "group")
}
type Evidence @entity(immutable: true) {
# hash(groupId//i)
id: Bytes!
group: EvidenceGroup!
creationTime: BigInt!
uri: String!
submitter: Bytes!
}
type CrossChainRegistration @entity {
# pohId
id: Bytes!
claimer: Claimer!
expirationTime: BigInt!
lastReceivedTransferTimestamp: BigInt!
}
type OutTransfer @entity {
# pohId
id: Bytes!
foreignProxy: Bytes!
transferHash: Bytes!
transferTimestamp: BigInt!
}
type InTransfer @entity(immutable: true) {
# transfer hash
id: Bytes!
humanityId: Bytes!
}
type CrossChainGateway @entity {
# gateway address
id: Bytes!
foreignProxy: Bytes!
}
type _Schema_
@fulltext(
name: "submissionSearch"
language: en
algorithm: rank
include: [{ entity: "Claimer", fields: [{ name: "name" }] }]
)