@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,117 @@
1
+ import type { CircuitType } from '../types';
2
+ export declare const circuits: Record<string, CircuitType>;
3
+ export declare const validator_operator_set: {
4
+ doravaloper12yk434ut3un4wx0rult2aww89rsrel8nhmp387: {
5
+ operator_address: string;
6
+ account_address: string;
7
+ allocation: string;
8
+ allocation_dora: number;
9
+ moniker: string;
10
+ program_voting_power: number;
11
+ tokens: string;
12
+ };
13
+ doravaloper15frh0nn3v4yp3vv6sk4pn6jg9l8rt82f7uqfk5: {
14
+ operator_address: string;
15
+ account_address: string;
16
+ allocation: string;
17
+ allocation_dora: number;
18
+ moniker: string;
19
+ program_voting_power: number;
20
+ tokens: string;
21
+ };
22
+ doravaloper1ddewp74vd2w8jhth2p0uazmc8ajgtcuf3ntqgn: {
23
+ operator_address: string;
24
+ account_address: string;
25
+ allocation: string;
26
+ allocation_dora: number;
27
+ moniker: string;
28
+ program_voting_power: number;
29
+ tokens: string;
30
+ };
31
+ doravaloper1gh8j89jtc2vx6d3y4ehllcdlvluwa49w6xmjsm: {
32
+ operator_address: string;
33
+ account_address: string;
34
+ allocation: string;
35
+ allocation_dora: number;
36
+ moniker: string;
37
+ program_voting_power: number;
38
+ tokens: string;
39
+ };
40
+ doravaloper1j8ru7p8zctup6grfwuga6ndrjj7v88wzn407x7: {
41
+ operator_address: string;
42
+ account_address: string;
43
+ allocation: string;
44
+ allocation_dora: number;
45
+ moniker: string;
46
+ program_voting_power: number;
47
+ tokens: string;
48
+ };
49
+ doravaloper1l5zz0kkjt2n7nllsrymy96mc2v2gehda0zc85s: {
50
+ operator_address: string;
51
+ account_address: string;
52
+ allocation: string;
53
+ allocation_dora: number;
54
+ moniker: string;
55
+ program_voting_power: number;
56
+ tokens: string;
57
+ };
58
+ doravaloper1m9v3txhhtadjxpv09gwjhhs344qsxgfscwxjkg: {
59
+ operator_address: string;
60
+ account_address: string;
61
+ allocation: string;
62
+ allocation_dora: number;
63
+ moniker: string;
64
+ program_voting_power: number;
65
+ tokens: string;
66
+ };
67
+ doravaloper1tu8006g60t62zwgwf5knkaujv0uzhp2a6wh94h: {
68
+ operator_address: string;
69
+ account_address: string;
70
+ allocation: string;
71
+ allocation_dora: number;
72
+ moniker: string;
73
+ program_voting_power: number;
74
+ tokens: string;
75
+ };
76
+ doravaloper1x5z0tkafrgyeuqkrwfjr933vghjxchqnqlhcdw: {
77
+ operator_address: string;
78
+ account_address: string;
79
+ allocation: string;
80
+ allocation_dora: number;
81
+ moniker: string;
82
+ program_voting_power: number;
83
+ tokens: string;
84
+ };
85
+ doravaloper1z6kfew2nhuh02szc2hdecw4fqey2d32auucvux: {
86
+ operator_address: string;
87
+ account_address: string;
88
+ allocation: string;
89
+ allocation_dora: number;
90
+ moniker: string;
91
+ program_voting_power: number;
92
+ tokens: string;
93
+ };
94
+ doravaloper1zzne8ufazycklx4j6mgc987t8ykd6wxu63223v: {
95
+ operator_address: string;
96
+ account_address: string;
97
+ allocation: string;
98
+ allocation_dora: number;
99
+ moniker: string;
100
+ program_voting_power: number;
101
+ tokens: string;
102
+ };
103
+ };
104
+ export interface NetworkConfig {
105
+ network: string;
106
+ chainId: string;
107
+ rpcEndpoint: string;
108
+ restEndpoint: string;
109
+ apiEndpoint: string;
110
+ certificateApiEndpoint: string;
111
+ registryAddress: string;
112
+ maciCodeId: number;
113
+ oracleCodeId: number;
114
+ oracleWhitelistBackendPubkey: string;
115
+ oracleFeegrantOperator: string;
116
+ }
117
+ export declare function getDefaultParams(network?: 'mainnet' | 'testnet'): NetworkConfig;
@@ -0,0 +1,29 @@
1
+ import { OfflineSigner } from '@cosmjs/proto-signing';
2
+ import { SigningStargateClient } from '@cosmjs/stargate';
3
+ import { SigningCosmWasmClient } from '@cosmjs/cosmwasm-stargate';
4
+ import { MaciClient } from './ts/Maci.client';
5
+ import { AMaciClient } from './ts/AMaci.client';
6
+ import { RegistryClient } from './ts/Registry.client';
7
+ import { OracleMaciClient } from './ts/OracleMaci.client';
8
+ export declare function createMaciClientBy({ rpcEndpoint, wallet, contractAddress, }: {
9
+ rpcEndpoint: string;
10
+ wallet: OfflineSigner;
11
+ contractAddress: string;
12
+ }): Promise<MaciClient>;
13
+ export declare function createAMaciClientBy({ rpcEndpoint, wallet, contractAddress, }: {
14
+ rpcEndpoint: string;
15
+ wallet: OfflineSigner;
16
+ contractAddress: string;
17
+ }): Promise<AMaciClient>;
18
+ export declare function createRegistryClientBy({ rpcEndpoint, wallet, contractAddress, }: {
19
+ rpcEndpoint: string;
20
+ wallet: OfflineSigner;
21
+ contractAddress: string;
22
+ }): Promise<RegistryClient>;
23
+ export declare function createOracleMaciClientBy({ rpcEndpoint, wallet, contractAddress, }: {
24
+ rpcEndpoint: string;
25
+ wallet: OfflineSigner;
26
+ contractAddress: string;
27
+ }): Promise<OracleMaciClient>;
28
+ export declare function createContractClientByWallet(rpcEndpoint: string, wallet: OfflineSigner): Promise<SigningCosmWasmClient>;
29
+ export declare function getSignerClientByWallet(rpcEndpoint: string, wallet: OfflineSigner): Promise<SigningStargateClient>;
@@ -0,0 +1,37 @@
1
+ import { OfflineSigner } from '@cosmjs/proto-signing';
2
+ import { MaciClient } from './ts/Maci.client';
3
+ import { AMaciClient } from './ts/AMaci.client';
4
+ import { RegistryClient } from './ts/Registry.client';
5
+ import { ContractParams } from '../../types';
6
+ import { CreateAMaciRoundParams, CreateMaciRoundParams, CreateOracleMaciRoundParams } from './types';
7
+ export declare const prefix = "dora";
8
+ export declare class Contract {
9
+ rpcEndpoint: string;
10
+ registryAddress: string;
11
+ maciCodeId: number;
12
+ oracleCodeId: number;
13
+ constructor({ rpcEndpoint, registryAddress, maciCodeId, oracleCodeId, }: ContractParams);
14
+ createAMaciRound({ signer, startVoting, endVoting, operator, whitelist, title, description, link, maxVoter, maxOption, voiceCreditAmount, circuitType, preDeactivateRoot, }: CreateAMaciRoundParams): Promise<string>;
15
+ createMaciRound({ signer, operatorPubkey, startVoting, endVoting, whitelist, title, description, link, maxVoter, maxOption, circuitType, certSystemType, }: CreateMaciRoundParams): Promise<import("@cosmjs/cosmwasm-stargate").InstantiateResult>;
16
+ createOracleMaciRound({ signer, operatorPubkey, startVoting, endVoting, title, description, link, maxVoter, maxOption, circuitType, whitelistBackendPubkey, whitelistEcosystem, whitelistSnapshotHeight, whitelistVotingPowerArgs, feegrantOperator, }: CreateOracleMaciRoundParams): Promise<import("@cosmjs/cosmwasm-stargate").InstantiateResult>;
17
+ queryRoundInfo({ signer, roundAddress, }: {
18
+ signer: OfflineSigner;
19
+ roundAddress: string;
20
+ }): Promise<import("./ts/Maci.types").RoundInfo>;
21
+ oracleMaciClient({ signer, contractAddress, }: {
22
+ signer: OfflineSigner;
23
+ contractAddress: string;
24
+ }): Promise<import("./ts/OracleMaci.client").OracleMaciClient>;
25
+ registryClient({ signer, contractAddress, }: {
26
+ signer: OfflineSigner;
27
+ contractAddress: string;
28
+ }): Promise<RegistryClient>;
29
+ maciClient({ signer, contractAddress, }: {
30
+ signer: OfflineSigner;
31
+ contractAddress: string;
32
+ }): Promise<MaciClient>;
33
+ amaciClient({ signer, contractAddress, }: {
34
+ signer: OfflineSigner;
35
+ contractAddress: string;
36
+ }): Promise<AMaciClient>;
37
+ }
@@ -0,0 +1 @@
1
+ export { Contract } from './contract';
@@ -0,0 +1,216 @@
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, Uint128, MessageData, Groth16ProofType, Period, Boolean, ArrayOfString } from './AMaci.types';
9
+ export interface AMaciReadOnlyInterface {
10
+ contractAddress: string;
11
+ admin: () => Promise<Addr>;
12
+ operator: () => Promise<Addr>;
13
+ getRoundInfo: () => Promise<RoundInfo>;
14
+ getVotingTime: () => Promise<VotingTime>;
15
+ getPeriod: () => Promise<Period>;
16
+ getNumSignUp: () => Promise<Uint256>;
17
+ getMsgChainLength: () => Promise<Uint256>;
18
+ getDMsgChainLength: () => Promise<Uint256>;
19
+ getProcessedDMsgCount: () => Promise<Uint256>;
20
+ getProcessedMsgCount: () => Promise<Uint256>;
21
+ getProcessedUserCount: () => Promise<Uint256>;
22
+ getResult: ({ index }: {
23
+ index: Uint256;
24
+ }) => Promise<Uint256>;
25
+ getAllResult: () => Promise<Uint256>;
26
+ getStateIdxInc: ({ address }: {
27
+ address: Addr;
28
+ }) => Promise<Uint256>;
29
+ getVoiceCreditBalance: ({ index }: {
30
+ index: Uint256;
31
+ }) => Promise<Uint256>;
32
+ getVoiceCreditAmount: () => Promise<Uint256>;
33
+ whiteList: () => Promise<Whitelist>;
34
+ isWhiteList: ({ sender }: {
35
+ sender: Addr;
36
+ }) => Promise<Boolean>;
37
+ signuped: ({ pubkeyX }: {
38
+ pubkeyX: Uint256;
39
+ }) => Promise<Uint256>;
40
+ voteOptionMap: () => Promise<ArrayOfString>;
41
+ maxVoteOptions: () => Promise<Uint256>;
42
+ queryTotalFeeGrant: () => Promise<Uint128>;
43
+ queryCircuitType: () => Promise<Uint256>;
44
+ queryCertSystem: () => Promise<Uint256>;
45
+ queryPreDeactivateRoot: () => Promise<Uint256>;
46
+ }
47
+ export declare class AMaciQueryClient implements AMaciReadOnlyInterface {
48
+ client: CosmWasmClient;
49
+ contractAddress: string;
50
+ constructor(client: CosmWasmClient, contractAddress: string);
51
+ admin: () => Promise<Addr>;
52
+ operator: () => Promise<Addr>;
53
+ getRoundInfo: () => Promise<RoundInfo>;
54
+ getVotingTime: () => Promise<VotingTime>;
55
+ getPeriod: () => Promise<Period>;
56
+ getNumSignUp: () => Promise<Uint256>;
57
+ getMsgChainLength: () => Promise<Uint256>;
58
+ getDMsgChainLength: () => Promise<Uint256>;
59
+ getProcessedDMsgCount: () => Promise<Uint256>;
60
+ getProcessedMsgCount: () => Promise<Uint256>;
61
+ getProcessedUserCount: () => Promise<Uint256>;
62
+ getResult: ({ index }: {
63
+ index: Uint256;
64
+ }) => Promise<Uint256>;
65
+ getAllResult: () => Promise<Uint256>;
66
+ getStateIdxInc: ({ address, }: {
67
+ address: Addr;
68
+ }) => Promise<Uint256>;
69
+ getVoiceCreditBalance: ({ index, }: {
70
+ index: Uint256;
71
+ }) => Promise<Uint256>;
72
+ getVoiceCreditAmount: () => Promise<Uint256>;
73
+ whiteList: () => Promise<Whitelist>;
74
+ isWhiteList: ({ sender }: {
75
+ sender: Addr;
76
+ }) => Promise<Boolean>;
77
+ signuped: ({ pubkeyX }: {
78
+ pubkeyX: Uint256;
79
+ }) => Promise<Uint256>;
80
+ voteOptionMap: () => Promise<ArrayOfString>;
81
+ maxVoteOptions: () => Promise<Uint256>;
82
+ queryTotalFeeGrant: () => Promise<Uint128>;
83
+ queryCircuitType: () => Promise<Uint256>;
84
+ queryCertSystem: () => Promise<Uint256>;
85
+ queryPreDeactivateRoot: () => Promise<Uint256>;
86
+ }
87
+ export interface AMaciInterface extends AMaciReadOnlyInterface {
88
+ contractAddress: string;
89
+ sender: string;
90
+ setRoundInfo: ({ roundInfo, }: {
91
+ roundInfo: RoundInfo;
92
+ }, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
93
+ setWhitelists: ({ whitelists, }: {
94
+ whitelists: Whitelist;
95
+ }, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
96
+ setVoteOptionsMap: ({ voteOptionMap, }: {
97
+ voteOptionMap: string[];
98
+ }, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
99
+ signUp: ({ pubkey, }: {
100
+ pubkey: PubKey;
101
+ }, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
102
+ startProcessPeriod: (fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
103
+ publishDeactivateMessage: ({ encPubKey, message, }: {
104
+ encPubKey: PubKey;
105
+ message: MessageData;
106
+ }, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
107
+ processDeactivateMessage: ({ groth16Proof, newDeactivateCommitment, newDeactivateRoot, size, }: {
108
+ groth16Proof: Groth16ProofType;
109
+ newDeactivateCommitment: Uint256;
110
+ newDeactivateRoot: Uint256;
111
+ size: Uint256;
112
+ }, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
113
+ addNewKey: ({ d, groth16Proof, nullifier, pubkey, }: {
114
+ d: Uint256[];
115
+ groth16Proof: Groth16ProofType;
116
+ nullifier: Uint256;
117
+ pubkey: PubKey;
118
+ }, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
119
+ preAddNewKey: ({ d, groth16Proof, nullifier, pubkey, }: {
120
+ d: Uint256[];
121
+ groth16Proof: Groth16ProofType;
122
+ nullifier: Uint256;
123
+ pubkey: PubKey;
124
+ }, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
125
+ publishMessage: ({ encPubKey, message, }: {
126
+ encPubKey: PubKey;
127
+ message: MessageData;
128
+ }, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
129
+ processMessage: ({ groth16Proof, newStateCommitment, }: {
130
+ groth16Proof: Groth16ProofType;
131
+ newStateCommitment: Uint256;
132
+ }, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
133
+ stopProcessingPeriod: (fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
134
+ processTally: ({ groth16Proof, newTallyCommitment, }: {
135
+ groth16Proof: Groth16ProofType;
136
+ newTallyCommitment: Uint256;
137
+ }, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
138
+ stopTallyingPeriod: ({ results, salt, }: {
139
+ results: Uint256[];
140
+ salt: Uint256;
141
+ }, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
142
+ grant: ({ maxAmount, }: {
143
+ maxAmount: Uint128;
144
+ }, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
145
+ revoke: (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 AMaciClient extends AMaciQueryClient implements AMaciInterface {
152
+ client: SigningCosmWasmClient;
153
+ sender: string;
154
+ contractAddress: string;
155
+ constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string);
156
+ setRoundInfo: ({ roundInfo, }: {
157
+ roundInfo: RoundInfo;
158
+ }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
159
+ setWhitelists: ({ whitelists, }: {
160
+ whitelists: Whitelist;
161
+ }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
162
+ setVoteOptionsMap: ({ voteOptionMap, }: {
163
+ voteOptionMap: string[];
164
+ }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
165
+ signUp: ({ pubkey, }: {
166
+ pubkey: PubKey;
167
+ }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
168
+ startProcessPeriod: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
169
+ publishDeactivateMessage: ({ encPubKey, message, }: {
170
+ encPubKey: PubKey;
171
+ message: MessageData;
172
+ }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
173
+ processDeactivateMessage: ({ groth16Proof, newDeactivateCommitment, newDeactivateRoot, size, }: {
174
+ groth16Proof: Groth16ProofType;
175
+ newDeactivateCommitment: Uint256;
176
+ newDeactivateRoot: Uint256;
177
+ size: Uint256;
178
+ }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
179
+ addNewKey: ({ d, groth16Proof, nullifier, pubkey, }: {
180
+ d: Uint256[];
181
+ groth16Proof: Groth16ProofType;
182
+ nullifier: Uint256;
183
+ pubkey: PubKey;
184
+ }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
185
+ preAddNewKey: ({ d, groth16Proof, nullifier, pubkey, }: {
186
+ d: Uint256[];
187
+ groth16Proof: Groth16ProofType;
188
+ nullifier: Uint256;
189
+ pubkey: PubKey;
190
+ }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
191
+ publishMessage: ({ encPubKey, message, }: {
192
+ encPubKey: PubKey;
193
+ message: MessageData;
194
+ }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
195
+ processMessage: ({ groth16Proof, newStateCommitment, }: {
196
+ groth16Proof: Groth16ProofType;
197
+ newStateCommitment: Uint256;
198
+ }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
199
+ stopProcessingPeriod: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
200
+ processTally: ({ groth16Proof, newTallyCommitment, }: {
201
+ groth16Proof: Groth16ProofType;
202
+ newTallyCommitment: Uint256;
203
+ }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
204
+ stopTallyingPeriod: ({ results, salt, }: {
205
+ results: Uint256[];
206
+ salt: Uint256;
207
+ }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
208
+ grant: ({ maxAmount, }: {
209
+ maxAmount: Uint128;
210
+ }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
211
+ revoke: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
212
+ bond: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
213
+ withdraw: ({ amount, }: {
214
+ amount?: Uint128;
215
+ }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
216
+ }
@@ -0,0 +1,203 @@
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 type Uint256 = string;
8
+ export type Timestamp = Uint64;
9
+ export type Uint64 = string;
10
+ export interface InstantiateMsg {
11
+ admin: Addr;
12
+ certification_system: Uint256;
13
+ circuit_type: Uint256;
14
+ coordinator: PubKey;
15
+ max_vote_options: Uint256;
16
+ operator: Addr;
17
+ parameters: MaciParameters;
18
+ pre_deactivate_root: Uint256;
19
+ round_info: RoundInfo;
20
+ voice_credit_amount: Uint256;
21
+ voting_time: VotingTime;
22
+ whitelist?: Whitelist | null;
23
+ }
24
+ export interface PubKey {
25
+ x: Uint256;
26
+ y: Uint256;
27
+ }
28
+ export interface MaciParameters {
29
+ int_state_tree_depth: Uint256;
30
+ message_batch_size: Uint256;
31
+ state_tree_depth: Uint256;
32
+ vote_option_tree_depth: Uint256;
33
+ }
34
+ export interface RoundInfo {
35
+ description: string;
36
+ link: string;
37
+ title: string;
38
+ }
39
+ export interface VotingTime {
40
+ end_time: Timestamp;
41
+ start_time: Timestamp;
42
+ }
43
+ export interface Whitelist {
44
+ users: WhitelistConfig[];
45
+ }
46
+ export interface WhitelistConfig {
47
+ addr: Addr;
48
+ }
49
+ export type ExecuteMsg = {
50
+ set_round_info: {
51
+ round_info: RoundInfo;
52
+ };
53
+ } | {
54
+ set_whitelists: {
55
+ whitelists: Whitelist;
56
+ };
57
+ } | {
58
+ set_vote_options_map: {
59
+ vote_option_map: string[];
60
+ };
61
+ } | {
62
+ sign_up: {
63
+ pubkey: PubKey;
64
+ };
65
+ } | {
66
+ start_process_period: {};
67
+ } | {
68
+ publish_deactivate_message: {
69
+ enc_pub_key: PubKey;
70
+ message: MessageData;
71
+ };
72
+ } | {
73
+ process_deactivate_message: {
74
+ groth16_proof: Groth16ProofType;
75
+ new_deactivate_commitment: Uint256;
76
+ new_deactivate_root: Uint256;
77
+ size: Uint256;
78
+ };
79
+ } | {
80
+ add_new_key: {
81
+ d: [Uint256, Uint256, Uint256, Uint256];
82
+ groth16_proof: Groth16ProofType;
83
+ nullifier: Uint256;
84
+ pubkey: PubKey;
85
+ };
86
+ } | {
87
+ pre_add_new_key: {
88
+ d: [Uint256, Uint256, Uint256, Uint256];
89
+ groth16_proof: Groth16ProofType;
90
+ nullifier: Uint256;
91
+ pubkey: PubKey;
92
+ };
93
+ } | {
94
+ publish_message: {
95
+ enc_pub_key: PubKey;
96
+ message: MessageData;
97
+ };
98
+ } | {
99
+ process_message: {
100
+ groth16_proof: Groth16ProofType;
101
+ new_state_commitment: Uint256;
102
+ };
103
+ } | {
104
+ stop_processing_period: {};
105
+ } | {
106
+ process_tally: {
107
+ groth16_proof: Groth16ProofType;
108
+ new_tally_commitment: Uint256;
109
+ };
110
+ } | {
111
+ stop_tallying_period: {
112
+ results: Uint256[];
113
+ salt: Uint256;
114
+ };
115
+ } | {
116
+ grant: {
117
+ max_amount: Uint128;
118
+ };
119
+ } | {
120
+ revoke: {};
121
+ } | {
122
+ bond: {};
123
+ } | {
124
+ withdraw: {
125
+ amount?: Uint128 | null;
126
+ };
127
+ };
128
+ export type Uint128 = string;
129
+ export interface MessageData {
130
+ data: [Uint256, Uint256, Uint256, Uint256, Uint256, Uint256, Uint256];
131
+ }
132
+ export interface Groth16ProofType {
133
+ a: string;
134
+ b: string;
135
+ c: string;
136
+ }
137
+ export type QueryMsg = {
138
+ admin: {};
139
+ } | {
140
+ operator: {};
141
+ } | {
142
+ get_round_info: {};
143
+ } | {
144
+ get_voting_time: {};
145
+ } | {
146
+ get_period: {};
147
+ } | {
148
+ get_num_sign_up: {};
149
+ } | {
150
+ get_msg_chain_length: {};
151
+ } | {
152
+ get_d_msg_chain_length: {};
153
+ } | {
154
+ get_processed_d_msg_count: {};
155
+ } | {
156
+ get_processed_msg_count: {};
157
+ } | {
158
+ get_processed_user_count: {};
159
+ } | {
160
+ get_result: {
161
+ index: Uint256;
162
+ };
163
+ } | {
164
+ get_all_result: {};
165
+ } | {
166
+ get_state_idx_inc: {
167
+ address: Addr;
168
+ };
169
+ } | {
170
+ get_voice_credit_balance: {
171
+ index: Uint256;
172
+ };
173
+ } | {
174
+ get_voice_credit_amount: {};
175
+ } | {
176
+ white_list: {};
177
+ } | {
178
+ is_white_list: {
179
+ sender: Addr;
180
+ };
181
+ } | {
182
+ signuped: {
183
+ pubkey_x: Uint256;
184
+ };
185
+ } | {
186
+ vote_option_map: {};
187
+ } | {
188
+ max_vote_options: {};
189
+ } | {
190
+ query_total_fee_grant: {};
191
+ } | {
192
+ query_circuit_type: {};
193
+ } | {
194
+ query_cert_system: {};
195
+ } | {
196
+ query_pre_deactivate_root: {};
197
+ };
198
+ export type PeriodStatus = 'pending' | 'voting' | 'processing' | 'tallying' | 'ended';
199
+ export interface Period {
200
+ status: PeriodStatus;
201
+ }
202
+ export type Boolean = boolean;
203
+ export type ArrayOfString = string[];