@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,263 @@
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 Addr = string;
8
+ export type Timestamp = Uint64;
9
+ export type Uint64 = string;
10
+ export type VotingPowerMode = 'slope' | 'threshold';
11
+ export interface InstantiateMsg {
12
+ certification_system: Uint256;
13
+ circuit_type: Uint256;
14
+ coordinator: PubKey;
15
+ feegrant_operator: Addr;
16
+ groth16_process_vkey?: Groth16VKeyType | null;
17
+ groth16_tally_vkey?: Groth16VKeyType | null;
18
+ max_vote_options: Uint256;
19
+ parameters: MaciParameters;
20
+ plonk_process_vkey?: PlonkVKeyType | null;
21
+ plonk_tally_vkey?: PlonkVKeyType | null;
22
+ qtr_lib: QuinaryTreeRoot;
23
+ round_info: RoundInfo;
24
+ voting_time?: VotingTime | null;
25
+ whitelist_backend_pubkey: string;
26
+ whitelist_ecosystem: string;
27
+ whitelist_snapshot_height: Uint256;
28
+ whitelist_voting_power_args: VotingPowerArgs;
29
+ }
30
+ export interface PubKey {
31
+ x: Uint256;
32
+ y: Uint256;
33
+ }
34
+ export interface Groth16VKeyType {
35
+ vk_alpha1: string;
36
+ vk_beta_2: string;
37
+ vk_delta_2: string;
38
+ vk_gamma_2: string;
39
+ vk_ic0: string;
40
+ vk_ic1: string;
41
+ }
42
+ export interface MaciParameters {
43
+ int_state_tree_depth: Uint256;
44
+ message_batch_size: Uint256;
45
+ state_tree_depth: Uint256;
46
+ vote_option_tree_depth: Uint256;
47
+ }
48
+ export interface PlonkVKeyType {
49
+ g2_elements: string[];
50
+ n: number;
51
+ next_step_selector_commitments: string[];
52
+ non_residues: string[];
53
+ num_inputs: number;
54
+ permutation_commitments: string[];
55
+ selector_commitments: string[];
56
+ }
57
+ export interface QuinaryTreeRoot {
58
+ zeros: [
59
+ Uint256,
60
+ Uint256,
61
+ Uint256,
62
+ Uint256,
63
+ Uint256,
64
+ Uint256,
65
+ Uint256,
66
+ Uint256,
67
+ Uint256
68
+ ];
69
+ }
70
+ export interface RoundInfo {
71
+ description: string;
72
+ link: string;
73
+ title: string;
74
+ }
75
+ export interface VotingTime {
76
+ end_time?: Timestamp | null;
77
+ start_time?: Timestamp | null;
78
+ }
79
+ export interface VotingPowerArgs {
80
+ mode: VotingPowerMode;
81
+ slope: Uint256;
82
+ threshold: Uint256;
83
+ }
84
+ export type ExecuteMsg = {
85
+ set_params: {
86
+ int_state_tree_depth: Uint256;
87
+ message_batch_size: Uint256;
88
+ state_tree_depth: Uint256;
89
+ vote_option_tree_depth: Uint256;
90
+ };
91
+ } | {
92
+ set_round_info: {
93
+ round_info: RoundInfo;
94
+ };
95
+ } | {
96
+ set_vote_options_map: {
97
+ vote_option_map: string[];
98
+ };
99
+ } | {
100
+ start_voting_period: {};
101
+ } | {
102
+ sign_up: {
103
+ amount: Uint256;
104
+ certificate: string;
105
+ pubkey: PubKey;
106
+ };
107
+ } | {
108
+ start_process_period: {};
109
+ } | {
110
+ stop_voting_period: {};
111
+ } | {
112
+ publish_message: {
113
+ enc_pub_key: PubKey;
114
+ message: MessageData;
115
+ };
116
+ } | {
117
+ process_message: {
118
+ groth16_proof?: Groth16ProofType | null;
119
+ new_state_commitment: Uint256;
120
+ plonk_proof?: PlonkProofType | null;
121
+ };
122
+ } | {
123
+ stop_processing_period: {};
124
+ } | {
125
+ process_tally: {
126
+ groth16_proof?: Groth16ProofType | null;
127
+ new_tally_commitment: Uint256;
128
+ plonk_proof?: PlonkProofType | null;
129
+ };
130
+ } | {
131
+ stop_tallying_period: {
132
+ results: Uint256[];
133
+ salt: Uint256;
134
+ };
135
+ } | {
136
+ grant: {
137
+ base_amount: Uint128;
138
+ grantee: Addr;
139
+ };
140
+ } | {
141
+ revoke: {
142
+ grantee: Addr;
143
+ };
144
+ } | {
145
+ bond: {};
146
+ } | {
147
+ withdraw: {
148
+ amount?: Uint128 | null;
149
+ };
150
+ };
151
+ export type Uint128 = string;
152
+ export interface MessageData {
153
+ data: [Uint256, Uint256, Uint256, Uint256, Uint256, Uint256, Uint256];
154
+ }
155
+ export interface Groth16ProofType {
156
+ a: string;
157
+ b: string;
158
+ c: string;
159
+ }
160
+ export interface PlonkProofType {
161
+ grand_product_at_z_omega: string;
162
+ grand_product_commitment: string;
163
+ input_values: string[];
164
+ linearization_polynomial_at_z: string;
165
+ n: number;
166
+ num_inputs: number;
167
+ opening_at_z_omega_proof: string;
168
+ opening_at_z_proof: string;
169
+ permutation_polynomials_at_z: string[];
170
+ quotient_poly_commitments: string[];
171
+ quotient_polynomial_at_z: string;
172
+ wire_commitments: string[];
173
+ wire_values_at_z: string[];
174
+ wire_values_at_z_omega: string[];
175
+ }
176
+ export type QueryMsg = {
177
+ get_round_info: {};
178
+ } | {
179
+ get_voting_time: {};
180
+ } | {
181
+ get_period: {};
182
+ } | {
183
+ get_num_sign_up: {};
184
+ } | {
185
+ get_msg_chain_length: {};
186
+ } | {
187
+ get_processed_msg_count: {};
188
+ } | {
189
+ get_processed_user_count: {};
190
+ } | {
191
+ get_result: {
192
+ index: Uint256;
193
+ };
194
+ } | {
195
+ get_all_result: {};
196
+ } | {
197
+ get_state_idx_inc: {
198
+ address: Addr;
199
+ };
200
+ } | {
201
+ get_voice_credit_balance: {
202
+ index: Uint256;
203
+ };
204
+ } | {
205
+ is_white_list: {
206
+ amount: Uint256;
207
+ certificate: string;
208
+ sender: string;
209
+ };
210
+ } | {
211
+ white_balance_of: {
212
+ amount: Uint256;
213
+ certificate: string;
214
+ sender: string;
215
+ };
216
+ } | {
217
+ white_info: {
218
+ sender: string;
219
+ };
220
+ } | {
221
+ grant_info: {
222
+ grantee: string;
223
+ };
224
+ } | {
225
+ max_whitelist_num: {};
226
+ } | {
227
+ vote_option_map: {};
228
+ } | {
229
+ max_vote_options: {};
230
+ } | {
231
+ query_total_fee_grant: {};
232
+ } | {
233
+ query_circuit_type: {};
234
+ } | {
235
+ query_cert_system: {};
236
+ } | {
237
+ query_oracle_whitelist_config: {};
238
+ };
239
+ export type PeriodStatus = 'pending' | 'voting' | 'processing' | 'tallying' | 'ended';
240
+ export interface Period {
241
+ status: PeriodStatus;
242
+ }
243
+ export interface GrantConfig {
244
+ fee_amount: Uint128;
245
+ fee_grant: boolean;
246
+ }
247
+ export type Boolean = boolean;
248
+ export type Binary = string;
249
+ export interface OracleWhitelistConfig {
250
+ backend_pubkey: Binary;
251
+ ecosystem: string;
252
+ slope: Uint256;
253
+ snapshot_height: Uint256;
254
+ threshold: Uint256;
255
+ voting_power_mode: VotingPowerMode;
256
+ }
257
+ export type ArrayOfString = string[];
258
+ export interface WhitelistConfig {
259
+ balance: Uint256;
260
+ fee_amount: Uint128;
261
+ fee_grant: boolean;
262
+ is_register: boolean;
263
+ }
@@ -0,0 +1,128 @@
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 { Addr, Uint256, PubKey, RoundInfo, VotingTime, Whitelist, ValidatorSet, AdminResponse, String, Boolean } from './Registry.types';
9
+ export interface RegistryReadOnlyInterface {
10
+ contractAddress: string;
11
+ admin: () => Promise<AdminResponse>;
12
+ operator: () => Promise<Addr>;
13
+ isMaciOperator: ({ address }: {
14
+ address: Addr;
15
+ }) => Promise<Boolean>;
16
+ isValidator: ({ address }: {
17
+ address: Addr;
18
+ }) => Promise<Boolean>;
19
+ getValidators: () => Promise<ValidatorSet>;
20
+ getValidatorOperator: ({ address }: {
21
+ address: Addr;
22
+ }) => Promise<Addr>;
23
+ getMaciOperatorPubkey: ({ address }: {
24
+ address: Addr;
25
+ }) => Promise<PubKey>;
26
+ getMaciOperatorIdentity: ({ address }: {
27
+ address: Addr;
28
+ }) => Promise<String>;
29
+ }
30
+ export declare class RegistryQueryClient implements RegistryReadOnlyInterface {
31
+ client: CosmWasmClient;
32
+ contractAddress: string;
33
+ constructor(client: CosmWasmClient, contractAddress: string);
34
+ admin: () => Promise<AdminResponse>;
35
+ operator: () => Promise<Addr>;
36
+ isMaciOperator: ({ address }: {
37
+ address: Addr;
38
+ }) => Promise<Boolean>;
39
+ isValidator: ({ address }: {
40
+ address: Addr;
41
+ }) => Promise<Boolean>;
42
+ getValidators: () => Promise<ValidatorSet>;
43
+ getValidatorOperator: ({ address, }: {
44
+ address: Addr;
45
+ }) => Promise<Addr>;
46
+ getMaciOperatorPubkey: ({ address, }: {
47
+ address: Addr;
48
+ }) => Promise<PubKey>;
49
+ getMaciOperatorIdentity: ({ address, }: {
50
+ address: Addr;
51
+ }) => Promise<String>;
52
+ }
53
+ export interface RegistryInterface extends RegistryReadOnlyInterface {
54
+ contractAddress: string;
55
+ sender: string;
56
+ setMaciOperator: ({ operator, }: {
57
+ operator: Addr;
58
+ }, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
59
+ setMaciOperatorPubkey: ({ pubkey, }: {
60
+ pubkey: PubKey;
61
+ }, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
62
+ setMaciOperatorIdentity: ({ identity, }: {
63
+ identity: string;
64
+ }, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
65
+ createRound: ({ certificationSystem, circuitType, maxOption, maxVoter, operator, preDeactivateRoot, roundInfo, voiceCreditAmount, votingTime, whitelist, }: {
66
+ certificationSystem: Uint256;
67
+ circuitType: Uint256;
68
+ maxOption: Uint256;
69
+ maxVoter: Uint256;
70
+ operator: Addr;
71
+ preDeactivateRoot: Uint256;
72
+ roundInfo: RoundInfo;
73
+ voiceCreditAmount: Uint256;
74
+ votingTime: VotingTime;
75
+ whitelist?: Whitelist;
76
+ }, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
77
+ setValidators: ({ addresses, }: {
78
+ addresses: ValidatorSet;
79
+ }, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
80
+ removeValidator: ({ address, }: {
81
+ address: Addr;
82
+ }, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
83
+ updateAmaciCodeId: ({ amaciCodeId, }: {
84
+ amaciCodeId: number;
85
+ }, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
86
+ changeOperator: ({ address, }: {
87
+ address: Addr;
88
+ }, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
89
+ }
90
+ export declare class RegistryClient extends RegistryQueryClient implements RegistryInterface {
91
+ client: SigningCosmWasmClient;
92
+ sender: string;
93
+ contractAddress: string;
94
+ constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string);
95
+ setMaciOperator: ({ operator, }: {
96
+ operator: Addr;
97
+ }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
98
+ setMaciOperatorPubkey: ({ pubkey, }: {
99
+ pubkey: PubKey;
100
+ }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
101
+ setMaciOperatorIdentity: ({ identity, }: {
102
+ identity: string;
103
+ }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
104
+ createRound: ({ certificationSystem, circuitType, maxOption, maxVoter, operator, preDeactivateRoot, roundInfo, voiceCreditAmount, votingTime, whitelist, }: {
105
+ certificationSystem: Uint256;
106
+ circuitType: Uint256;
107
+ maxOption: Uint256;
108
+ maxVoter: Uint256;
109
+ operator: Addr;
110
+ preDeactivateRoot: Uint256;
111
+ roundInfo: RoundInfo;
112
+ voiceCreditAmount: Uint256;
113
+ votingTime: VotingTime;
114
+ whitelist?: Whitelist;
115
+ }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
116
+ setValidators: ({ addresses, }: {
117
+ addresses: ValidatorSet;
118
+ }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
119
+ removeValidator: ({ address, }: {
120
+ address: Addr;
121
+ }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
122
+ updateAmaciCodeId: ({ amaciCodeId, }: {
123
+ amaciCodeId: number;
124
+ }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
125
+ changeOperator: ({ address, }: {
126
+ address: Addr;
127
+ }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
128
+ }
@@ -0,0 +1,110 @@
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 Addr = string;
7
+ export interface InstantiateMsg {
8
+ admin: Addr;
9
+ amaci_code_id: number;
10
+ operator: Addr;
11
+ }
12
+ export type ExecuteMsg = {
13
+ set_maci_operator: {
14
+ operator: Addr;
15
+ };
16
+ } | {
17
+ set_maci_operator_pubkey: {
18
+ pubkey: PubKey;
19
+ };
20
+ } | {
21
+ set_maci_operator_identity: {
22
+ identity: string;
23
+ };
24
+ } | {
25
+ create_round: {
26
+ certification_system: Uint256;
27
+ circuit_type: Uint256;
28
+ max_option: Uint256;
29
+ max_voter: Uint256;
30
+ operator: Addr;
31
+ pre_deactivate_root: Uint256;
32
+ round_info: RoundInfo;
33
+ voice_credit_amount: Uint256;
34
+ voting_time: VotingTime;
35
+ whitelist?: Whitelist | null;
36
+ };
37
+ } | {
38
+ set_validators: {
39
+ addresses: ValidatorSet;
40
+ };
41
+ } | {
42
+ remove_validator: {
43
+ address: Addr;
44
+ };
45
+ } | {
46
+ update_amaci_code_id: {
47
+ amaci_code_id: number;
48
+ };
49
+ } | {
50
+ change_operator: {
51
+ address: Addr;
52
+ };
53
+ };
54
+ export type Uint256 = string;
55
+ export type Timestamp = Uint64;
56
+ export type Uint64 = string;
57
+ export interface PubKey {
58
+ x: Uint256;
59
+ y: Uint256;
60
+ }
61
+ export interface RoundInfo {
62
+ description: string;
63
+ link: string;
64
+ title: string;
65
+ }
66
+ export interface VotingTime {
67
+ end_time: Timestamp;
68
+ start_time: Timestamp;
69
+ }
70
+ export interface Whitelist {
71
+ users: WhitelistConfig[];
72
+ }
73
+ export interface WhitelistConfig {
74
+ addr: Addr;
75
+ }
76
+ export interface ValidatorSet {
77
+ addresses: Addr[];
78
+ }
79
+ export type QueryMsg = {
80
+ admin: {};
81
+ } | {
82
+ operator: {};
83
+ } | {
84
+ is_maci_operator: {
85
+ address: Addr;
86
+ };
87
+ } | {
88
+ is_validator: {
89
+ address: Addr;
90
+ };
91
+ } | {
92
+ get_validators: {};
93
+ } | {
94
+ get_validator_operator: {
95
+ address: Addr;
96
+ };
97
+ } | {
98
+ get_maci_operator_pubkey: {
99
+ address: Addr;
100
+ };
101
+ } | {
102
+ get_maci_operator_identity: {
103
+ address: Addr;
104
+ };
105
+ };
106
+ export interface AdminResponse {
107
+ admin: Addr;
108
+ }
109
+ export type String = string;
110
+ export type Boolean = boolean;
@@ -0,0 +1,39 @@
1
+ import { Whitelist as RegistryWhitelist } from './ts/Registry.types';
2
+ import { Whitelist as MaciWhitelist } from './ts/Maci.types';
3
+ import { OfflineSigner } from '@cosmjs/proto-signing';
4
+ import { MaciCircuitType, MaciCertSystemType, CertificateEcosystem } from '../../types';
5
+ export type CreateRoundParams = {
6
+ signer?: OfflineSigner;
7
+ title: string;
8
+ description?: string;
9
+ link?: string;
10
+ startVoting: Date;
11
+ endVoting: Date;
12
+ circuitType: MaciCircuitType;
13
+ };
14
+ export type CreateAMaciRoundParams = {
15
+ maxVoter: number;
16
+ maxOption: number;
17
+ operator: string;
18
+ whitelist: RegistryWhitelist;
19
+ voiceCreditAmount: string;
20
+ preDeactivateRoot?: string;
21
+ } & CreateRoundParams;
22
+ export type CreateMaciRoundParams = {
23
+ maxVoter: number;
24
+ maxOption: number;
25
+ operatorPubkey: bigint | string;
26
+ whitelist: MaciWhitelist;
27
+ certSystemType: MaciCertSystemType;
28
+ } & CreateRoundParams;
29
+ export type CreateOracleMaciRoundParams = {
30
+ voteOptionMap: string[];
31
+ operatorPubkey: bigint | string;
32
+ whitelistEcosystem: CertificateEcosystem;
33
+ whitelistSnapshotHeight: string;
34
+ whitelistVotingPowerArgs: {
35
+ mode: 'slope' | 'threshold';
36
+ slope: string;
37
+ threshold: string;
38
+ };
39
+ } & CreateRoundParams;
@@ -0,0 +1,63 @@
1
+ import { MaciCertSystemType, MaciCircuitType, MaciRoundType } from '../../types';
2
+ type MixedData<T> = T | Array<MixedData<T>> | {
3
+ [key: string]: MixedData<T>;
4
+ };
5
+ export declare const stringizing: (o: MixedData<bigint>, path?: MixedData<bigint>[]) => MixedData<string>;
6
+ export declare function getCircuitType(circuitType: MaciCircuitType): string;
7
+ export declare function getContractParams(type: MaciRoundType, circuitType: MaciCircuitType, proofSystem: MaciCertSystemType, maxVoter: number, maxOption: number): {
8
+ parameters: {
9
+ state_tree_depth: string;
10
+ int_state_tree_depth: string;
11
+ vote_option_tree_depth: string;
12
+ message_batch_size: string;
13
+ };
14
+ groth16ProcessVkey: {
15
+ vk_alpha1: string;
16
+ vk_beta_2: string;
17
+ vk_gamma_2: string;
18
+ vk_delta_2: string;
19
+ vk_ic0: string;
20
+ vk_ic1: string;
21
+ } | null | undefined;
22
+ groth16TallyVkey: {
23
+ vk_alpha1: string;
24
+ vk_beta_2: string;
25
+ vk_gamma_2: string;
26
+ vk_delta_2: string;
27
+ vk_ic0: string;
28
+ vk_ic1: string;
29
+ } | null | undefined;
30
+ plonkProcessVkey: {
31
+ n: number;
32
+ num_inputs: number;
33
+ selector_commitments: string[];
34
+ next_step_selector_commitments: string[];
35
+ permutation_commitments: string[];
36
+ non_residues: string[];
37
+ g2_elements: string[];
38
+ } | null | undefined;
39
+ plonkTallyVkey: {
40
+ n: number;
41
+ num_inputs: number;
42
+ selector_commitments: string[];
43
+ next_step_selector_commitments: string[];
44
+ permutation_commitments: string[];
45
+ non_residues: string[];
46
+ g2_elements: string[];
47
+ } | null | undefined;
48
+ maciVoteType: string;
49
+ maciCertSystem: string;
50
+ } | {
51
+ parameters?: undefined;
52
+ groth16ProcessVkey?: undefined;
53
+ groth16TallyVkey?: undefined;
54
+ plonkProcessVkey?: undefined;
55
+ plonkTallyVkey?: undefined;
56
+ maciVoteType?: undefined;
57
+ maciCertSystem?: undefined;
58
+ };
59
+ export declare function getAMaciRoundCircuitFee(maxVoter: number, maxOption: number): {
60
+ denom: string;
61
+ amount: string;
62
+ };
63
+ export {};
@@ -0,0 +1,63 @@
1
+ type Groth16VkeyType = {
2
+ vk_alpha1: string;
3
+ vk_beta_2: string;
4
+ vk_gamma_2: string;
5
+ vk_delta_2: string;
6
+ vk_ic0: string;
7
+ vk_ic1: string;
8
+ };
9
+ type CircuitInfoType = {
10
+ [key: string]: {
11
+ parameter: {
12
+ state_tree_depth: string;
13
+ int_state_tree_depth: string;
14
+ vote_option_tree_depth: string;
15
+ message_batch_size: string;
16
+ };
17
+ groth16: {
18
+ process_vkey?: Groth16VkeyType;
19
+ tally_vkey?: Groth16VkeyType;
20
+ process_1p1v_vkey?: Groth16VkeyType;
21
+ tally_1p1v_vkey?: Groth16VkeyType;
22
+ process_qv_vkey?: Groth16VkeyType;
23
+ tally_qv_vkey?: Groth16VkeyType;
24
+ };
25
+ plonk?: {
26
+ process_vkey: {
27
+ n: number;
28
+ num_inputs: number;
29
+ selector_commitments: string[];
30
+ next_step_selector_commitments: string[];
31
+ permutation_commitments: string[];
32
+ non_residues: string[];
33
+ g2_elements: string[];
34
+ };
35
+ tally_vkey: {
36
+ n: number;
37
+ num_inputs: number;
38
+ selector_commitments: string[];
39
+ next_step_selector_commitments: string[];
40
+ permutation_commitments: string[];
41
+ non_residues: string[];
42
+ g2_elements: string[];
43
+ };
44
+ };
45
+ };
46
+ };
47
+ export declare const CIRCUIT_INFO: CircuitInfoType;
48
+ export declare const MACI_TYPE: {
49
+ 'maci-1p1v': string;
50
+ 'maci-qv': string;
51
+ };
52
+ export declare const AMACI_TYPE: {
53
+ 'amaci-1p1v': string;
54
+ 'amaci-qv': string;
55
+ };
56
+ export declare const PROOF_SYSTEM: {
57
+ groth16: string;
58
+ plonk: string;
59
+ };
60
+ export declare const QTR_LIB: {
61
+ zeros: string[];
62
+ };
63
+ export {};