@dorafactory/maci-sdk 0.0.35 → 0.0.36

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 (83) hide show
  1. package/dist/index.d.ts +14 -2234
  2. package/dist/index.js +748 -348
  3. package/dist/index.js.map +1 -1
  4. package/dist/index.mjs +722 -350
  5. package/dist/index.mjs.map +1 -1
  6. package/dist/libs/const.d.ts +118 -0
  7. package/dist/libs/contract/config.d.ts +29 -0
  8. package/dist/libs/contract/contract.d.ts +57 -0
  9. package/dist/libs/contract/index.d.ts +1 -0
  10. package/dist/libs/contract/ts/AMaci.client.d.ts +216 -0
  11. package/dist/libs/contract/ts/AMaci.types.d.ts +221 -0
  12. package/dist/libs/contract/ts/Maci.client.d.ts +180 -0
  13. package/dist/libs/contract/ts/Maci.types.d.ts +226 -0
  14. package/dist/libs/contract/ts/OracleMaci.client.d.ts +206 -0
  15. package/dist/libs/contract/ts/OracleMaci.types.d.ts +263 -0
  16. package/dist/libs/contract/ts/Registry.client.d.ts +128 -0
  17. package/dist/libs/contract/ts/Registry.types.d.ts +110 -0
  18. package/dist/libs/contract/types.d.ts +39 -0
  19. package/dist/libs/contract/utils.d.ts +63 -0
  20. package/dist/libs/contract/vars.d.ts +63 -0
  21. package/dist/libs/crypto/babyjub.d.ts +73 -0
  22. package/dist/libs/crypto/bigintUtils.d.ts +6 -0
  23. package/dist/libs/crypto/constants.d.ts +3 -0
  24. package/dist/libs/crypto/hashing.d.ts +69 -0
  25. package/dist/libs/crypto/index.d.ts +9 -0
  26. package/dist/libs/crypto/keys.d.ts +74 -0
  27. package/dist/libs/crypto/sign.d.ts +9 -0
  28. package/dist/libs/crypto/tree.d.ts +23 -0
  29. package/dist/libs/crypto/types.d.ts +55 -0
  30. package/dist/libs/errors/index.d.ts +28 -0
  31. package/dist/libs/errors/types.d.ts +19 -0
  32. package/dist/libs/http/http.d.ts +16 -0
  33. package/dist/libs/http/index.d.ts +1 -0
  34. package/dist/libs/index.d.ts +7 -0
  35. package/dist/libs/indexer/index.d.ts +1 -0
  36. package/dist/libs/indexer/indexer.d.ts +152 -0
  37. package/dist/libs/indexer/types.d.ts +7 -0
  38. package/dist/libs/maci/index.d.ts +1 -0
  39. package/dist/libs/maci/maci.d.ts +182 -0
  40. package/dist/libs/maci/types.d.ts +6 -0
  41. package/dist/libs/oracle-certificate/index.d.ts +1 -0
  42. package/dist/libs/oracle-certificate/oracle-certificate.d.ts +9 -0
  43. package/dist/libs/oracle-certificate/types.d.ts +40 -0
  44. package/dist/libs/query/account.d.ts +7 -0
  45. package/dist/libs/query/circuit.d.ts +8 -0
  46. package/dist/libs/query/event.d.ts +7 -0
  47. package/dist/libs/query/index.d.ts +7 -0
  48. package/dist/libs/query/operator.d.ts +11 -0
  49. package/dist/libs/query/proof.d.ts +7 -0
  50. package/dist/libs/query/round.d.ts +18 -0
  51. package/dist/libs/query/transaction.d.ts +9 -0
  52. package/dist/maci.d.ts +190 -0
  53. package/dist/types/index.d.ts +383 -0
  54. package/dist/utils/index.d.ts +7 -0
  55. package/package.json +18 -24
  56. package/src/index.ts +1 -3
  57. package/src/libs/contract/contract.ts +14 -13
  58. package/src/libs/contract/types.ts +3 -3
  59. package/src/libs/crypto/babyjub.ts +132 -0
  60. package/src/libs/crypto/bigintUtils.ts +31 -0
  61. package/src/libs/crypto/constants.ts +22 -0
  62. package/src/libs/crypto/hashing.ts +167 -0
  63. package/src/libs/crypto/index.ts +9 -0
  64. package/src/libs/{circom/circomlib.ts → crypto/keys.ts} +104 -114
  65. package/src/libs/crypto/sign.ts +91 -0
  66. package/src/libs/crypto/tree.ts +176 -0
  67. package/src/libs/crypto/types.ts +101 -0
  68. package/src/libs/index.ts +1 -1
  69. package/src/libs/maci/maci.ts +28 -29
  70. package/src/maci.ts +132 -67
  71. package/src/types/index.ts +7 -0
  72. package/src/utils/index.ts +22 -22
  73. package/dist/browser.d.mts +0 -2233
  74. package/dist/browser.d.ts +0 -2233
  75. package/dist/browser.js +0 -31620
  76. package/dist/browser.js.map +0 -1
  77. package/dist/browser.mjs +0 -31631
  78. package/dist/browser.mjs.map +0 -1
  79. package/dist/index.d.mts +0 -2234
  80. package/src/browser.ts +0 -17
  81. package/src/libs/circom/index.ts +0 -98
  82. package/src/libs/circom/types.ts +0 -8
  83. package/src/polyfills/browser-polyfills.ts +0 -9
