@dorafactory/maci-sdk 0.1.3-pre.10 → 0.1.3-pre.12
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/index.js +6 -32
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -32
- package/dist/index.mjs.map +1 -1
- package/dist/maci.d.ts +2 -0
- package/package.json +1 -1
- package/src/libs/maci/maci.ts +0 -35
- package/src/maci.ts +8 -0
package/dist/index.js
CHANGED
|
@@ -7793,38 +7793,6 @@ var MACI = class {
|
|
|
7793
7793
|
`Failed to get round info: ${round.error.type} ${round.error.message}`
|
|
7794
7794
|
);
|
|
7795
7795
|
}
|
|
7796
|
-
let voiceCreditBalance;
|
|
7797
|
-
if (round.data.round.maciType === "aMACI") {
|
|
7798
|
-
const isWhiteListed = await this.isWhitelisted({
|
|
7799
|
-
signer,
|
|
7800
|
-
address,
|
|
7801
|
-
contractAddress
|
|
7802
|
-
});
|
|
7803
|
-
if (isWhiteListed) {
|
|
7804
|
-
const round2 = await this.indexer.getRoundWithFields(contractAddress, [
|
|
7805
|
-
"voiceCreditAmount"
|
|
7806
|
-
]);
|
|
7807
|
-
if (!isErrorResponse(round2)) {
|
|
7808
|
-
if (round2.data.round.voiceCreditAmount) {
|
|
7809
|
-
voiceCreditBalance = round2.data.round.voiceCreditAmount;
|
|
7810
|
-
} else {
|
|
7811
|
-
voiceCreditBalance = "0";
|
|
7812
|
-
}
|
|
7813
|
-
} else {
|
|
7814
|
-
throw new Error(
|
|
7815
|
-
`Failed to query amaci voice credit: ${round2.error.type} ${round2.error.message}`
|
|
7816
|
-
);
|
|
7817
|
-
}
|
|
7818
|
-
} else {
|
|
7819
|
-
voiceCreditBalance = "0";
|
|
7820
|
-
}
|
|
7821
|
-
} else {
|
|
7822
|
-
voiceCreditBalance = await this.getVoiceCreditBalance({
|
|
7823
|
-
signer,
|
|
7824
|
-
stateIdx,
|
|
7825
|
-
contractAddress
|
|
7826
|
-
});
|
|
7827
|
-
}
|
|
7828
7796
|
if (!address) {
|
|
7829
7797
|
address = (await signer.getAccounts())[0].address;
|
|
7830
7798
|
}
|
|
@@ -8811,6 +8779,12 @@ var MaciClient2 = class {
|
|
|
8811
8779
|
fee
|
|
8812
8780
|
});
|
|
8813
8781
|
}
|
|
8782
|
+
async getSignUpEventByPubKey(contractAddress, pubKey) {
|
|
8783
|
+
return await this.indexer.getSignUpEventByPubKey(contractAddress, pubKey);
|
|
8784
|
+
}
|
|
8785
|
+
async fetchAllDeactivateLogs(contractAddress) {
|
|
8786
|
+
return await this.indexer.fetchAllDeactivateLogs(contractAddress);
|
|
8787
|
+
}
|
|
8814
8788
|
};
|
|
8815
8789
|
// Annotate the CommonJS export names for ESM import in node:
|
|
8816
8790
|
0 && (module.exports = {
|