@dorafactory/maci-sdk 0.0.15 → 0.0.16
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 +3 -0
- package/dist/browser.d.ts +3 -0
- package/dist/browser.js +13 -2
- package/dist/browser.js.map +1 -1
- package/dist/browser.mjs +13 -2
- package/dist/browser.mjs.map +1 -1
- package/dist/index.d.mts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +13 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +13 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/libs/maci/maci.ts +15 -2
package/dist/browser.d.mts
CHANGED
|
@@ -1657,6 +1657,9 @@ declare class MACI {
|
|
|
1657
1657
|
contractAddress: string;
|
|
1658
1658
|
}): Promise<boolean>;
|
|
1659
1659
|
parseRoundStatus(votingStart: number, votingEnd: number, status: string, currentTime: Date): string;
|
|
1660
|
+
queryRoundBalance({ contractAddress }: {
|
|
1661
|
+
contractAddress: string;
|
|
1662
|
+
}): Promise<string>;
|
|
1660
1663
|
requestOracleCertificate({ signer, ecosystem, address, contractAddress, }: {
|
|
1661
1664
|
signer: OfflineSigner;
|
|
1662
1665
|
ecosystem: CertificateEcosystem;
|
package/dist/browser.d.ts
CHANGED
|
@@ -1657,6 +1657,9 @@ declare class MACI {
|
|
|
1657
1657
|
contractAddress: string;
|
|
1658
1658
|
}): Promise<boolean>;
|
|
1659
1659
|
parseRoundStatus(votingStart: number, votingEnd: number, status: string, currentTime: Date): string;
|
|
1660
|
+
queryRoundBalance({ contractAddress }: {
|
|
1661
|
+
contractAddress: string;
|
|
1662
|
+
}): Promise<string>;
|
|
1660
1663
|
requestOracleCertificate({ signer, ecosystem, address, contractAddress, }: {
|
|
1661
1664
|
signer: OfflineSigner;
|
|
1662
1665
|
ecosystem: CertificateEcosystem;
|
package/dist/browser.js
CHANGED
|
@@ -30252,7 +30252,7 @@ var MACI = class {
|
|
|
30252
30252
|
return round.data.round.voiceCreditAmount;
|
|
30253
30253
|
} else {
|
|
30254
30254
|
throw new Error(
|
|
30255
|
-
`Failed to query amaci voice credit: ${round.error.type}`
|
|
30255
|
+
`Failed to query amaci voice credit: ${round.error.type} ${round.error.message}`
|
|
30256
30256
|
);
|
|
30257
30257
|
}
|
|
30258
30258
|
} else {
|
|
@@ -30309,7 +30309,9 @@ var MACI = class {
|
|
|
30309
30309
|
async getRoundInfo({ contractAddress }) {
|
|
30310
30310
|
const roundInfo = await this.indexer.getRoundById(contractAddress);
|
|
30311
30311
|
if (isErrorResponse(roundInfo)) {
|
|
30312
|
-
throw new Error(
|
|
30312
|
+
throw new Error(
|
|
30313
|
+
`Failed to get round info: ${roundInfo.error.type} ${roundInfo.error.message}`
|
|
30314
|
+
);
|
|
30313
30315
|
}
|
|
30314
30316
|
return roundInfo.data.round;
|
|
30315
30317
|
}
|
|
@@ -30347,6 +30349,15 @@ var MACI = class {
|
|
|
30347
30349
|
}
|
|
30348
30350
|
return status;
|
|
30349
30351
|
}
|
|
30352
|
+
async queryRoundBalance({ contractAddress }) {
|
|
30353
|
+
const roundBalance = await this.indexer.balanceOf(contractAddress);
|
|
30354
|
+
if (isErrorResponse(roundBalance)) {
|
|
30355
|
+
throw new Error(
|
|
30356
|
+
`Failed to query round balance: ${roundBalance.error.type} ${roundBalance.error.message}`
|
|
30357
|
+
);
|
|
30358
|
+
}
|
|
30359
|
+
return roundBalance.data.balance;
|
|
30360
|
+
}
|
|
30350
30361
|
async requestOracleCertificate({
|
|
30351
30362
|
signer,
|
|
30352
30363
|
ecosystem,
|