@crisp-e3/sdk 0.15.0 → 0.17.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 +6 -6
- package/dist/.tsbuildinfo +1 -1
- package/dist/index.d.ts +150 -76
- package/dist/index.js +160 -2861
- package/dist/index.js.map +1 -1
- package/dist/workers/generateCircuitInputs.worker.js +56 -42
- package/dist/workers/generateCircuitInputs.worker.js.map +1 -1
- package/package.json +7 -5
package/README.md
CHANGED
|
@@ -31,7 +31,7 @@ const sdk = new CrispSDK(serverUrl)
|
|
|
31
31
|
|
|
32
32
|
// Generate a vote proof (automatically fetches previous ciphertext if needed)
|
|
33
33
|
const voteProof = await sdk.generateVoteProof({
|
|
34
|
-
e3Id:
|
|
34
|
+
e3Id: 1n,
|
|
35
35
|
vote: { yes: 100n, no: 0n },
|
|
36
36
|
publicKey: publicKeyBytes,
|
|
37
37
|
signature: '0x...',
|
|
@@ -43,7 +43,7 @@ const voteProof = await sdk.generateVoteProof({
|
|
|
43
43
|
|
|
44
44
|
// Generate a mask vote proof (automatically fetches previous ciphertext if needed)
|
|
45
45
|
const maskProof = await sdk.generateMaskVoteProof({
|
|
46
|
-
e3Id:
|
|
46
|
+
e3Id: 1n,
|
|
47
47
|
balance: 1000n,
|
|
48
48
|
slotAddress: '0x...',
|
|
49
49
|
publicKey: publicKeyBytes,
|
|
@@ -167,10 +167,10 @@ const previousCiphertext = await getPreviousCiphertext(serverUrl, e3Id, slotAddr
|
|
|
167
167
|
|
|
168
168
|
### State Functions
|
|
169
169
|
|
|
170
|
-
- `getRoundDetails(serverUrl: string, e3Id:
|
|
171
|
-
- `getRoundTokenDetails(serverUrl: string, e3Id:
|
|
170
|
+
- `getRoundDetails(serverUrl: string, e3Id: bigint): Promise<RoundDetails>` - Get round details
|
|
171
|
+
- `getRoundTokenDetails(serverUrl: string, e3Id: bigint): Promise<TokenDetails>` - Get token details
|
|
172
172
|
for a round
|
|
173
|
-
- `getPreviousCiphertext(serverUrl: string, e3Id:
|
|
173
|
+
- `getPreviousCiphertext(serverUrl: string, e3Id: bigint, address: string): Promise<Uint8Array | undefined>` -
|
|
174
174
|
Get previous ciphertext for a slot (undefined when slot is empty)
|
|
175
175
|
|
|
176
176
|
### Token Functions
|
|
@@ -179,7 +179,7 @@ const previousCiphertext = await getPreviousCiphertext(serverUrl, e3Id, slotAddr
|
|
|
179
179
|
Get token balance at a specific block
|
|
180
180
|
- `getTotalSupplyAt(tokenAddress: string, snapshotBlock: number, chainId: number): Promise<bigint>` -
|
|
181
181
|
Get total supply at a specific block
|
|
182
|
-
- `getTreeData(serverUrl: string, e3Id:
|
|
182
|
+
- `getTreeData(serverUrl: string, e3Id: bigint): Promise<bigint[]>` - Get merkle tree leaves from
|
|
183
183
|
server
|
|
184
184
|
|
|
185
185
|
### Vote Functions
|