@dorafactory/maci-sdk 0.1.3-pre.46.beta.6 → 0.1.3-pre.46.beta.7
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 +15 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +15 -9
- package/dist/index.mjs.map +1 -1
- package/dist/libs/api/client.d.ts +5 -0
- package/dist/libs/api/types.d.ts +45 -0
- package/dist/voter.d.ts +7 -5
- package/package.json +1 -1
- package/src/libs/api/client.ts +12 -0
- package/src/libs/api/types.ts +45 -0
- package/src/voter.ts +17 -16
package/dist/index.js
CHANGED
|
@@ -6673,6 +6673,15 @@ var MaciApiClient = class {
|
|
|
6673
6673
|
method: "GET"
|
|
6674
6674
|
});
|
|
6675
6675
|
}
|
|
6676
|
+
/**
|
|
6677
|
+
* Get coordinator public key, deactivate root, and voter scale for a round.
|
|
6678
|
+
* Lighter alternative to the full data endpoint when only circuit inputs are needed.
|
|
6679
|
+
*/
|
|
6680
|
+
async getPreDeactivateMeta(params) {
|
|
6681
|
+
return this.fetch(`/v1/pre-deactivate/${params.contractAddress}/meta`, {
|
|
6682
|
+
method: "GET"
|
|
6683
|
+
});
|
|
6684
|
+
}
|
|
6676
6685
|
/**
|
|
6677
6686
|
* Get K-anonymous Merkle proof packages for the specified leaf indices.
|
|
6678
6687
|
* The caller should mix the real leaf index with decoy indices to preserve privacy.
|
|
@@ -8410,7 +8419,7 @@ var VoterClient = class _VoterClient {
|
|
|
8410
8419
|
deactivateIdx,
|
|
8411
8420
|
voterScale,
|
|
8412
8421
|
newPubkey,
|
|
8413
|
-
pollId,
|
|
8422
|
+
pollId: BigInt(pollId),
|
|
8414
8423
|
wasmFile,
|
|
8415
8424
|
zkeyFile,
|
|
8416
8425
|
derivePathParams
|
|
@@ -8438,22 +8447,19 @@ var VoterClient = class _VoterClient {
|
|
|
8438
8447
|
operatorPubkey,
|
|
8439
8448
|
selectedOptions,
|
|
8440
8449
|
ticket,
|
|
8450
|
+
pollId,
|
|
8451
|
+
stateIdx,
|
|
8441
8452
|
derivePathParams
|
|
8442
8453
|
}) {
|
|
8443
|
-
const
|
|
8444
|
-
|
|
8445
|
-
derivePathParams
|
|
8446
|
-
});
|
|
8447
|
-
if (stateIdx === -1) {
|
|
8454
|
+
const resolvedStateIdx = stateIdx !== void 0 ? stateIdx : await this.getStateIdx({ contractAddress, derivePathParams });
|
|
8455
|
+
if (resolvedStateIdx === -1) {
|
|
8448
8456
|
throw new Error("State index is not set, Please signup or addNewKey first");
|
|
8449
8457
|
}
|
|
8450
|
-
const pollId = await this.getPollId(contractAddress);
|
|
8451
8458
|
const payload = this.buildVotePayload({
|
|
8452
|
-
stateIdx,
|
|
8459
|
+
stateIdx: resolvedStateIdx,
|
|
8453
8460
|
operatorPubkey,
|
|
8454
8461
|
selectedOptions,
|
|
8455
8462
|
pollId,
|
|
8456
|
-
// Pass pollId instead of contractAddress
|
|
8457
8463
|
derivePathParams
|
|
8458
8464
|
});
|
|
8459
8465
|
const voteResult = await this.saasSubmitVote({
|