@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,906 +1,766 @@
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
  */
6
6
 
7
7
  import {
8
- CosmWasmClient,
9
- SigningCosmWasmClient,
10
- ExecuteResult,
8
+ CosmWasmClient,
9
+ SigningCosmWasmClient,
10
+ ExecuteResult,
11
11
  } from '@cosmjs/cosmwasm-stargate';
12
12
  import { Coin, StdFee } from '@cosmjs/amino';
13
13
  import {
14
- Uint256,
15
- Timestamp,
16
- Uint64,
17
- InstantiateMsg,
18
- PubKey,
19
- Groth16VKeyType,
20
- MaciParameters,
21
- QuinaryTreeRoot,
22
- RoundInfo,
23
- VotingTime,
24
- Whitelist,
25
- WhitelistConfig,
26
- ExecuteMsg,
27
- Uint128,
28
- MessageData,
29
- Groth16ProofType,
30
- QueryMsg,
31
- Addr,
32
- PeriodStatus,
33
- Period,
34
- Boolean,
35
- ArrayOfString,
14
+ Uint256,
15
+ Timestamp,
16
+ Uint64,
17
+ InstantiateMsg,
18
+ PubKey,
19
+ Groth16VKeyType,
20
+ MaciParameters,
21
+ PlonkVKeyType,
22
+ QuinaryTreeRoot,
23
+ RoundInfo,
24
+ VotingTime,
25
+ Whitelist,
26
+ WhitelistConfig,
27
+ ExecuteMsg,
28
+ Uint128,
29
+ MessageData,
30
+ Groth16ProofType,
31
+ PlonkProofType,
32
+ QueryMsg,
33
+ Addr,
34
+ PeriodStatus,
35
+ Period,
36
+ Boolean,
37
+ ArrayOfString,
36
38
  } from './Maci.types';
37
39
  export interface MaciReadOnlyInterface {
38
- contractAddress: string;
39
- getRoundInfo: () => Promise<RoundInfo>;
40
- getVotingTime: () => Promise<VotingTime>;
41
- getPeriod: () => Promise<Period>;
42
- getNumSignUp: () => Promise<Uint256>;
43
- getMsgChainLength: () => Promise<Uint256>;
44
- getDMsgChainLength: () => Promise<Uint256>;
45
- getProcessedDMsgCount: () => Promise<Uint256>;
46
- getProcessedMsgCount: () => Promise<Uint256>;
47
- getProcessedUserCount: () => Promise<Uint256>;
48
- getResult: ({ index }: { index: Uint256 }) => Promise<Uint256>;
49
- getAllResult: () => Promise<Uint256>;
50
- getStateIdxInc: ({ address }: { address: Addr }) => Promise<Uint256>;
51
- getVoiceCreditBalance: ({ index }: { index: Uint256 }) => Promise<Uint256>;
52
- whiteList: () => Promise<Whitelist>;
53
- isWhiteList: ({ sender }: { sender: string }) => Promise<Boolean>;
54
- voteOptionMap: () => Promise<ArrayOfString>;
55
- maxVoteOptions: () => Promise<Uint256>;
56
- queryTotalFeeGrant: () => Promise<Uint128>;
57
- queryCircuitType: () => Promise<Uint256>;
58
- queryCertSystem: () => Promise<Uint256>;
40
+ contractAddress: string;
41
+ getRoundInfo: () => Promise<RoundInfo>;
42
+ getVotingTime: () => Promise<VotingTime>;
43
+ getPeriod: () => Promise<Period>;
44
+ getNumSignUp: () => Promise<Uint256>;
45
+ getMsgChainLength: () => Promise<Uint256>;
46
+ getProcessedMsgCount: () => Promise<Uint256>;
47
+ getProcessedUserCount: () => Promise<Uint256>;
48
+ getResult: ({ index }: { index: Uint256 }) => Promise<Uint256>;
49
+ getAllResult: () => Promise<Uint256>;
50
+ getStateIdxInc: ({ address }: { address: Addr }) => Promise<Uint256>;
51
+ getVoiceCreditBalance: ({ index }: { index: Uint256 }) => Promise<Uint256>;
52
+ whiteList: () => Promise<Whitelist>;
53
+ isWhiteList: ({ sender }: { sender: string }) => Promise<Boolean>;
54
+ whiteBalanceOf: ({ sender }: { sender: string }) => Promise<Uint256>;
55
+ voteOptionMap: () => Promise<ArrayOfString>;
56
+ maxVoteOptions: () => Promise<Uint256>;
57
+ queryTotalFeeGrant: () => Promise<Uint128>;
58
+ queryCircuitType: () => Promise<Uint256>;
59
+ queryCertSystem: () => Promise<Uint256>;
59
60
  }
