@dorafactory/maci-sdk 0.0.38 → 0.0.40
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.mts +2213 -0
- package/dist/index.d.ts +7 -11
- package/dist/index.js +49 -170
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +49 -163
- package/dist/index.mjs.map +1 -1
- package/dist/libs/contract/contract.d.ts +7 -11
- package/dist/libs/contract/types.d.ts +3 -1
- package/dist/libs/maci/maci.d.ts +13 -6
- package/dist/maci.d.ts +9 -4
- package/package.json +2 -16
- package/src/index.ts +25 -11
- package/src/libs/contract/config.ts +1 -4
- package/src/libs/contract/contract.ts +10 -24
- package/src/libs/contract/types.ts +4 -1
- package/src/libs/maci/maci.ts +19 -5
- package/src/maci.ts +14 -2
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,2213 @@
|
|
|
1
|
+
import { OfflineSigner } from '@cosmjs/proto-signing';
|
|
2
|
+
import * as _cosmjs_cosmwasm_stargate from '@cosmjs/cosmwasm-stargate';
|
|
3
|
+
import { CosmWasmClient, ExecuteResult, SigningCosmWasmClient } from '@cosmjs/cosmwasm-stargate';
|
|
4
|
+
import * as _cosmjs_stargate from '@cosmjs/stargate';
|
|
5
|
+
import * as _cosmjs_stargate_build_logs from '@cosmjs/stargate/build/logs';
|
|
6
|
+
import { StdFee, Coin } from '@cosmjs/amino';
|
|
7
|
+
|
|
8
|
+
type SignResult = {
|
|
9
|
+
signature: string;
|
|
10
|
+
pubkey: Uint8Array;
|
|
11
|
+
};
|
|
12
|
+
type SnarkBigNumber = bigint;
|
|
13
|
+
type PrivKey = SnarkBigNumber;
|
|
14
|
+
type PubKey$4<N = bigint> = [N, N];
|
|
15
|
+
type EcdhSharedKey<N = bigint> = [N, N];
|
|
16
|
+
type Point<N = SnarkBigNumber> = [N, N];
|
|
17
|
+
type Plaintext<N = bigint> = N[];
|
|
18
|
+
type Ciphertext<N = bigint> = N[];
|
|
19
|
+
type PathElements = bigint[][];
|
|
20
|
+
/**
|
|
21
|
+
* A acc queue
|
|
22
|
+
*/
|
|
23
|
+
interface Queue {
|
|
24
|
+
levels: Map<number, Map<number, bigint>>;
|
|
25
|
+
indices: number[];
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* A private key and a public key
|
|
29
|
+
*/
|
|
30
|
+
interface Keypair {
|
|
31
|
+
privKey: PrivKey;
|
|
32
|
+
pubKey: PubKey$4;
|
|
33
|
+
formatedPrivKey: PrivKey;
|
|
34
|
+
}
|
|
35
|
+
interface Signature<N = SnarkBigNumber> {
|
|
36
|
+
R8: Point<N>;
|
|
37
|
+
S: N;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* A interface for poseidon hash functions
|
|
41
|
+
*/
|
|
42
|
+
interface PoseidonFuncs {
|
|
43
|
+
[key: number]: (inputs: bigint[]) => bigint;
|
|
44
|
+
2: (inputs: bigint[]) => bigint;
|
|
45
|
+
3: (inputs: bigint[]) => bigint;
|
|
46
|
+
4: (inputs: bigint[]) => bigint;
|
|
47
|
+
5: (inputs: bigint[]) => bigint;
|
|
48
|
+
}
|
|
49
|
+
type Leaf = bigint;
|
|
50
|
+
type Node = Record<number, Leaf>;
|
|
51
|
+
interface IMerkleProof {
|
|
52
|
+
pathElements: Leaf[][];
|
|
53
|
+
pathIndices: number[];
|
|
54
|
+
root: Leaf;
|
|
55
|
+
leaf: Leaf;
|
|
56
|
+
}
|
|
57
|
+
type StringifiedBigInts = StringifiedBigInts[] | string | string[] | string[][] | string[][][] | {
|
|
58
|
+
[key: string]: StringifiedBigInts;
|
|
59
|
+
} | null;
|
|
60
|
+
type BigIntVariants = BigIntVariants[] | StringifiedBigInts | bigint | bigint[] | bigint[][] | bigint[][][] | {
|
|
61
|
+
[key: string]: BigIntVariants;
|
|
62
|
+
} | Uint8Array | null;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Generate a private key
|
|
66
|
+
* @returns A random seed for a private key.
|
|
67
|
+
*/
|
|
68
|
+
declare const genPrivKey: () => bigint;
|
|
69
|
+
/**
|
|
70
|
+
* Losslessly reduces the size of the representation of a public key
|
|
71
|
+
* @param pubKey The public key to pack
|
|
72
|
+
* @returns A packed public key
|
|
73
|
+
*/
|
|
74
|
+
declare const packPubKey: (pubKey: PubKey$4) => bigint;
|
|
75
|
+
/**
|
|
76
|
+
* Restores the original PubKey from its packed representation
|
|
77
|
+
* @param packed The value to unpack
|
|
78
|
+
* @returns The unpacked public key
|
|
79
|
+
*/
|
|
80
|
+
declare const unpackPubKey: (packed: bigint) => PubKey$4;
|
|
81
|
+
/**
|
|
82
|
+
* @param privKey A private key generated using genPrivKey()
|
|
83
|
+
* @returns A public key associated with the private key
|
|
84
|
+
*/
|
|
85
|
+
declare const genPubKey: (privKey: PrivKey) => PubKey$4;
|
|
86
|
+
/**
|
|
87
|
+
* Generates a keypair.
|
|
88
|
+
* @returns a keypair
|
|
89
|
+
*/
|
|
90
|
+
declare const genKeypair: (pkey?: PrivKey) => Keypair;
|
|
91
|
+
/**
|
|
92
|
+
* Generates an Elliptic-Curve Diffie–Hellman (ECDH) shared key given a private
|
|
93
|
+
* key and a public key.
|
|
94
|
+
* @param privKey A private key generated using genPrivKey()
|
|
95
|
+
* @param pubKey A public key generated using genPubKey()
|
|
96
|
+
* @returns The ECDH shared key.
|
|
97
|
+
*/
|
|
98
|
+
declare const genEcdhSharedKey: (privKey: PrivKey, pubKey: PubKey$4) => EcdhSharedKey;
|
|
99
|
+
declare const privateKeyFromTxt: (txt: string) => Keypair | undefined;
|
|
100
|
+
declare const genAddKeyProof: (depth: number, { coordPubKey, oldKey, deactivates, }: {
|
|
101
|
+
coordPubKey: PubKey$4;
|
|
102
|
+
oldKey: Keypair;
|
|
103
|
+
deactivates: bigint[][];
|
|
104
|
+
}) => Promise<{
|
|
105
|
+
inputHash: bigint;
|
|
106
|
+
coordPubKey: PubKey$4;
|
|
107
|
+
deactivateRoot: bigint;
|
|
108
|
+
deactivateIndex: number;
|
|
109
|
+
deactivateLeaf: bigint;
|
|
110
|
+
c1: bigint[];
|
|
111
|
+
c2: bigint[];
|
|
112
|
+
randomVal: bigint;
|
|
113
|
+
d1: bigint[];
|
|
114
|
+
d2: bigint[];
|
|
115
|
+
deactivateLeafPathElements: bigint[][];
|
|
116
|
+
nullifier: bigint;
|
|
117
|
+
oldPrivateKey: bigint;
|
|
118
|
+
} | null>;
|
|
119
|
+
|
|
120
|
+
type MixedData<T> = T | Array<MixedData<T>> | {
|
|
121
|
+
[key: string]: MixedData<T>;
|
|
122
|
+
};
|
|
123
|
+
declare const stringizing: (o: MixedData<bigint>, path?: MixedData<bigint>[]) => MixedData<string>;
|
|
124
|
+
declare const bigInt2Buffer: (i: bigint) => Buffer<ArrayBuffer>;
|
|
125
|
+
|
|
126
|
+
type FetchOptions = RequestInit & {
|
|
127
|
+
next?: {
|
|
128
|
+
revalidate?: boolean | number;
|
|
129
|
+
};
|
|
130
|
+
};
|
|
131
|
+
declare class Http {
|
|
132
|
+
private customFetch?;
|
|
133
|
+
private apiEndpoint;
|
|
134
|
+
private restEndpoint;
|
|
135
|
+
private defaultOptions?;
|
|
136
|
+
constructor(apiEndpoint: string, restEndpoint: string, customFetch?: typeof fetch | undefined, defaultOptions?: FetchOptions);
|
|
137
|
+
private getFetch;
|
|
138
|
+
fetch(url: string, options?: any): Promise<Response>;
|
|
139
|
+
fetchGraphql<T>(query: string, after: string, limit?: number | null): Promise<T>;
|
|
140
|
+
fetchRest(path: string, options?: any): Promise<any>;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* This file was automatically generated by @cosmwasm/ts-codegen@1.11.1.
|
|
145
|
+
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
|
|
146
|
+
* and run the @cosmwasm/ts-codegen generate command to regenerate this file.
|
|
147
|
+
*/
|
|
148
|
+
type Addr$3 = string;
|
|
149
|
+
type Uint256$3 = string;
|
|
150
|
+
type Timestamp$3 = Uint64$3;
|
|
151
|
+
type Uint64$3 = string;
|
|
152
|
+
interface PubKey$3 {
|
|
153
|
+
x: Uint256$3;
|
|
154
|
+
y: Uint256$3;
|
|
155
|
+
}
|
|
156
|
+
interface RoundInfo$3 {
|
|
157
|
+
description: string;
|
|
158
|
+
link: string;
|
|
159
|
+
title: string;
|
|
160
|
+
}
|
|
161
|
+
interface VotingTime$3 {
|
|
162
|
+
end_time: Timestamp$3;
|
|
163
|
+
start_time: Timestamp$3;
|
|
164
|
+
}
|
|
165
|
+
interface Whitelist$2 {
|
|
166
|
+
users: WhitelistConfig$3[];
|
|
167
|
+
}
|
|
168
|
+
interface WhitelistConfig$3 {
|
|
169
|
+
addr: Addr$3;
|
|
170
|
+
}
|
|
171
|
+
interface ValidatorSet {
|
|
172
|
+
addresses: Addr$3[];
|
|
173
|
+
}
|
|
174
|
+
interface AdminResponse {
|
|
175
|
+
admin: Addr$3;
|
|
176
|
+
}
|
|
177
|
+
type String = string;
|
|
178
|
+
type Boolean$3 = boolean;
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* This file was automatically generated by @cosmwasm/ts-codegen@1.11.1.
|
|
182
|
+
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
|
|
183
|
+
* and run the @cosmwasm/ts-codegen generate command to regenerate this file.
|
|
184
|
+
*/
|
|
185
|
+
type Uint256$2 = string;
|
|
186
|
+
type Timestamp$2 = Uint64$2;
|
|
187
|
+
type Uint64$2 = string;
|
|
188
|
+
interface PubKey$2 {
|
|
189
|
+
x: Uint256$2;
|
|
190
|
+
y: Uint256$2;
|
|
191
|
+
}
|
|
192
|
+
interface RoundInfo$2 {
|
|
193
|
+
description: string;
|
|
194
|
+
link: string;
|
|
195
|
+
title: string;
|
|
196
|
+
}
|
|
197
|
+
interface VotingTime$2 {
|
|
198
|
+
end_time?: Timestamp$2 | null;
|
|
199
|
+
start_time?: Timestamp$2 | null;
|
|
200
|
+
}
|
|
201
|
+
interface Whitelist$1 {
|
|
202
|
+
users: WhitelistConfig$2[];
|
|
203
|
+
}
|
|
204
|
+
interface WhitelistConfig$2 {
|
|
205
|
+
addr: string;
|
|
206
|
+
balance: Uint256$2;
|
|
207
|
+
}
|
|
208
|
+
type Uint128$2 = string;
|
|
209
|
+
interface MessageData$2 {
|
|
210
|
+
data: [Uint256$2, Uint256$2, Uint256$2, Uint256$2, Uint256$2, Uint256$2, Uint256$2];
|
|
211
|
+
}
|
|
212
|
+
interface Groth16ProofType$2 {
|
|
213
|
+
a: string;
|
|
214
|
+
b: string;
|
|
215
|
+
c: string;
|
|
216
|
+
}
|
|
217
|
+
interface PlonkProofType$1 {
|
|
218
|
+
grand_product_at_z_omega: string;
|
|
219
|
+
grand_product_commitment: string;
|
|
220
|
+
input_values: string[];
|
|
221
|
+
linearization_polynomial_at_z: string;
|
|
222
|
+
n: number;
|
|
223
|
+
num_inputs: number;
|
|
224
|
+
opening_at_z_omega_proof: string;
|
|
225
|
+
opening_at_z_proof: string;
|
|
226
|
+
permutation_polynomials_at_z: string[];
|
|
227
|
+
quotient_poly_commitments: string[];
|
|
228
|
+
quotient_polynomial_at_z: string;
|
|
229
|
+
wire_commitments: string[];
|
|
230
|
+
wire_values_at_z: string[];
|
|
231
|
+
wire_values_at_z_omega: string[];
|
|
232
|
+
}
|
|
233
|
+
type Addr$2 = string;
|
|
234
|
+
type PeriodStatus$2 = 'pending' | 'voting' | 'processing' | 'tallying' | 'ended';
|
|
235
|
+
interface Period$2 {
|
|
236
|
+
status: PeriodStatus$2;
|
|
237
|
+
}
|
|
238
|
+
type Boolean$2 = boolean;
|
|
239
|
+
type ArrayOfString$2 = string[];
|
|
240
|
+
|
|
241
|
+
type CreateRoundParams = {
|
|
242
|
+
signer?: OfflineSigner;
|
|
243
|
+
title: string;
|
|
244
|
+
description?: string;
|
|
245
|
+
link?: string;
|
|
246
|
+
startVoting: Date;
|
|
247
|
+
endVoting: Date;
|
|
248
|
+
circuitType: MaciCircuitType;
|
|
249
|
+
};
|
|
250
|
+
type CreateAMaciRoundParams = {
|
|
251
|
+
maxVoter: number;
|
|
252
|
+
maxOption: number;
|
|
253
|
+
operator: string;
|
|
254
|
+
whitelist: Whitelist$2;
|
|
255
|
+
voiceCreditAmount: string;
|
|
256
|
+
preDeactivateRoot?: string;
|
|
257
|
+
} & CreateRoundParams;
|
|
258
|
+
type CreateMaciRoundParams = {
|
|
259
|
+
maxVoter: number;
|
|
260
|
+
maxOption: number;
|
|
261
|
+
operatorPubkey: bigint | string;
|
|
262
|
+
whitelist: Whitelist$1;
|
|
263
|
+
certSystemType: MaciCertSystemType;
|
|
264
|
+
} & CreateRoundParams;
|
|
265
|
+
type CreateOracleMaciRoundParams = {
|
|
266
|
+
voteOptionMap: string[];
|
|
267
|
+
operatorPubkey: bigint | string;
|
|
268
|
+
whitelistEcosystem: CertificateEcosystem;
|
|
269
|
+
whitelistSnapshotHeight: string;
|
|
270
|
+
whitelistVotingPowerArgs: {
|
|
271
|
+
mode: 'slope' | 'threshold';
|
|
272
|
+
slope: string;
|
|
273
|
+
threshold: string;
|
|
274
|
+
};
|
|
275
|
+
} & CreateRoundParams;
|
|
276
|
+
|
|
277
|
+
declare enum MaciCircuitType {
|
|
278
|
+
IP1V = "0",
|
|
279
|
+
QV = "1"
|
|
280
|
+
}
|
|
281
|
+
declare enum MaciCertSystemType {
|
|
282
|
+
GROTH16 = "groth16",
|
|
283
|
+
PLONK = "plonk"
|
|
284
|
+
}
|
|
285
|
+
declare enum MaciRoundType {
|
|
286
|
+
MACI = "0",
|
|
287
|
+
AMACI = "1",
|
|
288
|
+
ORACLE_MACI = "2"
|
|
289
|
+
}
|
|
290
|
+
type CertificateEcosystem = 'cosmoshub' | 'doravota';
|
|
291
|
+
type ClientParams = {
|
|
292
|
+
signer?: OfflineSigner;
|
|
293
|
+
network: 'mainnet' | 'testnet';
|
|
294
|
+
rpcEndpoint?: string;
|
|
295
|
+
restEndpoint?: string;
|
|
296
|
+
apiEndpoint?: string;
|
|
297
|
+
certificateApiEndpoint?: string;
|
|
298
|
+
registryAddress?: string;
|
|
299
|
+
maciCodeId?: number;
|
|
300
|
+
oracleCodeId?: number;
|
|
301
|
+
customFetch?: typeof fetch;
|
|
302
|
+
defaultOptions?: FetchOptions;
|
|
303
|
+
feegrantOperator?: string;
|
|
304
|
+
whitelistBackendPubkey?: string;
|
|
305
|
+
maciKeypair?: Keypair;
|
|
306
|
+
secretKey?: string;
|
|
307
|
+
mnemonic?: string;
|
|
308
|
+
};
|
|
309
|
+
type ContractParams = {
|
|
310
|
+
rpcEndpoint: string;
|
|
311
|
+
registryAddress: string;
|
|
312
|
+
maciCodeId: number;
|
|
313
|
+
oracleCodeId: number;
|
|
314
|
+
whitelistBackendPubkey: string;
|
|
315
|
+
feegrantOperator: string;
|
|
316
|
+
};
|
|
317
|
+
type TransactionType = {
|
|
318
|
+
id: string;
|
|
319
|
+
blockHeight: string;
|
|
320
|
+
txHash: string;
|
|
321
|
+
timestamp: string;
|
|
322
|
+
type: string;
|
|
323
|
+
status: string;
|
|
324
|
+
circuitName: string;
|
|
325
|
+
fee: string;
|
|
326
|
+
gasUsed: string;
|
|
327
|
+
gasWanted: string;
|
|
328
|
+
caller: string;
|
|
329
|
+
contractAddress: string;
|
|
330
|
+
};
|
|
331
|
+
type RoundType = {
|
|
332
|
+
id: string;
|
|
333
|
+
blockHeight: string;
|
|
334
|
+
txHash: string;
|
|
335
|
+
caller: string;
|
|
336
|
+
admin: string;
|
|
337
|
+
operator: string;
|
|
338
|
+
contractAddress: string;
|
|
339
|
+
circuitName: string;
|
|
340
|
+
timestamp: string;
|
|
341
|
+
votingStart: string;
|
|
342
|
+
votingEnd: string;
|
|
343
|
+
status: string;
|
|
344
|
+
period: string;
|
|
345
|
+
actionType: string;
|
|
346
|
+
roundTitle: string;
|
|
347
|
+
roundDescription: string;
|
|
348
|
+
roundLink: string;
|
|
349
|
+
coordinatorPubkeyX: string;
|
|
350
|
+
coordinatorPubkeyY: string;
|
|
351
|
+
voteOptionMap: string;
|
|
352
|
+
results: string;
|
|
353
|
+
allResult: string;
|
|
354
|
+
gasStationEnable: boolean;
|
|
355
|
+
totalGrant: string;
|
|
356
|
+
baseGrant: string;
|
|
357
|
+
totalBond: string;
|
|
358
|
+
circuitType: string;
|
|
359
|
+
circuitPower: string;
|
|
360
|
+
certificationSystem: string;
|
|
361
|
+
codeId: string;
|
|
362
|
+
maciType: string;
|
|
363
|
+
voiceCreditAmount: string;
|
|
364
|
+
preDeactivateRoot: string;
|
|
365
|
+
identity: string;
|
|
366
|
+
operatorLogoUrl?: string;
|
|
367
|
+
operatorMoniker?: string;
|
|
368
|
+
resultsList?: {
|
|
369
|
+
v: number;
|
|
370
|
+
v2: number;
|
|
371
|
+
}[];
|
|
372
|
+
};
|
|
373
|
+
type SelectiveRoundType = Partial<RoundType>;
|
|
374
|
+
type ProofType = {
|
|
375
|
+
nodes: {
|
|
376
|
+
id: string;
|
|
377
|
+
blockHeight: string;
|
|
378
|
+
txHash: string;
|
|
379
|
+
contractAddress: string;
|
|
380
|
+
timestamp: string;
|
|
381
|
+
actionType: string;
|
|
382
|
+
commitment: string;
|
|
383
|
+
proof: string;
|
|
384
|
+
}[];
|
|
385
|
+
};
|
|
386
|
+
type OperatorDelayType = {
|
|
387
|
+
blockHeight: string;
|
|
388
|
+
delayProcessDmsgCount: number;
|
|
389
|
+
delayDuration: string;
|
|
390
|
+
delayReason: string;
|
|
391
|
+
delayType: string;
|
|
392
|
+
id: string;
|
|
393
|
+
nodeId: string;
|
|
394
|
+
operatorAddress: string;
|
|
395
|
+
timestamp: string;
|
|
396
|
+
roundAddress: string;
|
|
397
|
+
};
|
|
398
|
+
type OperatorType = {
|
|
399
|
+
id: string;
|
|
400
|
+
validatorAddress: string;
|
|
401
|
+
operatorAddress: string;
|
|
402
|
+
coordinatorPubkeyX: string;
|
|
403
|
+
coordinatorPubkeyY: string;
|
|
404
|
+
identity: string;
|
|
405
|
+
logoUrl: string;
|
|
406
|
+
moniker: string;
|
|
407
|
+
activeRoundsCount: number;
|
|
408
|
+
completedRoundsCount: number;
|
|
409
|
+
};
|
|
410
|
+
type CircuitType = {
|
|
411
|
+
maciType: string;
|
|
412
|
+
circuitType: string;
|
|
413
|
+
displayName: string;
|
|
414
|
+
repoUrl: string;
|
|
415
|
+
zipUrl: string;
|
|
416
|
+
roundCount?: number;
|
|
417
|
+
};
|
|
418
|
+
type SignUpEventType = {
|
|
419
|
+
id: string;
|
|
420
|
+
blockHeight: string;
|
|
421
|
+
txHash: string;
|
|
422
|
+
contractAddress: string;
|
|
423
|
+
timestamp: string;
|
|
424
|
+
pubKey: string;
|
|
425
|
+
stateIdx: number;
|
|
426
|
+
balance: string;
|
|
427
|
+
};
|
|
428
|
+
type CircuitsCountGraphqlResponse = {
|
|
429
|
+
data: {
|
|
430
|
+
rounds: {
|
|
431
|
+
totalCount: number;
|
|
432
|
+
};
|
|
433
|
+
};
|
|
434
|
+
};
|
|
435
|
+
type ErrorResponse = {
|
|
436
|
+
code: number;
|
|
437
|
+
error: {
|
|
438
|
+
message: string;
|
|
439
|
+
type: string;
|
|
440
|
+
};
|
|
441
|
+
};
|
|
442
|
+
type SuccessResponse<T> = {
|
|
443
|
+
code: 200;
|
|
444
|
+
data: T;
|
|
445
|
+
};
|
|
446
|
+
type CircuitResponse = SuccessResponse<{
|
|
447
|
+
circuit: CircuitType;
|
|
448
|
+
}> | ErrorResponse;
|
|
449
|
+
type CircuitsResponse = SuccessResponse<{
|
|
450
|
+
circuits: CircuitType[];
|
|
451
|
+
}> | ErrorResponse;
|
|
452
|
+
type BalanceResponse = SuccessResponse<{
|
|
453
|
+
balance: string;
|
|
454
|
+
}> | ErrorResponse;
|
|
455
|
+
type OperatorResponse = SuccessResponse<{
|
|
456
|
+
operator: OperatorType;
|
|
457
|
+
}> | ErrorResponse;
|
|
458
|
+
type MissRateResponse = SuccessResponse<{
|
|
459
|
+
missRate: (MissRateType & {
|
|
460
|
+
date: string;
|
|
461
|
+
})[];
|
|
462
|
+
}> | ErrorResponse;
|
|
463
|
+
type OperatorDelayOperationsResponse = SuccessResponse<{
|
|
464
|
+
operatorDelayOperations: {
|
|
465
|
+
pageInfo: {
|
|
466
|
+
endCursor: string;
|
|
467
|
+
hasNextPage: boolean;
|
|
468
|
+
};
|
|
469
|
+
edges: {
|
|
470
|
+
cursor: string;
|
|
471
|
+
node: OperatorDelayType;
|
|
472
|
+
}[];
|
|
473
|
+
totalCount: number;
|
|
474
|
+
};
|
|
475
|
+
}> | ErrorResponse;
|
|
476
|
+
type OperatorsResponse = SuccessResponse<{
|
|
477
|
+
operators: {
|
|
478
|
+
pageInfo: {
|
|
479
|
+
endCursor: string;
|
|
480
|
+
hasNextPage: boolean;
|
|
481
|
+
};
|
|
482
|
+
edges: {
|
|
483
|
+
cursor: string;
|
|
484
|
+
node: OperatorType;
|
|
485
|
+
}[];
|
|
486
|
+
totalCount: number;
|
|
487
|
+
};
|
|
488
|
+
}> | ErrorResponse;
|
|
489
|
+
type OperatorsGraphqlResponse = {
|
|
490
|
+
data: {
|
|
491
|
+
operators: {
|
|
492
|
+
pageInfo: {
|
|
493
|
+
endCursor: string;
|
|
494
|
+
hasNextPage: boolean;
|
|
495
|
+
};
|
|
496
|
+
edges: {
|
|
497
|
+
cursor: string;
|
|
498
|
+
node: OperatorType;
|
|
499
|
+
}[];
|
|
500
|
+
totalCount: number;
|
|
501
|
+
};
|
|
502
|
+
};
|
|
503
|
+
};
|
|
504
|
+
type RoundsCountGraphqlResponse = {
|
|
505
|
+
data: {
|
|
506
|
+
activeRoundsCount: {
|
|
507
|
+
totalCount: number;
|
|
508
|
+
};
|
|
509
|
+
completedRoundsCount: {
|
|
510
|
+
totalCount: number;
|
|
511
|
+
};
|
|
512
|
+
};
|
|
513
|
+
};
|
|
514
|
+
type VoteCountGraphqlResponse = {
|
|
515
|
+
data: {
|
|
516
|
+
signupsCount: {
|
|
517
|
+
totalCount: number;
|
|
518
|
+
};
|
|
519
|
+
messagesCount: {
|
|
520
|
+
totalCount: number;
|
|
521
|
+
};
|
|
522
|
+
};
|
|
523
|
+
};
|
|
524
|
+
type OperatorDelayOperationsGraphqlResponse = {
|
|
525
|
+
data: {
|
|
526
|
+
operatorDelayOperations: {
|
|
527
|
+
pageInfo: {
|
|
528
|
+
endCursor: string;
|
|
529
|
+
hasNextPage: boolean;
|
|
530
|
+
};
|
|
531
|
+
edges: {
|
|
532
|
+
cursor: string;
|
|
533
|
+
node: OperatorDelayType;
|
|
534
|
+
}[];
|
|
535
|
+
totalCount: number;
|
|
536
|
+
};
|
|
537
|
+
};
|
|
538
|
+
};
|
|
539
|
+
type TransactionGraphqlResponse = {
|
|
540
|
+
data: {
|
|
541
|
+
transaction: TransactionType;
|
|
542
|
+
};
|
|
543
|
+
};
|
|
544
|
+
type TransactionResponse = SuccessResponse<{
|
|
545
|
+
transaction: TransactionType;
|
|
546
|
+
}> | ErrorResponse;
|
|
547
|
+
type TransactionsGraphqlResponse = {
|
|
548
|
+
data: {
|
|
549
|
+
transactions: {
|
|
550
|
+
pageInfo: {
|
|
551
|
+
endCursor: string;
|
|
552
|
+
hasNextPage: boolean;
|
|
553
|
+
};
|
|
554
|
+
edges: {
|
|
555
|
+
cursor: string;
|
|
556
|
+
node: TransactionType;
|
|
557
|
+
}[];
|
|
558
|
+
totalCount: number;
|
|
559
|
+
};
|
|
560
|
+
};
|
|
561
|
+
};
|
|
562
|
+
type TransactionsResponse = SuccessResponse<{
|
|
563
|
+
transactions: {
|
|
564
|
+
pageInfo: {
|
|
565
|
+
endCursor: string;
|
|
566
|
+
hasNextPage: boolean;
|
|
567
|
+
};
|
|
568
|
+
edges: {
|
|
569
|
+
cursor: string;
|
|
570
|
+
node: TransactionType;
|
|
571
|
+
}[];
|
|
572
|
+
totalCount: number;
|
|
573
|
+
};
|
|
574
|
+
}> | ErrorResponse;
|
|
575
|
+
type RoundResponse = SuccessResponse<{
|
|
576
|
+
round: RoundType;
|
|
577
|
+
}> | ErrorResponse;
|
|
578
|
+
type SelectiveRoundResponse = SuccessResponse<{
|
|
579
|
+
round: SelectiveRoundType;
|
|
580
|
+
}> | ErrorResponse;
|
|
581
|
+
type RoundsResponse = SuccessResponse<{
|
|
582
|
+
rounds: {
|
|
583
|
+
pageInfo: {
|
|
584
|
+
endCursor: string;
|
|
585
|
+
hasNextPage: boolean;
|
|
586
|
+
};
|
|
587
|
+
edges: {
|
|
588
|
+
cursor: string;
|
|
589
|
+
node: RoundType;
|
|
590
|
+
}[];
|
|
591
|
+
totalCount: number;
|
|
592
|
+
};
|
|
593
|
+
}> | ErrorResponse;
|
|
594
|
+
type RoundGraphqlResponse = {
|
|
595
|
+
data: {
|
|
596
|
+
round: RoundType;
|
|
597
|
+
};
|
|
598
|
+
};
|
|
599
|
+
/**
|
|
600
|
+
* GraphQL response type for selective round fields
|
|
601
|
+
*/
|
|
602
|
+
type SelectiveRoundGraphqlResponse = {
|
|
603
|
+
data: {
|
|
604
|
+
round: SelectiveRoundType;
|
|
605
|
+
};
|
|
606
|
+
};
|
|
607
|
+
type RoundsGraphqlResponse = {
|
|
608
|
+
data: {
|
|
609
|
+
rounds: {
|
|
610
|
+
pageInfo: {
|
|
611
|
+
endCursor: string;
|
|
612
|
+
hasNextPage: boolean;
|
|
613
|
+
};
|
|
614
|
+
edges: {
|
|
615
|
+
cursor: string;
|
|
616
|
+
node: RoundType;
|
|
617
|
+
}[];
|
|
618
|
+
totalCount: number;
|
|
619
|
+
};
|
|
620
|
+
};
|
|
621
|
+
};
|
|
622
|
+
type ProofResponse = SuccessResponse<{
|
|
623
|
+
proofData: ProofType;
|
|
624
|
+
}> | ErrorResponse;
|
|
625
|
+
type ProofGraphqlResponse = {
|
|
626
|
+
data: {
|
|
627
|
+
proofData: ProofType;
|
|
628
|
+
};
|
|
629
|
+
};
|
|
630
|
+
type SignUpEventsResponse = SuccessResponse<{
|
|
631
|
+
signUpEvents: SignUpEventType[];
|
|
632
|
+
}> | ErrorResponse;
|
|
633
|
+
type SignUpEventsGraphqlResponse = {
|
|
634
|
+
data: {
|
|
635
|
+
signUpEvents: {
|
|
636
|
+
nodes: SignUpEventType[];
|
|
637
|
+
};
|
|
638
|
+
};
|
|
639
|
+
};
|
|
640
|
+
type MissRateType = {
|
|
641
|
+
delayCount: number;
|
|
642
|
+
deactivateDelay: {
|
|
643
|
+
count: number;
|
|
644
|
+
dmsgCount: number;
|
|
645
|
+
};
|
|
646
|
+
tallyDelay: {
|
|
647
|
+
count: number;
|
|
648
|
+
};
|
|
649
|
+
totalDelayDuration: number;
|
|
650
|
+
avgDelayDuration: number;
|
|
651
|
+
tallyCount: number;
|
|
652
|
+
deactivateCount: number;
|
|
653
|
+
missRate: number;
|
|
654
|
+
};
|
|
655
|
+
|
|
656
|
+
type OracleCertificateParams = {
|
|
657
|
+
certificateApiEndpoint: string;
|
|
658
|
+
http: Http;
|
|
659
|
+
};
|
|
660
|
+
type SignatureRequest = {
|
|
661
|
+
ecosystem: CertificateEcosystem;
|
|
662
|
+
address: string;
|
|
663
|
+
height: string;
|
|
664
|
+
contractAddress: string;
|
|
665
|
+
};
|
|
666
|
+
type SignatureResponse = {
|
|
667
|
+
signature: string;
|
|
668
|
+
amount: string;
|
|
669
|
+
snapshotHeight: string;
|
|
670
|
+
};
|
|
671
|
+
type FeegrantAllowanceResponse = {
|
|
672
|
+
granter: string;
|
|
673
|
+
grantee: string;
|
|
674
|
+
spend_limit: {
|
|
675
|
+
denom: string;
|
|
676
|
+
amount: string;
|
|
677
|
+
}[];
|
|
678
|
+
};
|
|
679
|
+
interface SnapshotHeightInfo {
|
|
680
|
+
lowestHeight: string;
|
|
681
|
+
latestHeight: string;
|
|
682
|
+
}
|
|
683
|
+
interface Ecosystem {
|
|
684
|
+
name: string;
|
|
685
|
+
displayName: string;
|
|
686
|
+
decimals: number;
|
|
687
|
+
apiPath: string;
|
|
688
|
+
snapshotHeightInfo: SnapshotHeightInfo;
|
|
689
|
+
baseSlope: number;
|
|
690
|
+
}
|
|
691
|
+
interface EcosystemsResponse {
|
|
692
|
+
ecosystems: Ecosystem[];
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
/**
|
|
696
|
+
* This file was automatically generated by @cosmwasm/ts-codegen@1.11.1.
|
|
697
|
+
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
|
|
698
|
+
* and run the @cosmwasm/ts-codegen generate command to regenerate this file.
|
|
699
|
+
*/
|
|
700
|
+
type Addr$1 = string;
|
|
701
|
+
type Uint256$1 = string;
|
|
702
|
+
type Timestamp$1 = Uint64$1;
|
|
703
|
+
type Uint64$1 = string;
|
|
704
|
+
interface PubKey$1 {
|
|
705
|
+
x: Uint256$1;
|
|
706
|
+
y: Uint256$1;
|
|
707
|
+
}
|
|
708
|
+
interface RoundInfo$1 {
|
|
709
|
+
description: string;
|
|
710
|
+
link: string;
|
|
711
|
+
title: string;
|
|
712
|
+
}
|
|
713
|
+
interface VotingTime$1 {
|
|
714
|
+
end_time: Timestamp$1;
|
|
715
|
+
start_time: Timestamp$1;
|
|
716
|
+
}
|
|
717
|
+
interface WhitelistBase {
|
|
718
|
+
users: WhitelistBaseConfig[];
|
|
719
|
+
}
|
|
720
|
+
interface WhitelistBaseConfig {
|
|
721
|
+
addr: Addr$1;
|
|
722
|
+
}
|
|
723
|
+
interface MessageData$1 {
|
|
724
|
+
data: [Uint256$1, Uint256$1, Uint256$1, Uint256$1, Uint256$1, Uint256$1, Uint256$1];
|
|
725
|
+
}
|
|
726
|
+
interface Groth16ProofType$1 {
|
|
727
|
+
a: string;
|
|
728
|
+
b: string;
|
|
729
|
+
c: string;
|
|
730
|
+
}
|
|
731
|
+
type Boolean$1 = boolean;
|
|
732
|
+
type DelayType = 'deactivate_delay' | 'tally_delay';
|
|
733
|
+
interface DelayRecords {
|
|
734
|
+
records: DelayRecord[];
|
|
735
|
+
}
|
|
736
|
+
interface DelayRecord {
|
|
737
|
+
delay_duration: number;
|
|
738
|
+
delay_process_dmsg_count: Uint256$1;
|
|
739
|
+
delay_reason: string;
|
|
740
|
+
delay_timestamp: Timestamp$1;
|
|
741
|
+
delay_type: DelayType;
|
|
742
|
+
}
|
|
743
|
+
type PeriodStatus$1 = 'pending' | 'voting' | 'processing' | 'tallying' | 'ended';
|
|
744
|
+
interface Period$1 {
|
|
745
|
+
status: PeriodStatus$1;
|
|
746
|
+
}
|
|
747
|
+
type Uint128$1 = string;
|
|
748
|
+
type ArrayOfString$1 = string[];
|
|
749
|
+
interface Whitelist {
|
|
750
|
+
users: WhitelistConfig$1[];
|
|
751
|
+
}
|
|
752
|
+
interface WhitelistConfig$1 {
|
|
753
|
+
addr: Addr$1;
|
|
754
|
+
is_register: boolean;
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
/**
|
|
758
|
+
* This file was automatically generated by @cosmwasm/ts-codegen@1.11.1.
|
|
759
|
+
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
|
|
760
|
+
* and run the @cosmwasm/ts-codegen generate command to regenerate this file.
|
|
761
|
+
*/
|
|
762
|
+
|
|
763
|
+
interface AMaciReadOnlyInterface {
|
|
764
|
+
contractAddress: string;
|
|
765
|
+
admin: () => Promise<Addr$1>;
|
|
766
|
+
operator: () => Promise<Addr$1>;
|
|
767
|
+
getRoundInfo: () => Promise<RoundInfo$1>;
|
|
768
|
+
getVotingTime: () => Promise<VotingTime$1>;
|
|
769
|
+
getPeriod: () => Promise<Period$1>;
|
|
770
|
+
getNumSignUp: () => Promise<Uint256$1>;
|
|
771
|
+
getMsgChainLength: () => Promise<Uint256$1>;
|
|
772
|
+
getDMsgChainLength: () => Promise<Uint256$1>;
|
|
773
|
+
getProcessedDMsgCount: () => Promise<Uint256$1>;
|
|
774
|
+
getProcessedMsgCount: () => Promise<Uint256$1>;
|
|
775
|
+
getProcessedUserCount: () => Promise<Uint256$1>;
|
|
776
|
+
getResult: ({ index }: {
|
|
777
|
+
index: Uint256$1;
|
|
778
|
+
}) => Promise<Uint256$1>;
|
|
779
|
+
getAllResult: () => Promise<Uint256$1>;
|
|
780
|
+
getStateIdxInc: ({ address }: {
|
|
781
|
+
address: Addr$1;
|
|
782
|
+
}) => Promise<Uint256$1>;
|
|
783
|
+
getVoiceCreditBalance: ({ index }: {
|
|
784
|
+
index: Uint256$1;
|
|
785
|
+
}) => Promise<Uint256$1>;
|
|
786
|
+
getVoiceCreditAmount: () => Promise<Uint256$1>;
|
|
787
|
+
whiteList: () => Promise<Whitelist>;
|
|
788
|
+
canSignUp: ({ sender }: {
|
|
789
|
+
sender: Addr$1;
|
|
790
|
+
}) => Promise<Boolean$1>;
|
|
791
|
+
isWhiteList: ({ sender }: {
|
|
792
|
+
sender: Addr$1;
|
|
793
|
+
}) => Promise<Boolean$1>;
|
|
794
|
+
isRegister: ({ sender }: {
|
|
795
|
+
sender: Addr$1;
|
|
796
|
+
}) => Promise<Boolean$1>;
|
|
797
|
+
signuped: ({ pubkeyX }: {
|
|
798
|
+
pubkeyX: Uint256$1;
|
|
799
|
+
}) => Promise<Uint256$1>;
|
|
800
|
+
voteOptionMap: () => Promise<ArrayOfString$1>;
|
|
801
|
+
maxVoteOptions: () => Promise<Uint256$1>;
|
|
802
|
+
queryTotalFeeGrant: () => Promise<Uint128$1>;
|
|
803
|
+
queryCircuitType: () => Promise<Uint256$1>;
|
|
804
|
+
queryCertSystem: () => Promise<Uint256$1>;
|
|
805
|
+
queryPreDeactivateRoot: () => Promise<Uint256$1>;
|
|
806
|
+
getDelayRecords: () => Promise<DelayRecords>;
|
|
807
|
+
}
|
|
808
|
+
declare class AMaciQueryClient implements AMaciReadOnlyInterface {
|
|
809
|
+
client: CosmWasmClient;
|
|
810
|
+
contractAddress: string;
|
|
811
|
+
constructor(client: CosmWasmClient, contractAddress: string);
|
|
812
|
+
admin: () => Promise<Addr$1>;
|
|
813
|
+
operator: () => Promise<Addr$1>;
|
|
814
|
+
getRoundInfo: () => Promise<RoundInfo$1>;
|
|
815
|
+
getVotingTime: () => Promise<VotingTime$1>;
|
|
816
|
+
getPeriod: () => Promise<Period$1>;
|
|
817
|
+
getNumSignUp: () => Promise<Uint256$1>;
|
|
818
|
+
getMsgChainLength: () => Promise<Uint256$1>;
|
|
819
|
+
getDMsgChainLength: () => Promise<Uint256$1>;
|
|
820
|
+
getProcessedDMsgCount: () => Promise<Uint256$1>;
|
|
821
|
+
getProcessedMsgCount: () => Promise<Uint256$1>;
|
|
822
|
+
getProcessedUserCount: () => Promise<Uint256$1>;
|
|
823
|
+
getResult: ({ index }: {
|
|
824
|
+
index: Uint256$1;
|
|
825
|
+
}) => Promise<Uint256$1>;
|
|
826
|
+
getAllResult: () => Promise<Uint256$1>;
|
|
827
|
+
getStateIdxInc: ({ address }: {
|
|
828
|
+
address: Addr$1;
|
|
829
|
+
}) => Promise<Uint256$1>;
|
|
830
|
+
getVoiceCreditBalance: ({ index, }: {
|
|
831
|
+
index: Uint256$1;
|
|
832
|
+
}) => Promise<Uint256$1>;
|
|
833
|
+
getVoiceCreditAmount: () => Promise<Uint256$1>;
|
|
834
|
+
whiteList: () => Promise<Whitelist>;
|
|
835
|
+
canSignUp: ({ sender }: {
|
|
836
|
+
sender: Addr$1;
|
|
837
|
+
}) => Promise<Boolean$1>;
|
|
838
|
+
isWhiteList: ({ sender }: {
|
|
839
|
+
sender: Addr$1;
|
|
840
|
+
}) => Promise<Boolean$1>;
|
|
841
|
+
isRegister: ({ sender }: {
|
|
842
|
+
sender: Addr$1;
|
|
843
|
+
}) => Promise<Boolean$1>;
|
|
844
|
+
signuped: ({ pubkeyX }: {
|
|
845
|
+
pubkeyX: Uint256$1;
|
|
846
|
+
}) => Promise<Uint256$1>;
|
|
847
|
+
voteOptionMap: () => Promise<ArrayOfString$1>;
|
|
848
|
+
maxVoteOptions: () => Promise<Uint256$1>;
|
|
849
|
+
queryTotalFeeGrant: () => Promise<Uint128$1>;
|
|
850
|
+
queryCircuitType: () => Promise<Uint256$1>;
|
|
851
|
+
queryCertSystem: () => Promise<Uint256$1>;
|
|
852
|
+
queryPreDeactivateRoot: () => Promise<Uint256$1>;
|
|
853
|
+
getDelayRecords: () => Promise<DelayRecords>;
|
|
854
|
+
}
|
|
855
|
+
interface AMaciInterface extends AMaciReadOnlyInterface {
|
|
856
|
+
contractAddress: string;
|
|
857
|
+
sender: string;
|
|
858
|
+
setRoundInfo: ({ roundInfo, }: {
|
|
859
|
+
roundInfo: RoundInfo$1;
|
|
860
|
+
}, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
861
|
+
setWhitelists: ({ whitelists, }: {
|
|
862
|
+
whitelists: WhitelistBase;
|
|
863
|
+
}, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
864
|
+
setVoteOptionsMap: ({ voteOptionMap, }: {
|
|
865
|
+
voteOptionMap: string[];
|
|
866
|
+
}, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
867
|
+
signUp: ({ pubkey, }: {
|
|
868
|
+
pubkey: PubKey$1;
|
|
869
|
+
}, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
870
|
+
startProcessPeriod: (fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
871
|
+
publishDeactivateMessage: ({ encPubKey, message, }: {
|
|
872
|
+
encPubKey: PubKey$1;
|
|
873
|
+
message: MessageData$1;
|
|
874
|
+
}, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
875
|
+
processDeactivateMessage: ({ groth16Proof, newDeactivateCommitment, newDeactivateRoot, size, }: {
|
|
876
|
+
groth16Proof: Groth16ProofType$1;
|
|
877
|
+
newDeactivateCommitment: Uint256$1;
|
|
878
|
+
newDeactivateRoot: Uint256$1;
|
|
879
|
+
size: Uint256$1;
|
|
880
|
+
}, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
881
|
+
addNewKey: ({ d, groth16Proof, nullifier, pubkey, }: {
|
|
882
|
+
d: Uint256$1[];
|
|
883
|
+
groth16Proof: Groth16ProofType$1;
|
|
884
|
+
nullifier: Uint256$1;
|
|
885
|
+
pubkey: PubKey$1;
|
|
886
|
+
}, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
887
|
+
preAddNewKey: ({ d, groth16Proof, nullifier, pubkey, }: {
|
|
888
|
+
d: Uint256$1[];
|
|
889
|
+
groth16Proof: Groth16ProofType$1;
|
|
890
|
+
nullifier: Uint256$1;
|
|
891
|
+
pubkey: PubKey$1;
|
|
892
|
+
}, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
893
|
+
publishMessage: ({ encPubKey, message, }: {
|
|
894
|
+
encPubKey: PubKey$1;
|
|
895
|
+
message: MessageData$1;
|
|
896
|
+
}, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
897
|
+
processMessage: ({ groth16Proof, newStateCommitment, }: {
|
|
898
|
+
groth16Proof: Groth16ProofType$1;
|
|
899
|
+
newStateCommitment: Uint256$1;
|
|
900
|
+
}, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
901
|
+
stopProcessingPeriod: (fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
902
|
+
processTally: ({ groth16Proof, newTallyCommitment, }: {
|
|
903
|
+
groth16Proof: Groth16ProofType$1;
|
|
904
|
+
newTallyCommitment: Uint256$1;
|
|
905
|
+
}, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
906
|
+
stopTallyingPeriod: ({ results, salt, }: {
|
|
907
|
+
results: Uint256$1[];
|
|
908
|
+
salt: Uint256$1;
|
|
909
|
+
}, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
910
|
+
claim: (fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
911
|
+
}
|
|
912
|
+
declare class AMaciClient extends AMaciQueryClient implements AMaciInterface {
|
|
913
|
+
client: SigningCosmWasmClient;
|
|
914
|
+
sender: string;
|
|
915
|
+
contractAddress: string;
|
|
916
|
+
constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string);
|
|
917
|
+
setRoundInfo: ({ roundInfo, }: {
|
|
918
|
+
roundInfo: RoundInfo$1;
|
|
919
|
+
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
920
|
+
setWhitelists: ({ whitelists, }: {
|
|
921
|
+
whitelists: WhitelistBase;
|
|
922
|
+
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
923
|
+
setVoteOptionsMap: ({ voteOptionMap, }: {
|
|
924
|
+
voteOptionMap: string[];
|
|
925
|
+
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
926
|
+
signUp: ({ pubkey, }: {
|
|
927
|
+
pubkey: PubKey$1;
|
|
928
|
+
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
929
|
+
startProcessPeriod: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
930
|
+
publishDeactivateMessage: ({ encPubKey, message, }: {
|
|
931
|
+
encPubKey: PubKey$1;
|
|
932
|
+
message: MessageData$1;
|
|
933
|
+
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
934
|
+
processDeactivateMessage: ({ groth16Proof, newDeactivateCommitment, newDeactivateRoot, size, }: {
|
|
935
|
+
groth16Proof: Groth16ProofType$1;
|
|
936
|
+
newDeactivateCommitment: Uint256$1;
|
|
937
|
+
newDeactivateRoot: Uint256$1;
|
|
938
|
+
size: Uint256$1;
|
|
939
|
+
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
940
|
+
addNewKey: ({ d, groth16Proof, nullifier, pubkey, }: {
|
|
941
|
+
d: Uint256$1[];
|
|
942
|
+
groth16Proof: Groth16ProofType$1;
|
|
943
|
+
nullifier: Uint256$1;
|
|
944
|
+
pubkey: PubKey$1;
|
|
945
|
+
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
946
|
+
preAddNewKey: ({ d, groth16Proof, nullifier, pubkey, }: {
|
|
947
|
+
d: Uint256$1[];
|
|
948
|
+
groth16Proof: Groth16ProofType$1;
|
|
949
|
+
nullifier: Uint256$1;
|
|
950
|
+
pubkey: PubKey$1;
|
|
951
|
+
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
952
|
+
publishMessage: ({ encPubKey, message, }: {
|
|
953
|
+
encPubKey: PubKey$1;
|
|
954
|
+
message: MessageData$1;
|
|
955
|
+
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
956
|
+
processMessage: ({ groth16Proof, newStateCommitment, }: {
|
|
957
|
+
groth16Proof: Groth16ProofType$1;
|
|
958
|
+
newStateCommitment: Uint256$1;
|
|
959
|
+
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
960
|
+
stopProcessingPeriod: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
961
|
+
processTally: ({ groth16Proof, newTallyCommitment, }: {
|
|
962
|
+
groth16Proof: Groth16ProofType$1;
|
|
963
|
+
newTallyCommitment: Uint256$1;
|
|
964
|
+
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
965
|
+
stopTallyingPeriod: ({ results, salt, }: {
|
|
966
|
+
results: Uint256$1[];
|
|
967
|
+
salt: Uint256$1;
|
|
968
|
+
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
969
|
+
claim: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
970
|
+
}
|
|
971
|
+
|
|
972
|
+
/**
|
|
973
|
+
* This file was automatically generated by @cosmwasm/ts-codegen@1.11.1.
|
|
974
|
+
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
|
|
975
|
+
* and run the @cosmwasm/ts-codegen generate command to regenerate this file.
|
|
976
|
+
*/
|
|
977
|
+
|
|
978
|
+
interface MaciReadOnlyInterface {
|
|
979
|
+
contractAddress: string;
|
|
980
|
+
getRoundInfo: () => Promise<RoundInfo$2>;
|
|
981
|
+
getVotingTime: () => Promise<VotingTime$2>;
|
|
982
|
+
getPeriod: () => Promise<Period$2>;
|
|
983
|
+
getNumSignUp: () => Promise<Uint256$2>;
|
|
984
|
+
getMsgChainLength: () => Promise<Uint256$2>;
|
|
985
|
+
getProcessedMsgCount: () => Promise<Uint256$2>;
|
|
986
|
+
getProcessedUserCount: () => Promise<Uint256$2>;
|
|
987
|
+
getResult: ({ index }: {
|
|
988
|
+
index: Uint256$2;
|
|
989
|
+
}) => Promise<Uint256$2>;
|
|
990
|
+
getAllResult: () => Promise<Uint256$2>;
|
|
991
|
+
getStateIdxInc: ({ address }: {
|
|
992
|
+
address: Addr$2;
|
|
993
|
+
}) => Promise<Uint256$2>;
|
|
994
|
+
getVoiceCreditBalance: ({ index }: {
|
|
995
|
+
index: Uint256$2;
|
|
996
|
+
}) => Promise<Uint256$2>;
|
|
997
|
+
whiteList: () => Promise<Whitelist$1>;
|
|
998
|
+
isWhiteList: ({ sender }: {
|
|
999
|
+
sender: string;
|
|
1000
|
+
}) => Promise<Boolean$2>;
|
|
1001
|
+
whiteBalanceOf: ({ sender }: {
|
|
1002
|
+
sender: string;
|
|
1003
|
+
}) => Promise<Uint256$2>;
|
|
1004
|
+
voteOptionMap: () => Promise<ArrayOfString$2>;
|
|
1005
|
+
maxVoteOptions: () => Promise<Uint256$2>;
|
|
1006
|
+
queryTotalFeeGrant: () => Promise<Uint128$2>;
|
|
1007
|
+
queryCircuitType: () => Promise<Uint256$2>;
|
|
1008
|
+
queryCertSystem: () => Promise<Uint256$2>;
|
|
1009
|
+
}
|
|
1010
|
+
declare class MaciQueryClient implements MaciReadOnlyInterface {
|
|
1011
|
+
client: CosmWasmClient;
|
|
1012
|
+
contractAddress: string;
|
|
1013
|
+
constructor(client: CosmWasmClient, contractAddress: string);
|
|
1014
|
+
getRoundInfo: () => Promise<RoundInfo$2>;
|
|
1015
|
+
getVotingTime: () => Promise<VotingTime$2>;
|
|
1016
|
+
getPeriod: () => Promise<Period$2>;
|
|
1017
|
+
getNumSignUp: () => Promise<Uint256$2>;
|
|
1018
|
+
getMsgChainLength: () => Promise<Uint256$2>;
|
|
1019
|
+
getProcessedMsgCount: () => Promise<Uint256$2>;
|
|
1020
|
+
getProcessedUserCount: () => Promise<Uint256$2>;
|
|
1021
|
+
getResult: ({ index }: {
|
|
1022
|
+
index: Uint256$2;
|
|
1023
|
+
}) => Promise<Uint256$2>;
|
|
1024
|
+
getAllResult: () => Promise<Uint256$2>;
|
|
1025
|
+
getStateIdxInc: ({ address }: {
|
|
1026
|
+
address: Addr$2;
|
|
1027
|
+
}) => Promise<Uint256$2>;
|
|
1028
|
+
getVoiceCreditBalance: ({ index, }: {
|
|
1029
|
+
index: Uint256$2;
|
|
1030
|
+
}) => Promise<Uint256$2>;
|
|
1031
|
+
whiteList: () => Promise<Whitelist$1>;
|
|
1032
|
+
isWhiteList: ({ sender }: {
|
|
1033
|
+
sender: string;
|
|
1034
|
+
}) => Promise<Boolean$2>;
|
|
1035
|
+
whiteBalanceOf: ({ sender }: {
|
|
1036
|
+
sender: string;
|
|
1037
|
+
}) => Promise<Uint256$2>;
|
|
1038
|
+
voteOptionMap: () => Promise<ArrayOfString$2>;
|
|
1039
|
+
maxVoteOptions: () => Promise<Uint256$2>;
|
|
1040
|
+
queryTotalFeeGrant: () => Promise<Uint128$2>;
|
|
1041
|
+
queryCircuitType: () => Promise<Uint256$2>;
|
|
1042
|
+
queryCertSystem: () => Promise<Uint256$2>;
|
|
1043
|
+
}
|
|
1044
|
+
interface MaciInterface extends MaciReadOnlyInterface {
|
|
1045
|
+
contractAddress: string;
|
|
1046
|
+
sender: string;
|
|
1047
|
+
setParams: ({ intStateTreeDepth, messageBatchSize, stateTreeDepth, voteOptionTreeDepth, }: {
|
|
1048
|
+
intStateTreeDepth: Uint256$2;
|
|
1049
|
+
messageBatchSize: Uint256$2;
|
|
1050
|
+
stateTreeDepth: Uint256$2;
|
|
1051
|
+
voteOptionTreeDepth: Uint256$2;
|
|
1052
|
+
}, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
1053
|
+
setRoundInfo: ({ roundInfo, }: {
|
|
1054
|
+
roundInfo: RoundInfo$2;
|
|
1055
|
+
}, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
1056
|
+
setWhitelists: ({ whitelists, }: {
|
|
1057
|
+
whitelists: Whitelist$1;
|
|
1058
|
+
}, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
1059
|
+
setVoteOptionsMap: ({ voteOptionMap, }: {
|
|
1060
|
+
voteOptionMap: string[];
|
|
1061
|
+
}, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
1062
|
+
startVotingPeriod: (fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
1063
|
+
signUp: ({ pubkey, }: {
|
|
1064
|
+
pubkey: PubKey$2;
|
|
1065
|
+
}, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
1066
|
+
startProcessPeriod: (fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
1067
|
+
stopVotingPeriod: (fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
1068
|
+
publishMessage: ({ encPubKey, message, }: {
|
|
1069
|
+
encPubKey: PubKey$2;
|
|
1070
|
+
message: MessageData$2;
|
|
1071
|
+
}, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
1072
|
+
processMessage: ({ groth16Proof, newStateCommitment, plonkProof, }: {
|
|
1073
|
+
groth16Proof?: Groth16ProofType$2;
|
|
1074
|
+
newStateCommitment: Uint256$2;
|
|
1075
|
+
plonkProof?: PlonkProofType$1;
|
|
1076
|
+
}, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
1077
|
+
stopProcessingPeriod: (fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
1078
|
+
processTally: ({ groth16Proof, newTallyCommitment, plonkProof, }: {
|
|
1079
|
+
groth16Proof?: Groth16ProofType$2;
|
|
1080
|
+
newTallyCommitment: Uint256$2;
|
|
1081
|
+
plonkProof?: PlonkProofType$1;
|
|
1082
|
+
}, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
1083
|
+
stopTallyingPeriod: ({ results, salt, }: {
|
|
1084
|
+
results: Uint256$2[];
|
|
1085
|
+
salt: Uint256$2;
|
|
1086
|
+
}, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
1087
|
+
grant: ({ maxAmount, }: {
|
|
1088
|
+
maxAmount: Uint128$2;
|
|
1089
|
+
}, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
1090
|
+
revoke: (fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
1091
|
+
bond: (fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
1092
|
+
withdraw: ({ amount, }: {
|
|
1093
|
+
amount?: Uint128$2;
|
|
1094
|
+
}, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
1095
|
+
}
|
|
1096
|
+
declare class MaciClient$1 extends MaciQueryClient implements MaciInterface {
|
|
1097
|
+
client: SigningCosmWasmClient;
|
|
1098
|
+
sender: string;
|
|
1099
|
+
contractAddress: string;
|
|
1100
|
+
constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string);
|
|
1101
|
+
setParams: ({ intStateTreeDepth, messageBatchSize, stateTreeDepth, voteOptionTreeDepth, }: {
|
|
1102
|
+
intStateTreeDepth: Uint256$2;
|
|
1103
|
+
messageBatchSize: Uint256$2;
|
|
1104
|
+
stateTreeDepth: Uint256$2;
|
|
1105
|
+
voteOptionTreeDepth: Uint256$2;
|
|
1106
|
+
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
1107
|
+
setRoundInfo: ({ roundInfo, }: {
|
|
1108
|
+
roundInfo: RoundInfo$2;
|
|
1109
|
+
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
1110
|
+
setWhitelists: ({ whitelists, }: {
|
|
1111
|
+
whitelists: Whitelist$1;
|
|
1112
|
+
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
1113
|
+
setVoteOptionsMap: ({ voteOptionMap, }: {
|
|
1114
|
+
voteOptionMap: string[];
|
|
1115
|
+
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
1116
|
+
startVotingPeriod: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
1117
|
+
signUp: ({ pubkey, }: {
|
|
1118
|
+
pubkey: PubKey$2;
|
|
1119
|
+
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
1120
|
+
startProcessPeriod: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
1121
|
+
stopVotingPeriod: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
1122
|
+
publishMessage: ({ encPubKey, message, }: {
|
|
1123
|
+
encPubKey: PubKey$2;
|
|
1124
|
+
message: MessageData$2;
|
|
1125
|
+
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
1126
|
+
processMessage: ({ groth16Proof, newStateCommitment, plonkProof, }: {
|
|
1127
|
+
groth16Proof?: Groth16ProofType$2;
|
|
1128
|
+
newStateCommitment: Uint256$2;
|
|
1129
|
+
plonkProof?: PlonkProofType$1;
|
|
1130
|
+
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
1131
|
+
stopProcessingPeriod: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
1132
|
+
processTally: ({ groth16Proof, newTallyCommitment, plonkProof, }: {
|
|
1133
|
+
groth16Proof?: Groth16ProofType$2;
|
|
1134
|
+
newTallyCommitment: Uint256$2;
|
|
1135
|
+
plonkProof?: PlonkProofType$1;
|
|
1136
|
+
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
1137
|
+
stopTallyingPeriod: ({ results, salt, }: {
|
|
1138
|
+
results: Uint256$2[];
|
|
1139
|
+
salt: Uint256$2;
|
|
1140
|
+
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
1141
|
+
grant: ({ maxAmount, }: {
|
|
1142
|
+
maxAmount: Uint128$2;
|
|
1143
|
+
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
1144
|
+
revoke: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
1145
|
+
bond: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
1146
|
+
withdraw: ({ amount, }: {
|
|
1147
|
+
amount?: Uint128$2;
|
|
1148
|
+
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
1149
|
+
}
|
|
1150
|
+
|
|
1151
|
+
/**
|
|
1152
|
+
* This file was automatically generated by @cosmwasm/ts-codegen@1.11.1.
|
|
1153
|
+
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
|
|
1154
|
+
* and run the @cosmwasm/ts-codegen generate command to regenerate this file.
|
|
1155
|
+
*/
|
|
1156
|
+
|
|
1157
|
+
interface RegistryReadOnlyInterface {
|
|
1158
|
+
contractAddress: string;
|
|
1159
|
+
admin: () => Promise<AdminResponse>;
|
|
1160
|
+
operator: () => Promise<Addr$3>;
|
|
1161
|
+
isMaciOperator: ({ address }: {
|
|
1162
|
+
address: Addr$3;
|
|
1163
|
+
}) => Promise<Boolean$3>;
|
|
1164
|
+
isValidator: ({ address }: {
|
|
1165
|
+
address: Addr$3;
|
|
1166
|
+
}) => Promise<Boolean$3>;
|
|
1167
|
+
getValidators: () => Promise<ValidatorSet>;
|
|
1168
|
+
getValidatorOperator: ({ address }: {
|
|
1169
|
+
address: Addr$3;
|
|
1170
|
+
}) => Promise<Addr$3>;
|
|
1171
|
+
getMaciOperatorPubkey: ({ address }: {
|
|
1172
|
+
address: Addr$3;
|
|
1173
|
+
}) => Promise<PubKey$3>;
|
|
1174
|
+
getMaciOperatorIdentity: ({ address }: {
|
|
1175
|
+
address: Addr$3;
|
|
1176
|
+
}) => Promise<String>;
|
|
1177
|
+
}
|
|
1178
|
+
declare class RegistryQueryClient implements RegistryReadOnlyInterface {
|
|
1179
|
+
client: CosmWasmClient;
|
|
1180
|
+
contractAddress: string;
|
|
1181
|
+
constructor(client: CosmWasmClient, contractAddress: string);
|
|
1182
|
+
admin: () => Promise<AdminResponse>;
|
|
1183
|
+
operator: () => Promise<Addr$3>;
|
|
1184
|
+
isMaciOperator: ({ address }: {
|
|
1185
|
+
address: Addr$3;
|
|
1186
|
+
}) => Promise<Boolean$3>;
|
|
1187
|
+
isValidator: ({ address }: {
|
|
1188
|
+
address: Addr$3;
|
|
1189
|
+
}) => Promise<Boolean$3>;
|
|
1190
|
+
getValidators: () => Promise<ValidatorSet>;
|
|
1191
|
+
getValidatorOperator: ({ address, }: {
|
|
1192
|
+
address: Addr$3;
|
|
1193
|
+
}) => Promise<Addr$3>;
|
|
1194
|
+
getMaciOperatorPubkey: ({ address, }: {
|
|
1195
|
+
address: Addr$3;
|
|
1196
|
+
}) => Promise<PubKey$3>;
|
|
1197
|
+
getMaciOperatorIdentity: ({ address, }: {
|
|
1198
|
+
address: Addr$3;
|
|
1199
|
+
}) => Promise<String>;
|
|
1200
|
+
}
|
|
1201
|
+
interface RegistryInterface extends RegistryReadOnlyInterface {
|
|
1202
|
+
contractAddress: string;
|
|
1203
|
+
sender: string;
|
|
1204
|
+
setMaciOperator: ({ operator, }: {
|
|
1205
|
+
operator: Addr$3;
|
|
1206
|
+
}, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
1207
|
+
setMaciOperatorPubkey: ({ pubkey, }: {
|
|
1208
|
+
pubkey: PubKey$3;
|
|
1209
|
+
}, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
1210
|
+
setMaciOperatorIdentity: ({ identity, }: {
|
|
1211
|
+
identity: string;
|
|
1212
|
+
}, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
1213
|
+
createRound: ({ certificationSystem, circuitType, maxOption, maxVoter, operator, preDeactivateRoot, roundInfo, voiceCreditAmount, votingTime, whitelist, }: {
|
|
1214
|
+
certificationSystem: Uint256$3;
|
|
1215
|
+
circuitType: Uint256$3;
|
|
1216
|
+
maxOption: Uint256$3;
|
|
1217
|
+
maxVoter: Uint256$3;
|
|
1218
|
+
operator: Addr$3;
|
|
1219
|
+
preDeactivateRoot: Uint256$3;
|
|
1220
|
+
roundInfo: RoundInfo$3;
|
|
1221
|
+
voiceCreditAmount: Uint256$3;
|
|
1222
|
+
votingTime: VotingTime$3;
|
|
1223
|
+
whitelist?: Whitelist$2;
|
|
1224
|
+
}, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
1225
|
+
setValidators: ({ addresses, }: {
|
|
1226
|
+
addresses: ValidatorSet;
|
|
1227
|
+
}, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
1228
|
+
removeValidator: ({ address, }: {
|
|
1229
|
+
address: Addr$3;
|
|
1230
|
+
}, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
1231
|
+
updateAmaciCodeId: ({ amaciCodeId, }: {
|
|
1232
|
+
amaciCodeId: number;
|
|
1233
|
+
}, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
1234
|
+
changeOperator: ({ address, }: {
|
|
1235
|
+
address: Addr$3;
|
|
1236
|
+
}, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
1237
|
+
}
|
|
1238
|
+
declare class RegistryClient extends RegistryQueryClient implements RegistryInterface {
|
|
1239
|
+
client: SigningCosmWasmClient;
|
|
1240
|
+
sender: string;
|
|
1241
|
+
contractAddress: string;
|
|
1242
|
+
constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string);
|
|
1243
|
+
setMaciOperator: ({ operator, }: {
|
|
1244
|
+
operator: Addr$3;
|
|
1245
|
+
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
1246
|
+
setMaciOperatorPubkey: ({ pubkey, }: {
|
|
1247
|
+
pubkey: PubKey$3;
|
|
1248
|
+
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
1249
|
+
setMaciOperatorIdentity: ({ identity, }: {
|
|
1250
|
+
identity: string;
|
|
1251
|
+
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
1252
|
+
createRound: ({ certificationSystem, circuitType, maxOption, maxVoter, operator, preDeactivateRoot, roundInfo, voiceCreditAmount, votingTime, whitelist, }: {
|
|
1253
|
+
certificationSystem: Uint256$3;
|
|
1254
|
+
circuitType: Uint256$3;
|
|
1255
|
+
maxOption: Uint256$3;
|
|
1256
|
+
maxVoter: Uint256$3;
|
|
1257
|
+
operator: Addr$3;
|
|
1258
|
+
preDeactivateRoot: Uint256$3;
|
|
1259
|
+
roundInfo: RoundInfo$3;
|
|
1260
|
+
voiceCreditAmount: Uint256$3;
|
|
1261
|
+
votingTime: VotingTime$3;
|
|
1262
|
+
whitelist?: Whitelist$2;
|
|
1263
|
+
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
1264
|
+
setValidators: ({ addresses, }: {
|
|
1265
|
+
addresses: ValidatorSet;
|
|
1266
|
+
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
1267
|
+
removeValidator: ({ address, }: {
|
|
1268
|
+
address: Addr$3;
|
|
1269
|
+
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
1270
|
+
updateAmaciCodeId: ({ amaciCodeId, }: {
|
|
1271
|
+
amaciCodeId: number;
|
|
1272
|
+
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
1273
|
+
changeOperator: ({ address, }: {
|
|
1274
|
+
address: Addr$3;
|
|
1275
|
+
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
1276
|
+
}
|
|
1277
|
+
|
|
1278
|
+
/**
|
|
1279
|
+
* This file was automatically generated by @cosmwasm/ts-codegen@1.11.1.
|
|
1280
|
+
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
|
|
1281
|
+
* and run the @cosmwasm/ts-codegen generate command to regenerate this file.
|
|
1282
|
+
*/
|
|
1283
|
+
type Uint256 = string;
|
|
1284
|
+
type Addr = string;
|
|
1285
|
+
type Timestamp = Uint64;
|
|
1286
|
+
type Uint64 = string;
|
|
1287
|
+
type VotingPowerMode = 'slope' | 'threshold';
|
|
1288
|
+
interface PubKey {
|
|
1289
|
+
x: Uint256;
|
|
1290
|
+
y: Uint256;
|
|
1291
|
+
}
|
|
1292
|
+
interface RoundInfo {
|
|
1293
|
+
description: string;
|
|
1294
|
+
link: string;
|
|
1295
|
+
title: string;
|
|
1296
|
+
}
|
|
1297
|
+
interface VotingTime {
|
|
1298
|
+
end_time?: Timestamp | null;
|
|
1299
|
+
start_time?: Timestamp | null;
|
|
1300
|
+
}
|
|
1301
|
+
type Uint128 = string;
|
|
1302
|
+
interface MessageData {
|
|
1303
|
+
data: [Uint256, Uint256, Uint256, Uint256, Uint256, Uint256, Uint256];
|
|
1304
|
+
}
|
|
1305
|
+
interface Groth16ProofType {
|
|
1306
|
+
a: string;
|
|
1307
|
+
b: string;
|
|
1308
|
+
c: string;
|
|
1309
|
+
}
|
|
1310
|
+
interface PlonkProofType {
|
|
1311
|
+
grand_product_at_z_omega: string;
|
|
1312
|
+
grand_product_commitment: string;
|
|
1313
|
+
input_values: string[];
|
|
1314
|
+
linearization_polynomial_at_z: string;
|
|
1315
|
+
n: number;
|
|
1316
|
+
num_inputs: number;
|
|
1317
|
+
opening_at_z_omega_proof: string;
|
|
1318
|
+
opening_at_z_proof: string;
|
|
1319
|
+
permutation_polynomials_at_z: string[];
|
|
1320
|
+
quotient_poly_commitments: string[];
|
|
1321
|
+
quotient_polynomial_at_z: string;
|
|
1322
|
+
wire_commitments: string[];
|
|
1323
|
+
wire_values_at_z: string[];
|
|
1324
|
+
wire_values_at_z_omega: string[];
|
|
1325
|
+
}
|
|
1326
|
+
type PeriodStatus = 'pending' | 'voting' | 'processing' | 'tallying' | 'ended';
|
|
1327
|
+
interface Period {
|
|
1328
|
+
status: PeriodStatus;
|
|
1329
|
+
}
|
|
1330
|
+
interface GrantConfig {
|
|
1331
|
+
fee_amount: Uint128;
|
|
1332
|
+
fee_grant: boolean;
|
|
1333
|
+
}
|
|
1334
|
+
type Boolean = boolean;
|
|
1335
|
+
type Binary = string;
|
|
1336
|
+
interface OracleWhitelistConfig {
|
|
1337
|
+
backend_pubkey: Binary;
|
|
1338
|
+
ecosystem: string;
|
|
1339
|
+
slope: Uint256;
|
|
1340
|
+
snapshot_height: Uint256;
|
|
1341
|
+
threshold: Uint256;
|
|
1342
|
+
voting_power_mode: VotingPowerMode;
|
|
1343
|
+
}
|
|
1344
|
+
type ArrayOfString = string[];
|
|
1345
|
+
interface WhitelistConfig {
|
|
1346
|
+
balance: Uint256;
|
|
1347
|
+
fee_amount: Uint128;
|
|
1348
|
+
fee_grant: boolean;
|
|
1349
|
+
is_register: boolean;
|
|
1350
|
+
}
|
|
1351
|
+
|
|
1352
|
+
/**
|
|
1353
|
+
* This file was automatically generated by @cosmwasm/ts-codegen@1.11.1.
|
|
1354
|
+
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
|
|
1355
|
+
* and run the @cosmwasm/ts-codegen generate command to regenerate this file.
|
|
1356
|
+
*/
|
|
1357
|
+
|
|
1358
|
+
interface OracleMaciReadOnlyInterface {
|
|
1359
|
+
contractAddress: string;
|
|
1360
|
+
getRoundInfo: () => Promise<RoundInfo>;
|
|
1361
|
+
getVotingTime: () => Promise<VotingTime>;
|
|
1362
|
+
getPeriod: () => Promise<Period>;
|
|
1363
|
+
getNumSignUp: () => Promise<Uint256>;
|
|
1364
|
+
getMsgChainLength: () => Promise<Uint256>;
|
|
1365
|
+
getProcessedMsgCount: () => Promise<Uint256>;
|
|
1366
|
+
getProcessedUserCount: () => Promise<Uint256>;
|
|
1367
|
+
getResult: ({ index }: {
|
|
1368
|
+
index: Uint256;
|
|
1369
|
+
}) => Promise<Uint256>;
|
|
1370
|
+
getAllResult: () => Promise<Uint256>;
|
|
1371
|
+
getStateIdxInc: ({ address }: {
|
|
1372
|
+
address: Addr;
|
|
1373
|
+
}) => Promise<Uint256>;
|
|
1374
|
+
getVoiceCreditBalance: ({ index }: {
|
|
1375
|
+
index: Uint256;
|
|
1376
|
+
}) => Promise<Uint256>;
|
|
1377
|
+
isWhiteList: ({ amount, certificate, sender, }: {
|
|
1378
|
+
amount: Uint256;
|
|
1379
|
+
certificate: string;
|
|
1380
|
+
sender: string;
|
|
1381
|
+
}) => Promise<Boolean>;
|
|
1382
|
+
whiteBalanceOf: ({ amount, certificate, sender, }: {
|
|
1383
|
+
amount: Uint256;
|
|
1384
|
+
certificate: string;
|
|
1385
|
+
sender: string;
|
|
1386
|
+
}) => Promise<Uint256>;
|
|
1387
|
+
whiteInfo: ({ sender }: {
|
|
1388
|
+
sender: string;
|
|
1389
|
+
}) => Promise<WhitelistConfig>;
|
|
1390
|
+
grantInfo: ({ grantee }: {
|
|
1391
|
+
grantee: string;
|
|
1392
|
+
}) => Promise<GrantConfig>;
|
|
1393
|
+
maxWhitelistNum: () => Promise<Uint128>;
|
|
1394
|
+
voteOptionMap: () => Promise<ArrayOfString>;
|
|
1395
|
+
maxVoteOptions: () => Promise<Uint256>;
|
|
1396
|
+
queryTotalFeeGrant: () => Promise<Uint128>;
|
|
1397
|
+
queryCircuitType: () => Promise<Uint256>;
|
|
1398
|
+
queryCertSystem: () => Promise<Uint256>;
|
|
1399
|
+
queryOracleWhitelistConfig: () => Promise<OracleWhitelistConfig>;
|
|
1400
|
+
}
|
|
1401
|
+
declare class OracleMaciQueryClient implements OracleMaciReadOnlyInterface {
|
|
1402
|
+
client: CosmWasmClient;
|
|
1403
|
+
contractAddress: string;
|
|
1404
|
+
constructor(client: CosmWasmClient, contractAddress: string);
|
|
1405
|
+
getRoundInfo: () => Promise<RoundInfo>;
|
|
1406
|
+
getVotingTime: () => Promise<VotingTime>;
|
|
1407
|
+
getPeriod: () => Promise<Period>;
|
|
1408
|
+
getNumSignUp: () => Promise<Uint256>;
|
|
1409
|
+
getMsgChainLength: () => Promise<Uint256>;
|
|
1410
|
+
getProcessedMsgCount: () => Promise<Uint256>;
|
|
1411
|
+
getProcessedUserCount: () => Promise<Uint256>;
|
|
1412
|
+
getResult: ({ index }: {
|
|
1413
|
+
index: Uint256;
|
|
1414
|
+
}) => Promise<Uint256>;
|
|
1415
|
+
getAllResult: () => Promise<Uint256>;
|
|
1416
|
+
getStateIdxInc: ({ address }: {
|
|
1417
|
+
address: Addr;
|
|
1418
|
+
}) => Promise<Uint256>;
|
|
1419
|
+
getVoiceCreditBalance: ({ index, }: {
|
|
1420
|
+
index: Uint256;
|
|
1421
|
+
}) => Promise<Uint256>;
|
|
1422
|
+
isWhiteList: ({ amount, certificate, sender, }: {
|
|
1423
|
+
amount: Uint256;
|
|
1424
|
+
certificate: string;
|
|
1425
|
+
sender: string;
|
|
1426
|
+
}) => Promise<Boolean>;
|
|
1427
|
+
whiteBalanceOf: ({ amount, certificate, sender, }: {
|
|
1428
|
+
amount: Uint256;
|
|
1429
|
+
certificate: string;
|
|
1430
|
+
sender: string;
|
|
1431
|
+
}) => Promise<Uint256>;
|
|
1432
|
+
whiteInfo: ({ sender, }: {
|
|
1433
|
+
sender: string;
|
|
1434
|
+
}) => Promise<WhitelistConfig>;
|
|
1435
|
+
grantInfo: ({ grantee, }: {
|
|
1436
|
+
grantee: string;
|
|
1437
|
+
}) => Promise<GrantConfig>;
|
|
1438
|
+
maxWhitelistNum: () => Promise<Uint128>;
|
|
1439
|
+
voteOptionMap: () => Promise<ArrayOfString>;
|
|
1440
|
+
maxVoteOptions: () => Promise<Uint256>;
|
|
1441
|
+
queryTotalFeeGrant: () => Promise<Uint128>;
|
|
1442
|
+
queryCircuitType: () => Promise<Uint256>;
|
|
1443
|
+
queryCertSystem: () => Promise<Uint256>;
|
|
1444
|
+
queryOracleWhitelistConfig: () => Promise<OracleWhitelistConfig>;
|
|
1445
|
+
}
|
|
1446
|
+
interface OracleMaciInterface extends OracleMaciReadOnlyInterface {
|
|
1447
|
+
contractAddress: string;
|
|
1448
|
+
sender: string;
|
|
1449
|
+
setParams: ({ intStateTreeDepth, messageBatchSize, stateTreeDepth, voteOptionTreeDepth, }: {
|
|
1450
|
+
intStateTreeDepth: Uint256;
|
|
1451
|
+
messageBatchSize: Uint256;
|
|
1452
|
+
stateTreeDepth: Uint256;
|
|
1453
|
+
voteOptionTreeDepth: Uint256;
|
|
1454
|
+
}, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
1455
|
+
setRoundInfo: ({ roundInfo, }: {
|
|
1456
|
+
roundInfo: RoundInfo;
|
|
1457
|
+
}, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
1458
|
+
setVoteOptionsMap: ({ voteOptionMap, }: {
|
|
1459
|
+
voteOptionMap: string[];
|
|
1460
|
+
}, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
1461
|
+
startVotingPeriod: (fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
1462
|
+
signUp: ({ amount, certificate, pubkey, }: {
|
|
1463
|
+
amount: Uint256;
|
|
1464
|
+
certificate: string;
|
|
1465
|
+
pubkey: PubKey;
|
|
1466
|
+
}, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
1467
|
+
startProcessPeriod: (fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
1468
|
+
stopVotingPeriod: (fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
1469
|
+
publishMessage: ({ encPubKey, message, }: {
|
|
1470
|
+
encPubKey: PubKey;
|
|
1471
|
+
message: MessageData;
|
|
1472
|
+
}, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
1473
|
+
processMessage: ({ groth16Proof, newStateCommitment, plonkProof, }: {
|
|
1474
|
+
groth16Proof?: Groth16ProofType;
|
|
1475
|
+
newStateCommitment: Uint256;
|
|
1476
|
+
plonkProof?: PlonkProofType;
|
|
1477
|
+
}, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
1478
|
+
stopProcessingPeriod: (fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
1479
|
+
processTally: ({ groth16Proof, newTallyCommitment, plonkProof, }: {
|
|
1480
|
+
groth16Proof?: Groth16ProofType;
|
|
1481
|
+
newTallyCommitment: Uint256;
|
|
1482
|
+
plonkProof?: PlonkProofType;
|
|
1483
|
+
}, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
1484
|
+
stopTallyingPeriod: ({ results, salt, }: {
|
|
1485
|
+
results: Uint256[];
|
|
1486
|
+
salt: Uint256;
|
|
1487
|
+
}, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
1488
|
+
grant: ({ baseAmount, grantee, }: {
|
|
1489
|
+
baseAmount: Uint128;
|
|
1490
|
+
grantee: Addr;
|
|
1491
|
+
}, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
1492
|
+
revoke: ({ grantee, }: {
|
|
1493
|
+
grantee: Addr;
|
|
1494
|
+
}, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
1495
|
+
bond: (fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
1496
|
+
withdraw: ({ amount, }: {
|
|
1497
|
+
amount?: Uint128;
|
|
1498
|
+
}, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
1499
|
+
}
|
|
1500
|
+
declare class OracleMaciClient extends OracleMaciQueryClient implements OracleMaciInterface {
|
|
1501
|
+
client: SigningCosmWasmClient;
|
|
1502
|
+
sender: string;
|
|
1503
|
+
contractAddress: string;
|
|
1504
|
+
constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string);
|
|
1505
|
+
setParams: ({ intStateTreeDepth, messageBatchSize, stateTreeDepth, voteOptionTreeDepth, }: {
|
|
1506
|
+
intStateTreeDepth: Uint256;
|
|
1507
|
+
messageBatchSize: Uint256;
|
|
1508
|
+
stateTreeDepth: Uint256;
|
|
1509
|
+
voteOptionTreeDepth: Uint256;
|
|
1510
|
+
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
1511
|
+
setRoundInfo: ({ roundInfo, }: {
|
|
1512
|
+
roundInfo: RoundInfo;
|
|
1513
|
+
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
1514
|
+
setVoteOptionsMap: ({ voteOptionMap, }: {
|
|
1515
|
+
voteOptionMap: string[];
|
|
1516
|
+
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
1517
|
+
startVotingPeriod: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
1518
|
+
signUp: ({ amount, certificate, pubkey, }: {
|
|
1519
|
+
amount: Uint256;
|
|
1520
|
+
certificate: string;
|
|
1521
|
+
pubkey: PubKey;
|
|
1522
|
+
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
1523
|
+
startProcessPeriod: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
1524
|
+
stopVotingPeriod: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
1525
|
+
publishMessage: ({ encPubKey, message, }: {
|
|
1526
|
+
encPubKey: PubKey;
|
|
1527
|
+
message: MessageData;
|
|
1528
|
+
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
1529
|
+
processMessage: ({ groth16Proof, newStateCommitment, plonkProof, }: {
|
|
1530
|
+
groth16Proof?: Groth16ProofType;
|
|
1531
|
+
newStateCommitment: Uint256;
|
|
1532
|
+
plonkProof?: PlonkProofType;
|
|
1533
|
+
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
1534
|
+
stopProcessingPeriod: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
1535
|
+
processTally: ({ groth16Proof, newTallyCommitment, plonkProof, }: {
|
|
1536
|
+
groth16Proof?: Groth16ProofType;
|
|
1537
|
+
newTallyCommitment: Uint256;
|
|
1538
|
+
plonkProof?: PlonkProofType;
|
|
1539
|
+
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
1540
|
+
stopTallyingPeriod: ({ results, salt, }: {
|
|
1541
|
+
results: Uint256[];
|
|
1542
|
+
salt: Uint256;
|
|
1543
|
+
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
1544
|
+
grant: ({ baseAmount, grantee, }: {
|
|
1545
|
+
baseAmount: Uint128;
|
|
1546
|
+
grantee: Addr;
|
|
1547
|
+
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
1548
|
+
revoke: ({ grantee, }: {
|
|
1549
|
+
grantee: Addr;
|
|
1550
|
+
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
1551
|
+
bond: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
1552
|
+
withdraw: ({ amount, }: {
|
|
1553
|
+
amount?: Uint128;
|
|
1554
|
+
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
1555
|
+
}
|
|
1556
|
+
|
|
1557
|
+
declare class UserAccount {
|
|
1558
|
+
http: Http;
|
|
1559
|
+
constructor(http: Http);
|
|
1560
|
+
balanceOf(address: string): Promise<BalanceResponse>;
|
|
1561
|
+
}
|
|
1562
|
+
|
|
1563
|
+
declare class Circuit {
|
|
1564
|
+
http: Http;
|
|
1565
|
+
constructor(http: Http);
|
|
1566
|
+
getCircuitByName(name: string): Promise<CircuitResponse>;
|
|
1567
|
+
getCircuits(): Promise<CircuitsResponse>;
|
|
1568
|
+
}
|
|
1569
|
+
|
|
1570
|
+
declare class Operator {
|
|
1571
|
+
http: Http;
|
|
1572
|
+
amaciRegistryContract: string;
|
|
1573
|
+
constructor(http: Http, amaciRegistryContract: string);
|
|
1574
|
+
getOperatorByAddress(address: string): Promise<OperatorResponse>;
|
|
1575
|
+
getOperatorDelayOperationsByAddress(address: string, after: string, limit?: number): Promise<OperatorDelayOperationsResponse>;
|
|
1576
|
+
getOperators(after: string, limit?: number): Promise<OperatorsResponse>;
|
|
1577
|
+
queryMissRate(address: string, durationDay: number): Promise<MissRateResponse>;
|
|
1578
|
+
}
|
|
1579
|
+
|
|
1580
|
+
declare class Round {
|
|
1581
|
+
http: Http;
|
|
1582
|
+
constructor(http: Http);
|
|
1583
|
+
getRoundById(address: string): Promise<RoundResponse>;
|
|
1584
|
+
/**
|
|
1585
|
+
* Get round information with selective fields
|
|
1586
|
+
* @param address Round address
|
|
1587
|
+
* @param fields Array of fields to return, returns all fields if empty
|
|
1588
|
+
* @returns Round information response
|
|
1589
|
+
*/
|
|
1590
|
+
getRoundWithFields(address: string, fields?: string[]): Promise<SelectiveRoundResponse>;
|
|
1591
|
+
getRounds(after: string, limit?: number): Promise<RoundsResponse>;
|
|
1592
|
+
getRoundsByCircuitName(circuitName: string, after: string, limit?: number): Promise<RoundsResponse>;
|
|
1593
|
+
getRoundsByStatus(status: string, after: string, limit?: number): Promise<RoundsResponse>;
|
|
1594
|
+
getRoundsByOperator(operator: string, after: string, limit?: number): Promise<RoundsResponse>;
|
|
1595
|
+
}
|
|
1596
|
+
|
|
1597
|
+
declare class Transaction {
|
|
1598
|
+
http: Http;
|
|
1599
|
+
constructor(http: Http);
|
|
1600
|
+
getTransactionByHash(txHash: string): Promise<TransactionResponse>;
|
|
1601
|
+
getTransactions(after: string, limit?: number): Promise<TransactionsResponse>;
|
|
1602
|
+
getTransactionsByContractAddress(address: string, after: string, limit?: number): Promise<TransactionsResponse>;
|
|
1603
|
+
}
|
|
1604
|
+
|
|
1605
|
+
declare class Proof {
|
|
1606
|
+
http: Http;
|
|
1607
|
+
constructor(http: Http);
|
|
1608
|
+
getProofByContractAddress(address: string): Promise<ProofResponse>;
|
|
1609
|
+
}
|
|
1610
|
+
|
|
1611
|
+
declare class Event {
|
|
1612
|
+
http: Http;
|
|
1613
|
+
constructor(http: Http);
|
|
1614
|
+
getSignUpEventByPubKey(contractAddress: string, pubKey: bigint[]): Promise<SignUpEventsResponse>;
|
|
1615
|
+
}
|
|
1616
|
+
|
|
1617
|
+
type IndexerParams = {
|
|
1618
|
+
restEndpoint: string;
|
|
1619
|
+
apiEndpoint: string;
|
|
1620
|
+
registryAddress: string;
|
|
1621
|
+
http: Http;
|
|
1622
|
+
};
|
|
1623
|
+
|
|
1624
|
+
/**
|
|
1625
|
+
* @class Indexer
|
|
1626
|
+
* @description This class is used to interact with Maci Indexer.
|
|
1627
|
+
*/
|
|
1628
|
+
declare class Indexer {
|
|
1629
|
+
restEndpoint: string;
|
|
1630
|
+
apiEndpoint: string;
|
|
1631
|
+
registryAddress: string;
|
|
1632
|
+
http: Http;
|
|
1633
|
+
round: Round;
|
|
1634
|
+
account: UserAccount;
|
|
1635
|
+
circuit: Circuit;
|
|
1636
|
+
operator: Operator;
|
|
1637
|
+
proof: Proof;
|
|
1638
|
+
transaction: Transaction;
|
|
1639
|
+
event: Event;
|
|
1640
|
+
/**
|
|
1641
|
+
* @constructor
|
|
1642
|
+
* @param {IndexerParams} params - The parameters for the Maci Indexer instance.
|
|
1643
|
+
*/
|
|
1644
|
+
constructor({ restEndpoint, apiEndpoint, registryAddress, http, }: IndexerParams);
|
|
1645
|
+
/**
|
|
1646
|
+
* @method balanceOf
|
|
1647
|
+
* @description Get the balance of a specific address.
|
|
1648
|
+
* @param {string} address - The address to check the balance for.
|
|
1649
|
+
* @returns {Promise<BalanceResponse>} The balance response.
|
|
1650
|
+
*/
|
|
1651
|
+
balanceOf(address: string): Promise<BalanceResponse>;
|
|
1652
|
+
/**
|
|
1653
|
+
* @method getRoundById
|
|
1654
|
+
* @description Get a round by its ID.
|
|
1655
|
+
* @param {string} id - The ID of the round.
|
|
1656
|
+
* @returns {Promise<RoundResponse>} The round response.
|
|
1657
|
+
*/
|
|
1658
|
+
getRoundById(id: string): Promise<RoundResponse>;
|
|
1659
|
+
/**
|
|
1660
|
+
* @method getRoundWithFields
|
|
1661
|
+
* @description Get a round by its address with selective fields.
|
|
1662
|
+
* @param {string} address - The address of the round.
|
|
1663
|
+
* @param {string[]} [fields] - The fields to retrieve.
|
|
1664
|
+
* @returns {Promise<SelectiveRoundResponse>} The round response.
|
|
1665
|
+
*/
|
|
1666
|
+
getRoundWithFields(address: string, fields?: string[]): Promise<SelectiveRoundResponse>;
|
|
1667
|
+
/**
|
|
1668
|
+
* @method getRounds
|
|
1669
|
+
* @description Get multiple rounds.
|
|
1670
|
+
* @param {string} after - The cursor to start after.
|
|
1671
|
+
* @param {number} [limit] - The number of rounds to retrieve.
|
|
1672
|
+
* @returns {Promise<RoundsResponse>} The rounds response.
|
|
1673
|
+
*/
|
|
1674
|
+
getRounds(after: string, limit?: number): Promise<RoundsResponse>;
|
|
1675
|
+
/**
|
|
1676
|
+
* @method getRoundsByStatus
|
|
1677
|
+
* @description Get rounds by their status.
|
|
1678
|
+
* @param {string} status - The status of the rounds to retrieve.
|
|
1679
|
+
* @param {string} after - The cursor to start after.
|
|
1680
|
+
* @param {number} [limit] - The number of rounds to retrieve.
|
|
1681
|
+
* @returns {Promise<RoundsResponse>} The rounds response.
|
|
1682
|
+
*/
|
|
1683
|
+
getRoundsByStatus(status: string, after: string, limit?: number): Promise<RoundsResponse>;
|
|
1684
|
+
/**
|
|
1685
|
+
* @method getRoundsByCircuitName
|
|
1686
|
+
* @description Get rounds by their circuit name.
|
|
1687
|
+
* @param {string} name - The name of the circuit.
|
|
1688
|
+
* @param {string} after - The cursor to start after.
|
|
1689
|
+
* @param {number} [limit] - The number of rounds to retrieve.
|
|
1690
|
+
* @returns {Promise<RoundsResponse>} The rounds response.
|
|
1691
|
+
*/
|
|
1692
|
+
getRoundsByCircuitName(name: string, after: string, limit?: number): Promise<RoundsResponse>;
|
|
1693
|
+
/**
|
|
1694
|
+
* @method getRoundsByOperator
|
|
1695
|
+
* @description Get rounds by their operator address.
|
|
1696
|
+
* @param {string} address - The address of the operator.
|
|
1697
|
+
* @param {string} after - The cursor to start after.
|
|
1698
|
+
* @param {number} [limit] - The number of rounds to retrieve.
|
|
1699
|
+
* @returns {Promise<RoundsResponse>} The rounds response.
|
|
1700
|
+
*/
|
|
1701
|
+
getRoundsByOperator(address: string, after: string, limit?: number): Promise<RoundsResponse>;
|
|
1702
|
+
/**
|
|
1703
|
+
* @method getOperatorByAddress
|
|
1704
|
+
* @description Get an operator by their address.
|
|
1705
|
+
* @param {string} address - The address of the operator.
|
|
1706
|
+
* @returns {Promise<OperatorResponse>} The operator response.
|
|
1707
|
+
*/
|
|
1708
|
+
getOperatorByAddress(address: string): Promise<OperatorResponse>;
|
|
1709
|
+
getOperatorDelayOperationsByAddress(address: string, after: string, limit?: number): Promise<OperatorDelayOperationsResponse>;
|
|
1710
|
+
queryMissRate(address: string, durationDay: number): Promise<MissRateResponse>;
|
|
1711
|
+
/**
|
|
1712
|
+
* @method getOperators
|
|
1713
|
+
* @description Get multiple operators.
|
|
1714
|
+
* @param {string} after - The cursor to start after.
|
|
1715
|
+
* @param {number} [limit] - The number of operators to retrieve.
|
|
1716
|
+
* @returns {Promise<OperatorsResponse>} The operators response.
|
|
1717
|
+
*/
|
|
1718
|
+
getOperators(after: string, limit?: number): Promise<OperatorsResponse>;
|
|
1719
|
+
/**
|
|
1720
|
+
* @method getCircuitByName
|
|
1721
|
+
* @description Get a circuit by its name.
|
|
1722
|
+
* @param {string} name - The name of the circuit.
|
|
1723
|
+
* @returns {Promise<CircuitResponse>} The circuit response.
|
|
1724
|
+
*/
|
|
1725
|
+
getCircuitByName(name: string): Promise<CircuitResponse>;
|
|
1726
|
+
/**
|
|
1727
|
+
* @method getCircuits
|
|
1728
|
+
* @description Get all available circuits.
|
|
1729
|
+
* @returns {Promise<CircuitsResponse>} The circuits response.
|
|
1730
|
+
*/
|
|
1731
|
+
getCircuits(): Promise<CircuitsResponse>;
|
|
1732
|
+
/**
|
|
1733
|
+
* @method getTransactionByHash
|
|
1734
|
+
* @description Get a transaction by its hash.
|
|
1735
|
+
* @param {string} hash - The hash of the transaction.
|
|
1736
|
+
* @returns {Promise<TransactionResponse>} The transaction response.
|
|
1737
|
+
*/
|
|
1738
|
+
getTransactionByHash(hash: string): Promise<TransactionResponse>;
|
|
1739
|
+
/**
|
|
1740
|
+
* @method getTransactions
|
|
1741
|
+
* @description Get multiple transactions.
|
|
1742
|
+
* @param {string} after - The cursor to start after.
|
|
1743
|
+
* @param {number} [limit] - The number of transactions to retrieve.
|
|
1744
|
+
* @returns {Promise<TransactionsResponse>} The transactions response.
|
|
1745
|
+
*/
|
|
1746
|
+
getTransactions(after: string, limit?: number): Promise<TransactionsResponse>;
|
|
1747
|
+
/**
|
|
1748
|
+
* @method getTransactionsByContractAddress
|
|
1749
|
+
* @description Get transactions by contract address.
|
|
1750
|
+
* @param {string} address - The contract address.
|
|
1751
|
+
* @param {string} after - The cursor to start after.
|
|
1752
|
+
* @param {number} [limit] - The number of transactions to retrieve.
|
|
1753
|
+
* @returns {Promise<TransactionsResponse>} The transactions response.
|
|
1754
|
+
*/
|
|
1755
|
+
getTransactionsByContractAddress(address: string, after: string, limit?: number): Promise<TransactionsResponse>;
|
|
1756
|
+
/**
|
|
1757
|
+
* @method getProofByContractAddress
|
|
1758
|
+
* @description Get proof data by contract address.
|
|
1759
|
+
* @param {string} address - The contract address.
|
|
1760
|
+
* @returns {Promise<ProofResponse>} The proof response.
|
|
1761
|
+
*/
|
|
1762
|
+
getProofByContractAddress(address: string): Promise<ProofResponse>;
|
|
1763
|
+
/**
|
|
1764
|
+
* @method getStateIdxByPubKey
|
|
1765
|
+
* @description Get the state index of a specific public key.
|
|
1766
|
+
* @param {string} contractAddress - The contract address.
|
|
1767
|
+
* @param {bigint[]} pubKey - The public key.
|
|
1768
|
+
* @returns {Promise<SignUpEventsResponse>} The sign up events response.
|
|
1769
|
+
*/
|
|
1770
|
+
getSignUpEventByPubKey(contractAddress: string, pubKey: bigint[]): Promise<SignUpEventsResponse>;
|
|
1771
|
+
}
|
|
1772
|
+
|
|
1773
|
+
declare class Contract {
|
|
1774
|
+
rpcEndpoint: string;
|
|
1775
|
+
registryAddress: string;
|
|
1776
|
+
maciCodeId: number;
|
|
1777
|
+
oracleCodeId: number;
|
|
1778
|
+
feegrantOperator: string;
|
|
1779
|
+
whitelistBackendPubkey: string;
|
|
1780
|
+
constructor({ rpcEndpoint, registryAddress, maciCodeId, oracleCodeId, feegrantOperator, whitelistBackendPubkey, }: ContractParams);
|
|
1781
|
+
createAMaciRound({ signer, startVoting, endVoting, operator, whitelist, title, description, link, maxVoter, maxOption, voiceCreditAmount, circuitType, preDeactivateRoot, }: CreateAMaciRoundParams & {
|
|
1782
|
+
signer: OfflineSigner;
|
|
1783
|
+
}): Promise<{
|
|
1784
|
+
contractAddress: string;
|
|
1785
|
+
logs: readonly _cosmjs_stargate_build_logs.Log[];
|
|
1786
|
+
height: number;
|
|
1787
|
+
transactionHash: string;
|
|
1788
|
+
events: readonly _cosmjs_stargate.Event[];
|
|
1789
|
+
gasWanted: bigint;
|
|
1790
|
+
gasUsed: bigint;
|
|
1791
|
+
}>;
|
|
1792
|
+
createMaciRound({ signer, operatorPubkey, startVoting, endVoting, whitelist, title, description, link, maxVoter, maxOption, circuitType, certSystemType, }: CreateMaciRoundParams & {
|
|
1793
|
+
signer: OfflineSigner;
|
|
1794
|
+
}): Promise<_cosmjs_cosmwasm_stargate.InstantiateResult>;
|
|
1795
|
+
createOracleMaciRound({ signer, operatorPubkey, startVoting, endVoting, title, description, link, voteOptionMap, circuitType, whitelistEcosystem, whitelistSnapshotHeight, whitelistVotingPowerArgs, }: CreateOracleMaciRoundParams & {
|
|
1796
|
+
signer: OfflineSigner;
|
|
1797
|
+
}): Promise<_cosmjs_cosmwasm_stargate.InstantiateResult>;
|
|
1798
|
+
queryRoundInfo({ signer, roundAddress, }: {
|
|
1799
|
+
signer: OfflineSigner;
|
|
1800
|
+
roundAddress: string;
|
|
1801
|
+
}): Promise<RoundInfo$2>;
|
|
1802
|
+
oracleMaciClient({ signer, contractAddress, }: {
|
|
1803
|
+
signer: OfflineSigner;
|
|
1804
|
+
contractAddress: string;
|
|
1805
|
+
}): Promise<OracleMaciClient>;
|
|
1806
|
+
registryClient({ signer, contractAddress, }: {
|
|
1807
|
+
signer: OfflineSigner;
|
|
1808
|
+
contractAddress: string;
|
|
1809
|
+
}): Promise<RegistryClient>;
|
|
1810
|
+
maciClient({ signer, contractAddress, }: {
|
|
1811
|
+
signer: OfflineSigner;
|
|
1812
|
+
contractAddress: string;
|
|
1813
|
+
}): Promise<MaciClient$1>;
|
|
1814
|
+
amaciClient({ signer, contractAddress, }: {
|
|
1815
|
+
signer: OfflineSigner;
|
|
1816
|
+
contractAddress: string;
|
|
1817
|
+
}): Promise<AMaciClient>;
|
|
1818
|
+
contractClient({ signer }: {
|
|
1819
|
+
signer: OfflineSigner;
|
|
1820
|
+
}): Promise<_cosmjs_cosmwasm_stargate.SigningCosmWasmClient>;
|
|
1821
|
+
}
|
|
1822
|
+
|
|
1823
|
+
declare function getAMaciRoundCircuitFee(maxVoter: number, maxOption: number): {
|
|
1824
|
+
denom: string;
|
|
1825
|
+
amount: string;
|
|
1826
|
+
};
|
|
1827
|
+
|
|
1828
|
+
declare class OracleCertificate {
|
|
1829
|
+
private certificateApiEndpoint;
|
|
1830
|
+
private http;
|
|
1831
|
+
constructor({ certificateApiEndpoint, http }: OracleCertificateParams);
|
|
1832
|
+
sign(data: SignatureRequest): Promise<SignatureResponse>;
|
|
1833
|
+
feegrantAllowance(granter: string, grantee: string): Promise<FeegrantAllowanceResponse>;
|
|
1834
|
+
listEcosystems(): Promise<EcosystemsResponse>;
|
|
1835
|
+
}
|
|
1836
|
+
|
|
1837
|
+
declare class MACI {
|
|
1838
|
+
contract: Contract;
|
|
1839
|
+
indexer: Indexer;
|
|
1840
|
+
oracleCertificate: OracleCertificate;
|
|
1841
|
+
maciKeypair: Keypair;
|
|
1842
|
+
constructor({ contract, indexer, oracleCertificate, maciKeypair, }: {
|
|
1843
|
+
contract: Contract;
|
|
1844
|
+
indexer: Indexer;
|
|
1845
|
+
oracleCertificate: OracleCertificate;
|
|
1846
|
+
maciKeypair: Keypair;
|
|
1847
|
+
});
|
|
1848
|
+
getStateIdxInc({ signer, address, contractAddress, }: {
|
|
1849
|
+
signer: OfflineSigner;
|
|
1850
|
+
address?: string;
|
|
1851
|
+
contractAddress: string;
|
|
1852
|
+
}): Promise<string>;
|
|
1853
|
+
getVoiceCreditBalance({ signer, stateIdx, contractAddress, }: {
|
|
1854
|
+
signer: OfflineSigner;
|
|
1855
|
+
stateIdx: number;
|
|
1856
|
+
contractAddress: string;
|
|
1857
|
+
}): Promise<string>;
|
|
1858
|
+
getStateIdxByPubKey({ contractAddress, pubKey, }: {
|
|
1859
|
+
contractAddress: string;
|
|
1860
|
+
pubKey: bigint[];
|
|
1861
|
+
}): Promise<number>;
|
|
1862
|
+
feegrantAllowance({ address, contractAddress, }: {
|
|
1863
|
+
address: string;
|
|
1864
|
+
contractAddress: string;
|
|
1865
|
+
}): Promise<FeegrantAllowanceResponse>;
|
|
1866
|
+
hasFeegrant({ address, contractAddress, }: {
|
|
1867
|
+
address: string;
|
|
1868
|
+
contractAddress: string;
|
|
1869
|
+
}): Promise<boolean>;
|
|
1870
|
+
queryWhitelistBalanceOf({ signer, address, contractAddress, certificate, mode, }: {
|
|
1871
|
+
signer: OfflineSigner;
|
|
1872
|
+
address?: string;
|
|
1873
|
+
contractAddress: string;
|
|
1874
|
+
certificate?: {
|
|
1875
|
+
signature: string;
|
|
1876
|
+
amount: string;
|
|
1877
|
+
};
|
|
1878
|
+
mode?: 'maci' | 'amaci';
|
|
1879
|
+
}): Promise<string>;
|
|
1880
|
+
isWhitelisted({ signer, address, contractAddress, }: {
|
|
1881
|
+
signer: OfflineSigner;
|
|
1882
|
+
address?: string;
|
|
1883
|
+
contractAddress: string;
|
|
1884
|
+
}): Promise<boolean>;
|
|
1885
|
+
getOracleWhitelistConfig({ signer, contractAddress, }: {
|
|
1886
|
+
signer: OfflineSigner;
|
|
1887
|
+
contractAddress: string;
|
|
1888
|
+
}): Promise<OracleWhitelistConfig>;
|
|
1889
|
+
getRoundInfo({ contractAddress }: {
|
|
1890
|
+
contractAddress: string;
|
|
1891
|
+
}): Promise<RoundType>;
|
|
1892
|
+
getRoundCircuitType({ contractAddress }: {
|
|
1893
|
+
contractAddress: string;
|
|
1894
|
+
}): Promise<string>;
|
|
1895
|
+
queryRoundIsQv({ contractAddress }: {
|
|
1896
|
+
contractAddress: string;
|
|
1897
|
+
}): Promise<boolean>;
|
|
1898
|
+
queryRoundClaimable({ contractAddress, }: {
|
|
1899
|
+
contractAddress: string;
|
|
1900
|
+
}): Promise<{
|
|
1901
|
+
claimable: boolean | null;
|
|
1902
|
+
balance: string | null;
|
|
1903
|
+
}>;
|
|
1904
|
+
queryAMaciChargeFee({ maxVoter, maxOption, }: {
|
|
1905
|
+
maxVoter: number;
|
|
1906
|
+
maxOption: number;
|
|
1907
|
+
}): Promise<{
|
|
1908
|
+
denom: string;
|
|
1909
|
+
amount: string;
|
|
1910
|
+
}>;
|
|
1911
|
+
queryRoundGasStation({ contractAddress }: {
|
|
1912
|
+
contractAddress: string;
|
|
1913
|
+
}): Promise<boolean>;
|
|
1914
|
+
parseRoundStatus(votingStart: number, votingEnd: number, status: string, currentTime: Date): string;
|
|
1915
|
+
queryRoundBalance({ contractAddress }: {
|
|
1916
|
+
contractAddress: string;
|
|
1917
|
+
}): Promise<string>;
|
|
1918
|
+
requestOracleCertificate({ signer, ecosystem, address, contractAddress, }: {
|
|
1919
|
+
signer: OfflineSigner;
|
|
1920
|
+
ecosystem: CertificateEcosystem;
|
|
1921
|
+
address?: string;
|
|
1922
|
+
contractAddress: string;
|
|
1923
|
+
}): Promise<SignatureResponse>;
|
|
1924
|
+
signup({ signer, address, contractAddress, maciKeypair, oracleCertificate, gasStation, }: {
|
|
1925
|
+
signer: OfflineSigner;
|
|
1926
|
+
address?: string;
|
|
1927
|
+
contractAddress: string;
|
|
1928
|
+
maciKeypair?: Keypair;
|
|
1929
|
+
oracleCertificate?: {
|
|
1930
|
+
amount: string;
|
|
1931
|
+
signature: string;
|
|
1932
|
+
};
|
|
1933
|
+
gasStation?: boolean;
|
|
1934
|
+
}): Promise<_cosmjs_cosmwasm_stargate.ExecuteResult>;
|
|
1935
|
+
private processVoteOptions;
|
|
1936
|
+
vote({ signer, address, stateIdx, contractAddress, selectedOptions, operatorCoordPubKey, maciKeypair, gasStation, }: {
|
|
1937
|
+
signer: OfflineSigner;
|
|
1938
|
+
address?: string;
|
|
1939
|
+
stateIdx: number;
|
|
1940
|
+
contractAddress: string;
|
|
1941
|
+
selectedOptions: {
|
|
1942
|
+
idx: number;
|
|
1943
|
+
vc: number;
|
|
1944
|
+
}[];
|
|
1945
|
+
operatorCoordPubKey: PubKey$4;
|
|
1946
|
+
maciKeypair?: Keypair;
|
|
1947
|
+
gasStation?: boolean;
|
|
1948
|
+
}): Promise<_cosmjs_cosmwasm_stargate.DeliverTxResponse>;
|
|
1949
|
+
publishMessage({ client, address, payload, contractAddress, gasStation, }: {
|
|
1950
|
+
client: SigningCosmWasmClient;
|
|
1951
|
+
address: string;
|
|
1952
|
+
payload: {
|
|
1953
|
+
msg: bigint[];
|
|
1954
|
+
encPubkeys: PubKey$4;
|
|
1955
|
+
}[];
|
|
1956
|
+
contractAddress: string;
|
|
1957
|
+
gasStation: boolean;
|
|
1958
|
+
}): Promise<_cosmjs_cosmwasm_stargate.DeliverTxResponse>;
|
|
1959
|
+
signupSimple({ client, address, pubKey, contractAddress, gasStation, }: {
|
|
1960
|
+
client: SigningCosmWasmClient;
|
|
1961
|
+
address: string;
|
|
1962
|
+
pubKey: PubKey$4;
|
|
1963
|
+
contractAddress: string;
|
|
1964
|
+
gasStation?: boolean;
|
|
1965
|
+
}): Promise<_cosmjs_cosmwasm_stargate.ExecuteResult>;
|
|
1966
|
+
signupOracle({ client, address, pubKey, contractAddress, oracleCertificate, gasStation, }: {
|
|
1967
|
+
client: SigningCosmWasmClient;
|
|
1968
|
+
address: string;
|
|
1969
|
+
pubKey: PubKey$4;
|
|
1970
|
+
contractAddress: string;
|
|
1971
|
+
oracleCertificate: {
|
|
1972
|
+
amount: string;
|
|
1973
|
+
signature: string;
|
|
1974
|
+
};
|
|
1975
|
+
gasStation?: boolean;
|
|
1976
|
+
}): Promise<_cosmjs_cosmwasm_stargate.ExecuteResult>;
|
|
1977
|
+
claimAMaciRound({ signer, contractAddress, }: {
|
|
1978
|
+
signer: OfflineSigner;
|
|
1979
|
+
contractAddress: string;
|
|
1980
|
+
}): Promise<_cosmjs_cosmwasm_stargate.ExecuteResult>;
|
|
1981
|
+
getOracleCertificateConfig(): Promise<EcosystemsResponse>;
|
|
1982
|
+
/**
|
|
1983
|
+
* Batch grant with bond (for maci)
|
|
1984
|
+
* @param signer
|
|
1985
|
+
* @param contractAddress
|
|
1986
|
+
* @param address
|
|
1987
|
+
* @param amount
|
|
1988
|
+
* @returns
|
|
1989
|
+
*/
|
|
1990
|
+
batchGrantWithBond({ signer, contractAddress, address, amount, }: {
|
|
1991
|
+
signer: OfflineSigner;
|
|
1992
|
+
contractAddress: string;
|
|
1993
|
+
amount: string;
|
|
1994
|
+
address?: string;
|
|
1995
|
+
}): Promise<_cosmjs_cosmwasm_stargate.DeliverTxResponse>;
|
|
1996
|
+
/**
|
|
1997
|
+
* Batch revoke with withdraw (for maci)
|
|
1998
|
+
* @param client
|
|
1999
|
+
* @param contractAddress
|
|
2000
|
+
* @param address
|
|
2001
|
+
* @returns
|
|
2002
|
+
*/
|
|
2003
|
+
batchRevokeWithdraw({ signer, contractAddress, address, }: {
|
|
2004
|
+
signer: OfflineSigner;
|
|
2005
|
+
contractAddress: string;
|
|
2006
|
+
address?: string;
|
|
2007
|
+
}): Promise<_cosmjs_cosmwasm_stargate.DeliverTxResponse>;
|
|
2008
|
+
}
|
|
2009
|
+
|
|
2010
|
+
/**
|
|
2011
|
+
* @class MaciClient
|
|
2012
|
+
* @description This class is used to interact with Maci Client.
|
|
2013
|
+
*/
|
|
2014
|
+
declare class MaciClient {
|
|
2015
|
+
network: 'mainnet' | 'testnet';
|
|
2016
|
+
rpcEndpoint: string;
|
|
2017
|
+
restEndpoint: string;
|
|
2018
|
+
apiEndpoint: string;
|
|
2019
|
+
certificateApiEndpoint: string;
|
|
2020
|
+
registryAddress: string;
|
|
2021
|
+
maciCodeId: number;
|
|
2022
|
+
oracleCodeId: number;
|
|
2023
|
+
feegrantOperator: string;
|
|
2024
|
+
whitelistBackendPubkey: string;
|
|
2025
|
+
http: Http;
|
|
2026
|
+
indexer: Indexer;
|
|
2027
|
+
contract: Contract;
|
|
2028
|
+
oracleCertificate: OracleCertificate;
|
|
2029
|
+
maci: MACI;
|
|
2030
|
+
maciKeypair: Keypair;
|
|
2031
|
+
signer?: OfflineSigner;
|
|
2032
|
+
/**
|
|
2033
|
+
* @constructor
|
|
2034
|
+
* @param {ClientParams} params - The parameters for the Maci Client instance.
|
|
2035
|
+
*/
|
|
2036
|
+
constructor({ signer, network, rpcEndpoint, restEndpoint, apiEndpoint, registryAddress, maciCodeId, oracleCodeId, customFetch, defaultOptions, feegrantOperator, whitelistBackendPubkey, certificateApiEndpoint, maciKeypair, }: ClientParams);
|
|
2037
|
+
getSigner(signer?: OfflineSigner): OfflineSigner;
|
|
2038
|
+
getMaciKeypair(): Keypair;
|
|
2039
|
+
getMaciPubkey(): bigint;
|
|
2040
|
+
packMaciPubkey(pubkey?: PubKey$4): bigint;
|
|
2041
|
+
unpackMaciPubkey(pubkey: bigint | string): PubKey$4;
|
|
2042
|
+
getAddress(signer?: OfflineSigner): Promise<string>;
|
|
2043
|
+
oracleMaciClient({ signer, contractAddress, }: {
|
|
2044
|
+
signer?: OfflineSigner;
|
|
2045
|
+
contractAddress: string;
|
|
2046
|
+
}): Promise<OracleMaciClient>;
|
|
2047
|
+
registryClient({ signer, contractAddress, }: {
|
|
2048
|
+
signer?: OfflineSigner;
|
|
2049
|
+
contractAddress: string;
|
|
2050
|
+
}): Promise<RegistryClient>;
|
|
2051
|
+
maciClient({ signer, contractAddress, }: {
|
|
2052
|
+
signer?: OfflineSigner;
|
|
2053
|
+
contractAddress: string;
|
|
2054
|
+
}): Promise<MaciClient$1>;
|
|
2055
|
+
amaciClient({ signer, contractAddress, }: {
|
|
2056
|
+
signer?: OfflineSigner;
|
|
2057
|
+
contractAddress: string;
|
|
2058
|
+
}): Promise<AMaciClient>;
|
|
2059
|
+
createAMaciRound(params: CreateAMaciRoundParams): Promise<{
|
|
2060
|
+
contractAddress: string;
|
|
2061
|
+
logs: readonly _cosmjs_stargate_build_logs.Log[];
|
|
2062
|
+
height: number;
|
|
2063
|
+
transactionHash: string;
|
|
2064
|
+
events: readonly _cosmjs_stargate.Event[];
|
|
2065
|
+
gasWanted: bigint;
|
|
2066
|
+
gasUsed: bigint;
|
|
2067
|
+
}>;
|
|
2068
|
+
createMaciRound(params: CreateMaciRoundParams): Promise<_cosmjs_cosmwasm_stargate.InstantiateResult>;
|
|
2069
|
+
createOracleMaciRound(params: CreateOracleMaciRoundParams): Promise<_cosmjs_cosmwasm_stargate.InstantiateResult>;
|
|
2070
|
+
genKeypairFromSign({ signer, address, }?: {
|
|
2071
|
+
signer?: OfflineSigner;
|
|
2072
|
+
address?: string;
|
|
2073
|
+
}): Promise<Keypair>;
|
|
2074
|
+
getStateIdxInc({ signer, address, contractAddress, }: {
|
|
2075
|
+
signer?: OfflineSigner;
|
|
2076
|
+
address?: string;
|
|
2077
|
+
contractAddress: string;
|
|
2078
|
+
}): Promise<string>;
|
|
2079
|
+
getVoiceCreditBalance({ signer, stateIdx, contractAddress, }: {
|
|
2080
|
+
signer?: OfflineSigner;
|
|
2081
|
+
stateIdx: number;
|
|
2082
|
+
contractAddress: string;
|
|
2083
|
+
}): Promise<string>;
|
|
2084
|
+
getStateIdxByPubKey({ contractAddress, pubKey, }: {
|
|
2085
|
+
contractAddress: string;
|
|
2086
|
+
pubKey: bigint[];
|
|
2087
|
+
}): Promise<number>;
|
|
2088
|
+
feegrantAllowance({ signer, address, contractAddress, }: {
|
|
2089
|
+
signer?: OfflineSigner;
|
|
2090
|
+
address?: string;
|
|
2091
|
+
contractAddress: string;
|
|
2092
|
+
}): Promise<FeegrantAllowanceResponse>;
|
|
2093
|
+
hasFeegrant({ signer, address, contractAddress, }: {
|
|
2094
|
+
signer?: OfflineSigner;
|
|
2095
|
+
address?: string;
|
|
2096
|
+
contractAddress: string;
|
|
2097
|
+
}): Promise<boolean>;
|
|
2098
|
+
queryWhitelistBalanceOf({ signer, address, contractAddress, certificate, mode, }: {
|
|
2099
|
+
signer?: OfflineSigner;
|
|
2100
|
+
address?: string;
|
|
2101
|
+
contractAddress: string;
|
|
2102
|
+
certificate?: {
|
|
2103
|
+
signature: string;
|
|
2104
|
+
amount: string;
|
|
2105
|
+
};
|
|
2106
|
+
mode?: 'maci' | 'amaci';
|
|
2107
|
+
}): Promise<string>;
|
|
2108
|
+
isWhitelisted({ signer, address, contractAddress, }: {
|
|
2109
|
+
signer?: OfflineSigner;
|
|
2110
|
+
address?: string;
|
|
2111
|
+
contractAddress: string;
|
|
2112
|
+
}): Promise<boolean>;
|
|
2113
|
+
getOracleWhitelistConfig({ signer, contractAddress, }: {
|
|
2114
|
+
signer?: OfflineSigner;
|
|
2115
|
+
contractAddress: string;
|
|
2116
|
+
}): Promise<OracleWhitelistConfig>;
|
|
2117
|
+
getRoundInfo({ contractAddress }: {
|
|
2118
|
+
contractAddress: string;
|
|
2119
|
+
}): Promise<RoundType>;
|
|
2120
|
+
getRoundCircuitType({ contractAddress }: {
|
|
2121
|
+
contractAddress: string;
|
|
2122
|
+
}): Promise<string>;
|
|
2123
|
+
queryRoundIsQv({ contractAddress }: {
|
|
2124
|
+
contractAddress: string;
|
|
2125
|
+
}): Promise<boolean>;
|
|
2126
|
+
queryRoundClaimable({ contractAddress, }: {
|
|
2127
|
+
contractAddress: string;
|
|
2128
|
+
}): Promise<{
|
|
2129
|
+
claimable: boolean | null;
|
|
2130
|
+
balance: string | null;
|
|
2131
|
+
}>;
|
|
2132
|
+
queryAMaciChargeFee({ maxVoter, maxOption, }: {
|
|
2133
|
+
maxVoter: number;
|
|
2134
|
+
maxOption: number;
|
|
2135
|
+
}): Promise<{
|
|
2136
|
+
denom: string;
|
|
2137
|
+
amount: string;
|
|
2138
|
+
}>;
|
|
2139
|
+
queryRoundGasStation({ contractAddress }: {
|
|
2140
|
+
contractAddress: string;
|
|
2141
|
+
}): Promise<boolean>;
|
|
2142
|
+
parseRoundStatus(votingStart: number, votingEnd: number, status: string, currentTime: Date): string;
|
|
2143
|
+
queryRoundBalance({ contractAddress }: {
|
|
2144
|
+
contractAddress: string;
|
|
2145
|
+
}): Promise<string>;
|
|
2146
|
+
requestOracleCertificate({ signer, ecosystem, address, contractAddress, }: {
|
|
2147
|
+
signer?: OfflineSigner;
|
|
2148
|
+
ecosystem: CertificateEcosystem;
|
|
2149
|
+
address?: string;
|
|
2150
|
+
contractAddress: string;
|
|
2151
|
+
}): Promise<SignatureResponse>;
|
|
2152
|
+
signup({ signer, address, contractAddress, maciKeypair, oracleCertificate, gasStation, }: {
|
|
2153
|
+
signer?: OfflineSigner;
|
|
2154
|
+
address?: string;
|
|
2155
|
+
contractAddress: string;
|
|
2156
|
+
maciKeypair?: Keypair;
|
|
2157
|
+
oracleCertificate?: {
|
|
2158
|
+
amount: string;
|
|
2159
|
+
signature: string;
|
|
2160
|
+
};
|
|
2161
|
+
gasStation?: boolean;
|
|
2162
|
+
}): Promise<_cosmjs_cosmwasm_stargate.ExecuteResult>;
|
|
2163
|
+
vote({ signer, address, stateIdx, contractAddress, selectedOptions, operatorCoordPubKey, maciKeypair, gasStation, }: {
|
|
2164
|
+
signer?: OfflineSigner;
|
|
2165
|
+
address?: string;
|
|
2166
|
+
stateIdx: number;
|
|
2167
|
+
contractAddress: string;
|
|
2168
|
+
selectedOptions: {
|
|
2169
|
+
idx: number;
|
|
2170
|
+
vc: number;
|
|
2171
|
+
}[];
|
|
2172
|
+
operatorCoordPubKey: PubKey$4;
|
|
2173
|
+
maciKeypair?: Keypair;
|
|
2174
|
+
gasStation?: boolean;
|
|
2175
|
+
}): Promise<_cosmjs_stargate.DeliverTxResponse>;
|
|
2176
|
+
claimAMaciRound({ signer, contractAddress, }: {
|
|
2177
|
+
signer?: OfflineSigner;
|
|
2178
|
+
contractAddress: string;
|
|
2179
|
+
}): Promise<_cosmjs_cosmwasm_stargate.ExecuteResult>;
|
|
2180
|
+
getOracleCertificateConfig(): Promise<EcosystemsResponse>;
|
|
2181
|
+
batchGrantWithBond({ signer, contractAddress, address, amount, }: {
|
|
2182
|
+
signer?: OfflineSigner;
|
|
2183
|
+
contractAddress: string;
|
|
2184
|
+
address?: string;
|
|
2185
|
+
amount: string;
|
|
2186
|
+
}): Promise<_cosmjs_stargate.DeliverTxResponse>;
|
|
2187
|
+
batchRevokeWithdraw({ signer, contractAddress, address, }: {
|
|
2188
|
+
signer?: OfflineSigner;
|
|
2189
|
+
contractAddress: string;
|
|
2190
|
+
address?: string;
|
|
2191
|
+
}): Promise<_cosmjs_stargate.DeliverTxResponse>;
|
|
2192
|
+
}
|
|
2193
|
+
|
|
2194
|
+
declare const circuits: Record<string, CircuitType>;
|
|
2195
|
+
interface NetworkConfig {
|
|
2196
|
+
network: string;
|
|
2197
|
+
chainId: string;
|
|
2198
|
+
rpcEndpoint: string;
|
|
2199
|
+
restEndpoint: string;
|
|
2200
|
+
apiEndpoint: string;
|
|
2201
|
+
certificateApiEndpoint: string;
|
|
2202
|
+
registryAddress: string;
|
|
2203
|
+
maciCodeId: number;
|
|
2204
|
+
oracleCodeId: number;
|
|
2205
|
+
oracleWhitelistBackendPubkey: string;
|
|
2206
|
+
oracleFeegrantOperator: string;
|
|
2207
|
+
oracleCodeIds: string[];
|
|
2208
|
+
}
|
|
2209
|
+
declare function getDefaultParams(network?: 'mainnet' | 'testnet'): NetworkConfig;
|
|
2210
|
+
|
|
2211
|
+
declare function isValidAddress(address: string): boolean;
|
|
2212
|
+
|
|
2213
|
+
export { type BalanceResponse, type BigIntVariants, type CertificateEcosystem, type Ciphertext, Circuit, type CircuitResponse, type CircuitType, type CircuitsCountGraphqlResponse, type CircuitsResponse, type ClientParams, type ContractParams, type CreateAMaciRoundParams, type CreateMaciRoundParams, type CreateOracleMaciRoundParams, type CreateRoundParams, type EcdhSharedKey, type ErrorResponse, Http, type IMerkleProof, type Keypair, type Leaf, MaciCertSystemType, MaciCircuitType, MaciClient, MaciRoundType, type MissRateResponse, type MissRateType, type NetworkConfig, type Node, Operator, type OperatorDelayOperationsGraphqlResponse, type OperatorDelayOperationsResponse, type OperatorDelayType, type OperatorResponse, type OperatorType, type OperatorsGraphqlResponse, type OperatorsResponse, type PathElements, type Plaintext, type Point, type PoseidonFuncs, type PrivKey, Proof, type ProofGraphqlResponse, type ProofResponse, type ProofType, type PubKey$4 as PubKey, type Queue, Round, type RoundGraphqlResponse, type RoundResponse, type RoundType, type RoundsCountGraphqlResponse, type RoundsGraphqlResponse, type RoundsResponse, type SelectiveRoundGraphqlResponse, type SelectiveRoundResponse, type SelectiveRoundType, type SignResult, type SignUpEventType, type SignUpEventsGraphqlResponse, type SignUpEventsResponse, type Signature, type SnarkBigNumber, type StringifiedBigInts, type SuccessResponse, Transaction, type TransactionGraphqlResponse, type TransactionResponse, type TransactionType, type TransactionsGraphqlResponse, type TransactionsResponse, UserAccount, type VoteCountGraphqlResponse, bigInt2Buffer, circuits, genAddKeyProof, genEcdhSharedKey, genKeypair, genPrivKey, genPubKey, getAMaciRoundCircuitFee, getDefaultParams, isValidAddress, packPubKey, privateKeyFromTxt, stringizing, unpackPubKey };
|