forked from nounsDAO/nouns-monorepo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.graphql
262 lines (183 loc) · 6.14 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
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
type Seed @entity {
"The Noun's ERC721 token id"
id: ID!
"The background index"
background: BigInt!
"The body index"
body: BigInt!
"The accessory index"
accessory: BigInt!
"The head index"
head: BigInt!
"The glasses index"
glasses: BigInt!
}
type Noun @entity {
"The Noun's ERC721 token id"
id: ID!
"The seed used to determine the Noun's traits"
seed: Seed
"The owner of the Noun"
owner: Account!
"Historical votes for the Noun"
votes: [Vote!]! @derivedFrom(field: "nouns")
}
type Bid @entity {
"Bid transaction hash"
id: ID!
"The Noun being bid on"
noun: Noun!
"Bid amount"
amount: BigInt!
"Bidder account"
bidder: Account
"Block number of the bid"
blockNumber: BigInt!
"Index of transaction within block"
txIndex: BigInt!
"The auction being bid in"
auction: Auction!
"The timestamp of the block the bid is in"
blockTimestamp: BigInt!
}
type Auction @entity {
"The Noun's ERC721 token id"
id: ID!
"The Noun"
noun: Noun!
"The current highest bid amount"
amount: BigInt!
"The time that the auction started"
startTime: BigInt!
"The time that the auction is scheduled to end"
endTime: BigInt!
"The account with the current highest bid"
bidder: Account
"Whether or not the auction has been settled"
settled: Boolean!
"The auction bids"
bids: [Bid!]! @derivedFrom(field: "auction")
}
enum ProposalStatus {
PENDING
ACTIVE
CANCELLED
VETOED
QUEUED
EXECUTED
}
type Account @entity {
"An Account is any address that holds any amount of Nouns, the id used is the blockchain address."
id: ID!
"Delegate address of the token holder which will participate in votings. Delegates don't need to hold any tokens and can even be the token holder itself."
delegate: Delegate
"Noun balance of this address expressed in the smallest unit of the Nouns ERC721 Token"
tokenBalanceRaw: BigInt!
"Noun balance of this address expressed as a BigInt normalized value for the Nouns ERC721 Token"
tokenBalance: BigInt!
"Total amount of Nouns ever held by this address expressed in the smallest unit of the Nouns ERC721 Token"
totalTokensHeldRaw: BigInt!
"Total amount of Nouns ever held by this address expressed as a BigInt normalized value for the Nouns ERC721 Token"
totalTokensHeld: BigInt!
"The Nouns owned by this account"
nouns: [Noun!]!
}
type Delegate @entity {
"A Delegate is any address that has been delegated with voting tokens by a token holder, id is the blockchain address of said delegate"
id: ID!
"Amount of votes delegated to this delegate to be used on proposal votings expressed in the smallest unit of the Nouns ERC721 Token"
delegatedVotesRaw: BigInt!
"Amount of votes delegated to this delegate to be used on proposal votings expressed as a BigInt normalized value for the Nouns ERC721 Token"
delegatedVotes: BigInt!
tokenHoldersRepresentedAmount: Int!
"Token holders that this delegate represents"
tokenHoldersRepresented: [Account!]! @derivedFrom(field: "delegate")
"Nouns that this delegate represents"
nounsRepresented: [Noun!]!
"Votes that a delegate has made in different proposals"
votes: [Vote!]! @derivedFrom(field: "voter")
"Proposals that the delegate has created"
proposals: [Proposal!]! @derivedFrom(field: "proposer")
}
type Proposal @entity {
"Internal proposal ID, in this implementation it seems to be a autoincremental id"
id: ID!
"Delegate that proposed the change"
proposer: Delegate!
"Targets data for the change"
targets: [Bytes!]
"Values data for the change"
values: [BigInt!]
"Signature data for the change"
signatures: [String!]
"Call data for the change"
calldatas: [Bytes!]
"The proposal creation timestamp"
createdTimestamp: BigInt!
"The proposal creation block"
createdBlock: BigInt!
"The proposal creation transaction hash"
createdTransactionHash: Bytes!
"Block number from where the voting starts"
startBlock: BigInt!
"Block number from where the voting ends"
endBlock: BigInt!
"The proposal threshold at the time of proposal creation"
proposalThreshold: BigInt!
"The required number of votes for quorum at the time of proposal creation"
quorumVotes: BigInt!
"The number of votes in favor of the proposal"
forVotes: BigInt!
"The number of votes against of the proposal"
againstVotes: BigInt!
"The number of votes to abstain on the proposal"
abstainVotes: BigInt!
"String description of the change"
description: String!
"Status of the proposal"
status: ProposalStatus!
"Once the proposal is queued for execution it will have an ETA of the execution"
executionETA: BigInt
"Votes associated to this proposal"
votes: [Vote!]! @derivedFrom(field: "proposal")
}
type Vote @entity {
"Delegate ID + Proposal ID"
id: ID!
"Whether the vote is in favour of the proposal"
support: Boolean!
"The integer support value: against (0), for (1), or abstain (2)"
supportDetailed: Int!
"Amount of votes in favour or against expressed in the smallest unit of the Nouns ERC721 Token"
votesRaw: BigInt!
"Amount of votes in favour or against expressed as a BigInt normalized value for the Nouns ERC721 Token"
votes: BigInt!
"The optional vote reason"
reason: String
"Delegate that emitted the vote"
voter: Delegate!
"The Nouns used to vote"
nouns: [Noun!]
"Proposal that is being voted on"
proposal: Proposal!
}
type Governance @entity {
"Unique entity used to keep track of common aggregated data"
id: ID!
"Number of proposals created"
proposals: BigInt!
"Total number of token holders currently"
currentTokenHolders: BigInt!
"Total number of delegates participating on the governance currently"
currentDelegates: BigInt!
"Total number of token holders"
totalTokenHolders: BigInt!
"Total number of delegates that held delegated votes"
totalDelegates: BigInt!
"Total number of votes delegated expressed in the smallest unit of the Nouns ERC721 Token"
delegatedVotesRaw: BigInt!
"Total number of votes delegated expressed as a BigInt normalized value for the Nouns ERC721 Token"
delegatedVotes: BigInt!
"Number of proposals currently queued for execution"
proposalsQueued: BigInt!
}