-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathschema.graphql
More file actions
206 lines (184 loc) · 5.18 KB
/
schema.graphql
File metadata and controls
206 lines (184 loc) · 5.18 KB
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
# ----------------- TOKEN TRANSFER EVENTS (Deposit, Refund, and Payout) -----------------
type Deposit @entity {
id: ID! # {depositId}
tokenAddress: Bytes!
volume: BigInt!
sender: User!
bounty: Bounty!
receiveTime: BigInt
organization: Organization!
tokenEvents: TokenEvents!
refunded: Boolean!
transactionHash: Bytes!
tokenId: BigInt
expiration: BigInt!
refundTime: BigInt
isNft: Boolean!
funderUuid: String
}
type Refund @entity {
id: ID! # depositId
depositId: Bytes!
tokenAddress: Bytes!
volume: BigInt!
sender: User!
bounty: Bounty!
refundTime: BigInt
organization: Organization!
tokenEvents: TokenEvents!
transactionHash: Bytes!
}
type Payout @entity {
id: ID! # depositId
tokenAddress: Bytes!
volume: BigInt!
payoutTime: BigInt
tokenId: BigInt
isNft: Boolean!
closer: User!
bounty: Bounty!
organization: Organization!
tokenEvents: TokenEvents!
transactionHash: Bytes!
}
# ----------------- TOKEN BALANCE -----------------
# Total token balances for Token overall
# All deposits, refunds, and payouts that have ever happened for a token
type TokenEvents @entity {
id: ID! # tokenAddress
deposits: [Deposit!]! @derivedFrom(field: "tokenEvents")
refunds: [Refund!]! @derivedFrom(field: "tokenEvents")
payouts: [Payout!]! @derivedFrom(field: "tokenEvents")
}
# Incremented for each Deposit
# Decremented for each Refund
type FundedTokenBalance @entity {
id: ID! #tokenAddress
volume: BigInt!
}
# Incremented for each Payout
type PayoutTokenBalance @entity {
id: ID! #tokenAddress
volume: BigInt!
}
# ----------------- BOUNTY -----------------
type Bounty @entity {
id: ID! # Bounty address hex string
bountyId: String!
bountyAddress: String!
issuer: User!
bountyType: BigInt!
bountyMintTime: BigInt!
bountyClosedTime: BigInt
status: BigInt!
closer: User
closerData: Bytes
organization: Organization!
bountyTokenBalances: [BountyFundedTokenBalance!]!
@derivedFrom(field: "bounty")
deposits: [Deposit!]! @derivedFrom(field: "bounty")
refunds: [Refund!]! @derivedFrom(field: "bounty")
payouts: [Payout!]! @derivedFrom(field: "bounty")
claims: [Claim!]! @derivedFrom(field: "bounty")
transactionHash: Bytes!
claimedTransactionHash: Bytes
payoutAddress: Bytes
version: BigInt!
hasFundingGoal: Boolean!
fundingGoalTokenAddress: Bytes
fundingGoalVolume: BigInt
payoutTokenAddress: Bytes
payoutTokenVolume: BigInt
payoutSchedule: [BigInt!]
externalUserId: String
invoiceRequired: Boolean
kycRequired: Boolean
supportingDocumentsRequired: Boolean
invoiceCompleted: [Boolean!]
supportingDocumentsCompleted: [Boolean!]
tierWinners: [String!]
alternativeName: String
alternativeLogo: String
}
type Claim @entity {
id: ID! # claimId
bounty: Bounty!
claimTime: BigInt!
bountyType: BigInt!
claimantAsset: String!
claimant: User!
externalUserId: String!
tier: BigInt
version: BigInt!
}
# Total token balances per Bounty per Token
# Incremented for each Deposit
# Decremented for each Refund
type BountyFundedTokenBalance @entity {
id: ID! # bountyAddres-tokenAddress
bounty: Bounty!
tokenAddress: Bytes!
volume: BigInt!
}
# ----------------- ORGANIZATION -----------------
type Organization @entity {
id: ID! # Organization ID on GitHub
bountiesCount: BigInt!
bountiesCreated: [Bounty!]! @derivedFrom(field: "organization")
deposits: [Deposit!]! @derivedFrom(field: "organization")
refunds: [Refund!]! @derivedFrom(field: "organization")
payouts: [Payout!]! @derivedFrom(field: "organization")
fundedTokenBalances: [OrganizationFundedTokenBalance!]!
@derivedFrom(field: "organization")
payoutTokenBalances: [OrganizationPayoutTokenBalance!]!
@derivedFrom(field: "organization")
}
type BountiesCounter @entity {
id: ID!
count: BigInt!
}
# Total token balances per Organization per Token
# Incremented for each Deposit
# Decremented for each Refund
type OrganizationFundedTokenBalance @entity {
id: ID! # organizationId-tokenAddress
organization: Organization!
tokenAddress: Bytes!
volume: BigInt!
}
# Incremented for each Payout
type OrganizationPayoutTokenBalance @entity {
id: ID! # organizationId-tokenAddress
organization: Organization!
tokenAddress: Bytes!
volume: BigInt!
}
# ----------------- USER -----------------
# User (Funder, Closer, Issuer)
type User @entity {
id: ID! # User address hex string
bountiesCreated: [Bounty!]! @derivedFrom(field: "issuer")
bountiesClosed: [Bounty!]! @derivedFrom(field: "closer")
deposits: [Deposit!]! @derivedFrom(field: "sender")
refunds: [Refund!]! @derivedFrom(field: "sender")
payouts: [Payout!]! @derivedFrom(field: "closer")
payoutTokenBalances: [UserPayoutTokenBalance!]! @derivedFrom(field: "user")
fundedTokenBalances: [UserFundedTokenBalance!]! @derivedFrom(field: "user")
externalUserId: String
}
# Total token balances per User per Token
# Incremented for each Deposit
# Decremented for each Refund
type UserFundedTokenBalance @entity {
id: ID! # userAddress-tokenAddress
user: User!
tokenAddress: Bytes!
volume: BigInt!
}
# Incremented for each Payout
type UserPayoutTokenBalance @entity {
id: ID! # userAddress-tokenAddress
user: User!
tokenAddress: Bytes!
volume: BigInt!
}