@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.
Files changed (50) hide show
  1. package/README.md +27 -7
  2. package/dist/index.js +751 -187
  3. package/dist/index.js.map +1 -1
  4. package/dist/index.mjs +748 -187
  5. package/dist/index.mjs.map +1 -1
  6. package/dist/libs/circom/tree.d.ts +20 -20
  7. package/dist/libs/contract/ts/AMaci.client.d.ts +1 -1
  8. package/dist/libs/contract/ts/Maci.client.d.ts +21 -47
  9. package/dist/libs/contract/ts/Maci.types.d.ts +40 -31
  10. package/dist/libs/contract/ts/OracleMaci.client.d.ts +52 -52
  11. package/dist/libs/contract/ts/OracleMaci.types.d.ts +17 -7
  12. package/dist/libs/contract/ts/Registry.client.d.ts +2 -2
  13. package/dist/libs/contract/types.d.ts +2 -2
  14. package/dist/libs/errors/types.d.ts +1 -0
  15. package/dist/libs/http/http.d.ts +1 -1
  16. package/dist/libs/index.d.ts +3 -0
  17. package/dist/libs/indexer/indexer.d.ts +11 -2
  18. package/dist/libs/maci/index.d.ts +1 -0
  19. package/dist/libs/maci/maci.d.ts +64 -5
  20. package/dist/libs/oracle-certificate/oracle-certificate.d.ts +1 -21
  21. package/dist/libs/oracle-certificate/types.d.ts +12 -0
  22. package/dist/libs/query/event.d.ts +7 -0
  23. package/dist/libs/query/index.d.ts +1 -0
  24. package/dist/maci.d.ts +7 -5
  25. package/dist/types/index.d.ts +22 -0
  26. package/package.json +1 -1
  27. package/src/libs/const.ts +3 -2
  28. package/src/libs/contract/contract.ts +2 -6
  29. package/src/libs/contract/ts/AMaci.client.ts +868 -874
  30. package/src/libs/contract/ts/AMaci.types.ts +216 -216
  31. package/src/libs/contract/ts/Maci.client.ts +748 -888
  32. package/src/libs/contract/ts/Maci.types.ts +229 -224
  33. package/src/libs/contract/ts/OracleMaci.client.ts +623 -348
  34. package/src/libs/contract/ts/OracleMaci.types.ts +191 -138
  35. package/src/libs/contract/ts/Registry.client.ts +438 -446
  36. package/src/libs/contract/ts/Registry.types.ts +97 -97
  37. package/src/libs/contract/types.ts +6 -2
  38. package/src/libs/contract/utils.ts +9 -0
  39. package/src/libs/errors/types.ts +1 -0
  40. package/src/libs/http/http.ts +3 -7
  41. package/src/libs/index.ts +3 -0
  42. package/src/libs/indexer/indexer.ts +18 -0
  43. package/src/libs/maci/index.ts +1 -0
  44. package/src/libs/maci/maci.ts +302 -10
  45. package/src/libs/oracle-certificate/oracle-certificate.ts +19 -73
  46. package/src/libs/oracle-certificate/types.ts +15 -1
  47. package/src/libs/query/event.ts +78 -0
  48. package/src/libs/query/index.ts +1 -0
  49. package/src/maci.ts +27 -5
  50. package/src/types/index.ts +28 -0
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was automatically generated by @cosmwasm/ts-codegen@0.30.1.
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
- circuit_type: Uint256;
12
- coordinator: PubKey;
13
- groth16_add_key_vkey: Groth16VKeyType;
14
- groth16_deactivate_vkey: Groth16VKeyType;
15
- groth16_process_vkey: Groth16VKeyType;
16
- groth16_tally_vkey: Groth16VKeyType;
17
- max_vote_options: Uint256;
18
- parameters: MaciParameters;
19
- qtr_lib: QuinaryTreeRoot;
20
- round_info: RoundInfo;
21
- voice_credit_amount: Uint256;
22
- voting_time?: VotingTime | null;
23
- whitelist?: Whitelist | null;
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
- x: Uint256;
27
- y: Uint256;
26
+ x: Uint256;
27
+ y: Uint256;
28
28
  }
