@dorafactory/maci-sdk 0.1.3-pre.46.beta.11 → 0.1.3-pre.46.beta.13
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 +21 -15
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +21 -15
- package/dist/index.mjs.map +1 -1
- package/dist/libs/api/client.d.ts +4 -1
- package/dist/libs/api/types.d.ts +18 -2
- package/dist/maci.d.ts +0 -21
- package/dist/voter.d.ts +24 -0
- package/package.json +1 -1
- package/src/libs/api/client.ts +8 -3
- package/src/libs/api/types.ts +18 -2
- package/src/maci.ts +0 -13
- package/src/voter.ts +15 -0
package/dist/index.js
CHANGED
|
@@ -6716,12 +6716,17 @@ var MaciApiClient = class {
|
|
|
6716
6716
|
/**
|
|
6717
6717
|
* Claim MACI Key
|
|
6718
6718
|
* Assign the next available pre-generated MACI key pair for an AMACI round (first-come-first-served).
|
|
6719
|
+
* Requires the X-Amaci-Claim-Key header for authentication.
|
|
6719
6720
|
* Returns pubkey, secretKey, and the full deactivate Merkle proof.
|
|
6720
6721
|
* WARNING: secretKey is returned only once and cannot be retrieved again.
|
|
6721
6722
|
*/
|
|
6722
6723
|
async claimMaciKey(params) {
|
|
6723
|
-
|
|
6724
|
-
|
|
6724
|
+
const { contractAddress, amaciClaimKey } = params;
|
|
6725
|
+
return this.fetch(`/v1/rounds/${contractAddress}/claim-key`, {
|
|
6726
|
+
method: "POST",
|
|
6727
|
+
headers: {
|
|
6728
|
+
"X-Amaci-Claim-Key": amaciClaimKey
|
|
6729
|
+
}
|
|
6725
6730
|
});
|
|
6726
6731
|
}
|
|
6727
6732
|
/**
|
|
@@ -7312,19 +7317,6 @@ var MaciClient = class {
|
|
|
7312
7317
|
}
|
|
7313
7318
|
return await this.saasApiClient.setVoteOptions(params);
|
|
7314
7319
|
}
|
|
7315
|
-
/**
|
|
7316
|
-
* Claim the next available pre-generated MACI key pair for an AMACI round via SaaS API.
|
|
7317
|
-
* The key is assigned on a first-come-first-served basis.
|
|
7318
|
-
* WARNING: secretKey is returned only once — save it immediately, it cannot be retrieved again.
|
|
7319
|
-
* @param contractAddress - Round contract address
|
|
7320
|
-
* @returns Claimed key pair with full deactivate Merkle proof
|
|
7321
|
-
*/
|
|
7322
|
-
async saasClaimKey(contractAddress) {
|
|
7323
|
-
if (!this.saasApiClient) {
|
|
7324
|
-
throw new Error("SaaS API client not initialized");
|
|
7325
|
-
}
|
|
7326
|
-
return await this.saasApiClient.claimMaciKey({ contractAddress });
|
|
7327
|
-
}
|
|
7328
7320
|
};
|
|
7329
7321
|
|
|
7330
7322
|
// src/voter.ts
|
|
@@ -8768,6 +8760,20 @@ var VoterClient = class _VoterClient {
|
|
|
8768
8760
|
account: newVoterClient
|
|
8769
8761
|
};
|
|
8770
8762
|
}
|
|
8763
|
+
/**
|
|
8764
|
+
* Claim the next available pre-generated MACI key pair for an AMACI round via SaaS API.
|
|
8765
|
+
* The key is assigned on a first-come-first-served basis.
|
|
8766
|
+
* Requires an AMACI claim key passed via the X-Amaci-Claim-Key header.
|
|
8767
|
+
* WARNING: secretKey is returned only once — save it immediately, it cannot be retrieved again.
|
|
8768
|
+
* @param params - Parameters including contractAddress and amaciClaimKey
|
|
8769
|
+
* @returns Claimed key pair with full deactivate Merkle proof
|
|
8770
|
+
*/
|
|
8771
|
+
async saasClaimKey(params) {
|
|
8772
|
+
if (!this.saasApiClient) {
|
|
8773
|
+
throw new Error("SaaS API client not initialized");
|
|
8774
|
+
}
|
|
8775
|
+
return await this.saasApiClient.claimMaciKey(params);
|
|
8776
|
+
}
|
|
8771
8777
|
/**
|
|
8772
8778
|
* Vote via SaaS API with automatic payload building
|
|
8773
8779
|
* @param params - Parameters including contract address, operator pubkey, vote options, and ticket
|