@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.d.mts +115 -117
- package/dist/browser.d.ts +115 -117
- package/dist/browser.js +197 -133
- package/dist/browser.js.map +1 -1
- package/dist/browser.mjs +197 -133
- package/dist/browser.mjs.map +1 -1
- package/dist/index.d.mts +115 -117
- package/dist/index.d.ts +115 -117
- package/dist/index.js +197 -133
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +197 -133
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/maci.ts +304 -157
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
|
-
|
|
31355
|
-
|
|
31356
|
-
|
|
31357
|
-
|
|
31358
|
-
|
|
31359
|
-
|
|
31360
|
-
|
|
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
|
-
|
|
31364
|
-
|
|
31365
|
-
|
|
31366
|
-
|
|
31367
|
-
|
|
31368
|
-
|
|
31369
|
-
|
|
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
|
-
|
|
31373
|
-
|
|
31374
|
-
|
|
31375
|
-
|
|
31376
|
-
|
|
31377
|
-
|
|
31378
|
-
|
|
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
|
-
|
|
31383
|
-
|
|
31384
|
-
|
|
31385
|
-
|
|
31386
|
-
|
|
31387
|
-
|
|
31388
|
-
|
|
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
|
-
|
|
31393
|
-
|
|
31394
|
-
|
|
31395
|
-
|
|
31396
|
-
|
|
31397
|
-
|
|
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
|
-
|
|
31404
|
-
|
|
31405
|
-
|
|
31406
|
-
|
|
31407
|
-
|
|
31408
|
-
|
|
31409
|
-
|
|
31410
|
-
|
|
31411
|
-
|
|
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
|
-
|
|
31415
|
-
|
|
31416
|
-
|
|
31417
|
-
|
|
31418
|
-
|
|
31419
|
-
|
|
31420
|
-
|
|
31421
|
-
|
|
31422
|
-
|
|
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
|
-
|
|
31426
|
-
|
|
31427
|
-
|
|
31428
|
-
|
|
31429
|
-
|
|
31430
|
-
|
|
31431
|
-
|
|
31428
|
+
async getOracleWhitelistConfig({
|
|
31429
|
+
signer,
|
|
31430
|
+
contractAddress
|
|
31431
|
+
}) {
|
|
31432
|
+
return await this.maci.getOracleWhitelistConfig({
|
|
31433
|
+
signer,
|
|
31434
|
+
contractAddress
|
|
31435
|
+
});
|
|
31432
31436
|
}
|
|
31433
|
-
|
|
31434
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
31462
|
-
|
|
31463
|
-
|
|
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
|
-
|
|
31471
|
-
|
|
31472
|
-
|
|
31473
|
-
|
|
31474
|
-
|
|
31475
|
-
|
|
31476
|
-
|
|
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
|
-
|
|
31481
|
-
|
|
31482
|
-
|
|
31483
|
-
|
|
31484
|
-
|
|
31485
|
-
|
|
31486
|
-
|
|
31487
|
-
|
|
31488
|
-
|
|
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
|
-
|
|
31491
|
-
|
|
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
|
-
|
|
31496
|
-
|
|
31497
|
-
|
|
31498
|
-
|
|
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
|
|