60
61
  export class MaciQueryClient implements MaciReadOnlyInterface {
61
- client: CosmWasmClient;
62
- contractAddress: string;
63
-
64
- constructor(client: CosmWasmClient, contractAddress: string) {
65
- this.client = client;
66
- this.contractAddress = contractAddress;
67
- this.getRoundInfo = this.getRoundInfo.bind(this);
68
- this.getVotingTime = this.getVotingTime.bind(this);
69
- this.getPeriod = this.getPeriod.bind(this);
70
- this.getNumSignUp = this.getNumSignUp.bind(this);
71
- this.getMsgChainLength = this.getMsgChainLength.bind(this);
72
- this.getDMsgChainLength = this.getDMsgChainLength.bind(this);
73
- this.getProcessedDMsgCount = this.getProcessedDMsgCount.bind(this);
74
- this.getProcessedMsgCount = this.getProcessedMsgCount.bind(this);
75
- this.getProcessedUserCount = this.getProcessedUserCount.bind(this);
76
- this.getResult = this.getResult.bind(this);
77
- this.getAllResult = this.getAllResult.bind(this);
78
- this.getStateIdxInc = this.getStateIdxInc.bind(this);
79
- this.getVoiceCreditBalance = this.getVoiceCreditBalance.bind(this);
80
- this.whiteList = this.whiteList.bind(this);
81
- this.isWhiteList = this.isWhiteList.bind(this);
82
- this.voteOptionMap = this.voteOptionMap.bind(this);
83
- this.maxVoteOptions = this.maxVoteOptions.bind(this);
84
- this.queryTotalFeeGrant = this.queryTotalFeeGrant.bind(this);
85
- this.queryCircuitType = this.queryCircuitType.bind(this);
86
- this.queryCertSystem = this.queryCertSystem.bind(this);
87
- }
88
-
89
- getRoundInfo = async (): Promise<RoundInfo> => {
90
- return this.client.queryContractSmart(this.contractAddress, {
91
- get_round_info: {},
92
- });
93
- };
94
- getVotingTime = async (): Promise<VotingTime> => {
95
- return this.client.queryContractSmart(this.contractAddress, {
96
- get_voting_time: {},
97
- });
98
- };
99
- getPeriod = async (): Promise<Period> => {
100
- return this.client.queryContractSmart(this.contractAddress, {
101
- get_period: {},
102
- });
103
- };
104
- getNumSignUp = async (): Promise<Uint256> => {
105
- return this.client.queryContractSmart(this.contractAddress, {
106
- get_num_sign_up: {},
107
- });
108
- };
109
- getMsgChainLength = async (): Promise<Uint256> => {
110
- return this.client.queryContractSmart(this.contractAddress, {
111
- get_msg_chain_length: {},
112
- });
113
- };
114
- getDMsgChainLength = async (): Promise<Uint256> => {
115
- return this.client.queryContractSmart(this.contractAddress, {
116
- get_d_msg_chain_length: {},
117
- });
118
- };
119
- getProcessedDMsgCount = async (): Promise<Uint256> => {
120
- return this.client.queryContractSmart(this.contractAddress, {
121
- get_processed_d_msg_count: {},
122
- });
123
- };
124
- getProcessedMsgCount = async (): Promise<Uint256> => {
125
- return this.client.queryContractSmart(this.contractAddress, {
126
- get_processed_msg_count: {},
127
- });
128
- };
129
- getProcessedUserCount = async (): Promise<Uint256> => {
130
- return this.client.queryContractSmart(this.contractAddress, {
131
- get_processed_user_count: {},
132
- });
133
- };
134
- getResult = async ({ index }: { index: Uint256 }): Promise<Uint256> => {
135
- return this.client.queryContractSmart(this.contractAddress, {
136
- get_result: {
137
- index,
138
- },
139
- });
140
- };
141
- getAllResult = async (): Promise<Uint256> => {
142
- return this.client.queryContractSmart(this.contractAddress, {
143
- get_all_result: {},
144
- });
145
- };
146
- getStateIdxInc = async ({
147
- address,
148
- }: {
149
- address: Addr;
150
- }): Promise<Uint256> => {
151
- return this.client.queryContractSmart(this.contractAddress, {
152
- get_state_idx_inc: {
153
- address,
154
- },
155
- });
156
- };
157
- getVoiceCreditBalance = async ({
158
- index,
159
- }: {
160
- index: Uint256;
161
- }): Promise<Uint256> => {
162
- return this.client.queryContractSmart(this.contractAddress, {
163
- get_voice_credit_balance: {
164
- index,
165
- },
166
- });
167
- };
168
- whiteList = async (): Promise<Whitelist> => {
169
- return this.client.queryContractSmart(this.contractAddress, {
170
- white_list: {},
171
- });
172
- };
173
- isWhiteList = async ({ sender }: { sender: string }): Promise<Boolean> => {
174
- return this.client.queryContractSmart(this.contractAddress, {
175
- is_white_list: {
176
- sender,
177
- },
178
- });
179
- };
180
- voteOptionMap = async (): Promise<ArrayOfString> => {
181
- return this.client.queryContractSmart(this.contractAddress, {
182
- vote_option_map: {},
183
- });
184
- };
185
- maxVoteOptions = async (): Promise<Uint256> => {
186
- return this.client.queryContractSmart(this.contractAddress, {
187
- max_vote_options: {},
188
- });
189
- };
190
- queryTotalFeeGrant = async (): Promise<Uint128> => {
191
- return this.client.queryContractSmart(this.contractAddress, {
192
- query_total_fee_grant: {},
193
- });
194
- };
195
- queryCircuitType = async (): Promise<Uint256> => {
196
- return this.client.queryContractSmart(this.contractAddress, {
197
- query_circuit_type: {},
198
- });
199
- };
200
- queryCertSystem = async (): Promise<Uint256> => {
201
- return this.client.queryContractSmart(this.contractAddress, {
202
- query_cert_system: {},
203
- });
204
- };
62
+ client: CosmWasmClient;
63
+ contractAddress: string;
64
+ constructor(client: CosmWasmClient, contractAddress: string) {
65
+ this.client = client;
66
+ this.contractAddress = contractAddress;
67
+ this.getRoundInfo = this.getRoundInfo.bind(this);
68
+ this.getVotingTime = this.getVotingTime.bind(this);
69
+ this.getPeriod = this.getPeriod.bind(this);
70
+ this.getNumSignUp = this.getNumSignUp.bind(this);
71
+ this.getMsgChainLength = this.getMsgChainLength.bind(this);
72
+ this.getProcessedMsgCount = this.getProcessedMsgCount.bind(this);
73
+ this.getProcessedUserCount = this.getProcessedUserCount.bind(this);
74
+ this.getResult = this.getResult.bind(this);
75
+ this.getAllResult = this.getAllResult.bind(this);
76
+ this.getStateIdxInc = this.getStateIdxInc.bind(this);
77
+ this.getVoiceCreditBalance = this.getVoiceCreditBalance.bind(this);
78
+ this.whiteList = this.whiteList.bind(this);
79
+ this.isWhiteList = this.isWhiteList.bind(this);
80
+ this.whiteBalanceOf = this.whiteBalanceOf.bind(this);
81
+ this.voteOptionMap = this.voteOptionMap.bind(this);
82
+ this.maxVoteOptions = this.maxVoteOptions.bind(this);
83
+ this.queryTotalFeeGrant = this.queryTotalFeeGrant.bind(this);
84
+ this.queryCircuitType = this.queryCircuitType.bind(this);
85
+ this.queryCertSystem = this.queryCertSystem.bind(this);
86
+ }
87
+ getRoundInfo = async (): Promise<RoundInfo> => {
88
+ return this.client.queryContractSmart(this.contractAddress, {
89
+ get_round_info: {},
90
+ });
91
+ };
92
+ getVotingTime = async (): Promise<VotingTime> => {
93
+ return this.client.queryContractSmart(this.contractAddress, {
94
+ get_voting_time: {},
95
+ });
96
+ };
97
+ getPeriod = async (): Promise<Period> => {
98
+ return this.client.queryContractSmart(this.contractAddress, {
99
+ get_period: {},
100
+ });
101
+ };
102
+ getNumSignUp = async (): Promise<Uint256> => {
103
+ return this.client.queryContractSmart(this.contractAddress, {
104
+ get_num_sign_up: {},
105
+ });
106
+ };
107
+ getMsgChainLength = async (): Promise<Uint256> => {
108
+ return this.client.queryContractSmart(this.contractAddress, {
109
+ get_msg_chain_length: {},
110
+ });
111
+ };
112
+ getProcessedMsgCount = async (): Promise<Uint256> => {
113
+ return this.client.queryContractSmart(this.contractAddress, {
114
+ get_processed_msg_count: {},
115
+ });
116
+ };
117
+ getProcessedUserCount = async (): Promise<Uint256> => {
118
+ return this.client.queryContractSmart(this.contractAddress, {
119
+ get_processed_user_count: {},
120
+ });
121
+ };
122
+ getResult = async ({ index }: { index: Uint256 }): Promise<Uint256> => {
123
+ return this.client.queryContractSmart(this.contractAddress, {
124
+ get_result: {
125
+ index,
126
+ },
127
+ });
128
+ };
129
+ getAllResult = async (): Promise<Uint256> => {
130
+ return this.client.queryContractSmart(this.contractAddress, {
131
+ get_all_result: {},
132
+ });
133
+ };
134
+ getStateIdxInc = async ({ address }: { address: Addr }): Promise<Uint256> => {
135
+ return this.client.queryContractSmart(this.contractAddress, {
136
+ get_state_idx_inc: {
137
+ address,
138
+ },
139
+ });
140
+ };
141
+ getVoiceCreditBalance = async ({
142
+ index,
143
+ }: {
144
+ index: Uint256;
145
+ }): Promise<Uint256> => {
146
+ return this.client.queryContractSmart(this.contractAddress, {
147
+ get_voice_credit_balance: {
148
+ index,
149
+ },
150
+ });
151
+ };
152
+ whiteList = async (): Promise<Whitelist> => {
153
+ return this.client.queryContractSmart(this.contractAddress, {
154
+ white_list: {},
155
+ });
156
+ };
157
+ isWhiteList = async ({ sender }: { sender: string }): Promise<Boolean> => {
158
+ return this.client.queryContractSmart(this.contractAddress, {
159
+ is_white_list: {
160
+ sender,
161
+ },
162
+ });
163
+ };
164
+ whiteBalanceOf = async ({ sender }: { sender: string }): Promise<Uint256> => {
165
+ return this.client.queryContractSmart(this.contractAddress, {
166
+ white_balance_of: {
167
+ sender,
168
+ },
169
+ });
170
+ };
171
+ voteOptionMap = async (): Promise<ArrayOfString> => {
172
+ return this.client.queryContractSmart(this.contractAddress, {
173
+ vote_option_map: {},
174
+ });
175
+ };
176
+ maxVoteOptions = async (): Promise<Uint256> => {
177
+ return this.client.queryContractSmart(this.contractAddress, {
178
+ max_vote_options: {},
179
+ });
180
+ };
181
+ queryTotalFeeGrant = async (): Promise<Uint128> => {
182
+ return this.client.queryContractSmart(this.contractAddress, {
183
+ query_total_fee_grant: {},
184
+ });
185
+ };
186
+ queryCircuitType = async (): Promise<Uint256> => {
187
+ return this.client.queryContractSmart(this.contractAddress, {
188
+ query_circuit_type: {},
189
+ });
190
+ };
191
+ queryCertSystem = async (): Promise<Uint256> => {
192
+ return this.client.queryContractSmart(this.contractAddress, {
193
+ query_cert_system: {},
194
+ });
195
+ };
205
196
  }
