@dorafactory/maci-sdk 0.0.35 → 0.0.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/dist/index.d.ts +14 -2234
  2. package/dist/index.js +748 -348
  3. package/dist/index.js.map +1 -1
  4. package/dist/index.mjs +722 -350
  5. package/dist/index.mjs.map +1 -1
  6. package/dist/libs/const.d.ts +118 -0
  7. package/dist/libs/contract/config.d.ts +29 -0
  8. package/dist/libs/contract/contract.d.ts +57 -0
  9. package/dist/libs/contract/index.d.ts +1 -0
  10. package/dist/libs/contract/ts/AMaci.client.d.ts +216 -0
  11. package/dist/libs/contract/ts/AMaci.types.d.ts +221 -0
  12. package/dist/libs/contract/ts/Maci.client.d.ts +180 -0
  13. package/dist/libs/contract/ts/Maci.types.d.ts +226 -0
  14. package/dist/libs/contract/ts/OracleMaci.client.d.ts +206 -0
  15. package/dist/libs/contract/ts/OracleMaci.types.d.ts +263 -0
  16. package/dist/libs/contract/ts/Registry.client.d.ts +128 -0
  17. package/dist/libs/contract/ts/Registry.types.d.ts +110 -0
  18. package/dist/libs/contract/types.d.ts +39 -0
  19. package/dist/libs/contract/utils.d.ts +63 -0
  20. package/dist/libs/contract/vars.d.ts +63 -0
  21. package/dist/libs/crypto/babyjub.d.ts +73 -0
  22. package/dist/libs/crypto/bigintUtils.d.ts +6 -0
  23. package/dist/libs/crypto/constants.d.ts +3 -0
  24. package/dist/libs/crypto/hashing.d.ts +69 -0
  25. package/dist/libs/crypto/index.d.ts +9 -0
  26. package/dist/libs/crypto/keys.d.ts +74 -0
  27. package/dist/libs/crypto/sign.d.ts +9 -0
  28. package/dist/libs/crypto/tree.d.ts +23 -0
  29. package/dist/libs/crypto/types.d.ts +55 -0
  30. package/dist/libs/errors/index.d.ts +28 -0
  31. package/dist/libs/errors/types.d.ts +19 -0
  32. package/dist/libs/http/http.d.ts +16 -0
  33. package/dist/libs/http/index.d.ts +1 -0
  34. package/dist/libs/index.d.ts +7 -0
  35. package/dist/libs/indexer/index.d.ts +1 -0
  36. package/dist/libs/indexer/indexer.d.ts +152 -0
  37. package/dist/libs/indexer/types.d.ts +7 -0
  38. package/dist/libs/maci/index.d.ts +1 -0
  39. package/dist/libs/maci/maci.d.ts +182 -0
  40. package/dist/libs/maci/types.d.ts +6 -0
  41. package/dist/libs/oracle-certificate/index.d.ts +1 -0
  42. package/dist/libs/oracle-certificate/oracle-certificate.d.ts +9 -0
  43. package/dist/libs/oracle-certificate/types.d.ts +40 -0
  44. package/dist/libs/query/account.d.ts +7 -0
  45. package/dist/libs/query/circuit.d.ts +8 -0
  46. package/dist/libs/query/event.d.ts +7 -0
  47. package/dist/libs/query/index.d.ts +7 -0
  48. package/dist/libs/query/operator.d.ts +11 -0
  49. package/dist/libs/query/proof.d.ts +7 -0
  50. package/dist/libs/query/round.d.ts +18 -0
  51. package/dist/libs/query/transaction.d.ts +9 -0
  52. package/dist/maci.d.ts +190 -0
  53. package/dist/types/index.d.ts +383 -0
  54. package/dist/utils/index.d.ts +7 -0
  55. package/package.json +18 -24
  56. package/src/index.ts +1 -3
  57. package/src/libs/contract/contract.ts +14 -13
  58. package/src/libs/contract/types.ts +3 -3
  59. package/src/libs/crypto/babyjub.ts +132 -0
  60. package/src/libs/crypto/bigintUtils.ts +31 -0
  61. package/src/libs/crypto/constants.ts +22 -0
  62. package/src/libs/crypto/hashing.ts +167 -0
  63. package/src/libs/crypto/index.ts +9 -0
  64. package/src/libs/{circom/circomlib.ts → crypto/keys.ts} +104 -114
  65. package/src/libs/crypto/sign.ts +91 -0
  66. package/src/libs/crypto/tree.ts +176 -0
  67. package/src/libs/crypto/types.ts +101 -0
  68. package/src/libs/index.ts +1 -1
  69. package/src/libs/maci/maci.ts +28 -29
  70. package/src/maci.ts +132 -67
  71. package/src/types/index.ts +7 -0
  72. package/src/utils/index.ts +22 -22
  73. package/dist/browser.d.mts +0 -2233
  74. package/dist/browser.d.ts +0 -2233
  75. package/dist/browser.js +0 -31620
  76. package/dist/browser.js.map +0 -1
  77. package/dist/browser.mjs +0 -31631
  78. package/dist/browser.mjs.map +0 -1
  79. package/dist/index.d.mts +0 -2234
  80. package/src/browser.ts +0 -17
  81. package/src/libs/circom/index.ts +0 -98
  82. package/src/libs/circom/types.ts +0 -8
  83. package/src/polyfills/browser-polyfills.ts +0 -9
