@dorafactory/maci-sdk 0.1.2 → 0.1.3-pre.10
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/dist/index.d.ts +1 -1
- package/dist/index.js +2371 -975
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2369 -975
- package/dist/index.mjs.map +1 -1
- package/dist/libs/const.d.ts +1 -2
- package/dist/libs/contract/config.d.ts +12 -0
- package/dist/libs/contract/contract.d.ts +66 -4
- package/dist/libs/contract/ts/AMaci.client.d.ts +25 -3
- package/dist/libs/contract/ts/AMaci.types.d.ts +26 -1
- package/dist/libs/contract/ts/ApiMaci.client.d.ts +170 -0
- package/dist/libs/contract/ts/ApiMaci.types.d.ts +187 -0
- package/dist/libs/contract/ts/ApiSaas.client.d.ts +148 -0
- package/dist/libs/contract/ts/ApiSaas.types.d.ts +126 -0
- package/dist/libs/contract/ts/Registry.client.d.ts +17 -7
- package/dist/libs/contract/ts/Registry.types.d.ts +16 -5
- package/dist/libs/contract/types.d.ts +15 -3
- package/dist/libs/crypto/bigintUtils.d.ts +2 -0
- package/dist/libs/maci/maci.d.ts +34 -4
- package/dist/maci.d.ts +47 -3
- package/dist/types/index.d.ts +2 -2
- package/package.json +1 -1
- package/src/index.ts +5 -1
- package/src/libs/const.ts +5 -6
- package/src/libs/contract/config.ts +36 -0
- package/src/libs/contract/contract.ts +611 -6
- package/src/libs/contract/ts/AMaci.client.ts +66 -0
- package/src/libs/contract/ts/AMaci.types.ts +30 -1
- package/src/libs/contract/ts/ApiMaci.client.ts +459 -0
- package/src/libs/contract/ts/ApiMaci.types.ts +188 -0
- package/src/libs/contract/ts/ApiSaas.client.ts +581 -0
- package/src/libs/contract/ts/ApiSaas.types.ts +144 -0
- package/src/libs/contract/ts/Registry.client.ts +57 -9
- package/src/libs/contract/ts/Registry.types.ts +18 -5
- package/src/libs/contract/types.ts +16 -3
- package/src/libs/crypto/bigintUtils.ts +28 -0
- package/src/libs/maci/maci.ts +190 -9
- package/src/maci.ts +86 -4
- package/src/types/index.ts +2 -2
|
@@ -0,0 +1,188 @@
|
|
|
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 Uint256 = string;
|
|
8
|
+
export type Timestamp = Uint64;
|
|
9
|
+
export type Uint64 = string;
|
|
10
|
+
export type VotingPowerMode = "slope" | "threshold";
|
|
11
|
+
export interface InstantiateMsg {
|
|
12
|
+
certification_system: Uint256;
|
|
13
|
+
circuit_type: Uint256;
|
|
14
|
+
coordinator: PubKey;
|
|
15
|
+
max_voters: number;
|
|
16
|
+
round_info: RoundInfo;
|
|
17
|
+
vote_option_map: string[];
|
|
18
|
+
voting_time: VotingTime;
|
|
19
|
+
whitelist_backend_pubkey: string;
|
|
20
|
+
whitelist_voting_power_args: VotingPowerArgs;
|
|
21
|
+
}
|
|
22
|
+
export interface PubKey {
|
|
23
|
+
x: Uint256;
|
|
24
|
+
y: Uint256;
|
|
25
|
+
}
|
|
26
|
+
export interface RoundInfo {
|
|
27
|
+
description: string;
|
|
28
|
+
link: string;
|
|
29
|
+
title: string;
|
|
30
|
+
}
|
|
31
|
+
export interface VotingTime {
|
|
32
|
+
end_time: Timestamp;
|
|
33
|
+
start_time: Timestamp;
|
|
34
|
+
}
|
|
35
|
+
export interface VotingPowerArgs {
|
|
36
|
+
mode: VotingPowerMode;
|
|
37
|
+
slope: Uint256;
|
|
38
|
+
threshold: Uint256;
|
|
39
|
+
}
|
|
40
|
+
export type ExecuteMsg = {
|
|
41
|
+
set_round_info: {
|
|
42
|
+
round_info: RoundInfo;
|
|
43
|
+
};
|
|
44
|
+
} | {
|
|
45
|
+
set_vote_options_map: {
|
|
46
|
+
vote_option_map: string[];
|
|
47
|
+
};
|
|
48
|
+
} | {
|
|
49
|
+
sign_up: {
|
|
50
|
+
amount: Uint256;
|
|
51
|
+
certificate: string;
|
|
52
|
+
pubkey: PubKey;
|
|
53
|
+
};
|
|
54
|
+
} | {
|
|
55
|
+
start_process_period: {};
|
|
56
|
+
} | {
|
|
57
|
+
publish_message: {
|
|
58
|
+
enc_pub_key: PubKey;
|
|
59
|
+
message: MessageData;
|
|
60
|
+
};
|
|
61
|
+
} | {
|
|
62
|
+
process_message: {
|
|
63
|
+
groth16_proof?: Groth16ProofType | null;
|
|
64
|
+
new_state_commitment: Uint256;
|
|
65
|
+
plonk_proof?: PlonkProofType | null;
|
|
66
|
+
};
|
|
67
|
+
} | {
|
|
68
|
+
stop_processing_period: {};
|
|
69
|
+
} | {
|
|
70
|
+
process_tally: {
|
|
71
|
+
groth16_proof?: Groth16ProofType | null;
|
|
72
|
+
new_tally_commitment: Uint256;
|
|
73
|
+
plonk_proof?: PlonkProofType | null;
|
|
74
|
+
};
|
|
75
|
+
} | {
|
|
76
|
+
stop_tallying_period: {
|
|
77
|
+
results: Uint256[];
|
|
78
|
+
salt: Uint256;
|
|
79
|
+
};
|
|
80
|
+
} | {
|
|
81
|
+
bond: {};
|
|
82
|
+
} | {
|
|
83
|
+
withdraw: {
|
|
84
|
+
amount?: Uint128 | null;
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
export type Uint128 = string;
|
|
88
|
+
export interface MessageData {
|
|
89
|
+
data: [Uint256, Uint256, Uint256, Uint256, Uint256, Uint256, Uint256];
|
|
90
|
+
}
|
|
91
|
+
export interface Groth16ProofType {
|
|
92
|
+
a: string;
|
|
93
|
+
b: string;
|
|
94
|
+
c: string;
|
|
95
|
+
}
|
|
96
|
+
export interface PlonkProofType {
|
|
97
|
+
grand_product_at_z_omega: string;
|
|
98
|
+
grand_product_commitment: string;
|
|
99
|
+
input_values: string[];
|
|
100
|
+
linearization_polynomial_at_z: string;
|
|
101
|
+
n: number;
|
|
102
|
+
num_inputs: number;
|
|
103
|
+
opening_at_z_omega_proof: string;
|
|
104
|
+
opening_at_z_proof: string;
|
|
105
|
+
permutation_polynomials_at_z: string[];
|
|
106
|
+
quotient_poly_commitments: string[];
|
|
107
|
+
quotient_polynomial_at_z: string;
|
|
108
|
+
wire_commitments: string[];
|
|
109
|
+
wire_values_at_z: string[];
|
|
110
|
+
wire_values_at_z_omega: string[];
|
|
111
|
+
}
|
|
112
|
+
export type QueryMsg = {
|
|
113
|
+
get_round_info: {};
|
|
114
|
+
} | {
|
|
115
|
+
get_voting_time: {};
|
|
116
|
+
} | {
|
|
117
|
+
get_period: {};
|
|
118
|
+
} | {
|
|
119
|
+
get_num_sign_up: {};
|
|
120
|
+
} | {
|
|
121
|
+
get_msg_chain_length: {};
|
|
122
|
+
} | {
|
|
123
|
+
get_processed_msg_count: {};
|
|
124
|
+
} | {
|
|
125
|
+
get_processed_user_count: {};
|
|
126
|
+
} | {
|
|
127
|
+
get_result: {
|
|
128
|
+
index: Uint256;
|
|
129
|
+
};
|
|
130
|
+
} | {
|
|
131
|
+
get_all_result: {};
|
|
132
|
+
} | {
|
|
133
|
+
get_state_idx_inc: {
|
|
134
|
+
address: Addr;
|
|
135
|
+
};
|
|
136
|
+
} | {
|
|
137
|
+
get_voice_credit_balance: {
|
|
138
|
+
index: Uint256;
|
|
139
|
+
};
|
|
140
|
+
} | {
|
|
141
|
+
is_white_list: {
|
|
142
|
+
amount: Uint256;
|
|
143
|
+
certificate: string;
|
|
144
|
+
pubkey: PubKey;
|
|
145
|
+
};
|
|
146
|
+
} | {
|
|
147
|
+
white_balance_of: {
|
|
148
|
+
amount: Uint256;
|
|
149
|
+
certificate: string;
|
|
150
|
+
pubkey: PubKey;
|
|
151
|
+
};
|
|
152
|
+
} | {
|
|
153
|
+
white_info: {
|
|
154
|
+
pubkey: PubKey;
|
|
155
|
+
};
|
|
156
|
+
} | {
|
|
157
|
+
max_whitelist_num: {};
|
|
158
|
+
} | {
|
|
159
|
+
vote_option_map: {};
|
|
160
|
+
} | {
|
|
161
|
+
max_vote_options: {};
|
|
162
|
+
} | {
|
|
163
|
+
query_total_fee_grant: {};
|
|
164
|
+
} | {
|
|
165
|
+
query_circuit_type: {};
|
|
166
|
+
} | {
|
|
167
|
+
query_cert_system: {};
|
|
168
|
+
} | {
|
|
169
|
+
query_oracle_whitelist_config: {};
|
|
170
|
+
};
|
|
171
|
+
export type Addr = string;
|
|
172
|
+
export type PeriodStatus = "pending" | "voting" | "processing" | "tallying" | "ended";
|
|
173
|
+
export interface Period {
|
|
174
|
+
status: PeriodStatus;
|
|
175
|
+
}
|
|
176
|
+
export type Boolean = boolean;
|
|
177
|
+
export type Binary = string;
|
|
178
|
+
export interface OracleWhitelistConfig {
|
|
179
|
+
backend_pubkey: Binary;
|
|
180
|
+
slope: Uint256;
|
|
181
|
+
threshold: Uint256;
|
|
182
|
+
voting_power_mode: VotingPowerMode;
|
|
183
|
+
}
|
|
184
|
+
export type ArrayOfString = string[];
|
|
185
|
+
export interface WhitelistConfig {
|
|
186
|
+
balance: Uint256;
|
|
187
|
+
is_register: boolean;
|
|
188
|
+
}
|