@dorafactory/maci-sdk 0.0.1

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 (74) hide show
  1. package/README.md +1 -0
  2. package/dist/index.d.ts +11 -0
  3. package/dist/index.js +4157 -0
  4. package/dist/index.js.map +1 -0
  5. package/dist/index.mjs +4123 -0
  6. package/dist/index.mjs.map +1 -0
  7. package/dist/libs/const.d.ts +117 -0
  8. package/dist/libs/contract/config.d.ts +29 -0
  9. package/dist/libs/contract/contract.d.ts +37 -0
  10. package/dist/libs/contract/index.d.ts +1 -0
  11. package/dist/libs/contract/ts/AMaci.client.d.ts +216 -0
  12. package/dist/libs/contract/ts/AMaci.types.d.ts +203 -0
  13. package/dist/libs/contract/ts/Maci.client.d.ts +206 -0
  14. package/dist/libs/contract/ts/Maci.types.d.ts +217 -0
  15. package/dist/libs/contract/ts/OracleMaci.client.d.ts +206 -0
  16. package/dist/libs/contract/ts/OracleMaci.types.d.ts +253 -0
  17. package/dist/libs/contract/ts/Registry.client.d.ts +128 -0
  18. package/dist/libs/contract/ts/Registry.types.d.ts +110 -0
  19. package/dist/libs/contract/types.d.ts +50 -0
  20. package/dist/libs/contract/utils.d.ts +67 -0
  21. package/dist/libs/contract/vars.d.ts +65 -0
  22. package/dist/libs/errors/index.d.ts +28 -0
  23. package/dist/libs/errors/types.d.ts +14 -0
  24. package/dist/libs/http/http.d.ts +16 -0
  25. package/dist/libs/http/index.d.ts +1 -0
  26. package/dist/libs/index.d.ts +4 -0
  27. package/dist/libs/indexer/index.d.ts +1 -0
  28. package/dist/libs/indexer/indexer.d.ts +133 -0
  29. package/dist/libs/indexer/types.d.ts +7 -0
  30. package/dist/libs/query/account.d.ts +7 -0
  31. package/dist/libs/query/circuit.d.ts +8 -0
  32. package/dist/libs/query/index.d.ts +6 -0
  33. package/dist/libs/query/operator.d.ts +9 -0
  34. package/dist/libs/query/proof.d.ts +7 -0
  35. package/dist/libs/query/round.d.ts +11 -0
  36. package/dist/libs/query/transaction.d.ts +9 -0
  37. package/dist/maci.d.ts +151 -0
  38. package/dist/types/index.d.ts +254 -0
  39. package/dist/utils/index.d.ts +1 -0
  40. package/package.json +154 -0
  41. package/src/index.ts +11 -0
  42. package/src/libs/const.ts +196 -0
  43. package/src/libs/contract/config.ts +117 -0
  44. package/src/libs/contract/contract.ts +330 -0
  45. package/src/libs/contract/index.ts +1 -0
  46. package/src/libs/contract/ts/AMaci.client.ts +893 -0
  47. package/src/libs/contract/ts/AMaci.types.ts +252 -0
  48. package/src/libs/contract/ts/Maci.client.ts +906 -0
  49. package/src/libs/contract/ts/Maci.types.ts +263 -0
  50. package/src/libs/contract/ts/OracleMaci.client.ts +561 -0
  51. package/src/libs/contract/ts/OracleMaci.types.ts +254 -0
  52. package/src/libs/contract/ts/Registry.client.ts +466 -0
  53. package/src/libs/contract/ts/Registry.types.ts +127 -0
  54. package/src/libs/contract/types.ts +57 -0
  55. package/src/libs/contract/utils.ts +175 -0
  56. package/src/libs/contract/vars.ts +420 -0
  57. package/src/libs/errors/index.ts +122 -0
  58. package/src/libs/errors/types.ts +14 -0
  59. package/src/libs/http/http.ts +152 -0
  60. package/src/libs/http/index.ts +1 -0
  61. package/src/libs/index.ts +4 -0
  62. package/src/libs/indexer/index.ts +1 -0
  63. package/src/libs/indexer/indexer.ts +240 -0
  64. package/src/libs/indexer/types.ts +8 -0
  65. package/src/libs/query/account.ts +39 -0
  66. package/src/libs/query/circuit.ts +99 -0
  67. package/src/libs/query/index.ts +6 -0
  68. package/src/libs/query/operator.ts +263 -0
  69. package/src/libs/query/proof.ts +76 -0
  70. package/src/libs/query/round.ts +533 -0
  71. package/src/libs/query/transaction.ts +204 -0
  72. package/src/maci.ts +313 -0
  73. package/src/types/index.ts +301 -0
  74. package/src/utils/index.ts +44 -0