206
197
  export interface MaciInterface extends MaciReadOnlyInterface {
207
- contractAddress: string;
208
- sender: string;
209
- setParams: (
210
- {
211
- intStateTreeDepth,
212
- messageBatchSize,
213
- stateTreeDepth,
214
- voteOptionTreeDepth,
215
- }: {
216
- intStateTreeDepth: Uint256;
217
- messageBatchSize: Uint256;
218
- stateTreeDepth: Uint256;
219
- voteOptionTreeDepth: Uint256;
220
- },
221
- fee?: number | StdFee | 'auto',
222
- memo?: string,
223
- _funds?: Coin[]
224
- ) => Promise<ExecuteResult>;
225
- setRoundInfo: (
226
- {
227
- roundInfo,
228
- }: {
229
- roundInfo: RoundInfo;
230
- },
231
- fee?: number | StdFee | 'auto',
232
- memo?: string,
233
- _funds?: Coin[]
234
- ) => Promise<ExecuteResult>;
235
- setWhitelists: (
236
- {
237
- whitelists,
238
- }: {
239
- whitelists: Whitelist;
240
- },
241
- fee?: number | StdFee | 'auto',
242
- memo?: string,
243
- _funds?: Coin[]
244
- ) => Promise<ExecuteResult>;
245
- setVoteOptionsMap: (
246
- {
247
- voteOptionMap,
248
- }: {
249
- voteOptionMap: string[];
250
- },
251
- fee?: number | StdFee | 'auto',
252
- memo?: string,
253
- _funds?: Coin[]
254
- ) => Promise<ExecuteResult>;
255
- startVotingPeriod: (
256
- fee?: number | StdFee | 'auto',
257
- memo?: string,
258
- _funds?: Coin[]
259
- ) => Promise<ExecuteResult>;
260
- signUp: (
261
- {
262
- pubkey,
263
- }: {
264
- pubkey: PubKey;
265
- },
266
- fee?: number | StdFee | 'auto',
267
- memo?: string,
268
- _funds?: Coin[]
269
- ) => Promise<ExecuteResult>;
270
- startProcessPeriod: (
271
- fee?: number | StdFee | 'auto',
272
- memo?: string,
273
- _funds?: Coin[]
274
- ) => Promise<ExecuteResult>;
275
- stopVotingPeriod: (
276
- fee?: number | StdFee | 'auto',
277
- memo?: string,
278
- _funds?: Coin[]
279
- ) => Promise<ExecuteResult>;
280
- publishDeactivateMessage: (
281
- {
282
- encPubKey,
283
- message,
284
- }: {
285
- encPubKey: PubKey;
286
- message: MessageData;
287
- },
288
- fee?: number | StdFee | 'auto',
289
- memo?: string,
290
- _funds?: Coin[]
291
- ) => Promise<ExecuteResult>;
292
- processDeactivateMessage: (
293
- {
294
- groth16Proof,
295
- newDeactivateCommitment,
296
- newDeactivateRoot,
297
- size,
298
- }: {
299
- groth16Proof: Groth16ProofType;
300
- newDeactivateCommitment: Uint256;
301
- newDeactivateRoot: Uint256;
302
- size: Uint256;
303
- },
304
- fee?: number | StdFee | 'auto',
305
- memo?: string,
306
- _funds?: Coin[]
307
- ) => Promise<ExecuteResult>;
308
- addNewKey: (
309
- {
310
- d,
311
- groth16Proof,
312
- nullifier,
313
- pubkey,
314
- }: {
315
- d: Uint256[];
316
- groth16Proof: Groth16ProofType;
317
- nullifier: Uint256;
318
- pubkey: PubKey;
319
- },
320
- fee?: number | StdFee | 'auto',
321
- memo?: string,
322
- _funds?: Coin[]
323
- ) => Promise<ExecuteResult>;
324
- publishMessage: (
325
- {
326
- encPubKey,
327
- message,
328
- }: {
329
- encPubKey: PubKey;
330
- message: MessageData;
331
- },
332
- fee?: number | StdFee | 'auto',
333
- memo?: string,
334
- _funds?: Coin[]
335
- ) => Promise<ExecuteResult>;
336
- processMessage: (
337
- {
338
- groth16Proof,
339
- newStateCommitment,
340
- }: {
341
- groth16Proof: Groth16ProofType;
342
- newStateCommitment: Uint256;
343
- },
344
- fee?: number | StdFee | 'auto',
345
- memo?: string,
346
- _funds?: Coin[]
347
- ) => Promise<ExecuteResult>;
348
- stopProcessingPeriod: (
349
- fee?: number | StdFee | 'auto',
350
- memo?: string,
351
- _funds?: Coin[]
352
- ) => Promise<ExecuteResult>;
353
- processTally: (
354
- {
355
- groth16Proof,
356
- newTallyCommitment,
357
- }: {
358
- groth16Proof: Groth16ProofType;
359
- newTallyCommitment: Uint256;
360
- },
361
- fee?: number | StdFee | 'auto',
362
- memo?: string,
363
- _funds?: Coin[]
364
- ) => Promise<ExecuteResult>;
365
- stopTallyingPeriod: (
366
- {
367
- results,
368
- salt,
369
- }: {
370
- results: Uint256[];
371
- salt: Uint256;
372
- },
373
- fee?: number | StdFee | 'auto',
374
- memo?: string,
375
- _funds?: Coin[]
376
- ) => Promise<ExecuteResult>;
377
- grant: (
378
- {
379
- maxAmount,
380
- }: {
381
- maxAmount: Uint128;
382
- },
383
- fee?: number | StdFee | 'auto',
384
- memo?: string,
385
- _funds?: Coin[]
386
- ) => Promise<ExecuteResult>;
387
- revoke: (
388
- fee?: number | StdFee | 'auto',
389
- memo?: string,
390
- _funds?: Coin[]
391
- ) => Promise<ExecuteResult>;
392
- bond: (
393
- fee?: number | StdFee | 'auto',
394
- memo?: string,
395
- _funds?: Coin[]
396
- ) => Promise<ExecuteResult>;
397
- withdraw: (
398
- {
399
- amount,
400
- }: {
401
- amount?: Uint128;
402
- },
403
- fee?: number | StdFee | 'auto',
404
- memo?: string,
405
- _funds?: Coin[]
406
- ) => Promise<ExecuteResult>;
198
+ contractAddress: string;
199
+ sender: string;
200
+ setParams: (
201
+ {
202
+ intStateTreeDepth,
203
+ messageBatchSize,
204
+ stateTreeDepth,
205
+ voteOptionTreeDepth,
206
+ }: {
207
+ intStateTreeDepth: Uint256;
208
+ messageBatchSize: Uint256;
209
+ stateTreeDepth: Uint256;
210
+ voteOptionTreeDepth: Uint256;
211
+ },
212
+ fee?: number | StdFee | 'auto',
213
+ memo?: string,
214
+ _funds?: Coin[]
215
+ ) => Promise<ExecuteResult>;
216
+ setRoundInfo: (
217
+ {
218
+ roundInfo,
219
+ }: {
220
+ roundInfo: RoundInfo;
221
+ },
222
+ fee?: number | StdFee | 'auto',
223
+ memo?: string,
224
+ _funds?: Coin[]
225
+ ) => Promise<ExecuteResult>;
226
+ setWhitelists: (
227
+ {
228
+ whitelists,
229
+ }: {
230
+ whitelists: Whitelist;
231
+ },
232
+ fee?: number | StdFee | 'auto',
233
+ memo?: string,
234
+ _funds?: Coin[]
235
+ ) => Promise<ExecuteResult>;
236
+ setVoteOptionsMap: (
237
+ {
238
+ voteOptionMap,
239
+ }: {
240
+ voteOptionMap: string[];
241
+ },
242
+ fee?: number | StdFee | 'auto',
243
+ memo?: string,
244
+ _funds?: Coin[]
245
+ ) => Promise<ExecuteResult>;
246
+ startVotingPeriod: (
247
+ fee?: number | StdFee | 'auto',
248
+ memo?: string,
249
+ _funds?: Coin[]
250
+ ) => Promise<ExecuteResult>;
251
+ signUp: (
252
+ {
253
+ pubkey,
254
+ }: {
255
+ pubkey: PubKey;
256
+ },
257
+ fee?: number | StdFee | 'auto',
258
+ memo?: string,
259
+ _funds?: Coin[]
260
+ ) => Promise<ExecuteResult>;
261
+ startProcessPeriod: (
262
+ fee?: number | StdFee | 'auto',
263
+ memo?: string,
264
+ _funds?: Coin[]
265
+ ) => Promise<ExecuteResult>;
266
+ stopVotingPeriod: (
267
+ fee?: number | StdFee | 'auto',
268
+ memo?: string,
269
+ _funds?: Coin[]
270
+ ) => Promise<ExecuteResult>;
271
+ publishMessage: (
272
+ {
273
+ encPubKey,
274
+ message,
275
+ }: {
276
+ encPubKey: PubKey;
277
+ message: MessageData;
278
+ },
279
+ fee?: number | StdFee | 'auto',
280
+ memo?: string,
281
+ _funds?: Coin[]
282
+ ) => Promise<ExecuteResult>;
283
+ processMessage: (
284
+ {
285
+ groth16Proof,
286
+ newStateCommitment,
287
+ plonkProof,
288
+ }: {
289
+ groth16Proof?: Groth16ProofType;
290
+ newStateCommitment: Uint256;
291
+ plonkProof?: PlonkProofType;
292
+ },
293
+ fee?: number | StdFee | 'auto',
294
+ memo?: string,
295
+ _funds?: Coin[]
296
+ ) => Promise<ExecuteResult>;
297
+ stopProcessingPeriod: (
298
+ fee?: number | StdFee | 'auto',
299
+ memo?: string,
300
+ _funds?: Coin[]
301
+ ) => Promise<ExecuteResult>;
302
+ processTally: (
303
+ {
304
+ groth16Proof,
305
+ newTallyCommitment,
306
+ plonkProof,
307
+ }: {
308
+ groth16Proof?: Groth16ProofType;
309
+ newTallyCommitment: Uint256;
310
+ plonkProof?: PlonkProofType;
311
+ },
312
+ fee?: number | StdFee | 'auto',
313
+ memo?: string,
314
+ _funds?: Coin[]
315
+ ) => Promise<ExecuteResult>;
316
+ stopTallyingPeriod: (
317
+ {
318
+ results,
319
+ salt,
320
+ }: {
321
+ results: Uint256[];
322
+ salt: Uint256;
323
+ },
324
+ fee?: number | StdFee | 'auto',
325
+ memo?: string,
326
+ _funds?: Coin[]
327
+ ) => Promise<ExecuteResult>;
328
+ grant: (
329
+ {
330
+ maxAmount,
331
+ }: {
332
+ maxAmount: Uint128;
333
+ },
334
+ fee?: number | StdFee | 'auto',
335
+ memo?: string,
336
+ _funds?: Coin[]
337
+ ) => Promise<ExecuteResult>;
338
+ revoke: (
339
+ fee?: number | StdFee | 'auto',
340
+ memo?: string,
341
+ _funds?: Coin[]
342
+ ) => Promise<ExecuteResult>;
343
+ bond: (
344
+ fee?: number | StdFee | 'auto',
345
+ memo?: string,
346
+ _funds?: Coin[]
347
+ ) => Promise<ExecuteResult>;
348
+ withdraw: (
349
+ {
350
+ amount,
351
+ }: {
352
+ amount?: Uint128;
353
+ },
354
+ fee?: number | StdFee | 'auto',
355
+ memo?: string,
356
+ _funds?: Coin[]
357
+ ) => Promise<ExecuteResult>;
407
358
  }
