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