-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.graphql
220 lines (185 loc) · 4.08 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
type Block @entity {
id: ID!
number: BigInt!
timestamp: BigInt!
date: String!
}
type Transaction @entity {
id: ID!
code: BigInt!
codespace: String!
gas_used: BigInt!
gas_wanted: BigInt!
info: String!
log: String!
signatures: [Signature!]! @derivedFrom(field: "transaction")
auth_info: String
# derive from
block: Block!
}
type Signature @entity {
id: ID!
signature: String!
transaction: Transaction!
}
type Proposal @entity {
id: ID!
# message
type: String!
authority: String!
# proposal metadata
proposer: String!
title: String!
summary: String!
metadata: String
proposal_type: ProposalType!
governance_parameter: GovernanceParameter!
# timestamp
submit_time: Timestamp!
deposit_end_time: Timestamp
voting_start_time: Timestamp
voting_end_time: Timestamp
# proposal state
status: ProposalStatus!
# derive from
block: Block!
transaction: Transaction!
votes: [Vote!]! @derivedFrom(field: "proposal")
deposits: [Deposit!]! @derivedFrom(field: "proposal")
messages: [ProposalMessage!]! @derivedFrom(field: "proposal")
}
type ProposalMessage @entity {
id: ID!
message_index: BigInt! # the message's index in the "messages" proposal field
type: String! # the message type (e.g "/cosmwasm.wasm.v1.MsgStoreCode")
raw_data: String! # undecoded message value in Hex
json_data: String # decoded JSON value
proposal: Proposal!
}
enum ProposalStatus {
VotingPeriod
DepositPeriod
Passed
Rejected
Failed
Canceled
Dropped
}
enum ProposalType {
Unspecified
Standard
MultipleChoice
Optimistic
Expedited
}
type Vote @entity {
id: ID!
# vote
voter: String!
option: String!
weight: BigDecimal!
# derive from
block: Block!
transaction: Transaction!
proposal: Proposal!
}
type Deposit @entity {
id: ID!
# deposit
amount: String!
denom: String!
depositor: String!
# derive from
block: Block!
transaction: Transaction!
proposal: Proposal!
}
type GovernanceParameter @entity {
id: ID!
# governance parameters
deposit_params: DepositParam! @derivedFrom(field: "governance_parameter")
voting_params: VotingParam! @derivedFrom(field: "governance_parameter")
tally_params: TallyParam! @derivedFrom(field: "governance_parameter")
# derive from
block: Block!
}
type DepositParam @entity {
id: ID!
# deposit parameters
min_deposit: [String!]! # 512000000 uatom
expedited_min_deposit: [String!]
max_deposit_period: BigInt!
# deriveFrom
block: Block!
governance_parameter: GovernanceParameter!
}
type VotingParam @entity {
id: ID!
# voting parameters
voting_period: BigInt!
expedited_voting_period: BigInt
# deriveFrom
block: Block!
governance_parameter: GovernanceParameter!
}
type TallyParam @entity {
id: ID!
# tally parameters
quorum: BigDecimal!
expedited_quorum: BigDecimal
threshold: BigDecimal!
expedited_threshold: BigDecimal
veto_threshold: BigDecimal!
# deriveFrom
block: Block!
governance_parameter: GovernanceParameter!
}
type SoftwareUpgradeProposal @entity {
id: ID!
name: String!
height: BigInt!
info: String!
proposal: Proposal!
}
type CommunityPoolSpend @entity {
id: ID!
authority: String!
recipient: String!
amount: BigInt!
denom: String!
proposal: Proposal!
}
type ClientUpdate @entity {
id: ID!
subject_client_id: String!
substitute_client_id: String!
proposal: Proposal!
}
type ParameterChange @entity {
id: ID!
subspace: String!
key: String!
value: String!
proposal: Proposal!
}
#type VoteStats @aggregation(intervals: ["hour", "day"], source: "Vote") {
# id: ID!
# timestamp: Timestamp!
# proposal: Proposal!
#
# # Aggregates
# yesCount: BigInt!
# @aggregate(fn: "count", arg: "case when option = 'Yes' then 1 else 0 end")
# noCount: BigInt!
# @aggregate(fn: "count", arg: "case when option = 'No' then 1 else 0 end")
# abstainCount: BigInt!
# @aggregate(
# fn: "count"
# arg: "case when option = 'Abstain' then 1 else 0 end"
# )
# noWithVetoCount: BigInt!
# @aggregate(
# fn: "count"
# arg: "case when option = 'NoWithVeto' then 1 else 0 end"
# )
#}