@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.
- package/README.md +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +4157 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +4123 -0
- package/dist/index.mjs.map +1 -0
- package/dist/libs/const.d.ts +117 -0
- package/dist/libs/contract/config.d.ts +29 -0
- package/dist/libs/contract/contract.d.ts +37 -0
- package/dist/libs/contract/index.d.ts +1 -0
- package/dist/libs/contract/ts/AMaci.client.d.ts +216 -0
- package/dist/libs/contract/ts/AMaci.types.d.ts +203 -0
- package/dist/libs/contract/ts/Maci.client.d.ts +206 -0
- package/dist/libs/contract/ts/Maci.types.d.ts +217 -0
- package/dist/libs/contract/ts/OracleMaci.client.d.ts +206 -0
- package/dist/libs/contract/ts/OracleMaci.types.d.ts +253 -0
- package/dist/libs/contract/ts/Registry.client.d.ts +128 -0
- package/dist/libs/contract/ts/Registry.types.d.ts +110 -0
- package/dist/libs/contract/types.d.ts +50 -0
- package/dist/libs/contract/utils.d.ts +67 -0
- package/dist/libs/contract/vars.d.ts +65 -0
- package/dist/libs/errors/index.d.ts +28 -0
- package/dist/libs/errors/types.d.ts +14 -0
- package/dist/libs/http/http.d.ts +16 -0
- package/dist/libs/http/index.d.ts +1 -0
- package/dist/libs/index.d.ts +4 -0
- package/dist/libs/indexer/index.d.ts +1 -0
- package/dist/libs/indexer/indexer.d.ts +133 -0
- package/dist/libs/indexer/types.d.ts +7 -0
- package/dist/libs/query/account.d.ts +7 -0
- package/dist/libs/query/circuit.d.ts +8 -0
- package/dist/libs/query/index.d.ts +6 -0
- package/dist/libs/query/operator.d.ts +9 -0
- package/dist/libs/query/proof.d.ts +7 -0
- package/dist/libs/query/round.d.ts +11 -0
- package/dist/libs/query/transaction.d.ts +9 -0
- package/dist/maci.d.ts +151 -0
- package/dist/types/index.d.ts +254 -0
- package/dist/utils/index.d.ts +1 -0
- package/package.json +154 -0
- package/src/index.ts +11 -0
- package/src/libs/const.ts +196 -0
- package/src/libs/contract/config.ts +117 -0
- package/src/libs/contract/contract.ts +330 -0
- package/src/libs/contract/index.ts +1 -0
- package/src/libs/contract/ts/AMaci.client.ts +893 -0
- package/src/libs/contract/ts/AMaci.types.ts +252 -0
- package/src/libs/contract/ts/Maci.client.ts +906 -0
- package/src/libs/contract/ts/Maci.types.ts +263 -0
- package/src/libs/contract/ts/OracleMaci.client.ts +561 -0
- package/src/libs/contract/ts/OracleMaci.types.ts +254 -0
- package/src/libs/contract/ts/Registry.client.ts +466 -0
- package/src/libs/contract/ts/Registry.types.ts +127 -0
- package/src/libs/contract/types.ts +57 -0
- package/src/libs/contract/utils.ts +175 -0
- package/src/libs/contract/vars.ts +420 -0
- package/src/libs/errors/index.ts +122 -0
- package/src/libs/errors/types.ts +14 -0
- package/src/libs/http/http.ts +152 -0
- package/src/libs/http/index.ts +1 -0
- package/src/libs/index.ts +4 -0
- package/src/libs/indexer/index.ts +1 -0
- package/src/libs/indexer/indexer.ts +240 -0
- package/src/libs/indexer/types.ts +8 -0
- package/src/libs/query/account.ts +39 -0
- package/src/libs/query/circuit.ts +99 -0
- package/src/libs/query/index.ts +6 -0
- package/src/libs/query/operator.ts +263 -0
- package/src/libs/query/proof.ts +76 -0
- package/src/libs/query/round.ts +533 -0
- package/src/libs/query/transaction.ts +204 -0
- package/src/maci.ts +313 -0
- package/src/types/index.ts +301 -0
- package/src/utils/index.ts +44 -0
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was automatically generated by @cosmwasm/ts-codegen@0.30.1.
|
|
3
|
+
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
|
|
4
|
+
* and run the @cosmwasm/ts-codegen generate command to regenerate this file.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export type Uint256 = string;
|
|
8
|
+
export type Timestamp = Uint64;
|
|
9
|
+
export type Uint64 = string;
|
|
10
|
+
export interface InstantiateMsg {
|
|
11
|
+
circuit_type: Uint256;
|
|
12
|
+
coordinator: PubKey;
|
|
13
|
+
groth16_add_key_vkey: Groth16VKeyType;
|
|
14
|
+
groth16_deactivate_vkey: Groth16VKeyType;
|
|
15
|
+
groth16_process_vkey: Groth16VKeyType;
|
|
16
|
+
groth16_tally_vkey: Groth16VKeyType;
|
|
17
|
+
max_vote_options: Uint256;
|
|
18
|
+
parameters: MaciParameters;
|
|
19
|
+
qtr_lib: QuinaryTreeRoot;
|
|
20
|
+
round_info: RoundInfo;
|
|
21
|
+
voice_credit_amount: Uint256;
|
|
22
|
+
voting_time?: VotingTime | null;
|
|
23
|
+
whitelist?: Whitelist | null;
|
|
24
|
+
}
|
|
25
|
+
export interface PubKey {
|
|
26
|
+
x: Uint256;
|
|
27
|
+
y: Uint256;
|
|
28
|
+
}
|
|
29
|
+
export interface Groth16VKeyType {
|
|
30
|
+
vk_alpha1: string;
|
|
31
|
+
vk_beta_2: string;
|
|
32
|
+
vk_delta_2: string;
|
|
33
|
+
vk_gamma_2: string;
|
|
34
|
+
vk_ic0: string;
|
|
35
|
+
vk_ic1: string;
|
|
36
|
+
}
|
|
37
|
+
export interface MaciParameters {
|
|
38
|
+
int_state_tree_depth: Uint256;
|
|
39
|
+
message_batch_size: Uint256;
|
|
40
|
+
state_tree_depth: Uint256;
|
|
41
|
+
vote_option_tree_depth: Uint256;
|
|
42
|
+
}
|
|
43
|
+
export interface QuinaryTreeRoot {
|
|
44
|
+
zeros: [
|
|
45
|
+
Uint256,
|
|
46
|
+
Uint256,
|
|
47
|
+
Uint256,
|
|
48
|
+
Uint256,
|
|
49
|
+
Uint256,
|
|
50
|
+
Uint256,
|
|
51
|
+
Uint256,
|
|
52
|
+
Uint256,
|
|
53
|
+
Uint256
|
|
54
|
+
];
|
|
55
|
+
}
|
|
56
|
+
export interface RoundInfo {
|
|
57
|
+
description: string;
|
|
58
|
+
link: string;
|
|
59
|
+
title: string;
|
|
60
|
+
}
|
|
61
|
+
export interface VotingTime {
|
|
62
|
+
end_time?: Timestamp | null;
|
|
63
|
+
start_time?: Timestamp | null;
|
|
64
|
+
}
|
|
65
|
+
export interface Whitelist {
|
|
66
|
+
users: WhitelistConfig[];
|
|
67
|
+
}
|
|
68
|
+
export interface WhitelistConfig {
|
|
69
|
+
addr: string;
|
|
70
|
+
}
|
|
71
|
+
export type ExecuteMsg =
|
|
72
|
+
| {
|
|
73
|
+
set_params: {
|
|
74
|
+
int_state_tree_depth: Uint256;
|
|
75
|
+
message_batch_size: Uint256;
|
|
76
|
+
state_tree_depth: Uint256;
|
|
77
|
+
vote_option_tree_depth: Uint256;
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
| {
|
|
81
|
+
set_round_info: {
|
|
82
|
+
round_info: RoundInfo;
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
| {
|
|
86
|
+
set_whitelists: {
|
|
87
|
+
whitelists: Whitelist;
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
| {
|
|
91
|
+
set_vote_options_map: {
|
|
92
|
+
vote_option_map: string[];
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
| {
|
|
96
|
+
start_voting_period: {};
|
|
97
|
+
}
|
|
98
|
+
| {
|
|
99
|
+
sign_up: {
|
|
100
|
+
pubkey: PubKey;
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
| {
|
|
104
|
+
start_process_period: {};
|
|
105
|
+
}
|
|
106
|
+
| {
|
|
107
|
+
stop_voting_period: {};
|
|
108
|
+
}
|
|
109
|
+
| {
|
|
110
|
+
publish_deactivate_message: {
|
|
111
|
+
enc_pub_key: PubKey;
|
|
112
|
+
message: MessageData;
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
| {
|
|
116
|
+
process_deactivate_message: {
|
|
117
|
+
groth16_proof: Groth16ProofType;
|
|
118
|
+
new_deactivate_commitment: Uint256;
|
|
119
|
+
new_deactivate_root: Uint256;
|
|
120
|
+
size: Uint256;
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
| {
|
|
124
|
+
add_new_key: {
|
|
125
|
+
d: [Uint256, Uint256, Uint256, Uint256];
|
|
126
|
+
groth16_proof: Groth16ProofType;
|
|
127
|
+
nullifier: Uint256;
|
|
128
|
+
pubkey: PubKey;
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
| {
|
|
132
|
+
publish_message: {
|
|
133
|
+
enc_pub_key: PubKey;
|
|
134
|
+
message: MessageData;
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
| {
|
|
138
|
+
process_message: {
|
|
139
|
+
groth16_proof: Groth16ProofType;
|
|
140
|
+
new_state_commitment: Uint256;
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
| {
|
|
144
|
+
stop_processing_period: {};
|
|
145
|
+
}
|
|
146
|
+
| {
|
|
147
|
+
process_tally: {
|
|
148
|
+
groth16_proof: Groth16ProofType;
|
|
149
|
+
new_tally_commitment: Uint256;
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
| {
|
|
153
|
+
stop_tallying_period: {
|
|
154
|
+
results: Uint256[];
|
|
155
|
+
salt: Uint256;
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
| {
|
|
159
|
+
grant: {
|
|
160
|
+
max_amount: Uint128;
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
| {
|
|
164
|
+
revoke: {};
|
|
165
|
+
}
|
|
166
|
+
| {
|
|
167
|
+
bond: {};
|
|
168
|
+
}
|
|
169
|
+
| {
|
|
170
|
+
withdraw: {
|
|
171
|
+
amount?: Uint128 | null;
|
|
172
|
+
};
|
|
173
|
+
};
|
|
174
|
+
export type Uint128 = string;
|
|
175
|
+
export interface MessageData {
|
|
176
|
+
data: [Uint256, Uint256, Uint256, Uint256, Uint256, Uint256, Uint256];
|
|
177
|
+
}
|
|
178
|
+
export interface Groth16ProofType {
|
|
179
|
+
a: string;
|
|
180
|
+
b: string;
|
|
181
|
+
c: string;
|
|
182
|
+
}
|
|
183
|
+
export type QueryMsg =
|
|
184
|
+
| {
|
|
185
|
+
get_round_info: {};
|
|
186
|
+
}
|
|
187
|
+
| {
|
|
188
|
+
get_voting_time: {};
|
|
189
|
+
}
|
|
190
|
+
| {
|
|
191
|
+
get_period: {};
|
|
192
|
+
}
|
|
193
|
+
| {
|
|
194
|
+
get_num_sign_up: {};
|
|
195
|
+
}
|
|
196
|
+
| {
|
|
197
|
+
get_msg_chain_length: {};
|
|
198
|
+
}
|
|
199
|
+
| {
|
|
200
|
+
get_d_msg_chain_length: {};
|
|
201
|
+
}
|
|
202
|
+
| {
|
|
203
|
+
get_processed_d_msg_count: {};
|
|
204
|
+
}
|
|
205
|
+
| {
|
|
206
|
+
get_processed_msg_count: {};
|
|
207
|
+
}
|
|
208
|
+
| {
|
|
209
|
+
get_processed_user_count: {};
|
|
210
|
+
}
|
|
211
|
+
| {
|
|
212
|
+
get_result: {
|
|
213
|
+
index: Uint256;
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
| {
|
|
217
|
+
get_all_result: {};
|
|
218
|
+
}
|
|
219
|
+
| {
|
|
220
|
+
get_state_idx_inc: {
|
|
221
|
+
address: Addr;
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
| {
|
|
225
|
+
get_voice_credit_balance: {
|
|
226
|
+
index: Uint256;
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
| {
|
|
230
|
+
white_list: {};
|
|
231
|
+
}
|
|
232
|
+
| {
|
|
233
|
+
is_white_list: {
|
|
234
|
+
sender: string;
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
| {
|
|
238
|
+
vote_option_map: {};
|
|
239
|
+
}
|
|
240
|
+
| {
|
|
241
|
+
max_vote_options: {};
|
|
242
|
+
}
|
|
243
|
+
| {
|
|
244
|
+
query_total_fee_grant: {};
|
|
245
|
+
}
|
|
246
|
+
| {
|
|
247
|
+
query_circuit_type: {};
|
|
248
|
+
}
|
|
249
|
+
| {
|
|
250
|
+
query_cert_system: {};
|
|
251
|
+
};
|
|
252
|
+
export type Addr = string;
|
|
253
|
+
export type PeriodStatus =
|
|
254
|
+
| 'pending'
|
|
255
|
+
| 'voting'
|
|
256
|
+
| 'processing'
|
|
257
|
+
| 'tallying'
|
|
258
|
+
| 'ended';
|
|
259
|
+
export interface Period {
|
|
260
|
+
status: PeriodStatus;
|
|
261
|
+
}
|
|
262
|
+
export type Boolean = boolean;
|
|
263
|
+
export type ArrayOfString = string[];
|