@@ -0,0 +1,180 @@
1
+ /**
2
+ * This file was automatically generated by @cosmwasm/ts-codegen@1.11.1.
3
+ * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
4
+ * and run the @cosmwasm/ts-codegen generate command to regenerate this file.
5
+ */
6
+ import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from '@cosmjs/cosmwasm-stargate';
7
+ import { Coin, StdFee } from '@cosmjs/amino';
8
+ import { Uint256, PubKey, RoundInfo, VotingTime, Whitelist, Uint128, MessageData, Groth16ProofType, PlonkProofType, Addr, Period, Boolean, ArrayOfString } from './Maci.types';
9
+ export interface MaciReadOnlyInterface {
10
+ contractAddress: string;
11
+ getRoundInfo: () => Promise<RoundInfo>;
12
+ getVotingTime: () => Promise<VotingTime>;
13
+ getPeriod: () => Promise<Period>;
14
+ getNumSignUp: () => Promise<Uint256>;
15
+ getMsgChainLength: () => Promise<Uint256>;
16
+ getProcessedMsgCount: () => Promise<Uint256>;
17
+ getProcessedUserCount: () => Promise<Uint256>;
18
+ getResult: ({ index }: {
19
+ index: Uint256;
20
+ }) => Promise<Uint256>;
21
+ getAllResult: () => Promise<Uint256>;
22
+ getStateIdxInc: ({ address }: {
23
+ address: Addr;
24
+ }) => Promise<Uint256>;
25
+ getVoiceCreditBalance: ({ index }: {
26
+ index: Uint256;
27
+ }) => Promise<Uint256>;
28
+ whiteList: () => Promise<Whitelist>;
29
+ isWhiteList: ({ sender }: {
30
+ sender: string;
31
+ }) => Promise<Boolean>;
32
+ whiteBalanceOf: ({ sender }: {
33
+ sender: string;
34
+ }) => Promise<Uint256>;
35
+ voteOptionMap: () => Promise<ArrayOfString>;
36
+ maxVoteOptions: () => Promise<Uint256>;
37
+ queryTotalFeeGrant: () => Promise<Uint128>;
38
+ queryCircuitType: () => Promise<Uint256>;
39
+ queryCertSystem: () => Promise<Uint256>;
40
+ }
41
+ export declare class MaciQueryClient implements MaciReadOnlyInterface {
42
+ client: CosmWasmClient;
43
+ contractAddress: string;
44
+ constructor(client: CosmWasmClient, contractAddress: string);
45
+ getRoundInfo: () => Promise<RoundInfo>;
46
+ getVotingTime: () => Promise<VotingTime>;
47
+ getPeriod: () => Promise<Period>;
48
+ getNumSignUp: () => Promise<Uint256>;
49
+ getMsgChainLength: () => Promise<Uint256>;
50
+ getProcessedMsgCount: () => Promise<Uint256>;
51
+ getProcessedUserCount: () => Promise<Uint256>;
52
+ getResult: ({ index }: {
53
+ index: Uint256;
54
+ }) => Promise<Uint256>;
55
+ getAllResult: () => Promise<Uint256>;
56
+ getStateIdxInc: ({ address }: {
57
+ address: Addr;
58
+ }) => Promise<Uint256>;
59
+ getVoiceCreditBalance: ({ index, }: {
60
+ index: Uint256;
61
+ }) => Promise<Uint256>;
62
+ whiteList: () => Promise<Whitelist>;
63
+ isWhiteList: ({ sender }: {
64
+ sender: string;
65
+ }) => Promise<Boolean>;
66
+ whiteBalanceOf: ({ sender }: {
67
+ sender: string;
68
+ }) => Promise<Uint256>;
69
+ voteOptionMap: () => Promise<ArrayOfString>;
70
+ maxVoteOptions: () => Promise<Uint256>;
71
+ queryTotalFeeGrant: () => Promise<Uint128>;
72
+ queryCircuitType: () => Promise<Uint256>;
73
+ queryCertSystem: () => Promise<Uint256>;
74
+ }
75
+ export interface MaciInterface extends MaciReadOnlyInterface {
76
+ contractAddress: string;
77
+ sender: string;
78
+ setParams: ({ intStateTreeDepth, messageBatchSize, stateTreeDepth, voteOptionTreeDepth, }: {
79
+ intStateTreeDepth: Uint256;
80
+ messageBatchSize: Uint256;
81
+ stateTreeDepth: Uint256;
82
+ voteOptionTreeDepth: Uint256;
83
+ }, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
84
+ setRoundInfo: ({ roundInfo, }: {
85
+ roundInfo: RoundInfo;
86
+ }, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
87
+ setWhitelists: ({ whitelists, }: {
88
+ whitelists: Whitelist;
89
+ }, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
90
+ setVoteOptionsMap: ({ voteOptionMap, }: {
91
+ voteOptionMap: string[];
92
+ }, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
93
+ startVotingPeriod: (fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
94
+ signUp: ({ pubkey, }: {
95
+ pubkey: PubKey;
96
+ }, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
97
+ startProcessPeriod: (fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
98
+ stopVotingPeriod: (fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
99
+ publishMessage: ({ encPubKey, message, }: {
100
+ encPubKey: PubKey;
101
+ message: MessageData;
102
+ }, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
103
+ processMessage: ({ groth16Proof, newStateCommitment, plonkProof, }: {
104
+ groth16Proof?: Groth16ProofType;
105
+ newStateCommitment: Uint256;
106
+ plonkProof?: PlonkProofType;
107
+ }, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
108
+ stopProcessingPeriod: (fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
109
+ processTally: ({ groth16Proof, newTallyCommitment, plonkProof, }: {
110
+ groth16Proof?: Groth16ProofType;
111
+ newTallyCommitment: Uint256;
112
+ plonkProof?: PlonkProofType;
113
+ }, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
114
+ stopTallyingPeriod: ({ results, salt, }: {
115
+ results: Uint256[];
116
+ salt: Uint256;
117
+ }, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
118
+ grant: ({ maxAmount, }: {
119
+ maxAmount: Uint128;
120
+ }, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
121
+ revoke: (fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
122
+ bond: (fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
123
+ withdraw: ({ amount, }: {
124
+ amount?: Uint128;
125
+ }, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
126
+ }
127
+ export declare class MaciClient extends MaciQueryClient implements MaciInterface {
128
+ client: SigningCosmWasmClient;
129
+ sender: string;
130
+ contractAddress: string;
131
+ constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string);
132
+ setParams: ({ intStateTreeDepth, messageBatchSize, stateTreeDepth, voteOptionTreeDepth, }: {
133
+ intStateTreeDepth: Uint256;
134
+ messageBatchSize: Uint256;
135
+ stateTreeDepth: Uint256;
136
+ voteOptionTreeDepth: Uint256;
137
+ }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
138
+ setRoundInfo: ({ roundInfo, }: {
139
+ roundInfo: RoundInfo;
140
+ }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
141
+ setWhitelists: ({ whitelists, }: {
142
+ whitelists: Whitelist;
143
+ }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
144
+ setVoteOptionsMap: ({ voteOptionMap, }: {
145
+ voteOptionMap: string[];
146
+ }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
147
+ startVotingPeriod: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
148
+ signUp: ({ pubkey, }: {
149
+ pubkey: PubKey;
150
+ }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
151
+ startProcessPeriod: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
152
+ stopVotingPeriod: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
153
+ publishMessage: ({ encPubKey, message, }: {
154
+ encPubKey: PubKey;
155
+ message: MessageData;
156
+ }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
157
+ processMessage: ({ groth16Proof, newStateCommitment, plonkProof, }: {
158
+ groth16Proof?: Groth16ProofType;
159
+ newStateCommitment: Uint256;
160
+ plonkProof?: PlonkProofType;
161
+ }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
162
+ stopProcessingPeriod: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
163
+ processTally: ({ groth16Proof, newTallyCommitment, plonkProof, }: {
164
+ groth16Proof?: Groth16ProofType;
165
+ newTallyCommitment: Uint256;
166
+ plonkProof?: PlonkProofType;
167
+ }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
168
+ stopTallyingPeriod: ({ results, salt, }: {
169
+ results: Uint256[];
170
+ salt: Uint256;
171
+ }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
172
+ grant: ({ maxAmount, }: {
173
+ maxAmount: Uint128;
174
+ }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
175
+ revoke: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
176
+ bond: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
177
+ withdraw: ({ amount, }: {
178
+ amount?: Uint128;
179
+ }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
180
+ }
@@ -0,0 +1,226 @@
1
+ /**
2
+ * This file was automatically generated by @cosmwasm/ts-codegen@1.11.1.
3
+ * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
4
+ * and run the @cosmwasm/ts-codegen generate command to regenerate this file.
5
+ */
6
+ export type Uint256 = string;
7
+ export type Timestamp = Uint64;
8
+ export type Uint64 = string;
9
+ export interface InstantiateMsg {
10
+ certification_system: Uint256;
11
+ circuit_type: Uint256;
12
+ coordinator: PubKey;
13
+ groth16_process_vkey?: Groth16VKeyType | null;
14
+ groth16_tally_vkey?: Groth16VKeyType | null;
15
+ max_vote_options: Uint256;
16
+ parameters: MaciParameters;
17
+ plonk_process_vkey?: PlonkVKeyType | null;
18
+ plonk_tally_vkey?: PlonkVKeyType | null;
19
+ qtr_lib: QuinaryTreeRoot;
20
+ round_info: RoundInfo;
21
+ voting_time?: VotingTime | null;
22
+ whitelist?: Whitelist | null;
23
+ }
24
+ export interface PubKey {
25
+ x: Uint256;
26
+ y: Uint256;
27
+ }
28
+ export interface Groth16VKeyType {
29
+ vk_alpha1: string;
30
+ vk_beta_2: string;
31
+ vk_delta_2: string;
32
+ vk_gamma_2: string;
33
+ vk_ic0: string;
34
+ vk_ic1: string;
35
+ }
36
+ export interface MaciParameters {
37
+ int_state_tree_depth: Uint256;
38
+ message_batch_size: Uint256;
39
+ state_tree_depth: Uint256;
40
+ vote_option_tree_depth: Uint256;
41
+ }
42
+ export interface PlonkVKeyType {
43
+ g2_elements: string[];
44
+ n: number;
45
+ next_step_selector_commitments: string[];
46
+ non_residues: string[];
47
+ num_inputs: number;
48
+ permutation_commitments: string[];
49
+ selector_commitments: string[];
50
+ }
51
+ export interface QuinaryTreeRoot {
52
+ zeros: [
53
+ Uint256,
54
+ Uint256,
55
+ Uint256,
56
+ Uint256,
57
+ Uint256,
58
+ Uint256,
59
+ Uint256,
60
+ Uint256,
61
+ Uint256
62
+ ];
63
+ }
64
+ export interface RoundInfo {
65
+ description: string;
66
+ link: string;
67
+ title: string;
68
+ }
69
+ export interface VotingTime {
70
+ end_time?: Timestamp | null;
71
+ start_time?: Timestamp | null;
72
+ }
73
+ export interface Whitelist {
74
+ users: WhitelistConfig[];
75
+ }
76
+ export interface WhitelistConfig {
77
+ addr: string;
78
+ balance: Uint256;
79
+ }
80
+ export type ExecuteMsg = {
81
+ set_params: {
82
+ int_state_tree_depth: Uint256;
83
+ message_batch_size: Uint256;
84
+ state_tree_depth: Uint256;
85
+ vote_option_tree_depth: Uint256;
86
+ };
87
+ } | {
88
+ set_round_info: {
89
+ round_info: RoundInfo;
90
+ };
91
+ } | {
92
+ set_whitelists: {
93
+ whitelists: Whitelist;
94
+ };
95
+ } | {
96
+ set_vote_options_map: {
97
+ vote_option_map: string[];
98
+ };
99
+ } | {
100
+ start_voting_period: {};
101
+ } | {
102
+ sign_up: {
103
+ pubkey: PubKey;
104
+ };
105
+ } | {
106
+ start_process_period: {};
107
+ } | {
108
+ stop_voting_period: {};
109
+ } | {
110
+ publish_message: {
111
+ enc_pub_key: PubKey;
112
+ message: MessageData;
113
+ };
114
+ } | {
115
+ process_message: {
116
+ groth16_proof?: Groth16ProofType | null;
117
+ new_state_commitment: Uint256;
118
+ plonk_proof?: PlonkProofType | null;
119
+ };
120
+ } | {
121
+ stop_processing_period: {};
122
+ } | {
123
+ process_tally: {
124
+ groth16_proof?: Groth16ProofType | null;
125
+ new_tally_commitment: Uint256;
126
+ plonk_proof?: PlonkProofType | null;
127
+ };
128
+ } | {
129
+ stop_tallying_period: {
130
+ results: Uint256[];
131
+ salt: Uint256;
132
+ };
133
+ } | {
134
+ grant: {
135
+ max_amount: Uint128;
136
+ };
137
+ } | {
138
+ revoke: {};
139
+ } | {
140
+ bond: {};
141
+ } | {
142
+ withdraw: {
143
+ amount?: Uint128 | null;
144
+ };
145
+ };
146
+ export type Uint128 = string;
147
+ export interface MessageData {
148
+ data: [Uint256, Uint256, Uint256, Uint256, Uint256, Uint256, Uint256];
149
+ }
150
+ export interface Groth16ProofType {
151
+ a: string;
152
+ b: string;
153
+ c: string;
154
+ }
155
+ export interface PlonkProofType {
156
+ grand_product_at_z_omega: string;
157
+ grand_product_commitment: string;
158
+ input_values: string[];
159
+ linearization_polynomial_at_z: string;
160
+ n: number;
161
+ num_inputs: number;
162
+ opening_at_z_omega_proof: string;
163
+ opening_at_z_proof: string;
164
+ permutation_polynomials_at_z: string[];
165
+ quotient_poly_commitments: string[];
166
+ quotient_polynomial_at_z: string;
167
+ wire_commitments: string[];
168
+ wire_values_at_z: string[];
169
+ wire_values_at_z_omega: string[];
170
+ }
171
+ export type QueryMsg = {
172
+ get_round_info: {};
173
+ } | {
174
+ get_voting_time: {};
175
+ } | {
176
+ get_period: {};
177
+ } | {
178
+ get_num_sign_up: {};
179
+ } | {
180
+ get_msg_chain_length: {};
181
+ } | {
182
+ get_processed_msg_count: {};
183
+ } | {
184
+ get_processed_user_count: {};
185
+ } | {
186
+ get_result: {
187
+ index: Uint256;
188
+ };
189
+ } | {
190
+ get_all_result: {};
191
+ } | {
192
+ get_state_idx_inc: {
193
+ address: Addr;
194
+ };
195
+ } | {
196
+ get_voice_credit_balance: {
197
+ index: Uint256;
198
+ };
199
+ } | {
200
+ white_list: {};
201
+ } | {
202
+ is_white_list: {
203
+ sender: string;
204
+ };
205
+ } | {
206
+ white_balance_of: {
207
+ sender: string;
208
+ };
209
+ } | {
210
+ vote_option_map: {};
211
+ } | {
212
+ max_vote_options: {};
213
+ } | {
214
+ query_total_fee_grant: {};
215
+ } | {
216
+ query_circuit_type: {};
217
+ } | {
218
+ query_cert_system: {};
219
+ };
220
+ export type Addr = string;
221
+ export type PeriodStatus = 'pending' | 'voting' | 'processing' | 'tallying' | 'ended';
222
+ export interface Period {
223
+ status: PeriodStatus;
224
+ }
225
+ export type Boolean = boolean;
226
+ export type ArrayOfString = string[];
@@ -0,0 +1,206 @@
1
+ /**
2
+ * This file was automatically generated by @cosmwasm/ts-codegen@1.11.1.
3
+ * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
4
+ * and run the @cosmwasm/ts-codegen generate command to regenerate this file.
5
+ */
6
+ import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from '@cosmjs/cosmwasm-stargate';
7
+ import { Coin, StdFee } from '@cosmjs/amino';
8
+ import { Uint256, Addr, PubKey, RoundInfo, VotingTime, Uint128, MessageData, Groth16ProofType, PlonkProofType, Period, GrantConfig, Boolean, OracleWhitelistConfig, ArrayOfString, WhitelistConfig } from './OracleMaci.types';
9
+ export interface OracleMaciReadOnlyInterface {
10
+ contractAddress: string;
11
+ getRoundInfo: () => Promise<RoundInfo>;
12
+ getVotingTime: () => Promise<VotingTime>;
13
+ getPeriod: () => Promise<Period>;
14
+ getNumSignUp: () => Promise<Uint256>;
15
+ getMsgChainLength: () => Promise<Uint256>;
16
+ getProcessedMsgCount: () => Promise<Uint256>;
17
+ getProcessedUserCount: () => Promise<Uint256>;
18
+ getResult: ({ index }: {
19
+ index: Uint256;
20
+ }) => Promise<Uint256>;
21
+ getAllResult: () => Promise<Uint256>;
22
+ getStateIdxInc: ({ address }: {
23
+ address: Addr;
24
+ }) => Promise<Uint256>;
25
+ getVoiceCreditBalance: ({ index }: {
26
+ index: Uint256;
27
+ }) => Promise<Uint256>;
28
+ isWhiteList: ({ amount, certificate, sender, }: {
29
+ amount: Uint256;
30
+ certificate: string;
31
+ sender: string;
32
+ }) => Promise<Boolean>;
33
+ whiteBalanceOf: ({ amount, certificate, sender, }: {
34
+ amount: Uint256;
35
+ certificate: string;
36
+ sender: string;
37
+ }) => Promise<Uint256>;
38
+ whiteInfo: ({ sender }: {
39
+ sender: string;
40
+ }) => Promise<WhitelistConfig>;
41
+ grantInfo: ({ grantee }: {
42
+ grantee: string;
43
+ }) => Promise<GrantConfig>;
44
+ maxWhitelistNum: () => Promise<Uint128>;
45
+ voteOptionMap: () => Promise<ArrayOfString>;
46
+ maxVoteOptions: () => Promise<Uint256>;
47
+ queryTotalFeeGrant: () => Promise<Uint128>;
48
+ queryCircuitType: () => Promise<Uint256>;
49
+ queryCertSystem: () => Promise<Uint256>;
50
+ queryOracleWhitelistConfig: () => Promise<OracleWhitelistConfig>;
51
+ }
52
+ export declare class OracleMaciQueryClient implements OracleMaciReadOnlyInterface {
53
+ client: CosmWasmClient;
54
+ contractAddress: string;
55
+ constructor(client: CosmWasmClient, contractAddress: string);
56
+ getRoundInfo: () => Promise<RoundInfo>;
57
+ getVotingTime: () => Promise<VotingTime>;
58
+ getPeriod: () => Promise<Period>;
59
+ getNumSignUp: () => Promise<Uint256>;
60
+ getMsgChainLength: () => Promise<Uint256>;
61
+ getProcessedMsgCount: () => Promise<Uint256>;
62
+ getProcessedUserCount: () => Promise<Uint256>;
63
+ getResult: ({ index }: {
64
+ index: Uint256;
65
+ }) => Promise<Uint256>;
66
+ getAllResult: () => Promise<Uint256>;
67
+ getStateIdxInc: ({ address }: {
68
+ address: Addr;
69
+ }) => Promise<Uint256>;
70
+ getVoiceCreditBalance: ({ index, }: {
71
+ index: Uint256;
72
+ }) => Promise<Uint256>;
73
+ isWhiteList: ({ amount, certificate, sender, }: {
74
+ amount: Uint256;
75
+ certificate: string;
76
+ sender: string;
77
+ }) => Promise<Boolean>;
78
+ whiteBalanceOf: ({ amount, certificate, sender, }: {
79
+ amount: Uint256;
80
+ certificate: string;
81
+ sender: string;
82
+ }) => Promise<Uint256>;
83
+ whiteInfo: ({ sender, }: {
84
+ sender: string;
85
+ }) => Promise<WhitelistConfig>;
86
+ grantInfo: ({ grantee, }: {
87
+ grantee: string;
88
+ }) => Promise<GrantConfig>;
89
+ maxWhitelistNum: () => Promise<Uint128>;
90
+ voteOptionMap: () => Promise<ArrayOfString>;
91
+ maxVoteOptions: () => Promise<Uint256>;
92
+ queryTotalFeeGrant: () => Promise<Uint128>;
93
+ queryCircuitType: () => Promise<Uint256>;
94
+ queryCertSystem: () => Promise<Uint256>;
95
+ queryOracleWhitelistConfig: () => Promise<OracleWhitelistConfig>;
96
+ }
97
+ export interface OracleMaciInterface extends OracleMaciReadOnlyInterface {
98
+ contractAddress: string;
99
+ sender: string;
100
+ setParams: ({ intStateTreeDepth, messageBatchSize, stateTreeDepth, voteOptionTreeDepth, }: {
101
+ intStateTreeDepth: Uint256;
102
+ messageBatchSize: Uint256;
103
+ stateTreeDepth: Uint256;
104
+ voteOptionTreeDepth: Uint256;
105
+ }, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
106
+ setRoundInfo: ({ roundInfo, }: {
107
+ roundInfo: RoundInfo;
108
+ }, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
109
+ setVoteOptionsMap: ({ voteOptionMap, }: {
110
+ voteOptionMap: string[];
111
+ }, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
112
+ startVotingPeriod: (fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
113
+ signUp: ({ amount, certificate, pubkey, }: {
114
+ amount: Uint256;
115
+ certificate: string;
116
+ pubkey: PubKey;
117
+ }, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
118
+ startProcessPeriod: (fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
119
+ stopVotingPeriod: (fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
120
+ publishMessage: ({ encPubKey, message, }: {
121
+ encPubKey: PubKey;
122
+ message: MessageData;
123
+ }, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
124
+ processMessage: ({ groth16Proof, newStateCommitment, plonkProof, }: {
125
+ groth16Proof?: Groth16ProofType;
126
+ newStateCommitment: Uint256;
127
+ plonkProof?: PlonkProofType;
128
+ }, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
129
+ stopProcessingPeriod: (fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
130
+ processTally: ({ groth16Proof, newTallyCommitment, plonkProof, }: {
131
+ groth16Proof?: Groth16ProofType;
132
+ newTallyCommitment: Uint256;
133
+ plonkProof?: PlonkProofType;
134
+ }, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
135
+ stopTallyingPeriod: ({ results, salt, }: {
136
+ results: Uint256[];
137
+ salt: Uint256;
138
+ }, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
139
+ grant: ({ baseAmount, grantee, }: {
140
+ baseAmount: Uint128;
141
+ grantee: Addr;
142
+ }, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
143
+ revoke: ({ grantee, }: {
144
+ grantee: Addr;
145
+ }, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
146
+ bond: (fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
147
+ withdraw: ({ amount, }: {
148
+ amount?: Uint128;
149
+ }, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
150
+ }
151
+ export declare class OracleMaciClient extends OracleMaciQueryClient implements OracleMaciInterface {
152
+ client: SigningCosmWasmClient;
153
+ sender: string;
154
+ contractAddress: string;
155
+ constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string);
156
+ setParams: ({ intStateTreeDepth, messageBatchSize, stateTreeDepth, voteOptionTreeDepth, }: {
157
+ intStateTreeDepth: Uint256;
158
+ messageBatchSize: Uint256;
159
+ stateTreeDepth: Uint256;
160
+ voteOptionTreeDepth: Uint256;
161
+ }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
162
+ setRoundInfo: ({ roundInfo, }: {
163
+ roundInfo: RoundInfo;
164
+ }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
165
+ setVoteOptionsMap: ({ voteOptionMap, }: {
166
+ voteOptionMap: string[];
167
+ }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
168
+ startVotingPeriod: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
169
+ signUp: ({ amount, certificate, pubkey, }: {
170
+ amount: Uint256;
171
+ certificate: string;
172
+ pubkey: PubKey;
173
+ }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
174
+ startProcessPeriod: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
175
+ stopVotingPeriod: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
176
+ publishMessage: ({ encPubKey, message, }: {
177
+ encPubKey: PubKey;
178
+ message: MessageData;
179
+ }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
180
+ processMessage: ({ groth16Proof, newStateCommitment, plonkProof, }: {
181
+ groth16Proof?: Groth16ProofType;
182
+ newStateCommitment: Uint256;
183
+ plonkProof?: PlonkProofType;
184
+ }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
185
+ stopProcessingPeriod: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
186
+ processTally: ({ groth16Proof, newTallyCommitment, plonkProof, }: {
187
+ groth16Proof?: Groth16ProofType;
188
+ newTallyCommitment: Uint256;
189
+ plonkProof?: PlonkProofType;
190
+ }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
191
+ stopTallyingPeriod: ({ results, salt, }: {
192
+ results: Uint256[];
193
+ salt: Uint256;
194
+ }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
195
+ grant: ({ baseAmount, grantee, }: {
196
+ baseAmount: Uint128;
197
+ grantee: Addr;
198
+ }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
199
+ revoke: ({ grantee, }: {
200
+ grantee: Addr;
201
+ }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
202
+ bond: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
203
+ withdraw: ({ amount, }: {
204
+ amount?: Uint128;
205
+ }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
206
+ }