@dorafactory/maci-sdk 0.0.35 → 0.0.37

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 (85) hide show
  1. package/dist/index.d.ts +14 -2234
  2. package/dist/index.js +770 -348
  3. package/dist/index.js.map +1 -1
  4. package/dist/index.mjs +741 -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 +2 -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 +58 -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/index.ts +1 -0
  59. package/src/libs/contract/types.ts +3 -3
  60. package/src/libs/contract/utils.ts +0 -24
  61. package/src/libs/crypto/babyjub.ts +132 -0
  62. package/src/libs/crypto/bigintUtils.ts +31 -0
  63. package/src/libs/crypto/constants.ts +22 -0
  64. package/src/libs/crypto/hashing.ts +167 -0
  65. package/src/libs/crypto/index.ts +9 -0
  66. package/src/libs/{circom/circomlib.ts → crypto/keys.ts} +104 -114
  67. package/src/libs/crypto/sign.ts +91 -0
  68. package/src/libs/crypto/tree.ts +176 -0
  69. package/src/libs/crypto/types.ts +101 -0
  70. package/src/libs/index.ts +1 -1
  71. package/src/libs/maci/maci.ts +28 -29
  72. package/src/maci.ts +132 -67
  73. package/src/types/index.ts +7 -0
  74. package/src/utils/index.ts +22 -22
  75. package/dist/browser.d.mts +0 -2233
  76. package/dist/browser.d.ts +0 -2233
  77. package/dist/browser.js +0 -31620
  78. package/dist/browser.js.map +0 -1
  79. package/dist/browser.mjs +0 -31631
  80. package/dist/browser.mjs.map +0 -1
  81. package/dist/index.d.mts +0 -2234
  82. package/src/browser.ts +0 -17
  83. package/src/libs/circom/index.ts +0 -98
  84. package/src/libs/circom/types.ts +0 -8
  85. package/src/polyfills/browser-polyfills.ts +0 -9