408
359
  export class MaciClient extends MaciQueryClient implements MaciInterface {
409
- client: SigningCosmWasmClient;
410
- sender: string;
411
- contractAddress: string;
412
-
413
- constructor(
414
- client: SigningCosmWasmClient,
415
- sender: string,
416
- contractAddress: string
417
- ) {
418
- super(client, contractAddress);
419
- this.client = client;
420
- this.sender = sender;
421
- this.contractAddress = contractAddress;
422
- this.setParams = this.setParams.bind(this);
423
- this.setRoundInfo = this.setRoundInfo.bind(this);
424
- this.setWhitelists = this.setWhitelists.bind(this);
425
- this.setVoteOptionsMap = this.setVoteOptionsMap.bind(this);
426
- this.startVotingPeriod = this.startVotingPeriod.bind(this);
427
- this.signUp = this.signUp.bind(this);
428
- this.startProcessPeriod = this.startProcessPeriod.bind(this);
429
- this.stopVotingPeriod = this.stopVotingPeriod.bind(this);
430
- this.publishDeactivateMessage =
431
- this.publishDeactivateMessage.bind(this);
432
- this.processDeactivateMessage =
433
- this.processDeactivateMessage.bind(this);
434
- this.addNewKey = this.addNewKey.bind(this);
435
- this.publishMessage = this.publishMessage.bind(this);
436
- this.processMessage = this.processMessage.bind(this);
437
- this.stopProcessingPeriod = this.stopProcessingPeriod.bind(this);
438
- this.processTally = this.processTally.bind(this);
439
- this.stopTallyingPeriod = this.stopTallyingPeriod.bind(this);
440
- this.grant = this.grant.bind(this);
441
- this.revoke = this.revoke.bind(this);
442
- this.bond = this.bond.bind(this);
443
- this.withdraw = this.withdraw.bind(this);
444
- }
445
-
446
- setParams = async (
447
- {
448
- intStateTreeDepth,
449
- messageBatchSize,
450
- stateTreeDepth,
451
- voteOptionTreeDepth,
452
- }: {
453
- intStateTreeDepth: Uint256;
454
- messageBatchSize: Uint256;
455
- stateTreeDepth: Uint256;
456
- voteOptionTreeDepth: Uint256;
457
- },
458
- fee: number | StdFee | 'auto' = 'auto',
459
- memo?: string,
460
- _funds?: Coin[]
461
- ): Promise<ExecuteResult> => {
462
- return await this.client.execute(
463
- this.sender,
464
- this.contractAddress,
465
- {
466
- set_params: {
467
- int_state_tree_depth: intStateTreeDepth,
468
- message_batch_size: messageBatchSize,
469
- state_tree_depth: stateTreeDepth,
470
- vote_option_tree_depth: voteOptionTreeDepth,
471
- },
472
- },
473
- fee,
474
- memo,
475
- _funds
476
- );
477
- };
478
- setRoundInfo = async (
479
- {
480
- roundInfo,
481
- }: {
482
- roundInfo: RoundInfo;
483
- },
484
- fee: number | StdFee | 'auto' = 'auto',
485
- memo?: string,
486
- _funds?: Coin[]
487
- ): Promise<ExecuteResult> => {
488
- return await this.client.execute(
489
- this.sender,
490
- this.contractAddress,
491
- {
492
- set_round_info: {
493
- round_info: roundInfo,
494
- },
495
- },
496
- fee,
497
- memo,
498
- _funds
499
- );
500
- };
501
- setWhitelists = async (
502
- {
503
- whitelists,
504
- }: {
505
- whitelists: Whitelist;
506
- },
507
- fee: number | StdFee | 'auto' = 'auto',
508
- memo?: string,
509
- _funds?: Coin[]
510
- ): Promise<ExecuteResult> => {
511
- return await this.client.execute(
512
- this.sender,
513
- this.contractAddress,
514
- {
515
- set_whitelists: {
516
- whitelists,
517
- },
518
- },
519
- fee,
520
- memo,
521
- _funds
522
- );
523
- };
524
- setVoteOptionsMap = async (
525
- {
526
- voteOptionMap,
527
- }: {
528
- voteOptionMap: string[];
529
- },
530
- fee: number | StdFee | 'auto' = 'auto',
531
- memo?: string,
532
- _funds?: Coin[]
533
- ): Promise<ExecuteResult> => {
534
- return await this.client.execute(
535
- this.sender,
536
- this.contractAddress,
537
- {
538
- set_vote_options_map: {
539
- vote_option_map: voteOptionMap,
540
- },
541
- },
542
- fee,
543
- memo,
544
- _funds
545
- );
546
- };
547
- startVotingPeriod = async (
548
- fee: number | StdFee | 'auto' = 'auto',
549
- memo?: string,
550
- _funds?: Coin[]
551
- ): Promise<ExecuteResult> => {
552
- return await this.client.execute(
553
- this.sender,
554
- this.contractAddress,
555
- {
556
- start_voting_period: {},
557
- },
558
- fee,
559
- memo,
560
- _funds
561
- );
562
- };
563
- signUp = async (
564
- {
565
- pubkey,
566
- }: {
567
- pubkey: PubKey;
568
- },
569
- fee: number | StdFee | 'auto' = 'auto',
570
- memo?: string,
571
- _funds?: Coin[]
572
- ): Promise<ExecuteResult> => {
573
- return await this.client.execute(
574
- this.sender,
575
- this.contractAddress,
576
- {
577
- sign_up: {
578
- pubkey,
579
- },
580
- },
581
- fee,
582
- memo,
583
- _funds
584
- );
585
- };
586
- startProcessPeriod = async (
587
- fee: number | StdFee | 'auto' = 'auto',
588
- memo?: string,
589
- _funds?: Coin[]
590
- ): Promise<ExecuteResult> => {
591
- return await this.client.execute(
592
- this.sender,
593
- this.contractAddress,
594
- {
595
- start_process_period: {},
596
- },
597
- fee,
598
- memo,
599
- _funds
600
- );
601
- };
602
- stopVotingPeriod = async (
603
- fee: number | StdFee | 'auto' = 'auto',
604
- memo?: string,
605
- _funds?: Coin[]
606
- ): Promise<ExecuteResult> => {
607
- return await this.client.execute(
608
- this.sender,
609
- this.contractAddress,
610
- {
611
- stop_voting_period: {},
612
- },
613
- fee,
614
- memo,
615
- _funds
616
- );
617
- };
618
- publishDeactivateMessage = async (
619
- {
620
- encPubKey,
621
- message,
622
- }: {
623
- encPubKey: PubKey;
624
- message: MessageData;
625
- },
626
- fee: number | StdFee | 'auto' = 'auto',
627
- memo?: string,
628
- _funds?: Coin[]
629
- ): Promise<ExecuteResult> => {
630
- return await this.client.execute(
631
- this.sender,
632
- this.contractAddress,
633
- {
634
- publish_deactivate_message: {
635
- enc_pub_key: encPubKey,
636
- message,
637
- },
638
- },
639
- fee,
640
- memo,
641
- _funds
642
- );
643
- };
644
- processDeactivateMessage = async (
645
- {
646
- groth16Proof,
647
- newDeactivateCommitment,
648
- newDeactivateRoot,
649
- size,
650
- }: {
651
- groth16Proof: Groth16ProofType;
652
- newDeactivateCommitment: Uint256;
653
- newDeactivateRoot: Uint256;
654
- size: Uint256;
655
- },
656
- fee: number | StdFee | 'auto' = 'auto',
657
- memo?: string,
658
- _funds?: Coin[]
659
- ): Promise<ExecuteResult> => {
660
- return await this.client.execute(
661
- this.sender,
662
- this.contractAddress,
663
- {
664
- process_deactivate_message: {
665
- groth16_proof: groth16Proof,
666
- new_deactivate_commitment: newDeactivateCommitment,
667
- new_deactivate_root: newDeactivateRoot,
668
- size,
669
- },
670
- },
671
- fee,
672
- memo,
673
- _funds
674
- );
675
- };
676
- addNewKey = async (
677
- {
678
- d,
679
- groth16Proof,
680
- nullifier,
681
- pubkey,
682
- }: {
683
- d: Uint256[];
684
- groth16Proof: Groth16ProofType;
685
- nullifier: Uint256;
686
- pubkey: PubKey;
687
- },
688
- fee: number | StdFee | 'auto' = 'auto',
689
- memo?: string,
690
- _funds?: Coin[]
691
- ): Promise<ExecuteResult> => {
692
- return await this.client.execute(
693
- this.sender,
694
- this.contractAddress,
695
- {
696
- add_new_key: {
697
- d,
698
- groth16_proof: groth16Proof,
699
- nullifier,
700
- pubkey,
701
- },
702
- },
703
- fee,
704
- memo,
705
- _funds
706
- );
707
- };
708
- publishMessage = async (
709
- {
710
- encPubKey,
711
- message,
712
- }: {
713
- encPubKey: PubKey;
714
- message: MessageData;
715
- },
716
- fee: number | StdFee | 'auto' = 'auto',
717
- memo?: string,
718
- _funds?: Coin[]
719
- ): Promise<ExecuteResult> => {
720
- return await this.client.execute(
721
- this.sender,
722
- this.contractAddress,
723
- {
724
- publish_message: {
725
- enc_pub_key: encPubKey,
726
- message,
727
- },
728
- },
729
- fee,
730
- memo,
731
- _funds
732
- );
733
- };
734
- processMessage = async (
735
- {
736
- groth16Proof,
737
- newStateCommitment,
738
- }: {
739
- groth16Proof: Groth16ProofType;
740
- newStateCommitment: Uint256;
741
- },
742
- fee: number | StdFee | 'auto' = 'auto',
743
- memo?: string,
744
- _funds?: Coin[]
745
- ): Promise<ExecuteResult> => {
746
- return await this.client.execute(
747
- this.sender,
748
- this.contractAddress,
749
- {
750
- process_message: {
751
- groth16_proof: groth16Proof,
752
- new_state_commitment: newStateCommitment,
753
- },
754
- },
755
- fee,
756
- memo,
757
- _funds
758
- );
759
- };
760
- stopProcessingPeriod = async (
761
- fee: number | StdFee | 'auto' = 'auto',
762
- memo?: string,
763
- _funds?: Coin[]
764
- ): Promise<ExecuteResult> => {
765
- return await this.client.execute(
766
- this.sender,
767
- this.contractAddress,
768
- {
769
- stop_processing_period: {},
770
- },
771
- fee,
772
- memo,
773
- _funds
774
- );
775
- };
776
- processTally = async (
777
- {
778
- groth16Proof,
779
- newTallyCommitment,
780
- }: {
781
- groth16Proof: Groth16ProofType;
782
- newTallyCommitment: Uint256;
783
- },
784
- fee: number | StdFee | 'auto' = 'auto',
785
- memo?: string,
786
- _funds?: Coin[]
787
- ): Promise<ExecuteResult> => {
788
- return await this.client.execute(
789
- this.sender,
790
- this.contractAddress,
791
- {
792
- process_tally: {
793
- groth16_proof: groth16Proof,
794
- new_tally_commitment: newTallyCommitment,
795
- },
796
- },
797
- fee,
798
- memo,
799
- _funds
800
- );
801
- };
802
- stopTallyingPeriod = async (
803
- {
804
- results,
805
- salt,
806
- }: {
807
- results: Uint256[];
808
- salt: Uint256;
809
- },
810
- fee: number | StdFee | 'auto' = 'auto',
811
- memo?: string,
812
- _funds?: Coin[]
813
- ): Promise<ExecuteResult> => {
814
- return await this.client.execute(
815
- this.sender,
816
- this.contractAddress,
817
- {
818
- stop_tallying_period: {
819
- results,
820
- salt,
821
- },
822
- },
823
- fee,
824
- memo,
825
- _funds
826
- );
827
- };
828
- grant = async (
829
- {
830
- maxAmount,
831
- }: {
832
- maxAmount: Uint128;
833
- },
834
- fee: number | StdFee | 'auto' = 'auto',
835
- memo?: string,
836
- _funds?: Coin[]
837
- ): Promise<ExecuteResult> => {
838
- return await this.client.execute(
839
- this.sender,
840
- this.contractAddress,
841
- {
842
- grant: {
843
- max_amount: maxAmount,
844
- },
845
- },
846
- fee,
847
- memo,
848
- _funds
849
- );
850
- };
851
- revoke = async (
852
- fee: number | StdFee | 'auto' = 'auto',
853
- memo?: string,
854
- _funds?: Coin[]
855
- ): Promise<ExecuteResult> => {
856
- return await this.client.execute(
857
- this.sender,
858
- this.contractAddress,
859
- {
860
- revoke: {},
861
- },
862
- fee,
863
- memo,
864
- _funds
865
- );
866
- };
867
- bond = async (
868
- fee: number | StdFee | 'auto' = 'auto',
869
- memo?: string,
870
- _funds?: Coin[]
871
- ): Promise<ExecuteResult> => {
872
- return await this.client.execute(
873
- this.sender,
874
- this.contractAddress,
875
- {
876
- bond: {},
877
- },
878
- fee,
879
- memo,
880
- _funds
881
- );
882
- };
883
- withdraw = async (
884
- {
885
- amount,
886
- }: {
887
- amount?: Uint128;
888
- },
889
- fee: number | StdFee | 'auto' = 'auto',
890
- memo?: string,
891
- _funds?: Coin[]
892
- ): Promise<ExecuteResult> => {
893
- return await this.client.execute(
894
- this.sender,
895
- this.contractAddress,
896
- {
897
- withdraw: {
898
- amount,
899
- },
900
- },
901
- fee,
902
- memo,
903
- _funds
904
- );
905
- };
360
+ client: SigningCosmWasmClient;
361
+ sender: string;
362
+ contractAddress: string;
363
+ constructor(
364
+ client: SigningCosmWasmClient,
365
+ sender: string,
366
+ contractAddress: string
367
+ ) {
368
+ super(client, contractAddress);
369
+ this.client = client;
370
+ this.sender = sender;
371
+ this.contractAddress = contractAddress;
372
+ this.setParams = this.setParams.bind(this);
373
+ this.setRoundInfo = this.setRoundInfo.bind(this);
374
+ this.setWhitelists = this.setWhitelists.bind(this);
375
+ this.setVoteOptionsMap = this.setVoteOptionsMap.bind(this);
376
+ this.startVotingPeriod = this.startVotingPeriod.bind(this);
377
+ this.signUp = this.signUp.bind(this);
378
+ this.startProcessPeriod = this.startProcessPeriod.bind(this);
379
+ this.stopVotingPeriod = this.stopVotingPeriod.bind(this);
380
+ this.publishMessage = this.publishMessage.bind(this);
381
+ this.processMessage = this.processMessage.bind(this);
382
+ this.stopProcessingPeriod = this.stopProcessingPeriod.bind(this);
383
+ this.processTally = this.processTally.bind(this);
384
+ this.stopTallyingPeriod = this.stopTallyingPeriod.bind(this);
385
+ this.grant = this.grant.bind(this);
386
+ this.revoke = this.revoke.bind(this);
387
+ this.bond = this.bond.bind(this);
388
+ this.withdraw = this.withdraw.bind(this);
389
+ }
390
+ setParams = async (
391
+ {
392
+ intStateTreeDepth,
393
+ messageBatchSize,
394
+ stateTreeDepth,
395
+ voteOptionTreeDepth,
396
+ }: {
397
+ intStateTreeDepth: Uint256;
398
+ messageBatchSize: Uint256;
399
+ stateTreeDepth: Uint256;
400
+ voteOptionTreeDepth: Uint256;
401
+ },
402
+ fee: number | StdFee | 'auto' = 'auto',
403
+ memo?: string,
404
+ _funds?: Coin[]
405
+ ): Promise<ExecuteResult> => {
406
+ return await this.client.execute(
407
+ this.sender,
408
+ this.contractAddress,
409
+ {
410
+ set_params: {
411
+ int_state_tree_depth: intStateTreeDepth,
412
+ message_batch_size: messageBatchSize,
413
+ state_tree_depth: stateTreeDepth,
414
+ vote_option_tree_depth: voteOptionTreeDepth,
415
+ },
416
+ },
417
+ fee,
418
+ memo,
419
+ _funds
420
+ );
421
+ };
422
+ setRoundInfo = async (
423
+ {
424
+ roundInfo,
425
+ }: {
426
+ roundInfo: RoundInfo;
427
+ },
428
+ fee: number | StdFee | 'auto' = 'auto',
429
+ memo?: string,
430
+ _funds?: Coin[]
431
+ ): Promise<ExecuteResult> => {
432
+ return await this.client.execute(
433
+ this.sender,
434
+ this.contractAddress,
435
+ {
436
+ set_round_info: {
437
+ round_info: roundInfo,
438
+ },
439
+ },
440
+ fee,
441
+ memo,
442
+ _funds
443
+ );
444
+ };
445
+ setWhitelists = async (
446
+ {
447
+ whitelists,
448
+ }: {
449
+ whitelists: Whitelist;
450
+ },
451
+ fee: number | StdFee | 'auto' = 'auto',
452
+ memo?: string,
453
+ _funds?: Coin[]
454
+ ): Promise<ExecuteResult> => {
455
+ return await this.client.execute(
456
+ this.sender,
457
+ this.contractAddress,
458
+ {
459
+ set_whitelists: {
460
+ whitelists,
461
+ },
462
+ },
463
+ fee,
464
+ memo,
465
+ _funds
466
+ );
467
+ };
468
+ setVoteOptionsMap = async (
469
+ {
470
+ voteOptionMap,
471
+ }: {
472
+ voteOptionMap: string[];
473
+ },
474
+ fee: number | StdFee | 'auto' = 'auto',
475
+ memo?: string,
476
+ _funds?: Coin[]
477
+ ): Promise<ExecuteResult> => {
478
+ return await this.client.execute(
479
+ this.sender,
480
+ this.contractAddress,
481
+ {
482
+ set_vote_options_map: {
483
+ vote_option_map: voteOptionMap,
484
+ },
485
+ },
486
+ fee,
487
+ memo,
488
+ _funds
489
+ );
490
+ };
491
+ startVotingPeriod = async (
492
+ fee: number | StdFee | 'auto' = 'auto',
493
+ memo?: string,
494
+ _funds?: Coin[]
495
+ ): Promise<ExecuteResult> => {
496
+ return await this.client.execute(
497
+ this.sender,
498
+ this.contractAddress,
499
+ {
500
+ start_voting_period: {},
501
+ },
502
+ fee,
503
+ memo,
504
+ _funds
505
+ );
506
+ };
507
+ signUp = async (
508
+ {
509
+ pubkey,
510
+ }: {
511
+ pubkey: PubKey;
512
+ },
513
+ fee: number | StdFee | 'auto' = 'auto',
514
+ memo?: string,
515
+ _funds?: Coin[]
516
+ ): Promise<ExecuteResult> => {
517
+ return await this.client.execute(
518
+ this.sender,
519
+ this.contractAddress,
520
+ {
521
+ sign_up: {
522
+ pubkey,
523
+ },
524
+ },
525
+ fee,
526
+ memo,
527
+ _funds
528
+ );
529
+ };
530
+ startProcessPeriod = async (
531
+ fee: number | StdFee | 'auto' = 'auto',
532
+ memo?: string,
533
+ _funds?: Coin[]
534
+ ): Promise<ExecuteResult> => {
535
+ return await this.client.execute(
536
+ this.sender,
537
+ this.contractAddress,
538
+ {
539
+ start_process_period: {},
540
+ },
541
+ fee,
542
+ memo,
543
+ _funds
544
+ );
545
+ };
546
+ stopVotingPeriod = async (
547
+ fee: number | StdFee | 'auto' = 'auto',
548
+ memo?: string,
549
+ _funds?: Coin[]
550
+ ): Promise<ExecuteResult> => {
551
+ return await this.client.execute(
552
+ this.sender,
553
+ this.contractAddress,
554
+ {
555
+ stop_voting_period: {},
556
+ },
557
+ fee,
558
+ memo,
559
+ _funds
560
+ );
561
+ };
562
+ publishMessage = async (
563
+ {
564
+ encPubKey,
565
+ message,
566
+ }: {
567
+ encPubKey: PubKey;
568
+ message: MessageData;
569
+ },
570
+ fee: number | StdFee | 'auto' = 'auto',
571
+ memo?: string,
572
+ _funds?: Coin[]
573
+ ): Promise<ExecuteResult> => {
574
+ return await this.client.execute(
575
+ this.sender,
576
+ this.contractAddress,
577
+ {
578
+ publish_message: {
579
+ enc_pub_key: encPubKey,
580
+ message,
581
+ },
582
+ },
583
+ fee,
584
+ memo,
585
+ _funds
586
+ );
587
+ };
588
+ processMessage = async (
589
+ {
590
+ groth16Proof,
591
+ newStateCommitment,
592
+ plonkProof,
593
+ }: {
594
+ groth16Proof?: Groth16ProofType;
595
+ newStateCommitment: Uint256;
596
+ plonkProof?: PlonkProofType;
597
+ },
598
+ fee: number | StdFee | 'auto' = 'auto',
599
+ memo?: string,
600
+ _funds?: Coin[]
601
+ ): Promise<ExecuteResult> => {
602
+ return await this.client.execute(
603
+ this.sender,
604
+ this.contractAddress,
605
+ {
606
+ process_message: {
607
+ groth16_proof: groth16Proof,
608
+ new_state_commitment: newStateCommitment,
609
+ plonk_proof: plonkProof,
610
+ },
611
+ },
612
+ fee,
613
+ memo,
614
+ _funds
615
+ );
616
+ };
617
+ stopProcessingPeriod = async (
618
+ fee: number | StdFee | 'auto' = 'auto',
619
+ memo?: string,
620
+ _funds?: Coin[]
621
+ ): Promise<ExecuteResult> => {
622
+ return await this.client.execute(
623
+ this.sender,
624
+ this.contractAddress,
625
+ {
626
+ stop_processing_period: {},
627
+ },
628
+ fee,
629
+ memo,
630
+ _funds
631
+ );
632
+ };
633
+ processTally = async (
634
+ {
635
+ groth16Proof,
636
+ newTallyCommitment,
637
+ plonkProof,
638
+ }: {
639
+ groth16Proof?: Groth16ProofType;
640
+ newTallyCommitment: Uint256;
641
+ plonkProof?: PlonkProofType;
642
+ },
643
+ fee: number | StdFee | 'auto' = 'auto',
644
+ memo?: string,
645
+ _funds?: Coin[]
646
+ ): Promise<ExecuteResult> => {
647
+ return await this.client.execute(
648
+ this.sender,
649
+ this.contractAddress,
650
+ {
651
+ process_tally: {
652
+ groth16_proof: groth16Proof,
653
+ new_tally_commitment: newTallyCommitment,
654
+ plonk_proof: plonkProof,
655
+ },
656
+ },
657
+ fee,
658
+ memo,
659
+ _funds
660
+ );
661
+ };
662
+ stopTallyingPeriod = async (
663
+ {
664
+ results,
665
+ salt,
666
+ }: {
667
+ results: Uint256[];
668
+ salt: Uint256;
669
+ },
670
+ fee: number | StdFee | 'auto' = 'auto',
671
+ memo?: string,
672
+ _funds?: Coin[]
673
+ ): Promise<ExecuteResult> => {
674
+ return await this.client.execute(
675
+ this.sender,
676
+ this.contractAddress,
677
+ {
678
+ stop_tallying_period: {
679
+ results,
680
+ salt,
681
+ },
682
+ },
683
+ fee,
684
+ memo,
685
+ _funds
686
+ );
687
+ };
688
+ grant = async (
689
+ {
690
+ maxAmount,
691
+ }: {
692
+ maxAmount: Uint128;
693
+ },
694
+ fee: number | StdFee | 'auto' = 'auto',
695
+ memo?: string,
696
+ _funds?: Coin[]
697
+ ): Promise<ExecuteResult> => {
698
+ return await this.client.execute(
699
+ this.sender,
700
+ this.contractAddress,
701
+ {
702
+ grant: {
703
+ max_amount: maxAmount,
704
+ },
705
+ },
706
+ fee,
707
+ memo,
708
+ _funds
709
+ );
710
+ };
711
+ revoke = async (
712
+ fee: number | StdFee | 'auto' = 'auto',
713
+ memo?: string,
714
+ _funds?: Coin[]
715
+ ): Promise<ExecuteResult> => {
716
+ return await this.client.execute(
717
+ this.sender,
718
+ this.contractAddress,
719
+ {
720
+ revoke: {},
721
+ },
722
+ fee,
723
+ memo,
724
+ _funds
725
+ );
726
+ };
727
+ bond = async (
728
+ fee: number | StdFee | 'auto' = 'auto',
729
+ memo?: string,
730
+ _funds?: Coin[]
731
+ ): Promise<ExecuteResult> => {
732
+ return await this.client.execute(
733
+ this.sender,
734
+ this.contractAddress,
735
+ {
736
+ bond: {},
737
+ },
738
+ fee,
739
+ memo,
740
+ _funds
741
+ );
742
+ };
743
+ withdraw = async (
744
+ {
745
+ amount,
746
+ }: {
747
+ amount?: Uint128;
748
+ },
749
+ fee: number | StdFee | 'auto' = 'auto',
750
+ memo?: string,
751
+ _funds?: Coin[]
752
+ ): Promise<ExecuteResult> => {
753
+ return await this.client.execute(
754
+ this.sender,
755
+ this.contractAddress,
756
+ {
757
+ withdraw: {
758
+ amount,
759
+ },
760
+ },
761
+ fee,
762
+ memo,
763
+ _funds
764
+ );
765
+ };
906
766
  }