@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.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
|
-
|
|
31331
|
-
|
|
31332
|
-
|
|
31333
|
-
|
|
31334
|
-
|
|
31335
|
-
|
|
31336
|
-
|
|
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
|
-
|
|
31340
|
-
|
|
31341
|
-
|
|
31342
|
-
|
|
31343
|
-
|
|
31344
|
-
|
|
31345
|
-
|
|
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
|
-
|
|
31349
|
-
|
|
31350
|
-
|
|
31351
|
-
|
|
31352
|
-
|
|
31353
|
-
|
|
31354
|
-
|
|
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
|
-
|
|
31359
|
-
|
|
31360
|
-
|
|
31361
|
-
|
|
31362
|
-
|
|
31363
|
-
|
|
31364
|
-
|
|
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
|
-
|
|
31369
|
-
|
|
31370
|
-
|
|
31371
|
-
|
|
31372
|
-
|
|
31373
|
-
|
|
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
|
-
|
|
31380
|
-
|
|
31381
|
-
|
|
31382
|
-
|
|
31383
|
-
|
|
31384
|
-
|
|
31385
|
-
|
|
31386
|
-
|
|
31387
|
-
|
|
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
|
-
|
|
31391
|
-
|
|
31392
|
-
|
|
31393
|
-
|
|
31394
|
-
|
|
31395
|
-
|
|
31396
|
-
|
|
31397
|
-
|
|
31398
|
-
|
|
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
|
-
|
|
31402
|
-
|
|
31403
|
-
|
|
31404
|
-
|
|
31405
|
-
|
|
31406
|
-
|
|
31407
|
-
|
|
31404
|
+
async getOracleWhitelistConfig({
|
|
31405
|
+
signer,
|
|
31406
|
+
contractAddress
|
|
31407
|
+
}) {
|
|
31408
|
+
return await this.maci.getOracleWhitelistConfig({
|
|
31409
|
+
signer,
|
|
31410
|
+
contractAddress
|
|
31411
|
+
});
|
|
31408
31412
|
}
|
|
31409
|
-
|
|
31410
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
31438
|
-
|
|
31439
|
-
|
|
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
|
-
|
|
31447
|
-
|
|
31448
|
-
|
|
31449
|
-
|
|
31450
|
-
|
|
31451
|
-
|
|
31452
|
-
|
|
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
|
-
|
|
31457
|
-
|
|
31458
|
-
|
|
31459
|
-
|
|
31460
|
-
|
|
31461
|
-
|
|
31462
|
-
|
|
31463
|
-
|
|
31464
|
-
|
|
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
|
-
|
|
31467
|
-
|
|
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
|
-
|
|
31472
|
-
|
|
31473
|
-
|
|
31474
|
-
|
|
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
|
|