@dorafactory/maci-sdk 0.0.7 → 0.0.9
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.
- package/README.md +27 -7
- package/dist/index.js +751 -187
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +748 -187
- package/dist/index.mjs.map +1 -1
- package/dist/libs/circom/tree.d.ts +20 -20
- package/dist/libs/contract/ts/AMaci.client.d.ts +1 -1
- package/dist/libs/contract/ts/Maci.client.d.ts +21 -47
- package/dist/libs/contract/ts/Maci.types.d.ts +40 -31
- package/dist/libs/contract/ts/OracleMaci.client.d.ts +52 -52
- package/dist/libs/contract/ts/OracleMaci.types.d.ts +17 -7
- package/dist/libs/contract/ts/Registry.client.d.ts +2 -2
- package/dist/libs/contract/types.d.ts +2 -2
- package/dist/libs/errors/types.d.ts +1 -0
- package/dist/libs/http/http.d.ts +1 -1
- package/dist/libs/index.d.ts +3 -0
- package/dist/libs/indexer/indexer.d.ts +11 -2
- package/dist/libs/maci/index.d.ts +1 -0
- package/dist/libs/maci/maci.d.ts +64 -5
- package/dist/libs/oracle-certificate/oracle-certificate.d.ts +1 -21
- package/dist/libs/oracle-certificate/types.d.ts +12 -0
- package/dist/libs/query/event.d.ts +7 -0
- package/dist/libs/query/index.d.ts +1 -0
- package/dist/maci.d.ts +7 -5
- package/dist/types/index.d.ts +22 -0
- package/package.json +1 -1
- package/src/libs/const.ts +3 -2
- package/src/libs/contract/contract.ts +2 -6
- package/src/libs/contract/ts/AMaci.client.ts +868 -874
- package/src/libs/contract/ts/AMaci.types.ts +216 -216
- package/src/libs/contract/ts/Maci.client.ts +748 -888
- package/src/libs/contract/ts/Maci.types.ts +229 -224
- package/src/libs/contract/ts/OracleMaci.client.ts +623 -348
- package/src/libs/contract/ts/OracleMaci.types.ts +191 -138
- package/src/libs/contract/ts/Registry.client.ts +438 -446
- package/src/libs/contract/ts/Registry.types.ts +97 -97
- package/src/libs/contract/types.ts +6 -2
- package/src/libs/contract/utils.ts +9 -0
- package/src/libs/errors/types.ts +1 -0
- package/src/libs/http/http.ts +3 -7
- package/src/libs/index.ts +3 -0
- package/src/libs/indexer/indexer.ts +18 -0
- package/src/libs/maci/index.ts +1 -0
- package/src/libs/maci/maci.ts +302 -10
- package/src/libs/oracle-certificate/oracle-certificate.ts +19 -73
- package/src/libs/oracle-certificate/types.ts +15 -1
- package/src/libs/query/event.ts +78 -0
- package/src/libs/query/index.ts +1 -0
- package/src/maci.ts +27 -5
- package/src/types/index.ts +28 -0
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
export = Tree;
|
|
2
2
|
declare class Tree {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
3
|
+
constructor(degree: any, depth: any, zero: any);
|
|
4
|
+
DEPTH: any;
|
|
5
|
+
HEIGHT: any;
|
|
6
|
+
DEGREE: any;
|
|
7
|
+
LEAVES_COUNT: number;
|
|
8
|
+
LEAVES_IDX_0: number;
|
|
9
|
+
NODES_COUNT: number;
|
|
10
|
+
get root(): any;
|
|
11
|
+
initZero(zero: any): void;
|
|
12
|
+
zeros: any[] | undefined;
|
|
13
|
+
initNodes(): void;
|
|
14
|
+
nodes: any[] | undefined;
|
|
15
|
+
initLeaves(leaves: any): void;
|
|
16
|
+
leaf(leafIdx: any): any;
|
|
17
|
+
leaves(): any[];
|
|
18
|
+
updateLeaf(leafIdx: any, leaf: any): void;
|
|
19
|
+
pathIdxOf(leafIdx: any): number[];
|
|
20
|
+
pathElementOf(leafIdx: any): any[][];
|
|
21
|
+
subTree(length: any): Tree;
|
|
22
|
+
_update(nodeIdx: any): void;
|
|
23
23
|
}
|
|
@@ -63,7 +63,7 @@ export declare class AMaciQueryClient implements AMaciReadOnlyInterface {
|
|
|
63
63
|
index: Uint256;
|
|
64
64
|
}) => Promise<Uint256>;
|
|
65
65
|
getAllResult: () => Promise<Uint256>;
|
|
66
|
-
getStateIdxInc: ({ address
|
|
66
|
+
getStateIdxInc: ({ address }: {
|
|
67
67
|
address: Addr;
|
|
68
68
|
}) => Promise<Uint256>;
|
|
69
69
|
getVoiceCreditBalance: ({ index, }: {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This file was automatically generated by @cosmwasm/ts-codegen@
|
|
2
|
+
* This file was automatically generated by @cosmwasm/ts-codegen@1.11.1.
|
|
3
3
|
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
|
|
4
4
|
* and run the @cosmwasm/ts-codegen generate command to regenerate this file.
|
|
5
5
|
*/
|
|
6
6
|
import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from '@cosmjs/cosmwasm-stargate';
|
|
7
7
|
import { Coin, StdFee } from '@cosmjs/amino';
|
|
8
|
-
import { Uint256, PubKey, RoundInfo, VotingTime, Whitelist, Uint128, MessageData, Groth16ProofType, Addr, Period, Boolean, ArrayOfString } from './Maci.types';
|
|
8
|
+
import { Uint256, PubKey, RoundInfo, VotingTime, Whitelist, Uint128, MessageData, Groth16ProofType, PlonkProofType, Addr, Period, Boolean, ArrayOfString } from './Maci.types';
|
|
9
9
|
export interface MaciReadOnlyInterface {
|
|
10
10
|
contractAddress: string;
|
|
11
11
|
getRoundInfo: () => Promise<RoundInfo>;
|
|
@@ -13,8 +13,6 @@ export interface MaciReadOnlyInterface {
|
|
|
13
13
|
getPeriod: () => Promise<Period>;
|
|
14
14
|
getNumSignUp: () => Promise<Uint256>;
|
|
15
15
|
getMsgChainLength: () => Promise<Uint256>;
|
|
16
|
-
getDMsgChainLength: () => Promise<Uint256>;
|
|
17
|
-
getProcessedDMsgCount: () => Promise<Uint256>;
|
|
18
16
|
getProcessedMsgCount: () => Promise<Uint256>;
|
|
19
17
|
getProcessedUserCount: () => Promise<Uint256>;
|
|
20
18
|
getResult: ({ index }: {
|
|
@@ -31,6 +29,9 @@ export interface MaciReadOnlyInterface {
|
|
|
31
29
|
isWhiteList: ({ sender }: {
|
|
32
30
|
sender: string;
|
|
33
31
|
}) => Promise<Boolean>;
|
|
32
|
+
whiteBalanceOf: ({ sender }: {
|
|
33
|
+
sender: string;
|
|
34
|
+
}) => Promise<Uint256>;
|
|
34
35
|
voteOptionMap: () => Promise<ArrayOfString>;
|
|
35
36
|
maxVoteOptions: () => Promise<Uint256>;
|
|
36
37
|
queryTotalFeeGrant: () => Promise<Uint128>;
|
|
@@ -46,15 +47,13 @@ export declare class MaciQueryClient implements MaciReadOnlyInterface {
|
|
|
46
47
|
getPeriod: () => Promise<Period>;
|
|
47
48
|
getNumSignUp: () => Promise<Uint256>;
|
|
48
49
|
getMsgChainLength: () => Promise<Uint256>;
|
|
49
|
-
getDMsgChainLength: () => Promise<Uint256>;
|
|
50
|
-
getProcessedDMsgCount: () => Promise<Uint256>;
|
|
51
50
|
getProcessedMsgCount: () => Promise<Uint256>;
|
|
52
51
|
getProcessedUserCount: () => Promise<Uint256>;
|
|
53
52
|
getResult: ({ index }: {
|
|
54
53
|
index: Uint256;
|
|
55
54
|
}) => Promise<Uint256>;
|
|
56
55
|
getAllResult: () => Promise<Uint256>;
|
|
57
|
-
getStateIdxInc: ({ address
|
|
56
|
+
getStateIdxInc: ({ address }: {
|
|
58
57
|
address: Addr;
|
|
59
58
|
}) => Promise<Uint256>;
|
|
60
59
|
getVoiceCreditBalance: ({ index, }: {
|
|
@@ -64,6 +63,9 @@ export declare class MaciQueryClient implements MaciReadOnlyInterface {
|
|
|
64
63
|
isWhiteList: ({ sender }: {
|
|
65
64
|
sender: string;
|
|
66
65
|
}) => Promise<Boolean>;
|
|
66
|
+
whiteBalanceOf: ({ sender }: {
|
|
67
|
+
sender: string;
|
|
68
|
+
}) => Promise<Uint256>;
|
|
67
69
|
voteOptionMap: () => Promise<ArrayOfString>;
|
|
68
70
|
maxVoteOptions: () => Promise<Uint256>;
|
|
69
71
|
queryTotalFeeGrant: () => Promise<Uint128>;
|
|
@@ -94,34 +96,20 @@ export interface MaciInterface extends MaciReadOnlyInterface {
|
|
|
94
96
|
}, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
95
97
|
startProcessPeriod: (fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
96
98
|
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
99
|
publishMessage: ({ encPubKey, message, }: {
|
|
114
100
|
encPubKey: PubKey;
|
|
115
101
|
message: MessageData;
|
|
116
102
|
}, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
117
|
-
processMessage: ({ groth16Proof, newStateCommitment, }: {
|
|
118
|
-
groth16Proof
|
|
103
|
+
processMessage: ({ groth16Proof, newStateCommitment, plonkProof, }: {
|
|
104
|
+
groth16Proof?: Groth16ProofType;
|
|
119
105
|
newStateCommitment: Uint256;
|
|
106
|
+
plonkProof?: PlonkProofType;
|
|
120
107
|
}, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
121
108
|
stopProcessingPeriod: (fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
122
|
-
processTally: ({ groth16Proof, newTallyCommitment, }: {
|
|
123
|
-
groth16Proof
|
|
109
|
+
processTally: ({ groth16Proof, newTallyCommitment, plonkProof, }: {
|
|
110
|
+
groth16Proof?: Groth16ProofType;
|
|
124
111
|
newTallyCommitment: Uint256;
|
|
112
|
+
plonkProof?: PlonkProofType;
|
|
125
113
|
}, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
126
114
|
stopTallyingPeriod: ({ results, salt, }: {
|
|
127
115
|
results: Uint256[];
|
|
@@ -162,34 +150,20 @@ export declare class MaciClient extends MaciQueryClient implements MaciInterface
|
|
|
162
150
|
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
163
151
|
startProcessPeriod: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
164
152
|
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
153
|
publishMessage: ({ encPubKey, message, }: {
|
|
182
154
|
encPubKey: PubKey;
|
|
183
155
|
message: MessageData;
|
|
184
156
|
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
185
|
-
processMessage: ({ groth16Proof, newStateCommitment, }: {
|
|
186
|
-
groth16Proof
|
|
157
|
+
processMessage: ({ groth16Proof, newStateCommitment, plonkProof, }: {
|
|
158
|
+
groth16Proof?: Groth16ProofType;
|
|
187
159
|
newStateCommitment: Uint256;
|
|
160
|
+
plonkProof?: PlonkProofType;
|
|
188
161
|
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
189
162
|
stopProcessingPeriod: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
190
|
-
processTally: ({ groth16Proof, newTallyCommitment, }: {
|
|
191
|
-
groth16Proof
|
|
163
|
+
processTally: ({ groth16Proof, newTallyCommitment, plonkProof, }: {
|
|
164
|
+
groth16Proof?: Groth16ProofType;
|
|
192
165
|
newTallyCommitment: Uint256;
|
|
166
|
+
plonkProof?: PlonkProofType;
|
|
193
167
|
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
194
168
|
stopTallyingPeriod: ({ results, salt, }: {
|
|
195
169
|
results: Uint256[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This file was automatically generated by @cosmwasm/ts-codegen@
|
|
2
|
+
* This file was automatically generated by @cosmwasm/ts-codegen@1.11.1.
|
|
3
3
|
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
|
|
4
4
|
* and run the @cosmwasm/ts-codegen generate command to regenerate this file.
|
|
5
5
|
*/
|
|
@@ -7,17 +7,17 @@ export type Uint256 = string;
|
|
|
7
7
|
export type Timestamp = Uint64;
|
|
8
8
|
export type Uint64 = string;
|
|
9
9
|
export interface InstantiateMsg {
|
|
10
|
+
certification_system: Uint256;
|
|
10
11
|
circuit_type: Uint256;
|
|
11
12
|
coordinator: PubKey;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
groth16_process_vkey: Groth16VKeyType;
|
|
15
|
-
groth16_tally_vkey: Groth16VKeyType;
|
|
13
|
+
groth16_process_vkey?: Groth16VKeyType | null;
|
|
14
|
+
groth16_tally_vkey?: Groth16VKeyType | null;
|
|
16
15
|
max_vote_options: Uint256;
|
|
17
16
|
parameters: MaciParameters;
|
|
17
|
+
plonk_process_vkey?: PlonkVKeyType | null;
|
|
18
|
+
plonk_tally_vkey?: PlonkVKeyType | null;
|
|
18
19
|
qtr_lib: QuinaryTreeRoot;
|
|
19
20
|
round_info: RoundInfo;
|
|
20
|
-
voice_credit_amount: Uint256;
|
|
21
21
|
voting_time?: VotingTime | null;
|
|
22
22
|
whitelist?: Whitelist | null;
|
|
23
23
|
}
|
|
@@ -39,6 +39,15 @@ export interface MaciParameters {
|
|
|
39
39
|
state_tree_depth: Uint256;
|
|
40
40
|
vote_option_tree_depth: Uint256;
|
|
41
41
|
}
|
|
42
|
+
export interface PlonkVKeyType {
|
|
43
|
+
g2_elements: string[];
|
|
44
|
+
n: number;
|
|
45
|
+
next_step_selector_commitments: string[];
|
|
46
|
+
non_residues: string[];
|
|
47
|
+
num_inputs: number;
|
|
48
|
+
permutation_commitments: string[];
|
|
49
|
+
selector_commitments: string[];
|
|
50
|
+
}
|
|
42
51
|
export interface QuinaryTreeRoot {
|
|
43
52
|
zeros: [
|
|
44
53
|
Uint256,
|
|
@@ -66,6 +75,7 @@ export interface Whitelist {
|
|
|
66
75
|
}
|
|
67
76
|
export interface WhitelistConfig {
|
|
68
77
|
addr: string;
|
|
78
|
+
balance: Uint256;
|
|
69
79
|
}
|
|
70
80
|
export type ExecuteMsg = {
|
|
71
81
|
set_params: {
|
|
@@ -96,25 +106,6 @@ export type ExecuteMsg = {
|
|
|
96
106
|
start_process_period: {};
|
|
97
107
|
} | {
|
|
98
108
|
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
109
|
} | {
|
|
119
110
|
publish_message: {
|
|
120
111
|
enc_pub_key: PubKey;
|
|
@@ -122,15 +113,17 @@ export type ExecuteMsg = {
|
|
|
122
113
|
};
|
|
123
114
|
} | {
|
|
124
115
|
process_message: {
|
|
125
|
-
groth16_proof
|
|
116
|
+
groth16_proof?: Groth16ProofType | null;
|
|
126
117
|
new_state_commitment: Uint256;
|
|
118
|
+
plonk_proof?: PlonkProofType | null;
|
|
127
119
|
};
|
|
128
120
|
} | {
|
|
129
121
|
stop_processing_period: {};
|
|
130
122
|
} | {
|
|
131
123
|
process_tally: {
|
|
132
|
-
groth16_proof
|
|
124
|
+
groth16_proof?: Groth16ProofType | null;
|
|
133
125
|
new_tally_commitment: Uint256;
|
|
126
|
+
plonk_proof?: PlonkProofType | null;
|
|
134
127
|
};
|
|
135
128
|
} | {
|
|
136
129
|
stop_tallying_period: {
|
|
@@ -159,6 +152,22 @@ export interface Groth16ProofType {
|
|
|
159
152
|
b: string;
|
|
160
153
|
c: string;
|
|
161
154
|
}
|
|
155
|
+
export interface PlonkProofType {
|
|
156
|
+
grand_product_at_z_omega: string;
|
|
157
|
+
grand_product_commitment: string;
|
|
158
|
+
input_values: string[];
|
|
159
|
+
linearization_polynomial_at_z: string;
|
|
160
|
+
n: number;
|
|
161
|
+
num_inputs: number;
|
|
162
|
+
opening_at_z_omega_proof: string;
|
|
163
|
+
opening_at_z_proof: string;
|
|
164
|
+
permutation_polynomials_at_z: string[];
|
|
165
|
+
quotient_poly_commitments: string[];
|
|
166
|
+
quotient_polynomial_at_z: string;
|
|
167
|
+
wire_commitments: string[];
|
|
168
|
+
wire_values_at_z: string[];
|
|
169
|
+
wire_values_at_z_omega: string[];
|
|
170
|
+
}
|
|
162
171
|
export type QueryMsg = {
|
|
163
172
|
get_round_info: {};
|
|
164
173
|
} | {
|
|
@@ -169,10 +178,6 @@ export type QueryMsg = {
|
|
|
169
178
|
get_num_sign_up: {};
|
|
170
179
|
} | {
|
|
171
180
|
get_msg_chain_length: {};
|
|
172
|
-
} | {
|
|
173
|
-
get_d_msg_chain_length: {};
|
|
174
|
-
} | {
|
|
175
|
-
get_processed_d_msg_count: {};
|
|
176
181
|
} | {
|
|
177
182
|
get_processed_msg_count: {};
|
|
178
183
|
} | {
|
|
@@ -197,6 +202,10 @@ export type QueryMsg = {
|
|
|
197
202
|
is_white_list: {
|
|
198
203
|
sender: string;
|
|
199
204
|
};
|
|
205
|
+
} | {
|
|
206
|
+
white_balance_of: {
|
|
207
|
+
sender: string;
|
|
208
|
+
};
|
|
200
209
|
} | {
|
|
201
210
|
vote_option_map: {};
|
|
202
211
|
} | {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
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
|
|
7
|
-
import { Coin, StdFee } from
|
|
8
|
-
import { Uint256, Addr, PubKey, RoundInfo, VotingTime, Uint128, MessageData, Groth16ProofType, PlonkProofType, Period, GrantConfig, Boolean, OracleWhitelistConfig, ArrayOfString, WhitelistConfig } from
|
|
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
9
|
export interface OracleMaciReadOnlyInterface {
|
|
10
10
|
contractAddress: string;
|
|
11
11
|
getRoundInfo: () => Promise<RoundInfo>;
|
|
@@ -25,12 +25,12 @@ export interface OracleMaciReadOnlyInterface {
|
|
|
25
25
|
getVoiceCreditBalance: ({ index }: {
|
|
26
26
|
index: Uint256;
|
|
27
27
|
}) => Promise<Uint256>;
|
|
28
|
-
isWhiteList: ({ amount, certificate, sender }: {
|
|
28
|
+
isWhiteList: ({ amount, certificate, sender, }: {
|
|
29
29
|
amount: Uint256;
|
|
30
30
|
certificate: string;
|
|
31
31
|
sender: string;
|
|
32
32
|
}) => Promise<Boolean>;
|
|
33
|
-
whiteBalanceOf: ({ amount, certificate, sender }: {
|
|
33
|
+
whiteBalanceOf: ({ amount, certificate, sender, }: {
|
|
34
34
|
amount: Uint256;
|
|
35
35
|
certificate: string;
|
|
36
36
|
sender: string;
|
|
@@ -67,23 +67,23 @@ export declare class OracleMaciQueryClient implements OracleMaciReadOnlyInterfac
|
|
|
67
67
|
getStateIdxInc: ({ address }: {
|
|
68
68
|
address: Addr;
|
|
69
69
|
}) => Promise<Uint256>;
|
|
70
|
-
getVoiceCreditBalance: ({ index }: {
|
|
70
|
+
getVoiceCreditBalance: ({ index, }: {
|
|
71
71
|
index: Uint256;
|
|
72
72
|
}) => Promise<Uint256>;
|
|
73
|
-
isWhiteList: ({ amount, certificate, sender }: {
|
|
73
|
+
isWhiteList: ({ amount, certificate, sender, }: {
|
|
74
74
|
amount: Uint256;
|
|
75
75
|
certificate: string;
|
|
76
76
|
sender: string;
|
|
77
77
|
}) => Promise<Boolean>;
|
|
78
|
-
whiteBalanceOf: ({ amount, certificate, sender }: {
|
|
78
|
+
whiteBalanceOf: ({ amount, certificate, sender, }: {
|
|
79
79
|
amount: Uint256;
|
|
80
80
|
certificate: string;
|
|
81
81
|
sender: string;
|
|
82
82
|
}) => Promise<Uint256>;
|
|
83
|
-
whiteInfo: ({ sender }: {
|
|
83
|
+
whiteInfo: ({ sender, }: {
|
|
84
84
|
sender: string;
|
|
85
85
|
}) => Promise<WhitelistConfig>;
|
|
86
|
-
grantInfo: ({ grantee }: {
|
|
86
|
+
grantInfo: ({ grantee, }: {
|
|
87
87
|
grantee: string;
|
|
88
88
|
}) => Promise<GrantConfig>;
|
|
89
89
|
maxWhitelistNum: () => Promise<Uint128>;
|
|
@@ -97,110 +97,110 @@ export declare class OracleMaciQueryClient implements OracleMaciReadOnlyInterfac
|
|
|
97
97
|
export interface OracleMaciInterface extends OracleMaciReadOnlyInterface {
|
|
98
98
|
contractAddress: string;
|
|
99
99
|
sender: string;
|
|
100
|
-
setParams: ({ intStateTreeDepth, messageBatchSize, stateTreeDepth, voteOptionTreeDepth }: {
|
|
100
|
+
setParams: ({ intStateTreeDepth, messageBatchSize, stateTreeDepth, voteOptionTreeDepth, }: {
|
|
101
101
|
intStateTreeDepth: Uint256;
|
|
102
102
|
messageBatchSize: Uint256;
|
|
103
103
|
stateTreeDepth: Uint256;
|
|
104
104
|
voteOptionTreeDepth: Uint256;
|
|
105
|
-
}, fee?: number | StdFee |
|
|
106
|
-
setRoundInfo: ({ roundInfo }: {
|
|
105
|
+
}, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
106
|
+
setRoundInfo: ({ roundInfo, }: {
|
|
107
107
|
roundInfo: RoundInfo;
|
|
108
|
-
}, fee?: number | StdFee |
|
|
109
|
-
setVoteOptionsMap: ({ voteOptionMap }: {
|
|
108
|
+
}, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
109
|
+
setVoteOptionsMap: ({ voteOptionMap, }: {
|
|
110
110
|
voteOptionMap: string[];
|
|
111
|
-
}, fee?: number | StdFee |
|
|
112
|
-
startVotingPeriod: (fee?: number | StdFee |
|
|
113
|
-
signUp: ({ amount, certificate, pubkey }: {
|
|
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
114
|
amount: Uint256;
|
|
115
115
|
certificate: string;
|
|
116
116
|
pubkey: PubKey;
|
|
117
|
-
}, fee?: number | StdFee |
|
|
118
|
-
startProcessPeriod: (fee?: number | StdFee |
|
|
119
|
-
stopVotingPeriod: (fee?: number | StdFee |
|
|
120
|
-
publishMessage: ({ encPubKey, message }: {
|
|
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
121
|
encPubKey: PubKey;
|
|
122
122
|
message: MessageData;
|
|
123
|
-
}, fee?: number | StdFee |
|
|
124
|
-
processMessage: ({ groth16Proof, newStateCommitment, plonkProof }: {
|
|
123
|
+
}, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
124
|
+
processMessage: ({ groth16Proof, newStateCommitment, plonkProof, }: {
|
|
125
125
|
groth16Proof?: Groth16ProofType;
|
|
126
126
|
newStateCommitment: Uint256;
|
|
127
127
|
plonkProof?: PlonkProofType;
|
|
128
|
-
}, fee?: number | StdFee |
|
|
129
|
-
stopProcessingPeriod: (fee?: number | StdFee |
|
|
130
|
-
processTally: ({ groth16Proof, newTallyCommitment, plonkProof }: {
|
|
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
131
|
groth16Proof?: Groth16ProofType;
|
|
132
132
|
newTallyCommitment: Uint256;
|
|
133
133
|
plonkProof?: PlonkProofType;
|
|
134
|
-
}, fee?: number | StdFee |
|
|
135
|
-
stopTallyingPeriod: ({ results, salt }: {
|
|
134
|
+
}, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
135
|
+
stopTallyingPeriod: ({ results, salt, }: {
|
|
136
136
|
results: Uint256[];
|
|
137
137
|
salt: Uint256;
|
|
138
|
-
}, fee?: number | StdFee |
|
|
139
|
-
grant: ({ baseAmount, grantee }: {
|
|
138
|
+
}, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
139
|
+
grant: ({ baseAmount, grantee, }: {
|
|
140
140
|
baseAmount: Uint128;
|
|
141
141
|
grantee: Addr;
|
|
142
|
-
}, fee?: number | StdFee |
|
|
143
|
-
revoke: ({ grantee }: {
|
|
142
|
+
}, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
143
|
+
revoke: ({ grantee, }: {
|
|
144
144
|
grantee: Addr;
|
|
145
|
-
}, fee?: number | StdFee |
|
|
146
|
-
bond: (fee?: number | StdFee |
|
|
147
|
-
withdraw: ({ amount }: {
|
|
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
148
|
amount?: Uint128;
|
|
149
|
-
}, fee?: number | StdFee |
|
|
149
|
+
}, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
150
150
|
}
|
|
151
151
|
export declare class OracleMaciClient extends OracleMaciQueryClient implements OracleMaciInterface {
|
|
152
152
|
client: SigningCosmWasmClient;
|
|
153
153
|
sender: string;
|
|
154
154
|
contractAddress: string;
|
|
155
155
|
constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string);
|
|
156
|
-
setParams: ({ intStateTreeDepth, messageBatchSize, stateTreeDepth, voteOptionTreeDepth }: {
|
|
156
|
+
setParams: ({ intStateTreeDepth, messageBatchSize, stateTreeDepth, voteOptionTreeDepth, }: {
|
|
157
157
|
intStateTreeDepth: Uint256;
|
|
158
158
|
messageBatchSize: Uint256;
|
|
159
159
|
stateTreeDepth: Uint256;
|
|
160
160
|
voteOptionTreeDepth: Uint256;
|
|
161
161
|
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
162
|
-
setRoundInfo: ({ roundInfo }: {
|
|
162
|
+
setRoundInfo: ({ roundInfo, }: {
|
|
163
163
|
roundInfo: RoundInfo;
|
|
164
164
|
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
165
|
-
setVoteOptionsMap: ({ voteOptionMap }: {
|
|
165
|
+
setVoteOptionsMap: ({ voteOptionMap, }: {
|
|
166
166
|
voteOptionMap: string[];
|
|
167
167
|
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
168
168
|
startVotingPeriod: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
169
|
-
signUp: ({ amount, certificate, pubkey }: {
|
|
169
|
+
signUp: ({ amount, certificate, pubkey, }: {
|
|
170
170
|
amount: Uint256;
|
|
171
171
|
certificate: string;
|
|
172
172
|
pubkey: PubKey;
|
|
173
173
|
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
174
174
|
startProcessPeriod: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
175
175
|
stopVotingPeriod: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
176
|
-
publishMessage: ({ encPubKey, message }: {
|
|
176
|
+
publishMessage: ({ encPubKey, message, }: {
|
|
177
177
|
encPubKey: PubKey;
|
|
178
178
|
message: MessageData;
|
|
179
179
|
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
180
|
-
processMessage: ({ groth16Proof, newStateCommitment, plonkProof }: {
|
|
180
|
+
processMessage: ({ groth16Proof, newStateCommitment, plonkProof, }: {
|
|
181
181
|
groth16Proof?: Groth16ProofType;
|
|
182
182
|
newStateCommitment: Uint256;
|
|
183
183
|
plonkProof?: PlonkProofType;
|
|
184
184
|
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
185
185
|
stopProcessingPeriod: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
186
|
-
processTally: ({ groth16Proof, newTallyCommitment, plonkProof }: {
|
|
186
|
+
processTally: ({ groth16Proof, newTallyCommitment, plonkProof, }: {
|
|
187
187
|
groth16Proof?: Groth16ProofType;
|
|
188
188
|
newTallyCommitment: Uint256;
|
|
189
189
|
plonkProof?: PlonkProofType;
|
|
190
190
|
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
191
|
-
stopTallyingPeriod: ({ results, salt }: {
|
|
191
|
+
stopTallyingPeriod: ({ results, salt, }: {
|
|
192
192
|
results: Uint256[];
|
|
193
193
|
salt: Uint256;
|
|
194
194
|
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
195
|
-
grant: ({ baseAmount, grantee }: {
|
|
195
|
+
grant: ({ baseAmount, grantee, }: {
|
|
196
196
|
baseAmount: Uint128;
|
|
197
197
|
grantee: Addr;
|
|
198
198
|
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
199
|
-
revoke: ({ grantee }: {
|
|
199
|
+
revoke: ({ grantee, }: {
|
|
200
200
|
grantee: Addr;
|
|
201
201
|
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
202
202
|
bond: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
203
|
-
withdraw: ({ amount }: {
|
|
203
|
+
withdraw: ({ amount, }: {
|
|
204
204
|
amount?: Uint128;
|
|
205
205
|
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
206
206
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
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
|
-
*/
|
|
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
6
|
export type Uint256 = string;
|
|
7
7
|
export type Addr = string;
|
|
8
8
|
export type Timestamp = Uint64;
|
|
9
9
|
export type Uint64 = string;
|
|
10
|
-
export type VotingPowerMode =
|
|
10
|
+
export type VotingPowerMode = 'slope' | 'threshold';
|
|
11
11
|
export interface InstantiateMsg {
|
|
12
12
|
certification_system: Uint256;
|
|
13
13
|
circuit_type: Uint256;
|
|
@@ -55,7 +55,17 @@ export interface PlonkVKeyType {
|
|
|
55
55
|
selector_commitments: string[];
|
|
56
56
|
}
|
|
57
57
|
export interface QuinaryTreeRoot {
|
|
58
|
-
zeros: [
|
|
58
|
+
zeros: [
|
|
59
|
+
Uint256,
|
|
60
|
+
Uint256,
|
|
61
|
+
Uint256,
|
|
62
|
+
Uint256,
|
|
63
|
+
Uint256,
|
|
64
|
+
Uint256,
|
|
65
|
+
Uint256,
|
|
66
|
+
Uint256,
|
|
67
|
+
Uint256
|
|
68
|
+
];
|
|
59
69
|
}
|
|
60
70
|
export interface RoundInfo {
|
|
61
71
|
description: string;
|
|
@@ -226,7 +236,7 @@ export type QueryMsg = {
|
|
|
226
236
|
} | {
|
|
227
237
|
query_oracle_whitelist_config: {};
|
|
228
238
|
};
|
|
229
|
-
export type PeriodStatus =
|
|
239
|
+
export type PeriodStatus = 'pending' | 'voting' | 'processing' | 'tallying' | 'ended';
|
|
230
240
|
export interface Period {
|
|
231
241
|
status: PeriodStatus;
|
|
232
242
|
}
|
|
@@ -23,7 +23,7 @@ export interface RegistryReadOnlyInterface {
|
|
|
23
23
|
getMaciOperatorPubkey: ({ address }: {
|
|
24
24
|
address: Addr;
|
|
25
25
|
}) => Promise<PubKey>;
|
|
26
|
-
getMaciOperatorIdentity: ({ address
|
|
26
|
+
getMaciOperatorIdentity: ({ address }: {
|
|
27
27
|
address: Addr;
|
|
28
28
|
}) => Promise<String>;
|
|
29
29
|
}
|
|
@@ -33,7 +33,7 @@ export declare class RegistryQueryClient implements RegistryReadOnlyInterface {
|
|
|
33
33
|
constructor(client: CosmWasmClient, contractAddress: string);
|
|
34
34
|
admin: () => Promise<AdminResponse>;
|
|
35
35
|
operator: () => Promise<Addr>;
|
|
36
|
-
isMaciOperator: ({ address
|
|
36
|
+
isMaciOperator: ({ address }: {
|
|
37
37
|
address: Addr;
|
|
38
38
|
}) => Promise<Boolean>;
|
|
39
39
|
isValidator: ({ address }: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Whitelist as RegistryWhitelist } from './ts/Registry.types';
|
|
2
2
|
import { Whitelist as MaciWhitelist } from './ts/Maci.types';
|
|
3
3
|
import { OfflineSigner } from '@cosmjs/proto-signing';
|
|
4
|
-
import { MaciCircuitType, MaciCertSystemType } from '../../types';
|
|
4
|
+
import { MaciCircuitType, MaciCertSystemType, CertificateEcosystem } from '../../types';
|
|
5
5
|
export type CreateRoundParams = {
|
|
6
6
|
signer: OfflineSigner;
|
|
7
7
|
title: string;
|
|
@@ -26,7 +26,7 @@ export type CreateMaciRoundParams = {
|
|
|
26
26
|
} & CreateRoundParams;
|
|
27
27
|
export type CreateOracleMaciRoundParams = {
|
|
28
28
|
operatorPubkey: string;
|
|
29
|
-
whitelistEcosystem:
|
|
29
|
+
whitelistEcosystem: CertificateEcosystem;
|
|
30
30
|
whitelistSnapshotHeight: string;
|
|
31
31
|
whitelistVotingPowerArgs: {
|
|
32
32
|
mode: 'slope' | 'threshold';
|
package/dist/libs/http/http.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export declare class Http {
|
|
|
10
10
|
private defaultOptions?;
|
|
11
11
|
constructor(apiEndpoint: string, restEndpoint: string, customFetch?: typeof fetch | undefined, defaultOptions?: FetchOptions);
|
|
12
12
|
private getFetch;
|
|
13
|
-
fetch(url: string): Promise<Response>;
|
|
13
|
+
fetch(url: string, options?: any): Promise<Response>;
|
|
14
14
|
fetchGraphql<T>(query: string, after: string, limit?: number | null): Promise<T>;
|
|
15
15
|
fetchRest(path: string): Promise<any>;
|
|
16
16
|
}
|