@@ -0,0 +1,118 @@
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
+ oracleCodeIds: string[];
117
+ }
118
+ 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,57 @@
1
+ import { OfflineSigner } from '@cosmjs/proto-signing';
2
+ import { SigningCosmWasmClient } from '@cosmjs/cosmwasm-stargate';
3
+ import { MaciClient } from './ts/Maci.client';
4
+ import { AMaciClient } from './ts/AMaci.client';
5
+ import { RegistryClient } from './ts/Registry.client';
6
+ import { ContractParams } from '../../types';
7
+ import { CreateAMaciRoundParams, CreateMaciRoundParams, CreateOracleMaciRoundParams } from './types';
8
+ export declare const prefix = "dora";
9
+ export declare class Contract {
10
+ rpcEndpoint: string;
11
+ registryAddress: string;
12
+ maciCodeId: number;
13
+ oracleCodeId: number;
14
+ feegrantOperator: string;
15
+ whitelistBackendPubkey: string;
16
+ constructor({ rpcEndpoint, registryAddress, maciCodeId, oracleCodeId, feegrantOperator, whitelistBackendPubkey, }: ContractParams);
17
+ createAMaciRound({ signer, startVoting, endVoting, operator, whitelist, title, description, link, maxVoter, maxOption, voiceCreditAmount, circuitType, preDeactivateRoot, }: CreateAMaciRoundParams & {
18
+ signer: OfflineSigner;
19
+ }): Promise<{
20
+ contractAddress: string;
21
+ logs: readonly import("@cosmjs/stargate/build/logs").Log[];
22
+ height: number;
23
+ transactionHash: string;
24
+ events: readonly import("@cosmjs/stargate").Event[];
25
+ gasWanted: bigint;
26
+ gasUsed: bigint;
27
+ }>;
28
+ createMaciRound({ signer, operatorPubkey, startVoting, endVoting, whitelist, title, description, link, maxVoter, maxOption, circuitType, certSystemType, }: CreateMaciRoundParams & {
29
+ signer: OfflineSigner;
30
+ }): Promise<import("@cosmjs/cosmwasm-stargate").InstantiateResult>;
31
+ createOracleMaciRound({ signer, operatorPubkey, startVoting, endVoting, title, description, link, voteOptionMap, circuitType, whitelistEcosystem, whitelistSnapshotHeight, whitelistVotingPowerArgs, }: CreateOracleMaciRoundParams & {
32
+ signer: OfflineSigner;
33
+ }): Promise<import("@cosmjs/cosmwasm-stargate").InstantiateResult>;
34
+ queryRoundInfo({ signer, roundAddress, }: {
35
+ signer: OfflineSigner;
36
+ roundAddress: string;
37
+ }): Promise<import("./ts/Maci.types").RoundInfo>;
38
+ oracleMaciClient({ signer, contractAddress, }: {
39
+ signer: OfflineSigner;
40
+ contractAddress: string;
41
+ }): Promise<import("./ts/OracleMaci.client").OracleMaciClient>;
42
+ registryClient({ signer, contractAddress, }: {
43
+ signer: OfflineSigner;
44
+ contractAddress: string;
45
+ }): Promise<RegistryClient>;
46
+ maciClient({ signer, contractAddress, }: {
47
+ signer: OfflineSigner;
48
+ contractAddress: string;
49
+ }): Promise<MaciClient>;
50
+ amaciClient({ signer, contractAddress, }: {
51
+ signer: OfflineSigner;
52
+ contractAddress: string;
53
+ }): Promise<AMaciClient>;
54
+ contractClient({ signer }: {
55
+ signer: OfflineSigner;
56
+ }): Promise<SigningCosmWasmClient>;
57
+ }
@@ -0,0 +1,2 @@
1
+ export { Contract } from './contract';
2
+ export * from './utils';
@@ -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, WhitelistBase, MessageData, Groth16ProofType, Boolean, DelayRecords, Period, Uint128, ArrayOfString, Whitelist } 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
+ canSignUp: ({ sender }: {
35
+ sender: Addr;
36
+ }) => Promise<Boolean>;
37
+ isWhiteList: ({ sender }: {
38
+ sender: Addr;
39
+ }) => Promise<Boolean>;
40
+ isRegister: ({ sender }: {
41
+ sender: Addr;
42
+ }) => Promise<Boolean>;
43
+ signuped: ({ pubkeyX }: {
44
+ pubkeyX: Uint256;
45
+ }) => Promise<Uint256>;
46
+ voteOptionMap: () => Promise<ArrayOfString>;
47
+ maxVoteOptions: () => Promise<Uint256>;
48
+ queryTotalFeeGrant: () => Promise<Uint128>;
49
+ queryCircuitType: () => Promise<Uint256>;
50
+ queryCertSystem: () => Promise<Uint256>;
51
+ queryPreDeactivateRoot: () => Promise<Uint256>;
52
+ getDelayRecords: () => Promise<DelayRecords>;
53
+ }
54
+ export declare class AMaciQueryClient implements AMaciReadOnlyInterface {
55
+ client: CosmWasmClient;
56
+ contractAddress: string;
57
+ constructor(client: CosmWasmClient, contractAddress: string);
58
+ admin: () => Promise<Addr>;
59
+ operator: () => Promise<Addr>;
60
+ getRoundInfo: () => Promise<RoundInfo>;
61
+ getVotingTime: () => Promise<VotingTime>;
62
+ getPeriod: () => Promise<Period>;
63
+ getNumSignUp: () => Promise<Uint256>;
64
+ getMsgChainLength: () => Promise<Uint256>;
65
+ getDMsgChainLength: () => Promise<Uint256>;
66
+ getProcessedDMsgCount: () => Promise<Uint256>;
67
+ getProcessedMsgCount: () => Promise<Uint256>;
68
+ getProcessedUserCount: () => Promise<Uint256>;
69
+ getResult: ({ index }: {
70
+ index: Uint256;
71
+ }) => Promise<Uint256>;
72
+ getAllResult: () => Promise<Uint256>;
73
+ getStateIdxInc: ({ address }: {
74
+ address: Addr;
75
+ }) => Promise<Uint256>;
76
+ getVoiceCreditBalance: ({ index, }: {
77
+ index: Uint256;
78
+ }) => Promise<Uint256>;
79
+ getVoiceCreditAmount: () => Promise<Uint256>;
80
+ whiteList: () => Promise<Whitelist>;
81
+ canSignUp: ({ sender }: {
82
+ sender: Addr;
83
+ }) => Promise<Boolean>;
84
+ isWhiteList: ({ sender }: {
85
+ sender: Addr;
86
+ }) => Promise<Boolean>;
87
+ isRegister: ({ sender }: {
88
+ sender: Addr;
89
+ }) => Promise<Boolean>;
90
+ signuped: ({ pubkeyX }: {
91
+ pubkeyX: Uint256;
92
+ }) => Promise<Uint256>;
93
+ voteOptionMap: () => Promise<ArrayOfString>;
94
+ maxVoteOptions: () => Promise<Uint256>;
95
+ queryTotalFeeGrant: () => Promise<Uint128>;
96
+ queryCircuitType: () => Promise<Uint256>;
97
+ queryCertSystem: () => Promise<Uint256>;
98
+ queryPreDeactivateRoot: () => Promise<Uint256>;
99
+ getDelayRecords: () => Promise<DelayRecords>;
100
+ }
101
+ export interface AMaciInterface extends AMaciReadOnlyInterface {
102
+ contractAddress: string;
103
+ sender: string;
104
+ setRoundInfo: ({ roundInfo, }: {
105
+ roundInfo: RoundInfo;
106
+ }, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
107
+ setWhitelists: ({ whitelists, }: {
108
+ whitelists: WhitelistBase;
109
+ }, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
110
+ setVoteOptionsMap: ({ voteOptionMap, }: {
111
+ voteOptionMap: string[];
112
+ }, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
113
+ signUp: ({ pubkey, }: {
114
+ pubkey: PubKey;
115
+ }, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
116
+ startProcessPeriod: (fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
117
+ publishDeactivateMessage: ({ encPubKey, message, }: {
118
+ encPubKey: PubKey;
119
+ message: MessageData;
120
+ }, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
121
+ processDeactivateMessage: ({ groth16Proof, newDeactivateCommitment, newDeactivateRoot, size, }: {
122
+ groth16Proof: Groth16ProofType;
123
+ newDeactivateCommitment: Uint256;
124
+ newDeactivateRoot: Uint256;
125
+ size: Uint256;
126
+ }, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
127
+ addNewKey: ({ d, groth16Proof, nullifier, pubkey, }: {
128
+ d: Uint256[];
129
+ groth16Proof: Groth16ProofType;
130
+ nullifier: Uint256;
131
+ pubkey: PubKey;
132
+ }, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
133
+ preAddNewKey: ({ d, groth16Proof, nullifier, pubkey, }: {
134
+ d: Uint256[];
135
+ groth16Proof: Groth16ProofType;
136
+ nullifier: Uint256;
137
+ pubkey: PubKey;
138
+ }, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
139
+ publishMessage: ({ encPubKey, message, }: {
140
+ encPubKey: PubKey;
141
+ message: MessageData;
142
+ }, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
143
+ processMessage: ({ groth16Proof, newStateCommitment, }: {
144
+ groth16Proof: Groth16ProofType;
145
+ newStateCommitment: Uint256;
146
+ }, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
147
+ stopProcessingPeriod: (fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
148
+ processTally: ({ groth16Proof, newTallyCommitment, }: {
149
+ groth16Proof: Groth16ProofType;
150
+ newTallyCommitment: Uint256;
151
+ }, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
152
+ stopTallyingPeriod: ({ results, salt, }: {
153
+ results: Uint256[];
154
+ salt: Uint256;
155
+ }, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
156
+ claim: (fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
157
+ }
158
+ export declare class AMaciClient extends AMaciQueryClient implements AMaciInterface {
159
+ client: SigningCosmWasmClient;
160
+ sender: string;
161
+ contractAddress: string;
162
+ constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string);
163
+ setRoundInfo: ({ roundInfo, }: {
164
+ roundInfo: RoundInfo;
165
+ }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
166
+ setWhitelists: ({ whitelists, }: {
167
+ whitelists: WhitelistBase;
168
+ }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
169
+ setVoteOptionsMap: ({ voteOptionMap, }: {
170
+ voteOptionMap: string[];
171
+ }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
172
+ signUp: ({ pubkey, }: {
173
+ pubkey: PubKey;
174
+ }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
175
+ startProcessPeriod: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
176
+ publishDeactivateMessage: ({ encPubKey, message, }: {
177
+ encPubKey: PubKey;
178
+ message: MessageData;
179
+ }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
180
+ processDeactivateMessage: ({ groth16Proof, newDeactivateCommitment, newDeactivateRoot, size, }: {
181
+ groth16Proof: Groth16ProofType;
182
+ newDeactivateCommitment: Uint256;
183
+ newDeactivateRoot: Uint256;
184
+ size: Uint256;
185
+ }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
186
+ addNewKey: ({ d, groth16Proof, nullifier, pubkey, }: {
187
+ d: Uint256[];
188
+ groth16Proof: Groth16ProofType;
189
+ nullifier: Uint256;
190
+ pubkey: PubKey;
191
+ }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
192
+ preAddNewKey: ({ d, groth16Proof, nullifier, pubkey, }: {
193
+ d: Uint256[];
194
+ groth16Proof: Groth16ProofType;
195
+ nullifier: Uint256;
196
+ pubkey: PubKey;
197
+ }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
198
+ publishMessage: ({ encPubKey, message, }: {
199
+ encPubKey: PubKey;
200
+ message: MessageData;
201
+ }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
202
+ processMessage: ({ groth16Proof, newStateCommitment, }: {
203
+ groth16Proof: Groth16ProofType;
204
+ newStateCommitment: Uint256;
205
+ }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
206
+ stopProcessingPeriod: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
207
+ processTally: ({ groth16Proof, newTallyCommitment, }: {
208
+ groth16Proof: Groth16ProofType;
209
+ newTallyCommitment: Uint256;
210
+ }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
211
+ stopTallyingPeriod: ({ results, salt, }: {
212
+ results: Uint256[];
213
+ salt: Uint256;
214
+ }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
215
+ claim: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
216
+ }
@@ -0,0 +1,221 @@
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?: WhitelistBase | 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 WhitelistBase {
44
+ users: WhitelistBaseConfig[];
45
+ }
46
+ export interface WhitelistBaseConfig {
47
+ addr: Addr;
48
+ }
49
+ export type ExecuteMsg = {
50
+ set_round_info: {
51
+ round_info: RoundInfo;
52
+ };
53
+ } | {
54
+ set_whitelists: {
55
+ whitelists: WhitelistBase;
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
+ claim: {};
117
+ };
118
+ export interface MessageData {
119
+ data: [Uint256, Uint256, Uint256, Uint256, Uint256, Uint256, Uint256];
120
+ }
121
+ export interface Groth16ProofType {
122
+ a: string;
123
+ b: string;
124
+ c: string;
125
+ }
126
+ export type QueryMsg = {
127
+ admin: {};
128
+ } | {
129
+ operator: {};
130
+ } | {
131
+ get_round_info: {};
132
+ } | {
133
+ get_voting_time: {};
134
+ } | {
135
+ get_period: {};
136
+ } | {
137
+ get_num_sign_up: {};
138
+ } | {
139
+ get_msg_chain_length: {};
140
+ } | {
141
+ get_d_msg_chain_length: {};
142
+ } | {
143
+ get_processed_d_msg_count: {};
144
+ } | {
145
+ get_processed_msg_count: {};
146
+ } | {
147
+ get_processed_user_count: {};
148
+ } | {
149
+ get_result: {
150
+ index: Uint256;
151
+ };
152
+ } | {
153
+ get_all_result: {};
154
+ } | {
155
+ get_state_idx_inc: {
156
+ address: Addr;
157
+ };
158
+ } | {
159
+ get_voice_credit_balance: {
160
+ index: Uint256;
161
+ };
162
+ } | {
163
+ get_voice_credit_amount: {};
164
+ } | {
165
+ white_list: {};
166
+ } | {
167
+ can_sign_up: {
168
+ sender: Addr;
169
+ };
170
+ } | {
171
+ is_white_list: {
172
+ sender: Addr;
173
+ };
174
+ } | {
175
+ is_register: {
176
+ sender: Addr;
177
+ };
178
+ } | {
179
+ signuped: {
180
+ pubkey_x: Uint256;
181
+ };
182
+ } | {
183
+ vote_option_map: {};
184
+ } | {
185
+ max_vote_options: {};
186
+ } | {
187
+ query_total_fee_grant: {};
188
+ } | {
189
+ query_circuit_type: {};
190
+ } | {
191
+ query_cert_system: {};
192
+ } | {
193
+ query_pre_deactivate_root: {};
194
+ } | {
195
+ get_delay_records: {};
196
+ };
197
+ export type Boolean = boolean;
198
+ export type DelayType = 'deactivate_delay' | 'tally_delay';
199
+ export interface DelayRecords {
200
+ records: DelayRecord[];
201
+ }
202
+ export interface DelayRecord {
203
+ delay_duration: number;
204
+ delay_process_dmsg_count: Uint256;
205
+ delay_reason: string;
206
+ delay_timestamp: Timestamp;
207
+ delay_type: DelayType;
208
+ }
209
+ export type PeriodStatus = 'pending' | 'voting' | 'processing' | 'tallying' | 'ended';
210
+ export interface Period {
211
+ status: PeriodStatus;
212
+ }
213
+ export type Uint128 = string;
214
+ export type ArrayOfString = string[];
215
+ export interface Whitelist {
216
+ users: WhitelistConfig[];
217
+ }
218
+ export interface WhitelistConfig {
219
+ addr: Addr;
220
+ is_register: boolean;
221
+ }