@dorafactory/maci-sdk 0.0.7 → 0.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -7
- package/dist/index.js +751 -187
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +748 -187
- package/dist/index.mjs.map +1 -1
- package/dist/libs/circom/tree.d.ts +20 -20
- package/dist/libs/contract/ts/AMaci.client.d.ts +1 -1
- package/dist/libs/contract/ts/Maci.client.d.ts +21 -47
- package/dist/libs/contract/ts/Maci.types.d.ts +40 -31
- package/dist/libs/contract/ts/OracleMaci.client.d.ts +52 -52
- package/dist/libs/contract/ts/OracleMaci.types.d.ts +17 -7
- package/dist/libs/contract/ts/Registry.client.d.ts +2 -2
- package/dist/libs/contract/types.d.ts +2 -2
- package/dist/libs/errors/types.d.ts +1 -0
- package/dist/libs/http/http.d.ts +1 -1
- package/dist/libs/index.d.ts +3 -0
- package/dist/libs/indexer/indexer.d.ts +11 -2
- package/dist/libs/maci/index.d.ts +1 -0
- package/dist/libs/maci/maci.d.ts +64 -5
- package/dist/libs/oracle-certificate/oracle-certificate.d.ts +1 -21
- package/dist/libs/oracle-certificate/types.d.ts +12 -0
- package/dist/libs/query/event.d.ts +7 -0
- package/dist/libs/query/index.d.ts +1 -0
- package/dist/maci.d.ts +7 -5
- package/dist/types/index.d.ts +22 -0
- package/package.json +1 -1
- package/src/libs/const.ts +3 -2
- package/src/libs/contract/contract.ts +2 -6
- package/src/libs/contract/ts/AMaci.client.ts +868 -874
- package/src/libs/contract/ts/AMaci.types.ts +216 -216
- package/src/libs/contract/ts/Maci.client.ts +748 -888
- package/src/libs/contract/ts/Maci.types.ts +229 -224
- package/src/libs/contract/ts/OracleMaci.client.ts +623 -348
- package/src/libs/contract/ts/OracleMaci.types.ts +191 -138
- package/src/libs/contract/ts/Registry.client.ts +438 -446
- package/src/libs/contract/ts/Registry.types.ts +97 -97
- package/src/libs/contract/types.ts +6 -2
- package/src/libs/contract/utils.ts +9 -0
- package/src/libs/errors/types.ts +1 -0
- package/src/libs/http/http.ts +3 -7
- package/src/libs/index.ts +3 -0
- package/src/libs/indexer/indexer.ts +18 -0
- package/src/libs/maci/index.ts +1 -0
- package/src/libs/maci/maci.ts +302 -10
- package/src/libs/oracle-certificate/oracle-certificate.ts +19 -73
- package/src/libs/oracle-certificate/types.ts +15 -1
- package/src/libs/query/event.ts +78 -0
- package/src/libs/query/index.ts +1 -0
- package/src/maci.ts +27 -5
- package/src/types/index.ts +28 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This file was automatically generated by @cosmwasm/ts-codegen@
|
|
2
|
+
* This file was automatically generated by @cosmwasm/ts-codegen@1.11.1.
|
|
3
3
|
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
|
|
4
4
|
* and run the @cosmwasm/ts-codegen generate command to regenerate this file.
|
|
5
5
|
*/
|
|
@@ -8,256 +8,261 @@ export type Uint256 = string;
|
|
|
8
8
|
export type Timestamp = Uint64;
|
|
9
9
|
export type Uint64 = string;
|
|
10
10
|
export interface InstantiateMsg {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
11
|
+
certification_system: Uint256;
|
|
12
|
+
circuit_type: Uint256;
|
|
13
|
+
coordinator: PubKey;
|
|
14
|
+
groth16_process_vkey?: Groth16VKeyType | null;
|
|
15
|
+
groth16_tally_vkey?: Groth16VKeyType | null;
|
|
16
|
+
max_vote_options: Uint256;
|
|
17
|
+
parameters: MaciParameters;
|
|
18
|
+
plonk_process_vkey?: PlonkVKeyType | null;
|
|
19
|
+
plonk_tally_vkey?: PlonkVKeyType | null;
|
|
20
|
+
qtr_lib: QuinaryTreeRoot;
|
|
21
|
+
round_info: RoundInfo;
|
|
22
|
+
voting_time?: VotingTime | null;
|
|
23
|
+
whitelist?: Whitelist | null;
|
|
24
24
|
}
|
|
25
25
|
export interface PubKey {
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
x: Uint256;
|
|
27
|
+
y: Uint256;
|
|
28
28
|
}
|
|
29
29
|
export interface Groth16VKeyType {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
30
|
+
vk_alpha1: string;
|
|
31
|
+
vk_beta_2: string;
|
|
32
|
+
vk_delta_2: string;
|
|
33
|
+
vk_gamma_2: string;
|
|
34
|
+
vk_ic0: string;
|
|
35
|
+
vk_ic1: string;
|
|
36
36
|
}
|
|
37
37
|
export interface MaciParameters {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
38
|
+
int_state_tree_depth: Uint256;
|
|
39
|
+
message_batch_size: Uint256;
|
|
40
|
+
state_tree_depth: Uint256;
|
|
41
|
+
vote_option_tree_depth: Uint256;
|
|
42
|
+
}
|
|
43
|
+
export interface PlonkVKeyType {
|
|
44
|
+
g2_elements: string[];
|
|
45
|
+
n: number;
|
|
46
|
+
next_step_selector_commitments: string[];
|
|
47
|
+
non_residues: string[];
|
|
48
|
+
num_inputs: number;
|
|
49
|
+
permutation_commitments: string[];
|
|
50
|
+
selector_commitments: string[];
|
|
42
51
|
}
|
|
43
52
|
export interface QuinaryTreeRoot {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
zeros: [
|
|
54
|
+
Uint256,
|
|
55
|
+
Uint256,
|
|
56
|
+
Uint256,
|
|
57
|
+
Uint256,
|
|
58
|
+
Uint256,
|
|
59
|
+
Uint256,
|
|
60
|
+
Uint256,
|
|
61
|
+
Uint256,
|
|
62
|
+
Uint256
|
|
63
|
+
];
|
|
55
64
|
}
|
|
56
65
|
export interface RoundInfo {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
66
|
+
description: string;
|
|
67
|
+
link: string;
|
|
68
|
+
title: string;
|
|
60
69
|
}
|
|
61
70
|
export interface VotingTime {
|
|
62
|
-
|
|
63
|
-
|
|
71
|
+
end_time?: Timestamp | null;
|
|
72
|
+
start_time?: Timestamp | null;
|
|
64
73
|
}
|
|
65
74
|
export interface Whitelist {
|
|
66
|
-
|
|
75
|
+
users: WhitelistConfig[];
|
|
67
76
|
}
|
|
68
77
|
export interface WhitelistConfig {
|
|
69
|
-
|
|
78
|
+
addr: string;
|
|
79
|
+
balance: Uint256;
|
|
70
80
|
}
|
|
71
81
|
export type ExecuteMsg =
|
|
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
|
-
results: Uint256[];
|
|
155
|
-
salt: Uint256;
|
|
156
|
-
};
|
|
157
|
-
}
|
|
158
|
-
| {
|
|
159
|
-
grant: {
|
|
160
|
-
max_amount: Uint128;
|
|
161
|
-
};
|
|
162
|
-
}
|
|
163
|
-
| {
|
|
164
|
-
revoke: {};
|
|
165
|
-
}
|
|
166
|
-
| {
|
|
167
|
-
bond: {};
|
|
168
|
-
}
|
|
169
|
-
| {
|
|
170
|
-
withdraw: {
|
|
171
|
-
amount?: Uint128 | null;
|
|
172
|
-
};
|
|
173
|
-
};
|
|
82
|
+
| {
|
|
83
|
+
set_params: {
|
|
84
|
+
int_state_tree_depth: Uint256;
|
|
85
|
+
message_batch_size: Uint256;
|
|
86
|
+
state_tree_depth: Uint256;
|
|
87
|
+
vote_option_tree_depth: Uint256;
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
| {
|
|
91
|
+
set_round_info: {
|
|
92
|
+
round_info: RoundInfo;
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
| {
|
|
96
|
+
set_whitelists: {
|
|
97
|
+
whitelists: Whitelist;
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
| {
|
|
101
|
+
set_vote_options_map: {
|
|
102
|
+
vote_option_map: string[];
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
| {
|
|
106
|
+
start_voting_period: {};
|
|
107
|
+
}
|
|
108
|
+
| {
|
|
109
|
+
sign_up: {
|
|
110
|
+
pubkey: PubKey;
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
| {
|
|
114
|
+
start_process_period: {};
|
|
115
|
+
}
|
|
116
|
+
| {
|
|
117
|
+
stop_voting_period: {};
|
|
118
|
+
}
|
|
119
|
+
| {
|
|
120
|
+
publish_message: {
|
|
121
|
+
enc_pub_key: PubKey;
|
|
122
|
+
message: MessageData;
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
| {
|
|
126
|
+
process_message: {
|
|
127
|
+
groth16_proof?: Groth16ProofType | null;
|
|
128
|
+
new_state_commitment: Uint256;
|
|
129
|
+
plonk_proof?: PlonkProofType | null;
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
| {
|
|
133
|
+
stop_processing_period: {};
|
|
134
|
+
}
|
|
135
|
+
| {
|
|
136
|
+
process_tally: {
|
|
137
|
+
groth16_proof?: Groth16ProofType | null;
|
|
138
|
+
new_tally_commitment: Uint256;
|
|
139
|
+
plonk_proof?: PlonkProofType | null;
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
| {
|
|
143
|
+
stop_tallying_period: {
|
|
144
|
+
results: Uint256[];
|
|
145
|
+
salt: Uint256;
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
| {
|
|
149
|
+
grant: {
|
|
150
|
+
max_amount: Uint128;
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
| {
|
|
154
|
+
revoke: {};
|
|
155
|
+
}
|
|
156
|
+
| {
|
|
157
|
+
bond: {};
|
|
158
|
+
}
|
|
159
|
+
| {
|
|
160
|
+
withdraw: {
|
|
161
|
+
amount?: Uint128 | null;
|
|
162
|
+
};
|
|
163
|
+
};
|
|
174
164
|
export type Uint128 = string;
|
|
175
165
|
export interface MessageData {
|
|
176
|
-
|
|
166
|
+
data: [Uint256, Uint256, Uint256, Uint256, Uint256, Uint256, Uint256];
|
|
177
167
|
}
|
|
178
168
|
export interface Groth16ProofType {
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
169
|
+
a: string;
|
|
170
|
+
b: string;
|
|
171
|
+
c: string;
|
|
172
|
+
}
|
|
173
|
+
export interface PlonkProofType {
|
|
174
|
+
grand_product_at_z_omega: string;
|
|
175
|
+
grand_product_commitment: string;
|
|
176
|
+
input_values: string[];
|
|
177
|
+
linearization_polynomial_at_z: string;
|
|
178
|
+
n: number;
|
|
179
|
+
num_inputs: number;
|
|
180
|
+
opening_at_z_omega_proof: string;
|
|
181
|
+
opening_at_z_proof: string;
|
|
182
|
+
permutation_polynomials_at_z: string[];
|
|
183
|
+
quotient_poly_commitments: string[];
|
|
184
|
+
quotient_polynomial_at_z: string;
|
|
185
|
+
wire_commitments: string[];
|
|
186
|
+
wire_values_at_z: string[];
|
|
187
|
+
wire_values_at_z_omega: string[];
|
|
182
188
|
}
|
|
183
189
|
export type QueryMsg =
|
|
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
|
-
};
|
|
190
|
+
| {
|
|
191
|
+
get_round_info: {};
|
|
192
|
+
}
|
|
193
|
+
| {
|
|
194
|
+
get_voting_time: {};
|
|
195
|
+
}
|
|
196
|
+
| {
|
|
197
|
+
get_period: {};
|
|
198
|
+
}
|
|
199
|
+
| {
|
|
200
|
+
get_num_sign_up: {};
|
|
201
|
+
}
|
|
202
|
+
| {
|
|
203
|
+
get_msg_chain_length: {};
|
|
204
|
+
}
|
|
205
|
+
| {
|
|
206
|
+
get_processed_msg_count: {};
|
|
207
|
+
}
|
|
208
|
+
| {
|
|
209
|
+
get_processed_user_count: {};
|
|
210
|
+
}
|
|
211
|
+
| {
|
|
212
|
+
get_result: {
|
|
213
|
+
index: Uint256;
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
| {
|
|
217
|
+
get_all_result: {};
|
|
218
|
+
}
|
|
219
|
+
| {
|
|
220
|
+
get_state_idx_inc: {
|
|
221
|
+
address: Addr;
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
| {
|
|
225
|
+
get_voice_credit_balance: {
|
|
226
|
+
index: Uint256;
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
| {
|
|
230
|
+
white_list: {};
|
|
231
|
+
}
|
|
232
|
+
| {
|
|
233
|
+
is_white_list: {
|
|
234
|
+
sender: string;
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
| {
|
|
238
|
+
white_balance_of: {
|
|
239
|
+
sender: string;
|
|
240
|
+
};
|
|
241
|
+
}
|
|
242
|
+
| {
|
|
243
|
+
vote_option_map: {};
|
|
244
|
+
}
|
|
245
|
+
| {
|
|
246
|
+
max_vote_options: {};
|
|
247
|
+
}
|
|
248
|
+
| {
|
|
249
|
+
query_total_fee_grant: {};
|
|
250
|
+
}
|
|
251
|
+
| {
|
|
252
|
+
query_circuit_type: {};
|
|
253
|
+
}
|
|
254
|
+
| {
|
|
255
|
+
query_cert_system: {};
|
|
256
|
+
};
|
|
252
257
|
export type Addr = string;
|
|
253
258
|
export type PeriodStatus =
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
+
| 'pending'
|
|
260
|
+
| 'voting'
|
|
261
|
+
| 'processing'
|
|
262
|
+
| 'tallying'
|
|
263
|
+
| 'ended';
|
|
259
264
|
export interface Period {
|
|
260
|
-
|
|
265
|
+
status: PeriodStatus;
|
|
261
266
|
}
|
|
262
267
|
export type Boolean = boolean;
|
|
263
268
|
export type ArrayOfString = string[];
|