@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,252 @@
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
+
7
+ export type Addr = string;
8
+ export type Uint256 = string;
9
+ export type Timestamp = Uint64;
10
+ export type Uint64 = string;
11
+ export interface InstantiateMsg {
12
+ admin: Addr;
13
+ certification_system: Uint256;
14
+ circuit_type: Uint256;
15
+ coordinator: PubKey;
16
+ max_vote_options: Uint256;
17
+ operator: Addr;
18
+ parameters: MaciParameters;
19
+ pre_deactivate_root: Uint256;
20
+ round_info: RoundInfo;
21
+ voice_credit_amount: Uint256;
22
+ voting_time: VotingTime;
23
+ whitelist?: Whitelist | null;
24
+ }
25
+ export interface PubKey {
26
+ x: Uint256;
27
+ y: Uint256;
28
+ }
29
+ export interface MaciParameters {
30
+ int_state_tree_depth: Uint256;
31
+ message_batch_size: Uint256;
32
+ state_tree_depth: Uint256;
33
+ vote_option_tree_depth: Uint256;
34
+ }
35
+ export interface RoundInfo {
36
+ description: string;
37
+ link: string;
38
+ title: string;
39
+ }
40
+ export interface VotingTime {
41
+ end_time: Timestamp;
42
+ start_time: Timestamp;
43
+ }
44
+ export interface Whitelist {
45
+ users: WhitelistConfig[];
46
+ }
47
+ export interface WhitelistConfig {
48
+ addr: Addr;
49
+ }
50
+ export type ExecuteMsg =
51
+ | {
52
+ set_round_info: {
53
+ round_info: RoundInfo;
54
+ };
55
+ }
56
+ | {
57
+ set_whitelists: {
58
+ whitelists: Whitelist;
59
+ };
60
+ }
61
+ | {
62
+ set_vote_options_map: {
63
+ vote_option_map: string[];
64
+ };
65
+ }
66
+ | {
67
+ sign_up: {
68
+ pubkey: PubKey;
69
+ };
70
+ }
71
+ | {
72
+ start_process_period: {};
73
+ }
74
+ | {
75
+ publish_deactivate_message: {
76
+ enc_pub_key: PubKey;
77
+ message: MessageData;
78
+ };
79
+ }
80
+ | {
81
+ process_deactivate_message: {
82
+ groth16_proof: Groth16ProofType;
83
+ new_deactivate_commitment: Uint256;
84
+ new_deactivate_root: Uint256;
85
+ size: Uint256;
86
+ };
87
+ }
88
+ | {
89
+ add_new_key: {
90
+ d: [Uint256, Uint256, Uint256, Uint256];
91
+ groth16_proof: Groth16ProofType;
92
+ nullifier: Uint256;
93
+ pubkey: PubKey;
94
+ };
95
+ }
96
+ | {
97
+ pre_add_new_key: {
98
+ d: [Uint256, Uint256, Uint256, Uint256];
99
+ groth16_proof: Groth16ProofType;
100
+ nullifier: Uint256;
101
+ pubkey: PubKey;
102
+ };
103
+ }
104
+ | {
105
+ publish_message: {
106
+ enc_pub_key: PubKey;
107
+ message: MessageData;
108
+ };
109
+ }
110
+ | {
111
+ process_message: {
112
+ groth16_proof: Groth16ProofType;
113
+ new_state_commitment: Uint256;
114
+ };
115
+ }
116
+ | {
117
+ stop_processing_period: {};
118
+ }
119
+ | {
120
+ process_tally: {
121
+ groth16_proof: Groth16ProofType;
122
+ new_tally_commitment: Uint256;
123
+ };
124
+ }
125
+ | {
126
+ stop_tallying_period: {
127
+ results: Uint256[];
128
+ salt: Uint256;
129
+ };
130
+ }
131
+ | {
132
+ grant: {
133
+ max_amount: Uint128;
134
+ };
135
+ }
136
+ | {
137
+ revoke: {};
138
+ }
139
+ | {
140
+ bond: {};
141
+ }
142
+ | {
143
+ withdraw: {
144
+ amount?: Uint128 | null;
145
+ };
146
+ };
147
+ export type Uint128 = string;
148
+ export interface MessageData {
149
+ data: [Uint256, Uint256, Uint256, Uint256, Uint256, Uint256, Uint256];
150
+ }
151
+ export interface Groth16ProofType {
152
+ a: string;
153
+ b: string;
154
+ c: string;
155
+ }
156
+ export type QueryMsg =
157
+ | {
158
+ admin: {};
159
+ }
160
+ | {
161
+ operator: {};
162
+ }
163
+ | {
164
+ get_round_info: {};
165
+ }
166
+ | {
167
+ get_voting_time: {};
168
+ }
169
+ | {
170
+ get_period: {};
171
+ }
172
+ | {
173
+ get_num_sign_up: {};
174
+ }
175
+ | {
176
+ get_msg_chain_length: {};
177
+ }
178
+ | {
179
+ get_d_msg_chain_length: {};
180
+ }
181
+ | {
182
+ get_processed_d_msg_count: {};
183
+ }
184
+ | {
185
+ get_processed_msg_count: {};
186
+ }
187
+ | {
188
+ get_processed_user_count: {};
189
+ }
190
+ | {
191
+ get_result: {
192
+ index: Uint256;
193
+ };
194
+ }
195
+ | {
196
+ get_all_result: {};
197
+ }
198
+ | {
199
+ get_state_idx_inc: {
200
+ address: Addr;
201
+ };
202
+ }
203
+ | {
204
+ get_voice_credit_balance: {
205
+ index: Uint256;
206
+ };
207
+ }
208
+ | {
209
+ get_voice_credit_amount: {};
210
+ }
211
+ | {
212
+ white_list: {};
213
+ }
214
+ | {
215
+ is_white_list: {
216
+ sender: Addr;
217
+ };
218
+ }
219
+ | {
220
+ signuped: {
221
+ pubkey_x: Uint256;
222
+ };
223
+ }
224
+ | {
225
+ vote_option_map: {};
226
+ }
227
+ | {
228
+ max_vote_options: {};
229
+ }
230
+ | {
231
+ query_total_fee_grant: {};
232
+ }
233
+ | {
234
+ query_circuit_type: {};
235
+ }
236
+ | {
237
+ query_cert_system: {};
238
+ }
239
+ | {
240
+ query_pre_deactivate_root: {};
241
+ };
242
+ export type PeriodStatus =
243
+ | 'pending'
244
+ | 'voting'
245
+ | 'processing'
246
+ | 'tallying'
247
+ | 'ended';
248
+ export interface Period {
249
+ status: PeriodStatus;
250
+ }
251
+ export type Boolean = boolean;
252
+ export type ArrayOfString = string[];