@dorafactory/maci-sdk 0.0.31 → 0.0.32

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.js CHANGED
@@ -31350,155 +31350,219 @@ var MaciClient2 = class {
31350
31350
  async createOracleMaciRound(params) {
31351
31351
  return await this.contract.createOracleMaciRound(params);
31352
31352
  }
31353
- /**
31354
- * @method balanceOf
31355
- * @description Get the balance of a specific address.
31356
- * @param {string} address - The address to check the balance for.
31357
- * @returns {Promise<BalanceResponse>} The balance response.
31358
- */
31359
- async balanceOf(address) {
31360
- return await this.indexer.account.balanceOf(address);
31353
+ async getStateIdxInc({
31354
+ signer,
31355
+ address,
31356
+ contractAddress
31357
+ }) {
31358
+ return await this.maci.getStateIdxInc({
31359
+ signer,
31360
+ address,
31361
+ contractAddress
31362
+ });
31361
31363
  }
31362
- /**
31363
- * @method getRoundById
31364
- * @description Get a round by its ID.
31365
- * @param {string} id - The ID of the round.
31366
- * @returns {Promise<RoundResponse>} The round response.
31367
- */
31368
- async getRoundById(id) {
31369
- return await this.indexer.round.getRoundById(id);
31364
+ async getVoiceCreditBalance({
31365
+ signer,
31366
+ stateIdx,
31367
+ contractAddress
31368
+ }) {
31369
+ return await this.maci.getVoiceCreditBalance({
31370
+ signer,
31371
+ stateIdx,
31372
+ contractAddress
31373
+ });
31370
31374
  }
31371
- /**
31372
- * @method getRoundWithFields
31373
- * @description Get a round by its address with selective fields.
31374
- * @param {string} address - The address of the round.
31375
- * @param {string[]} [fields] - The fields to retrieve.
31376
- * @returns {Promise<SelectiveRoundResponse>} The round response.
31377
- */
31378
- async getRoundWithFields(address, fields) {
31379
- return await this.indexer.round.getRoundWithFields(address, fields);
31375
+ async getStateIdxByPubKey({
31376
+ contractAddress,
31377
+ pubKey
31378
+ }) {
31379
+ return await this.maci.getStateIdxByPubKey({
31380
+ contractAddress,
31381
+ pubKey
31382
+ });
31380
31383
  }
31381
- /**
31382
- * @method getRounds
31383
- * @description Get multiple rounds.
31384
- * @param {string} after - The cursor to start after.
31385
- * @param {number} [limit] - The number of rounds to retrieve.
31386
- * @returns {Promise<RoundsResponse>} The rounds response.
31387
- */
31388
- async getRounds(after, limit) {
31389
- return await this.indexer.round.getRounds(after, limit);
31384
+ async feegrantAllowance({
31385
+ address,
31386
+ contractAddress
31387
+ }) {
31388
+ return await this.maci.feegrantAllowance({
31389
+ address,
31390
+ contractAddress
31391
+ });
31390
31392
  }
31391
- /**
31392
- * @method getRoundsByStatus
31393
- * @description Get rounds by their status.
31394
- * @param {string} status - The status of the rounds to retrieve.
31395
- * @param {string} after - The cursor to start after.
31396
- * @param {number} [limit] - The number of rounds to retrieve.
31397
- * @returns {Promise<RoundsResponse>} The rounds response.
31398
- */
31399
- async getRoundsByStatus(status, after, limit) {
31400
- return await this.indexer.round.getRoundsByStatus(status, after, limit);
31393
+ async hasFeegrant({
31394
+ address,
31395
+ contractAddress
31396
+ }) {
31397
+ return await this.maci.hasFeegrant({
31398
+ address,
31399
+ contractAddress
31400
+ });
31401
31401
  }
31402
- /**
31403
- * @method getRoundsByCircuitName
31404
- * @description Get rounds by their circuit name.
31405
- * @param {string} name - The name of the circuit.
31406
- * @param {string} after - The cursor to start after.
31407
- * @param {number} [limit] - The number of rounds to retrieve.
31408
- * @returns {Promise<RoundsResponse>} The rounds response.
31409
- */
31410
- async getRoundsByCircuitName(name, after, limit) {
31411
- return await this.indexer.round.getRoundsByCircuitName(name, after, limit);
31402
+ async queryWhitelistBalanceOf({
31403
+ signer,
31404
+ address,
31405
+ contractAddress,
31406
+ certificate,
31407
+ mode = "maci"
31408
+ }) {
31409
+ return await this.maci.queryWhitelistBalanceOf({
31410
+ signer,
31411
+ address,
31412
+ contractAddress,
31413
+ certificate,
31414
+ mode
31415
+ });
31412
31416
  }
31413
- /**
31414
- * @method getRoundsByOperator
31415
- * @description Get rounds by their operator address.
31416
- * @param {string} address - The address of the operator.
31417
- * @param {string} after - The cursor to start after.
31418
- * @param {number} [limit] - The number of rounds to retrieve.
31419
- * @returns {Promise<RoundsResponse>} The rounds response.
31420
- */
31421
- async getRoundsByOperator(address, after, limit) {
31422
- return await this.indexer.round.getRoundsByOperator(address, after, limit);
31417
+ async isWhitelisted({
31418
+ signer,
31419
+ address,
31420
+ contractAddress
31421
+ }) {
31422
+ return await this.maci.isWhitelisted({
31423
+ signer,
31424
+ address,
31425
+ contractAddress
31426
+ });
31423
31427
  }
31424
- /**
31425
- * @method getOperatorByAddress
31426
- * @description Get an operator by their address.
31427
- * @param {string} address - The address of the operator.
31428
- * @returns {Promise<OperatorResponse>} The operator response.
31429
- */
31430
- async getOperatorByAddress(address) {
31431
- return await this.indexer.operator.getOperatorByAddress(address);
31428
+ async getOracleWhitelistConfig({
31429
+ signer,
31430
+ contractAddress
31431
+ }) {
31432
+ return await this.maci.getOracleWhitelistConfig({
31433
+ signer,
31434
+ contractAddress
31435
+ });
31432
31436
  }
31433
- /**
31434
- * @method getOperators
31435
- * @description Get multiple operators.
31436
- * @param {string} after - The cursor to start after.
31437
- * @param {number} [limit] - The number of operators to retrieve.
31438
- * @returns {Promise<OperatorsResponse>} The operators response.
31439
- */
31440
- async getOperators(after, limit) {
31441
- return await this.indexer.operator.getOperators(after, limit);
31437
+ async getRoundInfo({ contractAddress }) {
31438
+ return await this.maci.getRoundInfo({ contractAddress });
31442
31439
  }
31443
- /**
31444
- * @method getCircuitByName
31445
- * @description Get a circuit by its name.
31446
- * @param {string} name - The name of the circuit.
31447
- * @returns {Promise<CircuitResponse>} The circuit response.
31448
- */
31449
- async getCircuitByName(name) {
31450
- return await this.indexer.circuit.getCircuitByName(name);
31440
+ async getRoundCircuitType({ contractAddress }) {
31441
+ return await this.maci.getRoundCircuitType({ contractAddress });
31451
31442
  }
31452
- /**
31453
- * @method getCircuits
31454
- * @description Get all available circuits.
31455
- * @returns {Promise<CircuitsResponse>} The circuits response.
31456
- */
31457
- async getCircuits() {
31458
- return await this.indexer.circuit.getCircuits();
31443
+ async queryRoundIsQv({ contractAddress }) {
31444
+ return await this.maci.queryRoundIsQv({ contractAddress });
31459
31445
  }
31460
- /**
31461
- * @method getTransactionByHash
31462
- * @description Get a transaction by its hash.
31463
- * @param {string} hash - The hash of the transaction.
31464
- * @returns {Promise<TransactionResponse>} The transaction response.
31465
- */
31466
- async getTransactionByHash(hash) {
31467
- return await this.indexer.transaction.getTransactionByHash(hash);
31446
+ async queryRoundClaimable({
31447
+ contractAddress
31448
+ }) {
31449
+ return await this.maci.queryRoundClaimable({ contractAddress });
31468
31450
  }
31469
- /**
31470
- * @method getTransactions
31471
- * @description Get multiple transactions.
31472
- * @param {string} after - The cursor to start after.
31473
- * @param {number} [limit] - The number of transactions to retrieve.
31474
- * @returns {Promise<TransactionsResponse>} The transactions response.
31475
- */
31476
- async getTransactions(after, limit) {
31477
- return await this.indexer.transaction.getTransactions(after, limit);
31451
+ async queryAMaciChargeFee({
31452
+ maxVoter,
31453
+ maxOption
31454
+ }) {
31455
+ return await this.maci.queryAMaciChargeFee({
31456
+ maxVoter,
31457
+ maxOption
31458
+ });
31478
31459
  }
31479
- /**
31480
- * @method getTransactionsByContractAddress
31481
- * @description Get transactions by contract address.
31482
- * @param {string} address - The contract address.
31483
- * @param {string} after - The cursor to start after.
31484
- * @param {number} [limit] - The number of transactions to retrieve.
31485
- * @returns {Promise<TransactionsResponse>} The transactions response.
31486
- */
31487
- async getTransactionsByContractAddress(address, after, limit) {
31488
- return await this.indexer.transaction.getTransactionsByContractAddress(
31460
+ async queryRoundGasStation({ contractAddress }) {
31461
+ return await this.maci.queryRoundGasStation({ contractAddress });
31462
+ }
31463
+ parseRoundStatus(votingStart, votingEnd, status, currentTime) {
31464
+ return this.maci.parseRoundStatus(
31465
+ votingStart,
31466
+ votingEnd,
31467
+ status,
31468
+ currentTime
31469
+ );
31470
+ }
31471
+ async queryRoundBalance({ contractAddress }) {
31472
+ return await this.maci.queryRoundBalance({ contractAddress });
31473
+ }
31474
+ async requestOracleCertificate({
31475
+ signer,
31476
+ ecosystem,
31477
+ address,
31478
+ contractAddress
31479
+ }) {
31480
+ return await this.maci.requestOracleCertificate({
31481
+ signer,
31482
+ ecosystem,
31489
31483
  address,
31490
- after,
31491
- limit
31484
+ contractAddress
31485
+ });
31486
+ }
31487
+ async signup({
31488
+ signer,
31489
+ address,
31490
+ contractAddress,
31491
+ maciAccount,
31492
+ oracleCertificate,
31493
+ gasStation = false
31494
+ }) {
31495
+ return await this.maci.signup({
31496
+ signer,
31497
+ address,
31498
+ contractAddress,
31499
+ maciAccount,
31500
+ oracleCertificate,
31501
+ gasStation
31502
+ });
31503
+ }
31504
+ async vote({
31505
+ signer,
31506
+ address,
31507
+ stateIdx,
31508
+ contractAddress,
31509
+ selectedOptions,
31510
+ operatorCoordPubKey,
31511
+ maciAccount,
31512
+ gasStation = false
31513
+ }) {
31514
+ return await this.maci.vote({
31515
+ signer,
31516
+ address,
31517
+ stateIdx,
31518
+ contractAddress,
31519
+ selectedOptions,
31520
+ operatorCoordPubKey,
31521
+ maciAccount,
31522
+ gasStation
31523
+ });
31524
+ }
31525
+ async publishMessage({
31526
+ client,
31527
+ address,
31528
+ payload,
31529
+ contractAddress,
31530
+ gasStation
31531
+ }) {
31532
+ return await this.maci.publishMessage({
31533
+ client,
31534
+ address,
31535
+ payload,
31536
+ contractAddress,
31537
+ gasStation
31538
+ });
31539
+ }
31540
+ async claimAMaciRound({
31541
+ signer,
31542
+ contractAddress
31543
+ }) {
31544
+ return await this.maci.claimAMaciRound({
31545
+ signer,
31546
+ contractAddress
31547
+ });
31548
+ }
31549
+ async getOracleCertificateConfig() {
31550
+ return await this.maci.getOracleCertificateConfig();
31551
+ }
31552
+ async batchGrantWithBond(client, contractAddress, address, amount) {
31553
+ return await this.maci.batchGrantWithBond(
31554
+ client,
31555
+ contractAddress,
31556
+ address,
31557
+ amount
31492
31558
  );
31493
31559
  }
31494
- /**
31495
- * @method getProofByContractAddress
31496
- * @description Get proof data by contract address.
31497
- * @param {string} address - The contract address.
31498
- * @returns {Promise<ProofResponse>} The proof response.
31499
- */
31500
- async getProofByContractAddress(address) {
31501
- return await this.indexer.proof.getProofByContractAddress(address);
31560
+ async batchRevokeWithdraw(client, contractAddress, address) {
31561
+ return await this.maci.batchRevokeWithdraw(
31562
+ client,
31563
+ contractAddress,
31564
+ address
31565
+ );
31502
31566
  }
31503
31567
  };
31504
31568