@crisp-e3/sdk 0.9.0 → 0.11.0
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 +10 -3
- package/dist/index.js +16 -11
- package/dist/index.js.map +1 -1
- package/dist/workers/generateCircuitInputs.worker.js.map +1 -1
- package/package.json +3 -3
- package/dist/.tsbuildinfo +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -31,7 +31,7 @@ declare const getTotalSupplyAt: (tokenAddress: string, snapshotBlock: number, ch
|
|
|
31
31
|
type RoundDetailsResponse = {
|
|
32
32
|
id: string;
|
|
33
33
|
chain_id: string;
|
|
34
|
-
|
|
34
|
+
interfold_address: string;
|
|
35
35
|
status: string;
|
|
36
36
|
vote_count: string;
|
|
37
37
|
start_time: string;
|
|
@@ -49,7 +49,7 @@ type RoundDetailsResponse = {
|
|
|
49
49
|
type RoundDetails = {
|
|
50
50
|
e3Id: bigint;
|
|
51
51
|
chainId: bigint;
|
|
52
|
-
|
|
52
|
+
interfoldAddress: string;
|
|
53
53
|
status: string;
|
|
54
54
|
voteCount: bigint;
|
|
55
55
|
startTime: bigint;
|
|
@@ -200,6 +200,13 @@ declare const getMaxVoteValue: (numChoices: number) => number;
|
|
|
200
200
|
* @returns A zero vote with the given number of choices.
|
|
201
201
|
*/
|
|
202
202
|
declare const getZeroVote: (numChoices: number) => number[];
|
|
203
|
+
/**
|
|
204
|
+
* Scale down the raw balance to 1 decimal precision
|
|
205
|
+
* @param balance - The raw balance (with all tokens decimals)
|
|
206
|
+
* @param decimals - The decimals of the token
|
|
207
|
+
* @returns The balance as a .1 precision scaled value
|
|
208
|
+
*/
|
|
209
|
+
declare const getScaledBalance: (balance: bigint, decimals: bigint) => bigint;
|
|
203
210
|
|
|
204
211
|
/**
|
|
205
212
|
* Vote encoding and BFV encryption for the CRISP voting protocol.
|
|
@@ -304,4 +311,4 @@ declare class CrispSDK {
|
|
|
304
311
|
generateVoteProof(voteProofInputs: VoteProofRequest): Promise<ProofData>;
|
|
305
312
|
}
|
|
306
313
|
|
|
307
|
-
export { CreditMode, CrispSDK, MAX_MSG_NON_ZERO_COEFFS, MAX_VOTE_OPTIONS, MERKLE_TREE_MAX_DEPTH, type MaskVoteProofInputs, type ProofData, type RoundDetails, type RoundDetailsResponse, SIGNATURE_MESSAGE, SIGNATURE_MESSAGE_HASH, type TokenDetails, type Vote, type VoteProofInputs, decodeTally, destroyBBApi, encodeSolidityProof, encryptVote, generateBFVKeys, generateMaskVoteProof, generateMerkleProof, generateMerkleTree, generateVoteProof, getAddressFromSignature, getBalanceAt, getMaxVoteValue, getPreviousCiphertext, getRoundDetails, getRoundTokenDetails, getTotalSupplyAt, getTreeData, getZeroVote, hashLeaf, validateVote, verifyProof };
|
|
314
|
+
export { CreditMode, CrispSDK, MAX_MSG_NON_ZERO_COEFFS, MAX_VOTE_OPTIONS, MERKLE_TREE_MAX_DEPTH, type MaskVoteProofInputs, type ProofData, type RoundDetails, type RoundDetailsResponse, SIGNATURE_MESSAGE, SIGNATURE_MESSAGE_HASH, type TokenDetails, type Vote, type VoteProofInputs, decodeTally, destroyBBApi, encodeSolidityProof, encryptVote, generateBFVKeys, generateMaskVoteProof, generateMerkleProof, generateMerkleTree, generateVoteProof, getAddressFromSignature, getBalanceAt, getMaxVoteValue, getPreviousCiphertext, getRoundDetails, getRoundTokenDetails, getScaledBalance, getTotalSupplyAt, getTreeData, getZeroVote, hashLeaf, validateVote, verifyProof };
|