@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,14 +1,14 @@
1
1
  /**
2
- * This file was automatically generated by @cosmwasm/ts-codegen@1.11.1.
3
- * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
4
- * and run the @cosmwasm/ts-codegen generate command to regenerate this file.
5
- */
2
+ * This file was automatically generated by @cosmwasm/ts-codegen@1.11.1.
3
+ * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
4
+ * and run the @cosmwasm/ts-codegen generate command to regenerate this file.
5
+ */
6
6
 
7
7
  export type Uint256 = string;
8
8
  export type Addr = string;
9
9
  export type Timestamp = Uint64;
10
10
  export type Uint64 = string;
11
- export type VotingPowerMode = "slope" | "threshold";
11
+ export type VotingPowerMode = 'slope' | 'threshold';
12
12
  export interface InstantiateMsg {
13
13
  certification_system: Uint256;
14
14
  circuit_type: Uint256;
@@ -56,7 +56,17 @@ export interface PlonkVKeyType {
56
56
  selector_commitments: string[];
57
57
  }
58
58
  export interface QuinaryTreeRoot {
59
- zeros: [Uint256, Uint256, Uint256, Uint256, Uint256, Uint256, Uint256, Uint256, Uint256];
59
+ zeros: [
60
+ Uint256,
61
+ Uint256,
62
+ Uint256,
63
+ Uint256,
64
+ Uint256,
65
+ Uint256,
66
+ Uint256,
67
+ Uint256,
68
+ Uint256
69
+ ];
60
70
  }
61
71
  export interface RoundInfo {
62
72
  description: string;
@@ -72,73 +82,89 @@ export interface VotingPowerArgs {
72
82
  slope: Uint256;
73
83
  threshold: Uint256;
74
84
  }
75
- export type ExecuteMsg = {
76
- set_params: {
77
- int_state_tree_depth: Uint256;
78
- message_batch_size: Uint256;
79
- state_tree_depth: Uint256;
80
- vote_option_tree_depth: Uint256;
81
- };
82
- } | {
83
- set_round_info: {
84
- round_info: RoundInfo;
85
- };
86
- } | {
87
- set_vote_options_map: {
88
- vote_option_map: string[];
89
- };
90
- } | {
91
- start_voting_period: {};
92
- } | {
93
- sign_up: {
94
- amount: Uint256;
95
- certificate: string;
96
- pubkey: PubKey;
97
- };
98
- } | {
99
- start_process_period: {};
100
- } | {
101
- stop_voting_period: {};
102
- } | {
103
- publish_message: {
104
- enc_pub_key: PubKey;
105
- message: MessageData;
106
- };
107
- } | {
108
- process_message: {
109
- groth16_proof?: Groth16ProofType | null;
110
- new_state_commitment: Uint256;
111
- plonk_proof?: PlonkProofType | null;
112
- };
113
- } | {
114
- stop_processing_period: {};
115
- } | {
116
- process_tally: {
117
- groth16_proof?: Groth16ProofType | null;
118
- new_tally_commitment: Uint256;
119
- plonk_proof?: PlonkProofType | null;
120
- };
121
- } | {
122
- stop_tallying_period: {
123
- results: Uint256[];
124
- salt: Uint256;
125
- };
126
- } | {
127
- grant: {
128
- base_amount: Uint128;
129
- grantee: Addr;
130
- };
131
- } | {
132
- revoke: {
133
- grantee: Addr;
134
- };
135
- } | {
136
- bond: {};
137
- } | {
138
- withdraw: {
139
- amount?: Uint128 | null;
140
- };
141
- };
85
+ export type ExecuteMsg =
86
+ | {
87
+ set_params: {
88
+ int_state_tree_depth: Uint256;
89
+ message_batch_size: Uint256;
90
+ state_tree_depth: Uint256;
91
+ vote_option_tree_depth: Uint256;
92
+ };
93
+ }
94
+ | {
95
+ set_round_info: {
96
+ round_info: RoundInfo;
97
+ };
98
+ }
99
+ | {
100
+ set_vote_options_map: {
101
+ vote_option_map: string[];
102
+ };
103
+ }
104
+ | {
105
+ start_voting_period: {};
106
+ }
107
+ | {
108
+ sign_up: {
109
+ amount: Uint256;
110
+ certificate: string;
111
+ pubkey: PubKey;
112
+ };
113
+ }
114
+ | {
115
+ start_process_period: {};
116
+ }
117
+ | {
118
+ stop_voting_period: {};
119
+ }
120
+ | {
121
+ publish_message: {
122
+ enc_pub_key: PubKey;
123
+ message: MessageData;
124
+ };
125
+ }
126
+ | {
127
+ process_message: {
128
+ groth16_proof?: Groth16ProofType | null;
129
+ new_state_commitment: Uint256;
130
+ plonk_proof?: PlonkProofType | null;
131
+ };
132
+ }
133
+ | {
134
+ stop_processing_period: {};
135
+ }
136
+ | {
137
+ process_tally: {
138
+ groth16_proof?: Groth16ProofType | null;
139
+ new_tally_commitment: Uint256;
140
+ plonk_proof?: PlonkProofType | null;
141
+ };
142
+ }
143
+ | {
144
+ stop_tallying_period: {
145
+ results: Uint256[];
146
+ salt: Uint256;
147
+ };
148
+ }
149
+ | {
150
+ grant: {
151
+ base_amount: Uint128;
152
+ grantee: Addr;
153
+ };
154
+ }
155
+ | {
156
+ revoke: {
157
+ grantee: Addr;
158
+ };
159
+ }
160
+ | {
161
+ bond: {};
162
+ }
163
+ | {
164
+ withdraw: {
165
+ amount?: Uint128 | null;
166
+ };
167
+ };
142
168
  export type Uint128 = string;
143
169
  export interface MessageData {
144
170
  data: [Uint256, Uint256, Uint256, Uint256, Uint256, Uint256, Uint256];
@@ -164,70 +190,97 @@ export interface PlonkProofType {
164
190
  wire_values_at_z: string[];
165
191
  wire_values_at_z_omega: string[];
166
192
  }
167
- export type QueryMsg = {
168
- get_round_info: {};
169
- } | {
170
- get_voting_time: {};
171
- } | {
172
- get_period: {};
173
- } | {
174
- get_num_sign_up: {};
175
- } | {
176
- get_msg_chain_length: {};
177
- } | {
178
- get_processed_msg_count: {};
179
- } | {
180
- get_processed_user_count: {};
181
- } | {
182
- get_result: {
183
- index: Uint256;
184
- };
185
- } | {
186
- get_all_result: {};
187
- } | {
188
- get_state_idx_inc: {
189
- address: Addr;
190
- };
191
- } | {
192
- get_voice_credit_balance: {
193
- index: Uint256;
194
- };
195
- } | {
196
- is_white_list: {
197
- amount: Uint256;
198
- certificate: string;
199
- sender: string;
200
- };
201
- } | {
202
- white_balance_of: {
203
- amount: Uint256;
204
- certificate: string;
205
- sender: string;
206
- };
207
- } | {
208
- white_info: {
209
- sender: string;
210
- };
211
- } | {
212
- grant_info: {
213
- grantee: string;
214
- };
215
- } | {
216
- max_whitelist_num: {};
217
- } | {
218
- vote_option_map: {};
219
- } | {
220
- max_vote_options: {};
221
- } | {
222
- query_total_fee_grant: {};
223
- } | {
224
- query_circuit_type: {};
225
- } | {
226
- query_cert_system: {};
227
- } | {
228
- query_oracle_whitelist_config: {};
229
- };
230
- export type PeriodStatus = "pending" | "voting" | "processing" | "tallying" | "ended";
193
+ export type QueryMsg =
194
+ | {
195
+ get_round_info: {};
196
+ }
197
+ | {
198
+ get_voting_time: {};
199
+ }
200
+ | {
201
+ get_period: {};
202
+ }
203
+ | {
204
+ get_num_sign_up: {};
205
+ }
206
+ | {
207
+ get_msg_chain_length: {};
208
+ }
209
+ | {
210
+ get_processed_msg_count: {};
211
+ }
212
+ | {
213
+ get_processed_user_count: {};
214
+ }
215
+ | {
216
+ get_result: {
217
+ index: Uint256;
218
+ };
219
+ }
220
+ | {
221
+ get_all_result: {};
222
+ }
223
+ | {
224
+ get_state_idx_inc: {
225
+ address: Addr;
226
+ };
227
+ }
228
+ | {
229
+ get_voice_credit_balance: {
230
+ index: Uint256;
231
+ };
232
+ }
233
+ | {
234
+ is_white_list: {
235
+ amount: Uint256;
236
+ certificate: string;
237
+ sender: string;
238
+ };
239
+ }
240
+ | {
241
+ white_balance_of: {
242
+ amount: Uint256;
243
+ certificate: string;
244
+ sender: string;
245
+ };
246
+ }
247
+ | {
248
+ white_info: {
249
+ sender: string;
250
+ };
251
+ }
252
+ | {
253
+ grant_info: {
254
+ grantee: string;
255
+ };
256
+ }
257
+ | {
258
+ max_whitelist_num: {};
259
+ }
260
+ | {
261
+ vote_option_map: {};
262
+ }
263
+ | {
264
+ max_vote_options: {};
265
+ }
266
+ | {
267
+ query_total_fee_grant: {};
268
+ }
269
+ | {
270
+ query_circuit_type: {};
271
+ }
272
+ | {
273
+ query_cert_system: {};
274
+ }
275
+ | {
276
+ query_oracle_whitelist_config: {};
277
+ };
278
+ export type PeriodStatus =
279
+ | 'pending'
280
+ | 'voting'
281
+ | 'processing'
282
+ | 'tallying'
283
+ | 'ended';
231
284
  export interface Period {
232
285
  status: PeriodStatus;
233
286
  }
@@ -251,4 +304,4 @@ export interface WhitelistConfig {
251
304
  fee_amount: Uint128;
252
305
  fee_grant: boolean;
253
306
  is_register: boolean;
254
- }
307
+ }