@crisp-e3/sdk 0.0.2-test → 0.2.0-test
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.d.ts +5 -3
- package/dist/index.js +25 -9
- package/dist/index.js.map +1 -1
- package/package.json +8 -7
package/dist/index.d.ts
CHANGED
|
@@ -160,6 +160,7 @@ interface CRISPCircuitInputs {
|
|
|
160
160
|
u: Polynomial;
|
|
161
161
|
e0: Polynomial;
|
|
162
162
|
e1: Polynomial;
|
|
163
|
+
e1is: Polynomial[];
|
|
163
164
|
k1: Polynomial;
|
|
164
165
|
public_key_x: string[];
|
|
165
166
|
public_key_y: string[];
|
|
@@ -232,6 +233,7 @@ declare const getRoundTokenDetails: (serverUrl: string, e3Id: number) => Promise
|
|
|
232
233
|
|
|
233
234
|
declare const CRISP_SERVER_TOKEN_TREE_ENDPOINT = "state/token-holders";
|
|
234
235
|
declare const CRISP_SERVER_STATE_LITE_ENDPOINT = "state/lite";
|
|
236
|
+
declare const MERKLE_TREE_MAX_DEPTH = 20;
|
|
235
237
|
/**
|
|
236
238
|
* Half the minimum degree needed to support the maxium vote value
|
|
237
239
|
* If you change MAXIMUM_VOTE_VALUE, make sure to update this value too.
|
|
@@ -271,9 +273,8 @@ declare const generateMerkleTree: (leaves: bigint[]) => LeanIMT;
|
|
|
271
273
|
* @param balance The voter's balance
|
|
272
274
|
* @param address The voter's address
|
|
273
275
|
* @param leaves The leaves of the Merkle tree
|
|
274
|
-
* @param maxDepth The maximum depth of the Merkle tree
|
|
275
276
|
*/
|
|
276
|
-
declare const generateMerkleProof: (threshold: bigint, balance: bigint, address: string, leaves: bigint[]
|
|
277
|
+
declare const generateMerkleProof: (threshold: bigint, balance: bigint, address: string, leaves: bigint[]) => IMerkleProof;
|
|
277
278
|
/**
|
|
278
279
|
* Convert a number to its binary representation
|
|
279
280
|
* @param number The number to convert to binary
|
|
@@ -316,6 +317,7 @@ declare const decodeTally: (tally: string[], votingMode: VotingMode) => IVote;
|
|
|
316
317
|
* @param votingPower The voting power of the voter
|
|
317
318
|
*/
|
|
318
319
|
declare const validateVote: (votingMode: VotingMode, vote: IVote, votingPower: bigint) => void;
|
|
320
|
+
declare const encryptVote: (encodedVote: string[], publicKey: Uint8Array) => Promise<Uint8Array>;
|
|
319
321
|
/**
|
|
320
322
|
* This is a wrapper around enclave-e3/sdk encryption functions as CRISP circuit will require some more
|
|
321
323
|
* input values which generic Greco do not need.
|
|
@@ -362,4 +364,4 @@ declare const verifyProof: (proof: ProofData) => Promise<boolean>;
|
|
|
362
364
|
*/
|
|
363
365
|
declare const extractSignature: (message: string, signedMessage: `0x${string}`) => Promise<NoirSignatureInputs>;
|
|
364
366
|
|
|
365
|
-
export { type CRISPCircuitInputs, CRISP_SERVER_STATE_LITE_ENDPOINT, CRISP_SERVER_TOKEN_TREE_ENDPOINT, DEFAULT_BFV_PARAMS, HALF_LARGEST_MINIMUM_DEGREE, type IMerkleProof, type IRoundDetails, type IRoundDetailsResponse, type ITokenDetails, type IVote, MAXIMUM_VOTE_VALUE, MESSAGE, type NoirSignatureInputs, VotingMode, calculateValidIndicesForPlaintext, decodeTally, encodeVote, encryptVoteAndGenerateCRISPInputs, extractSignature, generateMaskVote, generateMerkleProof, generateMerkleTree, generateProof, generateProofWithReturnValue, getBalanceAt, getCircuitOutputValue, getRoundDetails, getRoundTokenDetails, getTotalSupplyAt, getTreeData, hashLeaf, toBinary, validateVote, verifyProof };
|
|
367
|
+
export { type CRISPCircuitInputs, CRISP_SERVER_STATE_LITE_ENDPOINT, CRISP_SERVER_TOKEN_TREE_ENDPOINT, DEFAULT_BFV_PARAMS, HALF_LARGEST_MINIMUM_DEGREE, type IMerkleProof, type IRoundDetails, type IRoundDetailsResponse, type ITokenDetails, type IVote, MAXIMUM_VOTE_VALUE, MERKLE_TREE_MAX_DEPTH, MESSAGE, type NoirSignatureInputs, VotingMode, calculateValidIndicesForPlaintext, decodeTally, encodeVote, encryptVote, encryptVoteAndGenerateCRISPInputs, extractSignature, generateMaskVote, generateMerkleProof, generateMerkleTree, generateProof, generateProofWithReturnValue, getBalanceAt, getCircuitOutputValue, getRoundDetails, getRoundTokenDetails, getTotalSupplyAt, getTreeData, hashLeaf, toBinary, validateVote, verifyProof };
|