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