@dorafactory/maci-sdk 0.0.31 → 0.0.33

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.js CHANGED
@@ -5376,13 +5376,21 @@ var MACI = class {
5376
5376
  }
5377
5377
  /**
5378
5378
  * Batch grant with bond (for maci)
5379
- * @param client
5379
+ * @param signer
5380
5380
  * @param contractAddress
5381
5381
  * @param address
5382
5382
  * @param amount
5383
5383
  * @returns
5384
5384
  */
5385
- async batchGrantWithBond(client, contractAddress, address, amount) {
5385
+ async batchGrantWithBond({
5386
+ signer,
5387
+ contractAddress,
5388
+ address,
5389
+ amount
5390
+ }) {
5391
+ const client = await this.contract.contractClient({
5392
+ signer
5393
+ });
5386
5394
  const msgs = [
5387
5395
  {
5388
5396
  typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract",
@@ -5435,7 +5443,14 @@ var MACI = class {
5435
5443
  * @param address
5436
5444
  * @returns
5437
5445
  */
5438
- async batchRevokeWithdraw(client, contractAddress, address) {
5446
+ async batchRevokeWithdraw({
5447
+ signer,
5448
+ contractAddress,
5449
+ address
5450
+ }) {
5451
+ const client = await this.contract.contractClient({
5452
+ signer
5453
+ });
5439
5454
  const msgs = [
5440
5455
  {
5441
5456
  typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract",
@@ -5573,155 +5588,228 @@ var MaciClient2 = class {
5573
5588
  async createOracleMaciRound(params) {
5574
5589
  return await this.contract.createOracleMaciRound(params);
5575
5590
  }
5576
- /**
5577
- * @method balanceOf
5578
- * @description Get the balance of a specific address.
5579
- * @param {string} address - The address to check the balance for.
5580
- * @returns {Promise<BalanceResponse>} The balance response.
5581
- */
5582
- async balanceOf(address) {
5583
- return await this.indexer.account.balanceOf(address);
5591
+ async getStateIdxInc({
5592
+ signer,
5593
+ address,
5594
+ contractAddress
5595
+ }) {
5596
+ return await this.maci.getStateIdxInc({
5597
+ signer,
5598
+ address,
5599
+ contractAddress
5600
+ });
5584
5601
  }
5585
- /**
5586
- * @method getRoundById
5587
- * @description Get a round by its ID.
5588
- * @param {string} id - The ID of the round.
5589
- * @returns {Promise<RoundResponse>} The round response.
5590
- */
5591
- async getRoundById(id) {
5592
- return await this.indexer.round.getRoundById(id);
5602
+ async getVoiceCreditBalance({
5603
+ signer,
5604
+ stateIdx,
5605
+ contractAddress
5606
+ }) {
5607
+ return await this.maci.getVoiceCreditBalance({
5608
+ signer,
5609
+ stateIdx,
5610
+ contractAddress
5611
+ });
5593
5612
  }
5594
- /**
5595
- * @method getRoundWithFields
5596
- * @description Get a round by its address with selective fields.
5597
- * @param {string} address - The address of the round.
5598
- * @param {string[]} [fields] - The fields to retrieve.
5599
- * @returns {Promise<SelectiveRoundResponse>} The round response.
5600
- */
5601
- async getRoundWithFields(address, fields) {
5602
- return await this.indexer.round.getRoundWithFields(address, fields);
5613
+ async getStateIdxByPubKey({
5614
+ contractAddress,
5615
+ pubKey
5616
+ }) {
5617
+ return await this.maci.getStateIdxByPubKey({
5618
+ contractAddress,
5619
+ pubKey
5620
+ });
5603
5621
  }
5604
- /**
5605
- * @method getRounds
5606
- * @description Get multiple rounds.
5607
- * @param {string} after - The cursor to start after.
5608
- * @param {number} [limit] - The number of rounds to retrieve.
5609
- * @returns {Promise<RoundsResponse>} The rounds response.
5610
- */
5611
- async getRounds(after, limit) {
5612
- return await this.indexer.round.getRounds(after, limit);
5622
+ async feegrantAllowance({
5623
+ address,
5624
+ contractAddress
5625
+ }) {
5626
+ return await this.maci.feegrantAllowance({
5627
+ address,
5628
+ contractAddress
5629
+ });
5613
5630
  }
5614
- /**
5615
- * @method getRoundsByStatus
5616
- * @description Get rounds by their status.
5617
- * @param {string} status - The status of the rounds to retrieve.
5618
- * @param {string} after - The cursor to start after.
5619
- * @param {number} [limit] - The number of rounds to retrieve.
5620
- * @returns {Promise<RoundsResponse>} The rounds response.
5621
- */
5622
- async getRoundsByStatus(status, after, limit) {
5623
- return await this.indexer.round.getRoundsByStatus(status, after, limit);
5631
+ async hasFeegrant({
5632
+ address,
5633
+ contractAddress
5634
+ }) {
5635
+ return await this.maci.hasFeegrant({
5636
+ address,
5637
+ contractAddress
5638
+ });
5624
5639
  }
5625
- /**
5626
- * @method getRoundsByCircuitName
5627
- * @description Get rounds by their circuit name.
5628
- * @param {string} name - The name of the circuit.
5629
- * @param {string} after - The cursor to start after.
5630
- * @param {number} [limit] - The number of rounds to retrieve.
5631
- * @returns {Promise<RoundsResponse>} The rounds response.
5632
- */
5633
- async getRoundsByCircuitName(name, after, limit) {
5634
- return await this.indexer.round.getRoundsByCircuitName(name, after, limit);
5640
+ async queryWhitelistBalanceOf({
5641
+ signer,
5642
+ address,
5643
+ contractAddress,
5644
+ certificate,
5645
+ mode = "maci"
5646
+ }) {
5647
+ return await this.maci.queryWhitelistBalanceOf({
5648
+ signer,
5649
+ address,
5650
+ contractAddress,
5651
+ certificate,
5652
+ mode
5653
+ });
5635
5654
  }
5636
- /**
5637
- * @method getRoundsByOperator
5638
- * @description Get rounds by their operator address.
5639
- * @param {string} address - The address of the operator.
5640
- * @param {string} after - The cursor to start after.
5641
- * @param {number} [limit] - The number of rounds to retrieve.
5642
- * @returns {Promise<RoundsResponse>} The rounds response.
5643
- */
5644
- async getRoundsByOperator(address, after, limit) {
5645
- return await this.indexer.round.getRoundsByOperator(address, after, limit);
5655
+ async isWhitelisted({
5656
+ signer,
5657
+ address,
5658
+ contractAddress
5659
+ }) {
5660
+ return await this.maci.isWhitelisted({
5661
+ signer,
5662
+ address,
5663
+ contractAddress
5664
+ });
5646
5665
  }
5647
- /**
5648
- * @method getOperatorByAddress
5649
- * @description Get an operator by their address.
5650
- * @param {string} address - The address of the operator.
5651
- * @returns {Promise<OperatorResponse>} The operator response.
5652
- */
5653
- async getOperatorByAddress(address) {
5654
- return await this.indexer.operator.getOperatorByAddress(address);
5666
+ async getOracleWhitelistConfig({
5667
+ signer,
5668
+ contractAddress
5669
+ }) {
5670
+ return await this.maci.getOracleWhitelistConfig({
5671
+ signer,
5672
+ contractAddress
5673
+ });
5655
5674
  }
5656
- /**
5657
- * @method getOperators
5658
- * @description Get multiple operators.
5659
- * @param {string} after - The cursor to start after.
5660
- * @param {number} [limit] - The number of operators to retrieve.
5661
- * @returns {Promise<OperatorsResponse>} The operators response.
5662
- */
5663
- async getOperators(after, limit) {
5664
- return await this.indexer.operator.getOperators(after, limit);
5675
+ async getRoundInfo({ contractAddress }) {
5676
+ return await this.maci.getRoundInfo({ contractAddress });
5665
5677
  }
5666
- /**
5667
- * @method getCircuitByName
5668
- * @description Get a circuit by its name.
5669
- * @param {string} name - The name of the circuit.
5670
- * @returns {Promise<CircuitResponse>} The circuit response.
5671
- */
5672
- async getCircuitByName(name) {
5673
- return await this.indexer.circuit.getCircuitByName(name);
5678
+ async getRoundCircuitType({ contractAddress }) {
5679
+ return await this.maci.getRoundCircuitType({ contractAddress });
5674
5680
  }
5675
- /**
5676
- * @method getCircuits
5677
- * @description Get all available circuits.
5678
- * @returns {Promise<CircuitsResponse>} The circuits response.
5679
- */
5680
- async getCircuits() {
5681
- return await this.indexer.circuit.getCircuits();
5681
+ async queryRoundIsQv({ contractAddress }) {
5682
+ return await this.maci.queryRoundIsQv({ contractAddress });
5682
5683
  }
5683
- /**
5684
- * @method getTransactionByHash
5685
- * @description Get a transaction by its hash.
5686
- * @param {string} hash - The hash of the transaction.
5687
- * @returns {Promise<TransactionResponse>} The transaction response.
5688
- */
5689
- async getTransactionByHash(hash) {
5690
- return await this.indexer.transaction.getTransactionByHash(hash);
5684
+ async queryRoundClaimable({
5685
+ contractAddress
5686
+ }) {
5687
+ return await this.maci.queryRoundClaimable({ contractAddress });
5691
5688
  }
5692
- /**
5693
- * @method getTransactions
5694
- * @description Get multiple transactions.
5695
- * @param {string} after - The cursor to start after.
5696
- * @param {number} [limit] - The number of transactions to retrieve.
5697
- * @returns {Promise<TransactionsResponse>} The transactions response.
5698
- */
5699
- async getTransactions(after, limit) {
5700
- return await this.indexer.transaction.getTransactions(after, limit);
5689
+ async queryAMaciChargeFee({
5690
+ maxVoter,
5691
+ maxOption
5692
+ }) {
5693
+ return await this.maci.queryAMaciChargeFee({
5694
+ maxVoter,
5695
+ maxOption
5696
+ });
5701
5697
  }
5702
- /**
5703
- * @method getTransactionsByContractAddress
5704
- * @description Get transactions by contract address.
5705
- * @param {string} address - The contract address.
5706
- * @param {string} after - The cursor to start after.
5707
- * @param {number} [limit] - The number of transactions to retrieve.
5708
- * @returns {Promise<TransactionsResponse>} The transactions response.
5709
- */
5710
- async getTransactionsByContractAddress(address, after, limit) {
5711
- return await this.indexer.transaction.getTransactionsByContractAddress(
5712
- address,
5713
- after,
5714
- limit
5698
+ async queryRoundGasStation({ contractAddress }) {
5699
+ return await this.maci.queryRoundGasStation({ contractAddress });
5700
+ }
5701
+ parseRoundStatus(votingStart, votingEnd, status, currentTime) {
5702
+ return this.maci.parseRoundStatus(
5703
+ votingStart,
5704
+ votingEnd,
5705
+ status,
5706
+ currentTime
5715
5707
  );
5716
5708
  }
5717
- /**
5718
- * @method getProofByContractAddress
5719
- * @description Get proof data by contract address.
5720
- * @param {string} address - The contract address.
5721
- * @returns {Promise<ProofResponse>} The proof response.
5722
- */
5723
- async getProofByContractAddress(address) {
5724
- return await this.indexer.proof.getProofByContractAddress(address);
5709
+ async queryRoundBalance({ contractAddress }) {
5710
+ return await this.maci.queryRoundBalance({ contractAddress });
5711
+ }
5712
+ async requestOracleCertificate({
5713
+ signer,
5714
+ ecosystem,
5715
+ address,
5716
+ contractAddress
5717
+ }) {
5718
+ return await this.maci.requestOracleCertificate({
5719
+ signer,
5720
+ ecosystem,
5721
+ address,
5722
+ contractAddress
5723
+ });
5724
+ }
5725
+ async signup({
5726
+ signer,
5727
+ address,
5728
+ contractAddress,
5729
+ maciAccount,
5730
+ oracleCertificate,
5731
+ gasStation = false
5732
+ }) {
5733
+ return await this.maci.signup({
5734
+ signer,
5735
+ address,
5736
+ contractAddress,
5737
+ maciAccount,
5738
+ oracleCertificate,
5739
+ gasStation
5740
+ });
5741
+ }
5742
+ async vote({
5743
+ signer,
5744
+ address,
5745
+ stateIdx,
5746
+ contractAddress,
5747
+ selectedOptions,
5748
+ operatorCoordPubKey,
5749
+ maciAccount,
5750
+ gasStation = false
5751
+ }) {
5752
+ return await this.maci.vote({
5753
+ signer,
5754
+ address,
5755
+ stateIdx,
5756
+ contractAddress,
5757
+ selectedOptions,
5758
+ operatorCoordPubKey,
5759
+ maciAccount,
5760
+ gasStation
5761
+ });
5762
+ }
5763
+ async publishMessage({
5764
+ client,
5765
+ address,
5766
+ payload,
5767
+ contractAddress,
5768
+ gasStation
5769
+ }) {
5770
+ return await this.maci.publishMessage({
5771
+ client,
5772
+ address,
5773
+ payload,
5774
+ contractAddress,
5775
+ gasStation
5776
+ });
5777
+ }
5778
+ async claimAMaciRound({
5779
+ signer,
5780
+ contractAddress
5781
+ }) {
5782
+ return await this.maci.claimAMaciRound({
5783
+ signer,
5784
+ contractAddress
5785
+ });
5786
+ }
5787
+ async getOracleCertificateConfig() {
5788
+ return await this.maci.getOracleCertificateConfig();
5789
+ }
5790
+ async batchGrantWithBond({
5791
+ signer,
5792
+ contractAddress,
5793
+ address,
5794
+ amount
5795
+ }) {
5796
+ return await this.maci.batchGrantWithBond({
5797
+ signer,
5798
+ contractAddress,
5799
+ address,
5800
+ amount
5801
+ });
5802
+ }
5803
+ async batchRevokeWithdraw({
5804
+ signer,
5805
+ contractAddress,
5806
+ address
5807
+ }) {
5808
+ return await this.maci.batchRevokeWithdraw({
5809
+ signer,
5810
+ contractAddress,
5811
+ address
5812
+ });
5725
5813
  }
5726
5814
  };
5727
5815