@crisp-e3/sdk 0.14.0 → 0.15.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/README.md
CHANGED
|
@@ -116,8 +116,8 @@ const isValid = await verifyProof(proof)
|
|
|
116
116
|
```typescript
|
|
117
117
|
import { decodeTally } from '@crisp-e3/sdk'
|
|
118
118
|
|
|
119
|
-
const tally = decodeTally(tallyBytes)
|
|
120
|
-
// Returns:
|
|
119
|
+
const tally = decodeTally(tallyBytes, numOptions)
|
|
120
|
+
// Returns: bigint[] — one total per option
|
|
121
121
|
```
|
|
122
122
|
|
|
123
123
|
#### Cryptographic Utilities
|
|
@@ -189,7 +189,8 @@ const previousCiphertext = await getPreviousCiphertext(serverUrl, e3Id, slotAddr
|
|
|
189
189
|
- `generateMaskVoteProof(maskVoteProofInputs: MaskVoteProofInputs): Promise<ProofData>` - Generate a
|
|
190
190
|
mask vote proof (low-level)
|
|
191
191
|
- `verifyProof(proof: ProofData): Promise<boolean>` - Verify a proof locally
|
|
192
|
-
- `decodeTally(tallyBytes: string):
|
|
192
|
+
- `decodeTally(tallyBytes: string | number[] | bigint[], numChoices: number): TallyResult` - Decode
|
|
193
|
+
an encoded tally into one total per option
|
|
193
194
|
- `generatePublicKey(): Uint8Array` - Generate a random public key
|
|
194
195
|
- `encryptVote(vote: Vote, publicKey: Uint8Array): Uint8Array` - Encrypt a vote
|
|
195
196
|
- `encodeSolidityProof(proof: ProofData): Hex` - Encode proof for Solidity contract
|