@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/dist/index.d.mts CHANGED
@@ -1667,10 +1667,11 @@ declare class MACI {
1667
1667
  address: string;
1668
1668
  contractAddress: string;
1669
1669
  }): Promise<SignatureResponse>;
1670
- signup({ signer, address, contractAddress, oracleCertificate, gasStation, }: {
1670
+ signup({ signer, address, contractAddress, maciAccount, oracleCertificate, gasStation, }: {
1671
1671
  signer: OfflineSigner;
1672
1672
  address: string;
1673
1673
  contractAddress: string;
1674
+ maciAccount?: Account;
1674
1675
  oracleCertificate?: {
1675
1676
  amount: string;
1676
1677
  signature: string;
@@ -1678,7 +1679,7 @@ declare class MACI {
1678
1679
  gasStation?: boolean;
1679
1680
  }): Promise<_cosmjs_cosmwasm_stargate.ExecuteResult>;
1680
1681
  private processVoteOptions;
1681
- vote({ signer, address, stateIdx, contractAddress, selectedOptions, operatorCoordPubKey, gasStation, }: {
1682
+ vote({ signer, address, stateIdx, contractAddress, selectedOptions, operatorCoordPubKey, maciAccount, gasStation, }: {
1682
1683
  signer: OfflineSigner;
1683
1684
  address: string;
1684
1685
  stateIdx: number;
@@ -1688,6 +1689,7 @@ declare class MACI {
1688
1689
  vc: number;
1689
1690
  }[];
1690
1691
  operatorCoordPubKey: PublicKey;
1692
+ maciAccount?: Account;
1691
1693
  gasStation?: boolean;
1692
1694
  }): Promise<_cosmjs_cosmwasm_stargate.DeliverTxResponse>;
1693
1695
  publishMessage({ client, address, payload, contractAddress, gasStation, }: {
package/dist/index.d.ts CHANGED
@@ -1667,10 +1667,11 @@ declare class MACI {
1667
1667
  address: string;
1668
1668
  contractAddress: string;
1669
1669
  }): Promise<SignatureResponse>;
1670
- signup({ signer, address, contractAddress, oracleCertificate, gasStation, }: {
1670
+ signup({ signer, address, contractAddress, maciAccount, oracleCertificate, gasStation, }: {
1671
1671
  signer: OfflineSigner;
1672
1672
  address: string;
1673
1673
  contractAddress: string;
1674
+ maciAccount?: Account;
1674
1675
  oracleCertificate?: {
1675
1676
  amount: string;
1676
1677
  signature: string;
@@ -1678,7 +1679,7 @@ declare class MACI {
1678
1679
  gasStation?: boolean;
1679
1680
  }): Promise<_cosmjs_cosmwasm_stargate.ExecuteResult>;
1680
1681
  private processVoteOptions;
1681
- vote({ signer, address, stateIdx, contractAddress, selectedOptions, operatorCoordPubKey, gasStation, }: {
1682
+ vote({ signer, address, stateIdx, contractAddress, selectedOptions, operatorCoordPubKey, maciAccount, gasStation, }: {
1682
1683
  signer: OfflineSigner;
1683
1684
  address: string;
1684
1685
  stateIdx: number;
@@ -1688,6 +1689,7 @@ declare class MACI {
1688
1689
  vc: number;
1689
1690
  }[];
1690
1691
  operatorCoordPubKey: PublicKey;
1692
+ maciAccount?: Account;
1691
1693
  gasStation?: boolean;
1692
1694
  }): Promise<_cosmjs_cosmwasm_stargate.DeliverTxResponse>;
1693
1695
  publishMessage({ client, address, payload, contractAddress, gasStation, }: {
package/dist/index.js CHANGED
@@ -4604,11 +4604,14 @@ var MACI = class {
4604
4604
  signer,
4605
4605
  address,
4606
4606
  contractAddress,
4607
+ maciAccount,
4607
4608
  oracleCertificate,
4608
4609
  gasStation = false
4609
4610
  }) {
4610
4611
  try {
4611
- const maciAccount = await this.circom.genKeypairFromSign(signer, address);
4612
+ if (maciAccount === void 0) {
4613
+ maciAccount = await this.circom.genKeypairFromSign(signer, address);
4614
+ }
4612
4615
  const client = await this.contract.contractClient({
4613
4616
  signer
4614
4617
  });
@@ -4663,6 +4666,7 @@ var MACI = class {
4663
4666
  contractAddress,
4664
4667
  selectedOptions,
4665
4668
  operatorCoordPubKey,
4669
+ maciAccount,
4666
4670
  gasStation = false
4667
4671
  }) {
4668
4672
  if (stateIdx === -1) {
@@ -4679,7 +4683,9 @@ var MACI = class {
4679
4683
  contractAddress,
4680
4684
  voiceCreditBalance
4681
4685
  });
4682
- const maciAccount = await this.circom.genKeypairFromSign(signer, address);
4686
+ if (maciAccount === void 0) {
4687
+ maciAccount = await this.circom.genKeypairFromSign(signer, address);
4688
+ }
4683
4689
  const plan = options.map((o) => {
4684
4690
  return [o.idx, o.vc];
4685
4691
  });