@@ -0,0 +1,91 @@
1
+ import {
2
+ OfflineSigner,
3
+ OfflineDirectSigner,
4
+ isOfflineDirectSigner,
5
+ } from '@cosmjs/proto-signing';
6
+ import { StdSignDoc } from '@cosmjs/amino';
7
+ import { SignDoc } from 'cosmjs-types/cosmos/tx/v1beta1/tx';
8
+ import { getDefaultParams } from '../const';
9
+ import { genKeypair } from './keys';
10
+ import { SignResult } from './types';
11
+
12
+ export async function signMessage(
13
+ signer: OfflineSigner,
14
+ address: string,
15
+ message: string,
16
+ network: 'mainnet' | 'testnet'
17
+ ): Promise<SignResult> {
18
+ const accounts = await signer.getAccounts();
19
+ const account = accounts.find((acc) => acc.address === address);
20
+ const chainId = getDefaultParams(network).chainId;
21
+
22
+ if (!account) {
23
+ throw new Error(`Address ${address} not found in wallet`);
24
+ }
25
+
26
+ if (isOfflineDirectSigner(signer)) {
27
+ // Direct
28
+ const signDoc: SignDoc = {
29
+ bodyBytes: new TextEncoder().encode(message),
30
+ authInfoBytes: new Uint8Array(),
31
+ chainId,
32
+ accountNumber: BigInt(0),
33
+ };
34
+
35
+ const { signature } = await signer.signDirect(address, signDoc);
36
+
37
+ return {
38
+ signature: signature.signature,
39
+ pubkey: account.pubkey,
40
+ };
41
+ } else {
42
+ // Amino
43
+ const signDoc: StdSignDoc = {
44
+ chain_id: chainId,
45
+ account_number: '0',
46
+ sequence: '0',
47
+ fee: {
48
+ gas: '0',
49
+ amount: [],
50
+ },
51
+ msgs: [],
52
+ memo: message,
53
+ };
54
+
55
+ const { signature } = await signer.signAmino(address, signDoc);
56
+
57
+ return {
58
+ signature: signature.signature,
59
+ pubkey: account.pubkey,
60
+ };
61
+ }
62
+ }
63
+
64
+ export async function genKeypairFromSignature(signature: string) {
65
+ const sign = BigInt('0x' + Buffer.from(signature, 'base64').toString('hex'));
66
+
67
+ return genKeypair(sign);
68
+ }
69
+
70
+ export async function genKeypairFromSign({
71
+ signer,
72
+ address,
73
+ network,
74
+ }: {
75
+ signer: OfflineSigner;
76
+ address?: string;
77
+ network: 'mainnet' | 'testnet';
78
+ }) {
79
+ if (!address) {
80
+ [{ address }] = await signer.getAccounts();
81
+ }
82
+
83
+ const sig = await signMessage(
84
+ signer,
85
+ address,
86
+ 'Generate_MACI_Private_Key',
87
+ network
88
+ );
89
+
90
+ return genKeypairFromSignature(sig.signature);
91
+ }
@@ -0,0 +1,176 @@
1
+ import { poseidon } from './hashing';
2
+
3
+ export class Tree {
4
+ private DEPTH: number;
5
+ private HEIGHT: number;
6
+ private DEGREE: number;
7
+ private LEAVES_COUNT: number;
8
+ private LEAVES_IDX_0: number;
9
+ private NODES_COUNT: number;
10
+ private zeros!: bigint[];
11
+ private nodes!: bigint[];
12
+
13
+ constructor(degree: number, depth: number, zero: bigint) {
14
+ this.DEPTH = depth;
15
+ this.HEIGHT = depth + 1;
16
+ this.DEGREE = degree;
17
+
18
+ this.LEAVES_COUNT = degree ** depth;
19
+ this.LEAVES_IDX_0 = (degree ** depth - 1) / (degree - 1);
20
+ this.NODES_COUNT = (degree ** (depth + 1) - 1) / (degree - 1);
21
+
22
+ this.initZero(zero);
23
+ this.initNodes();
24
+ }
25
+
26
+ get root(): bigint {
27
+ return this.nodes[0];
28
+ }
29
+
30
+ private async initZero(zero: bigint): Promise<void> {
31
+ this.zeros = new Array<bigint>(this.HEIGHT);
32
+ this.zeros[0] = zero;
33
+ for (let i = 1; i < this.zeros.length; i++) {
34
+ this.zeros[i] = await poseidon([this.zeros[i - 1], this.zeros[i - 1]]);
35
+ }
36
+ }
37
+
38
+ private async initNodes(): Promise<void> {
39
+ const DEGREE = this.DEGREE;
40
+
41
+ this.nodes = new Array<bigint>(this.NODES_COUNT);
42
+
43
+ for (let d = this.DEPTH; d >= 0; d--) {
44
+ const size = DEGREE ** d;
45
+ const idx0 = (DEGREE ** d - 1) / (DEGREE - 1);
46
+ const zero = this.zeros[this.DEPTH - d];
47
+ for (let i = 0; i < size; i++) {
48
+ this.nodes[idx0 + i] = zero;
49
+ }
50
+ }
51
+ }
52
+
53
+ initLeaves(leaves: (bigint | string | number)[]): void {
54
+ const DEGREE = this.DEGREE;
55
+ for (let i = 0; i < leaves.length; i++) {
56
+ if (i >= this.LEAVES_COUNT) {
57
+ console.error('OVERFLOW');
58
+ break;
59
+ }
60
+ this.nodes[this.LEAVES_IDX_0 + i] = BigInt(leaves[i]);
61
+ }
62
+
63
+ for (let d = this.DEPTH - 1; d >= 0; d--) {
64
+ const size = DEGREE ** d;
65
+ const idx0 = (DEGREE ** d - 1) / (DEGREE - 1);
66
+ for (let i = 0; i < size / DEGREE; i++) {
67
+ const start = (idx0 + i) * DEGREE + 1;
68
+ const children = this.nodes.slice(start, start + DEGREE);
69
+ this.nodes[idx0 + i] = poseidon(children);
70
+ }
71
+ }
72
+ }
73
+
74
+ leaf(leafIdx: number): bigint {
75
+ if (leafIdx > this.LEAVES_COUNT || leafIdx < 0) {
76
+ throw new Error('wrong leaf index');
77
+ }
78
+ const nodeIdx = this.LEAVES_IDX_0 + leafIdx;
79
+ return this.nodes[nodeIdx];
80
+ }
81
+
82
+ leaves(): bigint[] {
83
+ return this.nodes.slice(this.LEAVES_IDX_0);
84
+ }
85
+
86
+ updateLeaf(leafIdx: number, leaf: bigint): void {
87
+ if (leafIdx > this.LEAVES_COUNT || leafIdx < 0) {
88
+ throw new Error('wrong leaf index');
89
+ }
90
+ const nodeIdx = this.LEAVES_IDX_0 + leafIdx;
91
+ this.nodes[nodeIdx] = leaf;
92
+
93
+ this._update(nodeIdx);
94
+ }
95
+
96
+ pathIdxOf(leafIdx: number): number[] {
97
+ if (leafIdx > this.LEAVES_COUNT || leafIdx < 0) {
98
+ throw new Error('wrong leaf index');
99
+ }
100
+ let idx = this.LEAVES_IDX_0 + leafIdx;
101
+ const pathIdx: number[] = [];
102
+
103
+ for (let i = 0; i < this.DEPTH; i++) {
104
+ const parentIdx = Math.floor((idx - 1) / this.DEGREE);
105
+ const childrenIdx0 = parentIdx * this.DEGREE + 1;
106
+
107
+ pathIdx.push(idx - childrenIdx0);
108
+
109
+ idx = parentIdx;
110
+ }
111
+
112
+ return pathIdx;
113
+ }
114
+
115
+ pathElementOf(leafIdx: number): bigint[][] {
116
+ if (leafIdx > this.LEAVES_COUNT || leafIdx < 0) {
117
+ throw new Error('wrong leaf index');
118
+ }
119
+ let idx = this.LEAVES_IDX_0 + leafIdx;
120
+ const pathElement: bigint[][] = [];
121
+
122
+ for (let h = 0; h < this.DEPTH; h++) {
123
+ const parentIdx = Math.floor((idx - 1) / this.DEGREE);
124
+ const childrenIdx0 = parentIdx * this.DEGREE + 1;
125
+
126
+ const el: bigint[] = [];
127
+ for (let i = childrenIdx0; i < childrenIdx0 + this.DEGREE; i++) {
128
+ if (i === idx) continue;
129
+ el.push(this.nodes[i]);
130
+ }
131
+
132
+ pathElement.push(el);
133
+
134
+ idx = parentIdx;
135
+ }
136
+
137
+ return pathElement;
138
+ }
139
+
140
+ subTree(length: number): Tree {
141
+ const subTree = new Tree(this.DEGREE, this.DEPTH, this.zeros[0]);
142
+ const nodes = [...this.nodes];
143
+
144
+ const DEGREE = this.DEGREE;
145
+ let tail = length;
146
+ for (let d = this.DEPTH; d >= 0; d--) {
147
+ const size = DEGREE ** d;
148
+ const idx0 = (DEGREE ** d - 1) / (DEGREE - 1);
149
+ const zero = this.zeros[this.DEPTH - d];
150
+ for (let i = tail; i < size; i++) {
151
+ nodes[idx0 + i] = zero;
152
+ }
153
+ tail = Math.ceil(tail / DEGREE);
154
+ }
155
+
156
+ subTree.nodes = nodes;
157
+ subTree._update(this.LEAVES_IDX_0 + length - 1);
158
+
159
+ return subTree;
160
+ }
161
+
162
+ private async _update(nodeIdx: number): Promise<void> {
163
+ let idx = nodeIdx;
164
+ while (idx > 0) {
165
+ const parentIdx = Math.floor((idx - 1) / this.DEGREE);
166
+ const childrenIdx0 = parentIdx * this.DEGREE + 1;
167
+ this.nodes[parentIdx] = await poseidon(
168
+ this.nodes.slice(childrenIdx0, childrenIdx0 + this.DEGREE)
169
+ );
170
+
171
+ idx = parentIdx;
172
+ }
173
+ }
174
+ }
175
+
176
+ export default Tree;
@@ -0,0 +1,101 @@
1
+ export type SignResult = {
2
+ signature: string;
3
+ pubkey: Uint8Array;
4
+ };
5
+
6
+ // we define a bignumber as either a bigint or a string
7
+ // which is what we use the most in MACI
8
+ export type SnarkBigNumber = bigint;
9
+
10
+ // a private key is a single BigNumber
11
+ export type PrivKey = SnarkBigNumber;
12
+
13
+ // a public key is a pair of BigNumbers
14
+ export type PubKey<N = bigint> = [N, N];
15
+
16
+ // a shared key is a pair of BigNumbers
17
+ export type EcdhSharedKey<N = bigint> = [N, N];
18
+
19
+ // a point is a pair of BigNumbers
20
+ export type Point<N = SnarkBigNumber> = [N, N];
21
+
22
+ // a plaintext is an array of BigNumbers
23
+ export type Plaintext<N = bigint> = N[];
24
+
25
+ // a ciphertext is an array of BigNumbers
26
+ export type Ciphertext<N = bigint> = N[];
27
+
28
+ // a merkle tree path elements
29
+ export type PathElements = bigint[][];
30
+
31
+ /**
32
+ * A acc queue
33
+ */
34
+ export interface Queue {
35
+ levels: Map<number, Map<number, bigint>>;
36
+ indices: number[];
37
+ }
38
+
39
+ /**
40
+ * A private key and a public key
41
+ */
42
+ export interface Keypair {
43
+ privKey: PrivKey;
44
+ pubKey: PubKey;
45
+ formatedPrivKey: PrivKey;
46
+ }
47
+
48
+ // An EdDSA signature.
49
+ // R8 is a Baby Jubjub elliptic curve point and S is an element of the finite
50
+ // field of order `l` where `l` is the large prime number dividing the order of
51
+ // Baby Jubjub: see
52
+ // https://iden3-docs.readthedocs.io/en/latest/_downloads/a04267077fb3fdbf2b608e014706e004/Ed-DSA.pdf
53
+ export interface Signature<N = SnarkBigNumber> {
54
+ R8: Point<N>;
55
+ S: N;
56
+ }
57
+
58
+ /**
59
+ * A interface for poseidon hash functions
60
+ */
61
+ export interface PoseidonFuncs {
62
+ [key: number]: (inputs: bigint[]) => bigint;
63
+ 2: (inputs: bigint[]) => bigint;
64
+ 3: (inputs: bigint[]) => bigint;
65
+ 4: (inputs: bigint[]) => bigint;
66
+ 5: (inputs: bigint[]) => bigint;
67
+ }
68
+
69
+ // a leaf is a single BigNumber
70
+ export type Leaf = bigint;
71
+
72
+ // a node is a leaf or subroot in a quinary merkle tree
73
+ export type Node = Record<number, Leaf>;
74
+
75
+ // a merkle proof is a set of path elements, path indices, and a root
76
+ export interface IMerkleProof {
77
+ pathElements: Leaf[][];
78
+ pathIndices: number[];
79
+ root: Leaf;
80
+ leaf: Leaf;
81
+ }
82
+
83
+ export type StringifiedBigInts =
84
+ | StringifiedBigInts[]
85
+ | string
86
+ | string[]
87
+ | string[][]
88
+ | string[][][]
89
+ | { [key: string]: StringifiedBigInts }
90
+ | null;
91
+
92
+ export type BigIntVariants =
93
+ | BigIntVariants[]
94
+ | StringifiedBigInts
95
+ | bigint
96
+ | bigint[]
97
+ | bigint[][]
98
+ | bigint[][][]
99
+ | { [key: string]: BigIntVariants }
100
+ | Uint8Array
101
+ | null;
package/src/libs/index.ts CHANGED
@@ -3,5 +3,5 @@ export * from './query';
3
3
  export * from './indexer';