29
29
  export interface Groth16VKeyType {
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;
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
- int_state_tree_depth: Uint256;
39
- message_batch_size: Uint256;
40
- state_tree_depth: Uint256;
41
- vote_option_tree_depth: Uint256;
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
- zeros: [
45
- Uint256,
46
- Uint256,
47
- Uint256,
48
- Uint256,
49
- Uint256,
50
- Uint256,
51
- Uint256,
52
- Uint256,
53
- Uint256
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
- description: string;
58
- link: string;
59
- title: string;
66
+ description: string;
67
+ link: string;
68
+ title: string;
60
69
  }
61
70
  export interface VotingTime {
62
- end_time?: Timestamp | null;
63
- start_time?: Timestamp | null;
71
+ end_time?: Timestamp | null;
72
+ start_time?: Timestamp | null;
64
73
  }
65
74
  export interface Whitelist {
66
- users: WhitelistConfig[];
75
+ users: WhitelistConfig[];
67
76
  }
68
77
  export interface WhitelistConfig {
69
- addr: string;
78
+ addr: string;
79
+ balance: Uint256;
70
80
  }
71
81
  export type ExecuteMsg =
72
- | {
73
- set_params: {
74
- int_state_tree_depth: Uint256;
75
- message_batch_size: Uint256;
76
- state_tree_depth: Uint256;
77
- vote_option_tree_depth: Uint256;
78
- };
79
- }
80
- | {
81
- set_round_info: {
82
- round_info: RoundInfo;
83
- };
84
- }
85
- | {
86
- set_whitelists: {
87
- whitelists: Whitelist;
88
- };
89
- }
90
- | {
91
- set_vote_options_map: {
92
- vote_option_map: string[];
93
- };
94
- }
95
- | {
96
- start_voting_period: {};
97
- }
98
- | {
99
- sign_up: {
100
- pubkey: PubKey;
101
- };
102
- }
103
- | {
104
- start_process_period: {};
105
- }
106
- | {
107
- stop_voting_period: {};
108
- }
109
- | {
110
- publish_deactivate_message: {
111
- enc_pub_key: PubKey;
112
- message: MessageData;
113
- };
114
- }
115
- | {
116
- process_deactivate_message: {
117
- groth16_proof: Groth16ProofType;
118
- new_deactivate_commitment: Uint256;
119
- new_deactivate_root: Uint256;
120
- size: Uint256;
121
- };
122
- }
123
- | {
124
- add_new_key: {
125
- d: [Uint256, Uint256, Uint256, Uint256];
126
- groth16_proof: Groth16ProofType;
127
- nullifier: Uint256;
128
- pubkey: PubKey;
129
- };
130
- }
131
- | {
132
- publish_message: {
133
- enc_pub_key: PubKey;
134
- message: MessageData;
135
- };
136
- }
137
- | {
138
- process_message: {
139
- groth16_proof: Groth16ProofType;
140
- new_state_commitment: Uint256;
141
- };
142
- }
143
- | {
144
- stop_processing_period: {};
145
- }
146
- | {
147
- process_tally: {
148
- groth16_proof: Groth16ProofType;
149
- new_tally_commitment: Uint256;
150
- };
151
- }
152
- | {
153
- stop_tallying_period: {
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
- data: [Uint256, Uint256, Uint256, Uint256, Uint256, Uint256, Uint256];
166
+ data: [Uint256, Uint256, Uint256, Uint256, Uint256, Uint256, Uint256];
177
167
  }
178
168
  export interface Groth16ProofType {
179
- a: string;
180
- b: string;
181
- c: string;
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
- get_round_info: {};
186
- }
187
- | {
188
- get_voting_time: {};
189
- }
190
- | {
191
- get_period: {};
192
- }
193
- | {
194
- get_num_sign_up: {};
195
- }
196
- | {
197
- get_msg_chain_length: {};
198
- }
199
- | {
200
- get_d_msg_chain_length: {};
201
- }
202
- | {
203
- get_processed_d_msg_count: {};
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
- vote_option_map: {};
239
- }
240
- | {
241
- max_vote_options: {};
242
- }
243
- | {
244
- query_total_fee_grant: {};
245
- }
246
- | {
247
- query_circuit_type: {};
248
- }
249
- | {
250
- query_cert_system: {};
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
- | 'pending'
255
- | 'voting'
256
- | 'processing'
257
- | 'tallying'
258
- | 'ended';
259
+ | 'pending'
260
+ | 'voting'
261
+ | 'processing'
262
+ | 'tallying'
263
+ | 'ended';
259
264
  export interface Period {
260
- status: PeriodStatus;
265
+ status: PeriodStatus;
261
266
  }
262
267
  export type Boolean = boolean;
263
268
  export type ArrayOfString = string[];