@dorafactory/maci-sdk 0.0.12 → 0.0.13
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/browser.d.mts +2007 -0
- package/dist/browser.d.ts +2007 -0
- package/dist/browser.js +30833 -0
- package/dist/browser.js.map +1 -0
- package/dist/browser.mjs +30844 -0
- package/dist/browser.mjs.map +1 -0
- package/dist/index.d.mts +2008 -0
- package/dist/index.d.ts +2006 -14
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +31 -12
- package/src/browser.ts +17 -0
- package/src/libs/maci/maci.ts +1 -1
- package/src/polyfills/browser-polyfills.ts +9 -0
- package/dist/libs/circom/circomlib.d.ts +0 -39
- package/dist/libs/circom/index.d.ts +0 -10
- package/dist/libs/circom/tree.d.ts +0 -23
- package/dist/libs/circom/types.d.ts +0 -7
- package/dist/libs/const.d.ts +0 -117
- package/dist/libs/contract/config.d.ts +0 -29
- package/dist/libs/contract/contract.d.ts +0 -43
- package/dist/libs/contract/index.d.ts +0 -1
- package/dist/libs/contract/ts/AMaci.client.d.ts +0 -216
- package/dist/libs/contract/ts/AMaci.types.d.ts +0 -203
- package/dist/libs/contract/ts/Maci.client.d.ts +0 -180
- package/dist/libs/contract/ts/Maci.types.d.ts +0 -226
- package/dist/libs/contract/ts/OracleMaci.client.d.ts +0 -206
- package/dist/libs/contract/ts/OracleMaci.types.d.ts +0 -263
- package/dist/libs/contract/ts/Registry.client.d.ts +0 -128
- package/dist/libs/contract/ts/Registry.types.d.ts +0 -110
- package/dist/libs/contract/types.d.ts +0 -39
- package/dist/libs/contract/utils.d.ts +0 -59
- package/dist/libs/contract/vars.d.ts +0 -63
- package/dist/libs/errors/index.d.ts +0 -28
- package/dist/libs/errors/types.d.ts +0 -15
- package/dist/libs/http/http.d.ts +0 -16
- package/dist/libs/http/index.d.ts +0 -1
- package/dist/libs/index.d.ts +0 -7
- package/dist/libs/indexer/index.d.ts +0 -1
- package/dist/libs/indexer/indexer.d.ts +0 -142
- package/dist/libs/indexer/types.d.ts +0 -7
- package/dist/libs/maci/index.d.ts +0 -1
- package/dist/libs/maci/maci.d.ts +0 -121
- package/dist/libs/maci/types.d.ts +0 -6
- package/dist/libs/oracle-certificate/index.d.ts +0 -1
- package/dist/libs/oracle-certificate/oracle-certificate.d.ts +0 -7
- package/dist/libs/oracle-certificate/types.d.ts +0 -17
- package/dist/libs/query/account.d.ts +0 -7
- package/dist/libs/query/circuit.d.ts +0 -8
- package/dist/libs/query/event.d.ts +0 -7
- package/dist/libs/query/index.d.ts +0 -7
- package/dist/libs/query/operator.d.ts +0 -9
- package/dist/libs/query/proof.d.ts +0 -7
- package/dist/libs/query/round.d.ts +0 -11
- package/dist/libs/query/transaction.d.ts +0 -9
- package/dist/maci.d.ts +0 -157
- package/dist/types/index.d.ts +0 -294
- package/dist/utils/index.d.ts +0 -17
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dorafactory/maci-sdk",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.13",
|
|
4
4
|
"description": "SDK for interacting with maci",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"maci",
|
|
@@ -20,9 +20,18 @@
|
|
|
20
20
|
"engines": {
|
|
21
21
|
"node": ">=18"
|
|
22
22
|
},
|
|
23
|
-
"
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
"exports": {
|
|
24
|
+
".": {
|
|
25
|
+
"types": "./dist/index.d.ts",
|
|
26
|
+
"import": "./dist/index.mjs",
|
|
27
|
+
"require": "./dist/index.js",
|
|
28
|
+
"default": "./dist/index.js"
|
|
29
|
+
},
|
|
30
|
+
"./browser": {
|
|
31
|
+
"types": "./dist/browser.d.ts",
|
|
32
|
+
"import": "./dist/browser.mjs"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
26
35
|
"files": [
|
|
27
36
|
"dist",
|
|
28
37
|
"src"
|
|
@@ -34,19 +43,19 @@
|
|
|
34
43
|
"@cosmjs/launchpad": "^0.27.1",
|
|
35
44
|
"@cosmjs/proto-signing": "^0.32.1",
|
|
36
45
|
"@cosmjs/stargate": "^0.32.1",
|
|
46
|
+
"@dorafactory/circomlib": "^0.0.3",
|
|
37
47
|
"assert": "^2.1.0",
|
|
38
48
|
"bech32": "1.1.4",
|
|
39
|
-
"
|
|
49
|
+
"blake-hash": "^2.0.0",
|
|
40
50
|
"colorts": "^0.1.63",
|
|
41
51
|
"cosmjs-types": "^0.9.0",
|
|
42
|
-
"blake-hash": "^2.0.0",
|
|
43
|
-
"ffjavascript": "^0.2.60",
|
|
44
52
|
"ethers": "^6.13.4",
|
|
53
|
+
"ffjavascript": "^0.2.60",
|
|
45
54
|
"gql.tada": "^1.7.0",
|
|
46
55
|
"graphql": "^16.8.1",
|
|
47
56
|
"husky": "^8.0.3",
|
|
48
57
|
"keccak256": "^1.0.6",
|
|
49
|
-
"
|
|
58
|
+
"micro-ftch": "^0.4.2",
|
|
50
59
|
"superstruct": "^1.0.3",
|
|
51
60
|
"tmp": "^0.2.1",
|
|
52
61
|
"ts-retry-promise": "^0.7.1",
|
|
@@ -61,17 +70,27 @@
|
|
|
61
70
|
"@types/tmp": "^0.2.5",
|
|
62
71
|
"@typescript-eslint/eslint-plugin": "^6.8.0",
|
|
63
72
|
"@typescript-eslint/parser": "^6.8.0",
|
|
73
|
+
"buffer": "^6.0.3",
|
|
74
|
+
"crypto-browserify": "^3.12.1",
|
|
64
75
|
"dotenv": "^16.3.1",
|
|
76
|
+
"esbuild": "^0.25.0",
|
|
65
77
|
"eslint": "^8.52.0",
|
|
66
78
|
"eslint-config-prettier": "^8.8.0",
|
|
67
79
|
"eslint-plugin-prettier": "^5.0.1",
|
|
80
|
+
"events": "^3.3.0",
|
|
81
|
+
"events-browserify": "^0.0.1",
|
|
82
|
+
"https-browserify": "^1.0.0",
|
|
68
83
|
"lint-staged": "^15.0.2",
|
|
69
84
|
"prettier": "^2.8.8",
|
|
85
|
+
"process": "^0.11.10",
|
|
86
|
+
"stream-browserify": "^3.0.0",
|
|
87
|
+
"stream-http": "^3.2.0",
|
|
70
88
|
"ts-node": "^10.9.1",
|
|
71
89
|
"tsconfig-paths": "^4.2.0",
|
|
72
|
-
"tsup": "^
|
|
90
|
+
"tsup": "^8.0.0",
|
|
73
91
|
"typedoc": "^0.25.2",
|
|
74
|
-
"typescript": "^5.2.2"
|
|
92
|
+
"typescript": "^5.2.2",
|
|
93
|
+
"browserify-zlib": "^0.2.0"
|
|
75
94
|
},
|
|
76
95
|
"lint-staged": {
|
|
77
96
|
"**/*.ts": [
|
|
@@ -132,8 +151,8 @@
|
|
|
132
151
|
"scripts": {
|
|
133
152
|
"clean": "rm -rf tsconfig.tsbuildinfo ./dist",
|
|
134
153
|
"build": "npm run build:types && npm run build:tsup",
|
|
135
|
-
"build:tsup": "tsup
|
|
136
|
-
"build:types": "tsc --
|
|
154
|
+
"build:tsup": "tsup",
|
|
155
|
+
"build:types": "tsc --emitDeclarationOnly --declaration --declarationDir dist",
|
|
137
156
|
"watch:tsup": "tsup ./src/index.ts --format esm,cjs --clean --splitting --watch",
|
|
138
157
|
"watch:types": "tsc --watch",
|
|
139
158
|
"watch": "pnpm run clean & pnpm run watch:types & pnpm run watch:tsup",
|
package/src/browser.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import './polyfills/browser-polyfills';
|
|
2
|
+
export * from './libs';
|
|
3
|
+
export * from './types';
|
|
4
|
+
export * from './libs/const';
|
|
5
|
+
export { MaciClient } from './maci';
|
|
6
|
+
export { Http } from './libs/http';
|
|
7
|
+
export {
|
|
8
|
+
Round,
|
|
9
|
+
UserAccount,
|
|
10
|
+
Circuit,
|
|
11
|
+
Operator,
|
|
12
|
+
Proof,
|
|
13
|
+
Transaction,
|
|
14
|
+
} from './libs/query';
|
|
15
|
+
export * from './libs/circom';
|
|
16
|
+
export * from './utils';
|
|
17
|
+
export { Scalar, utils } from 'ffjavascript';
|
package/src/libs/maci/maci.ts
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
SigningCosmWasmClient,
|
|
9
9
|
} from '@cosmjs/cosmwasm-stargate';
|
|
10
10
|
import { GasPrice, calculateFee, StdFee } from '@cosmjs/stargate';
|
|
11
|
-
import { MsgExecuteContract } from 'cosmjs-types/cosmwasm/wasm/v1/tx';
|
|
11
|
+
import { MsgExecuteContract } from 'cosmjs-types/cosmwasm/wasm/v1/tx.js';
|
|
12
12
|
import { CertificateEcosystem, ErrorResponse } from '../../types';
|
|
13
13
|
import { SignatureResponse } from '../oracle-certificate/types';
|
|
14
14
|
import { OracleWhitelistConfig } from '../contract/ts/OracleMaci.types';
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
type MixedData<T> = T | Array<MixedData<T>> | {
|
|
2
|
-
[key: string]: MixedData<T>;
|
|
3
|
-
};
|
|
4
|
-
export type PrivateKey = bigint;
|
|
5
|
-
export type PublicKey = [bigint, bigint];
|
|
6
|
-
export interface Account {
|
|
7
|
-
privKey: PrivateKey;
|
|
8
|
-
pubKey: PublicKey;
|
|
9
|
-
formatedPrivKey: PrivateKey;
|
|
10
|
-
}
|
|
11
|
-
export declare const stringizing: (o: MixedData<bigint>, path?: MixedData<bigint>[]) => MixedData<string>;
|
|
12
|
-
export declare const genKeypair: (pkey?: PrivateKey) => Account;
|
|
13
|
-
export declare const genEcdhSharedKey: (privKey: PrivateKey, pubKey: PublicKey) => PublicKey;
|
|
14
|
-
export declare const genMessageFactory: (stateIdx: number, signPriKey: PrivateKey, signPubKey: PublicKey, coordPubKey: PublicKey) => (encPriKey: PrivateKey, nonce: number, voIdx: number, newVotes: number, isLastCmd: boolean, salt?: bigint) => bigint[];
|
|
15
|
-
export declare const batchGenMessage: (stateIdx: number, account: Account, coordPubKey: PublicKey, plan: [number, number][]) => {
|
|
16
|
-
msg: bigint[];
|
|
17
|
-
encPubkeys: PublicKey;
|
|
18
|
-
}[];
|
|
19
|
-
export declare const privateKeyFromTxt: (txt: string) => Account | undefined;
|
|
20
|
-
export declare const genAddKeyProof: (depth: number, { coordPubKey, oldKey, deactivates, }: {
|
|
21
|
-
coordPubKey: PublicKey;
|
|
22
|
-
oldKey: Account;
|
|
23
|
-
deactivates: bigint[][];
|
|
24
|
-
}) => Promise<{
|
|
25
|
-
inputHash: bigint;
|
|
26
|
-
coordPubKey: PublicKey;
|
|
27
|
-
deactivateRoot: any;
|
|
28
|
-
deactivateIndex: number;
|
|
29
|
-
deactivateLeaf: any;
|
|
30
|
-
c1: bigint[];
|
|
31
|
-
c2: bigint[];
|
|
32
|
-
randomVal: bigint;
|
|
33
|
-
d1: bigint[];
|
|
34
|
-
d2: bigint[];
|
|
35
|
-
deactivateLeafPathElements: any;
|
|
36
|
-
nullifier: any;
|
|
37
|
-
oldPrivateKey: bigint;
|
|
38
|
-
} | null>;
|
|
39
|
-
export {};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { OfflineSigner } from '@cosmjs/proto-signing';
|
|
2
|
-
import { SignResult, CircomParams } from './types';
|
|
3
|
-
export * from './circomlib';
|
|
4
|
-
export declare class Circom {
|
|
5
|
-
private network;
|
|
6
|
-
private chainId;
|
|
7
|
-
constructor({ network }: CircomParams);
|
|
8
|
-
signMessage(signer: OfflineSigner, address: string, message: string): Promise<SignResult>;
|
|
9
|
-
genKeypairFromSign(signer: OfflineSigner, address: string): Promise<import("./circomlib").Account>;
|
|
10
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export = Tree;
|
|
2
|
-
declare class Tree {
|
|
3
|
-
constructor(degree: any, depth: any, zero: any);
|
|
4
|
-
DEPTH: any;
|
|
5
|
-
HEIGHT: any;
|
|
6
|
-
DEGREE: any;
|
|
7
|
-
LEAVES_COUNT: number;
|
|
8
|
-
LEAVES_IDX_0: number;
|
|
9
|
-
NODES_COUNT: number;
|
|
10
|
-
get root(): any;
|
|
11
|
-
initZero(zero: any): void;
|
|
12
|
-
zeros: any[] | undefined;
|
|
13
|
-
initNodes(): void;
|
|
14
|
-
nodes: any[] | undefined;
|
|
15
|
-
initLeaves(leaves: any): void;
|
|
16
|
-
leaf(leafIdx: any): any;
|
|
17
|
-
leaves(): any[];
|
|
18
|
-
updateLeaf(leafIdx: any, leaf: any): void;
|
|
19
|
-
pathIdxOf(leafIdx: any): number[];
|
|
20
|
-
pathElementOf(leafIdx: any): any[][];
|
|
21
|
-
subTree(length: any): Tree;
|
|
22
|
-
_update(nodeIdx: any): void;
|
|
23
|
-
}
|
package/dist/libs/const.d.ts
DELETED
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
import type { CircuitType } from '../types';
|
|
2
|
-
export declare const circuits: Record<string, CircuitType>;
|
|
3
|
-
export declare const validator_operator_set: {
|
|
4
|
-
doravaloper12yk434ut3un4wx0rult2aww89rsrel8nhmp387: {
|
|
5
|
-
operator_address: string;
|
|
6
|
-
account_address: string;
|
|
7
|
-
allocation: string;
|
|
8
|
-
allocation_dora: number;
|
|
9
|
-
moniker: string;
|
|
10
|
-
program_voting_power: number;
|
|
11
|
-
tokens: string;
|
|
12
|
-
};
|
|
13
|
-
doravaloper15frh0nn3v4yp3vv6sk4pn6jg9l8rt82f7uqfk5: {
|
|
14
|
-
operator_address: string;
|
|
15
|
-
account_address: string;
|
|
16
|
-
allocation: string;
|
|
17
|
-
allocation_dora: number;
|
|
18
|
-
moniker: string;
|
|
19
|
-
program_voting_power: number;
|
|
20
|
-
tokens: string;
|
|
21
|
-
};
|
|
22
|
-
doravaloper1ddewp74vd2w8jhth2p0uazmc8ajgtcuf3ntqgn: {
|
|
23
|
-
operator_address: string;
|
|
24
|
-
account_address: string;
|
|
25
|
-
allocation: string;
|
|
26
|
-
allocation_dora: number;
|
|
27
|
-
moniker: string;
|
|
28
|
-
program_voting_power: number;
|
|
29
|
-
tokens: string;
|
|
30
|
-
};
|
|
31
|
-
doravaloper1gh8j89jtc2vx6d3y4ehllcdlvluwa49w6xmjsm: {
|
|
32
|
-
operator_address: string;
|
|
33
|
-
account_address: string;
|
|
34
|
-
allocation: string;
|
|
35
|
-
allocation_dora: number;
|
|
36
|
-
moniker: string;
|
|
37
|
-
program_voting_power: number;
|
|
38
|
-
tokens: string;
|
|
39
|
-
};
|
|
40
|
-
doravaloper1j8ru7p8zctup6grfwuga6ndrjj7v88wzn407x7: {
|
|
41
|
-
operator_address: string;
|
|
42
|
-
account_address: string;
|
|
43
|
-
allocation: string;
|
|
44
|
-
allocation_dora: number;
|
|
45
|
-
moniker: string;
|
|
46
|
-
program_voting_power: number;
|
|
47
|
-
tokens: string;
|
|
48
|
-
};
|
|
49
|
-
doravaloper1l5zz0kkjt2n7nllsrymy96mc2v2gehda0zc85s: {
|
|
50
|
-
operator_address: string;
|
|
51
|
-
account_address: string;
|
|
52
|
-
allocation: string;
|
|
53
|
-
allocation_dora: number;
|
|
54
|
-
moniker: string;
|
|
55
|
-
program_voting_power: number;
|
|
56
|
-
tokens: string;
|
|
57
|
-
};
|
|
58
|
-
doravaloper1m9v3txhhtadjxpv09gwjhhs344qsxgfscwxjkg: {
|
|
59
|
-
operator_address: string;
|
|
60
|
-
account_address: string;
|
|
61
|
-
allocation: string;
|
|
62
|
-
allocation_dora: number;
|
|
63
|
-
moniker: string;
|
|
64
|
-
program_voting_power: number;
|
|
65
|
-
tokens: string;
|
|
66
|
-
};
|
|
67
|
-
doravaloper1tu8006g60t62zwgwf5knkaujv0uzhp2a6wh94h: {
|
|
68
|
-
operator_address: string;
|
|
69
|
-
account_address: string;
|
|
70
|
-
allocation: string;
|
|
71
|
-
allocation_dora: number;
|
|
72
|
-
moniker: string;
|
|
73
|
-
program_voting_power: number;
|
|
74
|
-
tokens: string;
|
|
75
|
-
};
|
|
76
|
-
doravaloper1x5z0tkafrgyeuqkrwfjr933vghjxchqnqlhcdw: {
|
|
77
|
-
operator_address: string;
|
|
78
|
-
account_address: string;
|
|
79
|
-
allocation: string;
|
|
80
|
-
allocation_dora: number;
|
|
81
|
-
moniker: string;
|
|
82
|
-
program_voting_power: number;
|
|
83
|
-
tokens: string;
|
|
84
|
-
};
|
|
85
|
-
doravaloper1z6kfew2nhuh02szc2hdecw4fqey2d32auucvux: {
|
|
86
|
-
operator_address: string;
|
|
87
|
-
account_address: string;
|
|
88
|
-
allocation: string;
|
|
89
|
-
allocation_dora: number;
|
|
90
|
-
moniker: string;
|
|
91
|
-
program_voting_power: number;
|
|
92
|
-
tokens: string;
|
|
93
|
-
};
|
|
94
|
-
doravaloper1zzne8ufazycklx4j6mgc987t8ykd6wxu63223v: {
|
|
95
|
-
operator_address: string;
|
|
96
|
-
account_address: string;
|
|
97
|
-
allocation: string;
|
|
98
|
-
allocation_dora: number;
|
|
99
|
-
moniker: string;
|
|
100
|
-
program_voting_power: number;
|
|
101
|
-
tokens: string;
|
|
102
|
-
};
|
|
103
|
-
};
|
|
104
|
-
export interface NetworkConfig {
|
|
105
|
-
network: string;
|
|
106
|
-
chainId: string;
|
|
107
|
-
rpcEndpoint: string;
|
|
108
|
-
restEndpoint: string;
|
|
109
|
-
apiEndpoint: string;
|
|
110
|
-
certificateApiEndpoint: string;
|
|
111
|
-
registryAddress: string;
|
|
112
|
-
maciCodeId: number;
|
|
113
|
-
oracleCodeId: number;
|
|
114
|
-
oracleWhitelistBackendPubkey: string;
|
|
115
|
-
oracleFeegrantOperator: string;
|
|
116
|
-
}
|
|
117
|
-
export declare function getDefaultParams(network?: 'mainnet' | 'testnet'): NetworkConfig;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { OfflineSigner } from '@cosmjs/proto-signing';
|
|
2
|
-
import { SigningStargateClient } from '@cosmjs/stargate';
|
|
3
|
-
import { SigningCosmWasmClient } from '@cosmjs/cosmwasm-stargate';
|
|
4
|
-
import { MaciClient } from './ts/Maci.client';
|
|
5
|
-
import { AMaciClient } from './ts/AMaci.client';
|
|
6
|
-
import { RegistryClient } from './ts/Registry.client';
|
|
7
|
-
import { OracleMaciClient } from './ts/OracleMaci.client';
|
|
8
|
-
export declare function createMaciClientBy({ rpcEndpoint, wallet, contractAddress, }: {
|
|
9
|
-
rpcEndpoint: string;
|
|
10
|
-
wallet: OfflineSigner;
|
|
11
|
-
contractAddress: string;
|
|
12
|
-
}): Promise<MaciClient>;
|
|
13
|
-
export declare function createAMaciClientBy({ rpcEndpoint, wallet, contractAddress, }: {
|
|
14
|
-
rpcEndpoint: string;
|
|
15
|
-
wallet: OfflineSigner;
|
|
16
|
-
contractAddress: string;
|
|
17
|
-
}): Promise<AMaciClient>;
|
|
18
|
-
export declare function createRegistryClientBy({ rpcEndpoint, wallet, contractAddress, }: {
|
|
19
|
-
rpcEndpoint: string;
|
|
20
|
-
wallet: OfflineSigner;
|
|
21
|
-
contractAddress: string;
|
|
22
|
-
}): Promise<RegistryClient>;
|
|
23
|
-
export declare function createOracleMaciClientBy({ rpcEndpoint, wallet, contractAddress, }: {
|
|
24
|
-
rpcEndpoint: string;
|
|
25
|
-
wallet: OfflineSigner;
|
|
26
|
-
contractAddress: string;
|
|
27
|
-
}): Promise<OracleMaciClient>;
|
|
28
|
-
export declare function createContractClientByWallet(rpcEndpoint: string, wallet: OfflineSigner): Promise<SigningCosmWasmClient>;
|
|
29
|
-
export declare function getSignerClientByWallet(rpcEndpoint: string, wallet: OfflineSigner): Promise<SigningStargateClient>;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { OfflineSigner } from '@cosmjs/proto-signing';
|
|
2
|
-
import { SigningCosmWasmClient } from '@cosmjs/cosmwasm-stargate';
|
|
3
|
-
import { MaciClient } from './ts/Maci.client';
|
|
4
|
-
import { AMaciClient } from './ts/AMaci.client';
|
|
5
|
-
import { RegistryClient } from './ts/Registry.client';
|
|
6
|
-
import { ContractParams } from '../../types';
|
|
7
|
-
import { CreateAMaciRoundParams, CreateMaciRoundParams, CreateOracleMaciRoundParams } from './types';
|
|
8
|
-
export declare const prefix = "dora";
|
|
9
|
-
export declare class Contract {
|
|
10
|
-
rpcEndpoint: string;
|
|
11
|
-
registryAddress: string;
|
|
12
|
-
maciCodeId: number;
|
|
13
|
-
oracleCodeId: number;
|
|
14
|
-
feegrantOperator: string;
|
|
15
|
-
whitelistBackendPubkey: string;
|
|
16
|
-
constructor({ rpcEndpoint, registryAddress, maciCodeId, oracleCodeId, feegrantOperator, whitelistBackendPubkey, }: ContractParams);
|
|
17
|
-
createAMaciRound({ signer, startVoting, endVoting, operator, whitelist, title, description, link, maxVoter, maxOption, voiceCreditAmount, circuitType, preDeactivateRoot, }: CreateAMaciRoundParams): Promise<string>;
|
|
18
|
-
createMaciRound({ signer, operatorPubkey, startVoting, endVoting, whitelist, title, description, link, maxVoter, maxOption, circuitType, certSystemType, }: CreateMaciRoundParams): Promise<import("@cosmjs/cosmwasm-stargate").InstantiateResult>;
|
|
19
|
-
createOracleMaciRound({ signer, operatorPubkey, startVoting, endVoting, title, description, link, voteOptionMap, circuitType, whitelistEcosystem, whitelistSnapshotHeight, whitelistVotingPowerArgs, }: CreateOracleMaciRoundParams): Promise<import("@cosmjs/cosmwasm-stargate").InstantiateResult>;
|
|
20
|
-
queryRoundInfo({ signer, roundAddress, }: {
|
|
21
|
-
signer: OfflineSigner;
|
|
22
|
-
roundAddress: string;
|
|
23
|
-
}): Promise<import("./ts/Maci.types").RoundInfo>;
|
|
24
|
-
oracleMaciClient({ signer, contractAddress, }: {
|
|
25
|
-
signer: OfflineSigner;
|
|
26
|
-
contractAddress: string;
|
|
27
|
-
}): Promise<import("./ts/OracleMaci.client").OracleMaciClient>;
|
|
28
|
-
registryClient({ signer, contractAddress, }: {
|
|
29
|
-
signer: OfflineSigner;
|
|
30
|
-
contractAddress: string;
|
|
31
|
-
}): Promise<RegistryClient>;
|
|
32
|
-
maciClient({ signer, contractAddress, }: {
|
|
33
|
-
signer: OfflineSigner;
|
|
34
|
-
contractAddress: string;
|
|
35
|
-
}): Promise<MaciClient>;
|
|
36
|
-
amaciClient({ signer, contractAddress, }: {
|
|
37
|
-
signer: OfflineSigner;
|
|
38
|
-
contractAddress: string;
|
|
39
|
-
}): Promise<AMaciClient>;
|
|
40
|
-
contractClient({ signer }: {
|
|
41
|
-
signer: OfflineSigner;
|
|
42
|
-
}): Promise<SigningCosmWasmClient>;
|
|
43
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { Contract } from './contract';
|
|
@@ -1,216 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file was automatically generated by @cosmwasm/ts-codegen@1.11.1.
|
|
3
|
-
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
|
|
4
|
-
* and run the @cosmwasm/ts-codegen generate command to regenerate this file.
|
|
5
|
-
*/
|
|
6
|
-
import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from '@cosmjs/cosmwasm-stargate';
|
|
7
|
-
import { Coin, StdFee } from '@cosmjs/amino';
|
|
8
|
-
import { Addr, Uint256, PubKey, RoundInfo, VotingTime, Whitelist, Uint128, MessageData, Groth16ProofType, Period, Boolean, ArrayOfString } from './AMaci.types';
|
|
9
|
-
export interface AMaciReadOnlyInterface {
|
|
10
|
-
contractAddress: string;
|
|
11
|
-
admin: () => Promise<Addr>;
|
|
12
|
-
operator: () => Promise<Addr>;
|
|
13
|
-
getRoundInfo: () => Promise<RoundInfo>;
|
|
14
|
-
getVotingTime: () => Promise<VotingTime>;
|
|
15
|
-
getPeriod: () => Promise<Period>;
|
|
16
|
-
getNumSignUp: () => Promise<Uint256>;
|
|
17
|
-
getMsgChainLength: () => Promise<Uint256>;
|
|
18
|
-
getDMsgChainLength: () => Promise<Uint256>;
|
|
19
|
-
getProcessedDMsgCount: () => Promise<Uint256>;
|
|
20
|
-
getProcessedMsgCount: () => Promise<Uint256>;
|
|
21
|
-
getProcessedUserCount: () => Promise<Uint256>;
|
|
22
|
-
getResult: ({ index }: {
|
|
23
|
-
index: Uint256;
|
|
24
|
-
}) => Promise<Uint256>;
|
|
25
|
-
getAllResult: () => Promise<Uint256>;
|
|
26
|
-
getStateIdxInc: ({ address }: {
|
|
27
|
-
address: Addr;
|
|
28
|
-
}) => Promise<Uint256>;
|
|
29
|
-
getVoiceCreditBalance: ({ index }: {
|
|
30
|
-
index: Uint256;
|
|
31
|
-
}) => Promise<Uint256>;
|
|
32
|
-
getVoiceCreditAmount: () => Promise<Uint256>;
|
|
33
|
-
whiteList: () => Promise<Whitelist>;
|
|
34
|
-
isWhiteList: ({ sender }: {
|
|
35
|
-
sender: Addr;
|
|
36
|
-
}) => Promise<Boolean>;
|
|
37
|
-
signuped: ({ pubkeyX }: {
|
|
38
|
-
pubkeyX: Uint256;
|
|
39
|
-
}) => Promise<Uint256>;
|
|
40
|
-
voteOptionMap: () => Promise<ArrayOfString>;
|
|
41
|
-
maxVoteOptions: () => Promise<Uint256>;
|
|
42
|
-
queryTotalFeeGrant: () => Promise<Uint128>;
|
|
43
|
-
queryCircuitType: () => Promise<Uint256>;
|
|
44
|
-
queryCertSystem: () => Promise<Uint256>;
|
|
45
|
-
queryPreDeactivateRoot: () => Promise<Uint256>;
|
|
46
|
-
}
|
|
47
|
-
export declare class AMaciQueryClient implements AMaciReadOnlyInterface {
|
|
48
|
-
client: CosmWasmClient;
|
|
49
|
-
contractAddress: string;
|
|
50
|
-
constructor(client: CosmWasmClient, contractAddress: string);
|
|
51
|
-
admin: () => Promise<Addr>;
|
|
52
|
-
operator: () => Promise<Addr>;
|
|
53
|
-
getRoundInfo: () => Promise<RoundInfo>;
|
|
54
|
-
getVotingTime: () => Promise<VotingTime>;
|
|
55
|
-
getPeriod: () => Promise<Period>;
|
|
56
|
-
getNumSignUp: () => Promise<Uint256>;
|
|
57
|
-
getMsgChainLength: () => Promise<Uint256>;
|
|
58
|
-
getDMsgChainLength: () => Promise<Uint256>;
|
|
59
|
-
getProcessedDMsgCount: () => Promise<Uint256>;
|
|
60
|
-
getProcessedMsgCount: () => Promise<Uint256>;
|
|
61
|
-
getProcessedUserCount: () => Promise<Uint256>;
|
|
62
|
-
getResult: ({ index }: {
|
|
63
|
-
index: Uint256;
|
|
64
|
-
}) => Promise<Uint256>;
|
|
65
|
-
getAllResult: () => Promise<Uint256>;
|
|
66
|
-
getStateIdxInc: ({ address }: {
|
|
67
|
-
address: Addr;
|
|
68
|
-
}) => Promise<Uint256>;
|
|
69
|
-
getVoiceCreditBalance: ({ index, }: {
|
|
70
|
-
index: Uint256;
|
|
71
|
-
}) => Promise<Uint256>;
|
|
72
|
-
getVoiceCreditAmount: () => Promise<Uint256>;
|
|
73
|
-
whiteList: () => Promise<Whitelist>;
|
|
74
|
-
isWhiteList: ({ sender }: {
|
|
75
|
-
sender: Addr;
|
|
76
|
-
}) => Promise<Boolean>;
|
|
77
|
-
signuped: ({ pubkeyX }: {
|
|
78
|
-
pubkeyX: Uint256;
|
|
79
|
-
}) => Promise<Uint256>;
|
|
80
|
-
voteOptionMap: () => Promise<ArrayOfString>;
|
|
81
|
-
maxVoteOptions: () => Promise<Uint256>;
|
|
82
|
-
queryTotalFeeGrant: () => Promise<Uint128>;
|
|
83
|
-
queryCircuitType: () => Promise<Uint256>;
|
|
84
|
-
queryCertSystem: () => Promise<Uint256>;
|
|
85
|
-
queryPreDeactivateRoot: () => Promise<Uint256>;
|
|
86
|
-
}
|
|
87
|
-
export interface AMaciInterface extends AMaciReadOnlyInterface {
|
|
88
|
-
contractAddress: string;
|
|
89
|
-
sender: string;
|
|
90
|
-
setRoundInfo: ({ roundInfo, }: {
|
|
91
|
-
roundInfo: RoundInfo;
|
|
92
|
-
}, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
93
|
-
setWhitelists: ({ whitelists, }: {
|
|
94
|
-
whitelists: Whitelist;
|
|
95
|
-
}, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
96
|
-
setVoteOptionsMap: ({ voteOptionMap, }: {
|
|
97
|
-
voteOptionMap: string[];
|
|
98
|
-
}, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
99
|
-
signUp: ({ pubkey, }: {
|
|
100
|
-
pubkey: PubKey;
|
|
101
|
-
}, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
102
|
-
startProcessPeriod: (fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
103
|
-
publishDeactivateMessage: ({ encPubKey, message, }: {
|
|
104
|
-
encPubKey: PubKey;
|
|
105
|
-
message: MessageData;
|
|
106
|
-
}, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
107
|
-
processDeactivateMessage: ({ groth16Proof, newDeactivateCommitment, newDeactivateRoot, size, }: {
|
|
108
|
-
groth16Proof: Groth16ProofType;
|
|
109
|
-
newDeactivateCommitment: Uint256;
|
|
110
|
-
newDeactivateRoot: Uint256;
|
|
111
|
-
size: Uint256;
|
|
112
|
-
}, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
113
|
-
addNewKey: ({ d, groth16Proof, nullifier, pubkey, }: {
|
|
114
|
-
d: Uint256[];
|
|
115
|
-
groth16Proof: Groth16ProofType;
|
|
116
|
-
nullifier: Uint256;
|
|
117
|
-
pubkey: PubKey;
|
|
118
|
-
}, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
119
|
-
preAddNewKey: ({ d, groth16Proof, nullifier, pubkey, }: {
|
|
120
|
-
d: Uint256[];
|
|
121
|
-
groth16Proof: Groth16ProofType;
|
|
122
|
-
nullifier: Uint256;
|
|
123
|
-
pubkey: PubKey;
|
|
124
|
-
}, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
125
|
-
publishMessage: ({ encPubKey, message, }: {
|
|
126
|
-
encPubKey: PubKey;
|
|
127
|
-
message: MessageData;
|
|
128
|
-
}, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
129
|
-
processMessage: ({ groth16Proof, newStateCommitment, }: {
|
|
130
|
-
groth16Proof: Groth16ProofType;
|
|
131
|
-
newStateCommitment: Uint256;
|
|
132
|
-
}, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
133
|
-
stopProcessingPeriod: (fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
134
|
-
processTally: ({ groth16Proof, newTallyCommitment, }: {
|
|
135
|
-
groth16Proof: Groth16ProofType;
|
|
136
|
-
newTallyCommitment: Uint256;
|
|
137
|
-
}, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
138
|
-
stopTallyingPeriod: ({ results, salt, }: {
|
|
139
|
-
results: Uint256[];
|
|
140
|
-
salt: Uint256;
|
|
141
|
-
}, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
142
|
-
grant: ({ maxAmount, }: {
|
|
143
|
-
maxAmount: Uint128;
|
|
144
|
-
}, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
145
|
-
revoke: (fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
146
|
-
bond: (fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
147
|
-
withdraw: ({ amount, }: {
|
|
148
|
-
amount?: Uint128;
|
|
149
|
-
}, fee?: number | StdFee | 'auto', memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
150
|
-
}
|
|
151
|
-
export declare class AMaciClient extends AMaciQueryClient implements AMaciInterface {
|
|
152
|
-
client: SigningCosmWasmClient;
|
|
153
|
-
sender: string;
|
|
154
|
-
contractAddress: string;
|
|
155
|
-
constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string);
|
|
156
|
-
setRoundInfo: ({ roundInfo, }: {
|
|
157
|
-
roundInfo: RoundInfo;
|
|
158
|
-
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
159
|
-
setWhitelists: ({ whitelists, }: {
|
|
160
|
-
whitelists: Whitelist;
|
|
161
|
-
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
162
|
-
setVoteOptionsMap: ({ voteOptionMap, }: {
|
|
163
|
-
voteOptionMap: string[];
|
|
164
|
-
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
165
|
-
signUp: ({ pubkey, }: {
|
|
166
|
-
pubkey: PubKey;
|
|
167
|
-
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
168
|
-
startProcessPeriod: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
169
|
-
publishDeactivateMessage: ({ encPubKey, message, }: {
|
|
170
|
-
encPubKey: PubKey;
|
|
171
|
-
message: MessageData;
|
|
172
|
-
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
173
|
-
processDeactivateMessage: ({ groth16Proof, newDeactivateCommitment, newDeactivateRoot, size, }: {
|
|
174
|
-
groth16Proof: Groth16ProofType;
|
|
175
|
-
newDeactivateCommitment: Uint256;
|
|
176
|
-
newDeactivateRoot: Uint256;
|
|
177
|
-
size: Uint256;
|
|
178
|
-
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
179
|
-
addNewKey: ({ d, groth16Proof, nullifier, pubkey, }: {
|
|
180
|
-
d: Uint256[];
|
|
181
|
-
groth16Proof: Groth16ProofType;
|
|
182
|
-
nullifier: Uint256;
|
|
183
|
-
pubkey: PubKey;
|
|
184
|
-
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
185
|
-
preAddNewKey: ({ d, groth16Proof, nullifier, pubkey, }: {
|
|
186
|
-
d: Uint256[];
|
|
187
|
-
groth16Proof: Groth16ProofType;
|
|
188
|
-
nullifier: Uint256;
|
|
189
|
-
pubkey: PubKey;
|
|
190
|
-
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
191
|
-
publishMessage: ({ encPubKey, message, }: {
|
|
192
|
-
encPubKey: PubKey;
|
|
193
|
-
message: MessageData;
|
|
194
|
-
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
195
|
-
processMessage: ({ groth16Proof, newStateCommitment, }: {
|
|
196
|
-
groth16Proof: Groth16ProofType;
|
|
197
|
-
newStateCommitment: Uint256;
|
|
198
|
-
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
199
|
-
stopProcessingPeriod: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
200
|
-
processTally: ({ groth16Proof, newTallyCommitment, }: {
|
|
201
|
-
groth16Proof: Groth16ProofType;
|
|
202
|
-
newTallyCommitment: Uint256;
|
|
203
|
-
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
204
|
-
stopTallyingPeriod: ({ results, salt, }: {
|
|
205
|
-
results: Uint256[];
|
|
206
|
-
salt: Uint256;
|
|
207
|
-
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
208
|
-
grant: ({ maxAmount, }: {
|
|
209
|
-
maxAmount: Uint128;
|
|
210
|
-
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
211
|
-
revoke: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
212
|
-
bond: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
213
|
-
withdraw: ({ amount, }: {
|
|
214
|
-
amount?: Uint128;
|
|
215
|
-
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
|
|
216
|
-
}
|