4
4
  export * from './contract';
5
5
  export * from './oracle-certificate';
6
- export * from './circom';
7
6
  export * from './maci';
7
+ export * from './crypto';
@@ -1,11 +1,5 @@
1
1
  import { OfflineSigner } from '@cosmjs/proto-signing';
2
- import {
3
- Account,
4
- batchGenMessage,
5
- Circom,
6
- PublicKey,
7
- stringizing,
8
- } from '../circom';
2
+ import { Keypair, batchGenMessage, PubKey, stringizing } from '../crypto';
9
3
  import { Contract } from '../contract';
10
4
  import { Indexer } from '../indexer';
11
5
  import { OracleCertificate } from '../oracle-certificate';
@@ -31,25 +25,25 @@ export function isErrorResponse(response: unknown): response is ErrorResponse {
31
25
  }
32
26
 
33
27
  export class MACI {
34
- public circom: Circom;
35
28
  public contract: Contract;
36
29
  public indexer: Indexer;
37
30
  public oracleCertificate: OracleCertificate;
31
+ public maciKeypair: Keypair;
38
32
  constructor({
39
- circom,
40
33
  contract,
41
34
  indexer,
42
35
  oracleCertificate,
36
+ maciKeypair,
43
37
  }: {
44
- circom: Circom;
45
38
  contract: Contract;
46
39
  indexer: Indexer;
47
40
  oracleCertificate: OracleCertificate;
41
+ maciKeypair: Keypair;
48
42
  }) {
49
- this.circom = circom;
50
43
  this.contract = contract;
51
44
  this.indexer = indexer;
52
45
  this.oracleCertificate = oracleCertificate;
46
+ this.maciKeypair = maciKeypair;
53
47
  }
54
48
 
55
49
  async getStateIdxInc({
@@ -163,7 +157,10 @@ export class MACI {
163
157
  signer: OfflineSigner;
164
158
  address?: string;
165
159
  contractAddress: string;
166
- certificate?: string;
160
+ certificate?: {
161
+ signature: string;
162
+ amount: string;
163
+ };
167
164
  mode?: 'maci' | 'amaci';
168
165
  }): Promise<string> {
169
166
  if (!address) {
@@ -205,8 +202,8 @@ export class MACI {
205
202
  });
206
203
 
207
204
  const balance = await client.whiteBalanceOf({
208
- amount: address,
209
- certificate,
205
+ amount: certificate.amount,
206
+ certificate: certificate.signature,
210
207
  sender: address,
211
208
  });
212
209
 
@@ -444,14 +441,14 @@ export class MACI {
444
441
  signer,
445
442
  address,
446
443
  contractAddress,
447
- maciAccount,
444
+ maciKeypair,
448
445
  oracleCertificate,
449
446
  gasStation = false,
450
447
  }: {
451
448
  signer: OfflineSigner;
452
449
  address?: string;
453
450
  contractAddress: string;
454
- maciAccount?: Account;
451
+ maciKeypair?: Keypair;
455
452
  oracleCertificate?: {
456
453
  amount: string;
457
454
  signature: string;
@@ -463,8 +460,9 @@ export class MACI {
463
460
  address = (await signer.getAccounts())[0].address;
464
461
  }
465
462
 
466
- if (maciAccount === undefined) {
467
- maciAccount = await this.circom.genKeypairFromSign(signer, address);
463
+ if (maciKeypair === undefined) {
464
+ maciKeypair = this.maciKeypair;
465
+ // maciKeypair = await this.crypto.genKeypairFromSign(signer, address);
468
466
  }
469
467
 
470
468
  const client = await this.contract.contractClient({
@@ -475,7 +473,7 @@ export class MACI {
475
473
  return await this.signupOracle({
476
474
  client,
477
475
  address,
478
- pubKey: maciAccount.pubKey,
476
+ pubKey: maciKeypair.pubKey,
479
477
  contractAddress,
480
478
  oracleCertificate,
481
479
  gasStation,
@@ -484,7 +482,7 @@ export class MACI {
484
482
  return await this.signupSimple({
485
483
  client,
486
484
  address,
487
- pubKey: maciAccount.pubKey,
485
+ pubKey: maciKeypair.pubKey,
488
486
  contractAddress,
489
487
  gasStation,
490
488
  });
@@ -540,7 +538,7 @@ export class MACI {
540
538
  contractAddress,
541
539
  selectedOptions,
542
540
  operatorCoordPubKey,
543
- maciAccount,
541
+ maciKeypair,
544
542
  gasStation = false,
545
543
  }: {
546
544
  signer: OfflineSigner;
@@ -551,8 +549,8 @@ export class MACI {
551
549
  idx: number;
552
550
  vc: number;
553
551
  }[];
554
- operatorCoordPubKey: PublicKey;
555
- maciAccount?: Account;
552
+ operatorCoordPubKey: PubKey;
553
+ maciKeypair?: Keypair;
556
554
  gasStation?: boolean;
557
555
  }) {
558
556
  if (stateIdx === -1) {
@@ -576,8 +574,9 @@ export class MACI {
576
574
  address = (await signer.getAccounts())[0].address;
577
575
  }
578
576
 
579
- if (maciAccount === undefined) {
580
- maciAccount = await this.circom.genKeypairFromSign(signer, address);
577
+ if (maciKeypair === undefined) {
578
+ maciKeypair = this.maciKeypair;
579
+ // maciKeypair = await this.crypto.genKeypairFromSign(signer, address);
581
580
  }
582
581
 
583
582
  const plan = options.map((o) => {
@@ -586,7 +585,7 @@ export class MACI {
586
585
 
587
586
  const payload = batchGenMessage(
588
587
  stateIdx,
589
- maciAccount,
588
+ maciKeypair,
590
589
  operatorCoordPubKey,
591
590
  plan
592
591
  );
@@ -618,7 +617,7 @@ export class MACI {
618
617
  address: string;
619
618
  payload: {
620
619
  msg: bigint[];
621
- encPubkeys: PublicKey;
620
+ encPubkeys: PubKey;
622
621
  }[];
623
622
  contractAddress: string;
624
623
  gasStation: boolean;
@@ -671,7 +670,7 @@ export class MACI {
671
670
  }: {
672
671
  client: SigningCosmWasmClient;
673
672
  address: string;
674
- pubKey: PublicKey;
673
+ pubKey: PubKey;
675
674
  contractAddress: string;
676
675
  gasStation?: boolean;
677
676
  }) {
@@ -724,7 +723,7 @@ export class MACI {
724
723
  }: {
725
724
  client: SigningCosmWasmClient;
726
725
  address: string;
727
- pubKey: PublicKey;
726
+ pubKey: PubKey;
728
727
  contractAddress: string;
729
728
  oracleCertificate: {
730
729
  amount: string;