@dorafactory/maci-sdk 0.0.16 → 0.0.17

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/README.md CHANGED
@@ -178,6 +178,7 @@ const signupResponse = await client.maci.signup({
178
178
  signer: wallet,
179
179
  address,
180
180
  contractAddress: 'dora1...',
181
+ maciAccount,
181
182
  oracleCertificate: {
182
183
  amount: certificate.amount,
183
184
  signature: certificate.signature,
@@ -206,6 +207,7 @@ const voteResponse = await client.maci.vote({
206
207
  BigInt(roundInfo.coordinatorPubkeyX),
207
208
  BigInt(roundInfo.coordinatorPubkeyY),
208
209
  ],
210
+ maciAccount,
209
211
  gasStation: true,
210
212
  });
211
213
  ```
@@ -1666,10 +1666,11 @@ declare class MACI {
1666
1666
  address: string;
1667
1667
  contractAddress: string;
1668
1668
  }): Promise<SignatureResponse>;
1669
- signup({ signer, address, contractAddress, oracleCertificate, gasStation, }: {
1669
+ signup({ signer, address, contractAddress, maciAccount, oracleCertificate, gasStation, }: {
1670
1670
  signer: OfflineSigner;
1671
1671
  address: string;
1672
1672
  contractAddress: string;
1673
+ maciAccount?: Account;
1673
1674
  oracleCertificate?: {
1674
1675
  amount: string;
1675
1676
  signature: string;
@@ -1677,7 +1678,7 @@ declare class MACI {
1677
1678
  gasStation?: boolean;
1678
1679
  }): Promise<_cosmjs_cosmwasm_stargate.ExecuteResult>;
1679
1680
  private processVoteOptions;
1680
- vote({ signer, address, stateIdx, contractAddress, selectedOptions, operatorCoordPubKey, gasStation, }: {
1681
+ vote({ signer, address, stateIdx, contractAddress, selectedOptions, operatorCoordPubKey, maciAccount, gasStation, }: {
1681
1682
  signer: OfflineSigner;
1682
1683
  address: string;
1683
1684
  stateIdx: number;
@@ -1687,6 +1688,7 @@ declare class MACI {
1687
1688
  vc: number;
1688
1689
  }[];
1689
1690
  operatorCoordPubKey: PublicKey;
1691
+ maciAccount?: Account;
1690
1692
  gasStation?: boolean;
1691
1693
  }): Promise<_cosmjs_cosmwasm_stargate.DeliverTxResponse>;
1692
1694
  publishMessage({ client, address, payload, contractAddress, gasStation, }: {
package/dist/browser.d.ts CHANGED
@@ -1666,10 +1666,11 @@ declare class MACI {
1666
1666
  address: string;
1667
1667
  contractAddress: string;
1668
1668
  }): Promise<SignatureResponse>;
1669
- signup({ signer, address, contractAddress, oracleCertificate, gasStation, }: {
1669
+ signup({ signer, address, contractAddress, maciAccount, oracleCertificate, gasStation, }: {
1670
1670
  signer: OfflineSigner;
1671
1671
  address: string;
1672
1672
  contractAddress: string;
1673
+ maciAccount?: Account;
1673
1674
  oracleCertificate?: {
1674
1675
  amount: string;
1675
1676
  signature: string;
@@ -1677,7 +1678,7 @@ declare class MACI {
1677
1678
  gasStation?: boolean;
1678
1679
  }): Promise<_cosmjs_cosmwasm_stargate.ExecuteResult>;
1679
1680
  private processVoteOptions;
1680
- vote({ signer, address, stateIdx, contractAddress, selectedOptions, operatorCoordPubKey, gasStation, }: {
1681
+ vote({ signer, address, stateIdx, contractAddress, selectedOptions, operatorCoordPubKey, maciAccount, gasStation, }: {
1681
1682
  signer: OfflineSigner;
1682
1683
  address: string;
1683
1684
  stateIdx: number;
@@ -1687,6 +1688,7 @@ declare class MACI {
1687
1688
  vc: number;
1688
1689
  }[];
1689
1690
  operatorCoordPubKey: PublicKey;
1691
+ maciAccount?: Account;
1690
1692
  gasStation?: boolean;
1691
1693
  }): Promise<_cosmjs_cosmwasm_stargate.DeliverTxResponse>;
1692
1694
  publishMessage({ client, address, payload, contractAddress, gasStation, }: {
package/dist/browser.js CHANGED
@@ -30380,11 +30380,14 @@ var MACI = class {
30380
30380
  signer,
30381
30381
  address,
30382
30382
  contractAddress,
30383
+ maciAccount,
30383
30384
  oracleCertificate,
30384
30385
  gasStation = false
30385
30386
  }) {
30386
30387
  try {
30387
- const maciAccount = await this.circom.genKeypairFromSign(signer, address);
30388
+ if (maciAccount === void 0) {
30389
+ maciAccount = await this.circom.genKeypairFromSign(signer, address);
30390
+ }
30388
30391
  const client = await this.contract.contractClient({
30389
30392
  signer
30390
30393
  });
@@ -30439,6 +30442,7 @@ var MACI = class {
30439
30442
  contractAddress,
30440
30443
  selectedOptions,
30441
30444
  operatorCoordPubKey,
30445
+ maciAccount,
30442
30446
  gasStation = false
30443
30447
  }) {
30444
30448
  if (stateIdx === -1) {
@@ -30455,7 +30459,9 @@ var MACI = class {
30455
30459
  contractAddress,
30456
30460
  voiceCreditBalance
30457
30461
  });
30458
- const maciAccount = await this.circom.genKeypairFromSign(signer, address);
30462
+ if (maciAccount === void 0) {
30463
+ maciAccount = await this.circom.genKeypairFromSign(signer, address);
30464
+ }
30459
30465
  const plan = options.map((o) => {
30460
30466
  return [o.idx, o.vc];
30461
30467
  });