@@ -0,0 +1,206 @@
1
+ /**
2
+ * This file was automatically generated by @cosmwasm/ts-codegen@0.30.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, 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
+ getDMsgChainLength: () => Promise<Uint256>;
17
+ getProcessedDMsgCount: () => Promise<Uint256>;
18
+ getProcessedMsgCount: () => Promise<Uint256>;
19
+ getProcessedUserCount: () => Promise<Uint256>;
20
+ getResult: ({ index }: {
21
+ index: Uint256;
22
+ }) => Promise<Uint256>;
23
+ getAllResult: () => Promise<Uint256>;
24
+ getStateIdxInc: ({ address }: {
25
+ address: Addr;
26
+ }) => Promise<Uint256>;
27
+ getVoiceCreditBalance: ({ index }: {
28
+ index: Uint256;
29
+ }) => Promise<Uint256>;
30
+ whiteList: () => Promise<Whitelist>;
31
+ isWhiteList: ({ sender }: {
32
+ sender: string;
33
+ }) => Promise<Boolean>;
34
+ voteOptionMap: () => Promise<ArrayOfString>;
35
+ maxVoteOptions: () => Promise<Uint256>;
36
+ queryTotalFeeGrant: () => Promise<Uint128>;
37
+ queryCircuitType: () => Promise<Uint256>;
38
+ queryCertSystem: () => Promise<Uint256>;
39
+ }
40
+ export declare class MaciQueryClient implements MaciReadOnlyInterface {
41
+ client: CosmWasmClient;
42
+ contractAddress: string;
43
+ constructor(client: CosmWasmClient, contractAddress: string);
44
+ getRoundInfo: () => Promise<RoundInfo>;
45
+ getVotingTime: () => Promise<VotingTime>;
46
+ getPeriod: () => Promise<Period>;
47
+ getNumSignUp: () => Promise<Uint256>;
48
+ getMsgChainLength: () => Promise<Uint256>;
49
+ getDMsgChainLength: () => Promise<Uint256>;
50
+ getProcessedDMsgCount: () => Promise<Uint256>;
51
+ getProcessedMsgCount: () => Promise<Uint256>;
52
+ getProcessedUserCount: () => Promise<Uint256>;
53
+ getResult: ({ index }: {
54
+ index: Uint256;
55
+ }) => Promise<Uint256>;
56
+ getAllResult: () => Promise<Uint256>;
57
+ getStateIdxInc: ({ address, }: {
58
+ address: Addr;
59
+ }) => Promise<Uint256>;
60
+ getVoiceCreditBalance: ({ index, }: {
61
+ index: Uint256;
62
+ }) => Promise<Uint256>;
63
+ whiteList: () => Promise<Whitelist>;
64
+ isWhiteList: ({ sender }: {
65
+ sender: string;
66
+ }) => Promise<Boolean>;
67
+ voteOptionMap: () => Promise<ArrayOfString>;
68
+ maxVoteOptions: () => Promise<Uint256>;
69
+ queryTotalFeeGrant: () => Promise<Uint128>;
70
+ queryCircuitType: () => Promise<Uint256>;
71
+ queryCertSystem: () => Promise<Uint256>;
72
+ }
73
+ export interface MaciInterface extends MaciReadOnlyInterface {
74
+ contractAddress: string;
75
+ sender: string;
76
+ setParams: ({ intStateTreeDepth, messageBatchSize, stateTreeDepth, voteOptionTreeDepth, }: {
77
+ intStateTreeDepth: Uint256;
78
+ messageBatchSize: Uint256;
79
+ stateTreeDepth: Uint256;
80
+ voteOptionTreeDepth: Uint256;
81
+ }, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
82
+ setRoundInfo: ({ roundInfo, }: {
83
+ roundInfo: RoundInfo;
84
+ }, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
85
+ setWhitelists: ({ whitelists, }: {
86
+ whitelists: Whitelist;
87
+ }, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
88
+ setVoteOptionsMap: ({ voteOptionMap, }: {
89
+ voteOptionMap: string[];
90
+ }, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
91
+ startVotingPeriod: (fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
92
+ signUp: ({ pubkey, }: {
93
+ pubkey: PubKey;
94
+ }, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
95
+ startProcessPeriod: (fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
96
+ stopVotingPeriod: (fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
97
+ publishDeactivateMessage: ({ encPubKey, message, }: {
98
+ encPubKey: PubKey;
99
+ message: MessageData;
100
+ }, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
101
+ processDeactivateMessage: ({ groth16Proof, newDeactivateCommitment, newDeactivateRoot, size, }: {
102
+ groth16Proof: Groth16ProofType;
103
+ newDeactivateCommitment: Uint256;
104
+ newDeactivateRoot: Uint256;
105
+ size: Uint256;
106
+ }, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
107
+ addNewKey: ({ d, groth16Proof, nullifier, pubkey, }: {
108
+ d: Uint256[];
109
+ groth16Proof: Groth16ProofType;
110
+ nullifier: Uint256;
111
+ pubkey: PubKey;
112
+ }, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
113
+ publishMessage: ({ encPubKey, message, }: {
114
+ encPubKey: PubKey;
115
+ message: MessageData;
116
+ }, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
117
+ processMessage: ({ groth16Proof, newStateCommitment, }: {
118
+ groth16Proof: Groth16ProofType;
119
+ newStateCommitment: Uint256;
120
+ }, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
121
+ stopProcessingPeriod: (fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
122
+ processTally: ({ groth16Proof, newTallyCommitment, }: {
123
+ groth16Proof: Groth16ProofType;
124
+ newTallyCommitment: Uint256;
125
+ }, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
126
+ stopTallyingPeriod: ({ results, salt, }: {
127
+ results: Uint256[];
128
+ salt: Uint256;
129
+ }, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
130
+ grant: ({ maxAmount, }: {
131
+ maxAmount: Uint128;
132
+ }, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
133
+ revoke: (fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
134
+ bond: (fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
135
+ withdraw: ({ amount, }: {
136
+ amount?: Uint128;
137
+ }, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
138
+ }
139
+ export declare class MaciClient extends MaciQueryClient implements MaciInterface {
140
+ client: SigningCosmWasmClient;
141
+ sender: string;
142
+ contractAddress: string;
143
+ constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string);
144
+ setParams: ({ intStateTreeDepth, messageBatchSize, stateTreeDepth, voteOptionTreeDepth, }: {
145
+ intStateTreeDepth: Uint256;
146
+ messageBatchSize: Uint256;
147
+ stateTreeDepth: Uint256;
148
+ voteOptionTreeDepth: Uint256;
149
+ }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
150
+ setRoundInfo: ({ roundInfo, }: {
151
+ roundInfo: RoundInfo;
152
+ }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
153
+ setWhitelists: ({ whitelists, }: {
154
+ whitelists: Whitelist;
155
+ }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
156
+ setVoteOptionsMap: ({ voteOptionMap, }: {
157
+ voteOptionMap: string[];
158
+ }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
159
+ startVotingPeriod: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
160
+ signUp: ({ pubkey, }: {
161
+ pubkey: PubKey;
162
+ }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
163
+ startProcessPeriod: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
164
+ stopVotingPeriod: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
165
+ publishDeactivateMessage: ({ encPubKey, message, }: {
166
+ encPubKey: PubKey;
167
+ message: MessageData;
168
+ }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
169
+ processDeactivateMessage: ({ groth16Proof, newDeactivateCommitment, newDeactivateRoot, size, }: {
170
+ groth16Proof: Groth16ProofType;
171
+ newDeactivateCommitment: Uint256;
172
+ newDeactivateRoot: Uint256;
173
+ size: Uint256;
174
+ }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
175
+ addNewKey: ({ d, groth16Proof, nullifier, pubkey, }: {
176
+ d: Uint256[];
177
+ groth16Proof: Groth16ProofType;
178
+ nullifier: Uint256;
179
+ pubkey: PubKey;
180
+ }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
181
+ publishMessage: ({ encPubKey, message, }: {
182
+ encPubKey: PubKey;
183
+ message: MessageData;
184
+ }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
185
+ processMessage: ({ groth16Proof, newStateCommitment, }: {
186
+ groth16Proof: Groth16ProofType;
187
+ newStateCommitment: Uint256;
188
+ }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
189
+ stopProcessingPeriod: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
190
+ processTally: ({ groth16Proof, newTallyCommitment, }: {
191
+ groth16Proof: Groth16ProofType;
192
+ newTallyCommitment: Uint256;
193
+ }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
194
+ stopTallyingPeriod: ({ results, salt, }: {
195
+ results: Uint256[];
196
+ salt: Uint256;
197
+ }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
198
+ grant: ({ maxAmount, }: {
199
+ maxAmount: Uint128;
200
+ }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
201
+ revoke: (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
+ }
@@ -0,0 +1,217 @@
1
+ /**
2
+ * This file was automatically generated by @cosmwasm/ts-codegen@0.30.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
+ circuit_type: Uint256;
11
+ coordinator: PubKey;
12
+ groth16_add_key_vkey: Groth16VKeyType;
13
+ groth16_deactivate_vkey: Groth16VKeyType;
14
+ groth16_process_vkey: Groth16VKeyType;
15
+ groth16_tally_vkey: Groth16VKeyType;
16
+ max_vote_options: Uint256;
17
+ parameters: MaciParameters;
18
+ qtr_lib: QuinaryTreeRoot;
19
+ round_info: RoundInfo;
20
+ voice_credit_amount: Uint256;
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 QuinaryTreeRoot {
43
+ zeros: [
44
+ Uint256,
45
+ Uint256,
46
+ Uint256,
47
+ Uint256,
48
+ Uint256,
49
+ Uint256,
50
+ Uint256,
51
+ Uint256,
52
+ Uint256
53
+ ];
54
+ }
55
+ export interface RoundInfo {
56
+ description: string;
57
+ link: string;
58
+ title: string;
59
+ }
60
+ export interface VotingTime {
61
+ end_time?: Timestamp | null;
62
+ start_time?: Timestamp | null;
63
+ }
64
+ export interface Whitelist {
65
+ users: WhitelistConfig[];
66
+ }
67
+ export interface WhitelistConfig {
68
+ addr: string;
69
+ }
70
+ export type ExecuteMsg = {
71
+ set_params: {
72
+ int_state_tree_depth: Uint256;
73
+ message_batch_size: Uint256;
74
+ state_tree_depth: Uint256;
75
+ vote_option_tree_depth: Uint256;
76
+ };
77
+ } | {
78
+ set_round_info: {
79
+ round_info: RoundInfo;
80
+ };
81
+ } | {
82
+ set_whitelists: {
83
+ whitelists: Whitelist;
84
+ };
85
+ } | {
86
+ set_vote_options_map: {
87
+ vote_option_map: string[];
88
+ };
89
+ } | {
90
+ start_voting_period: {};
91
+ } | {
92
+ sign_up: {
93
+ pubkey: PubKey;
94
+ };
95
+ } | {
96
+ start_process_period: {};
97
+ } | {
98
+ stop_voting_period: {};
99
+ } | {
100
+ publish_deactivate_message: {
101
+ enc_pub_key: PubKey;
102
+ message: MessageData;
103
+ };
104
+ } | {
105
+ process_deactivate_message: {
106
+ groth16_proof: Groth16ProofType;
107
+ new_deactivate_commitment: Uint256;
108
+ new_deactivate_root: Uint256;
109
+ size: Uint256;
110
+ };
111
+ } | {
112
+ add_new_key: {
113
+ d: [Uint256, Uint256, Uint256, Uint256];
114
+ groth16_proof: Groth16ProofType;
115
+ nullifier: Uint256;
116
+ pubkey: PubKey;
117
+ };
118
+ } | {
119
+ publish_message: {
120
+ enc_pub_key: PubKey;
121
+ message: MessageData;
122
+ };
123
+ } | {
124
+ process_message: {
125
+ groth16_proof: Groth16ProofType;
126
+ new_state_commitment: Uint256;
127
+ };
128
+ } | {
129
+ stop_processing_period: {};
130
+ } | {
131
+ process_tally: {
132
+ groth16_proof: Groth16ProofType;
133
+ new_tally_commitment: Uint256;
134
+ };
135
+ } | {
136
+ stop_tallying_period: {
137
+ results: Uint256[];
138
+ salt: Uint256;
139
+ };
140
+ } | {
141
+ grant: {
142
+ max_amount: Uint128;
143
+ };
144
+ } | {
145
+ revoke: {};
146
+ } | {
147
+ bond: {};
148
+ } | {
149
+ withdraw: {
150
+ amount?: Uint128 | null;
151
+ };
152
+ };
153
+ export type Uint128 = string;
154
+ export interface MessageData {
155
+ data: [Uint256, Uint256, Uint256, Uint256, Uint256, Uint256, Uint256];
156
+ }
157
+ export interface Groth16ProofType {
158
+ a: string;
159
+ b: string;
160
+ c: string;
161
+ }
162
+ export type QueryMsg = {
163
+ get_round_info: {};
164
+ } | {
165
+ get_voting_time: {};
166
+ } | {
167
+ get_period: {};
168
+ } | {
169
+ get_num_sign_up: {};
170
+ } | {
171
+ get_msg_chain_length: {};
172
+ } | {
173
+ get_d_msg_chain_length: {};
174
+ } | {
175
+ get_processed_d_msg_count: {};
176
+ } | {
177
+ get_processed_msg_count: {};
178
+ } | {
179
+ get_processed_user_count: {};
180
+ } | {
181
+ get_result: {
182
+ index: Uint256;
183
+ };
184
+ } | {
185
+ get_all_result: {};
186
+ } | {
187
+ get_state_idx_inc: {
188
+ address: Addr;
189
+ };
190
+ } | {
191
+ get_voice_credit_balance: {
192
+ index: Uint256;
193
+ };
194
+ } | {
195
+ white_list: {};
196
+ } | {
197
+ is_white_list: {
198
+ sender: string;
199
+ };
200
+ } | {
201
+ vote_option_map: {};
202
+ } | {
203
+ max_vote_options: {};
204
+ } | {
205
+ query_total_fee_grant: {};
206
+ } | {
207
+ query_circuit_type: {};
208
+ } | {
209
+ query_cert_system: {};
210
+ };
211
+ export type Addr = string;
212
+ export type PeriodStatus = 'pending' | 'voting' | 'processing' | 'tallying' | 'ended';
213
+ export interface Period {
214
+ status: PeriodStatus;
215
+ }
216
+ export type Boolean = boolean;
217
+ 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
+ }