@cloakely/sdk 0.6.0 → 0.7.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 +16 -0
- package/dist/abis.d.ts +1281 -0
- package/dist/abis.js +1656 -0
- package/dist/bytecode.d.ts +4 -0
- package/dist/bytecode.js +1 -1
- package/dist/deployments.d.ts +6 -0
- package/dist/deployments.js +7 -0
- package/dist/private/client.d.ts +12 -3
- package/dist/private/client.js +6 -3
- package/dist/private/crypto.d.ts +2 -0
- package/dist/private/crypto.js +1 -1
- package/dist/private/index.d.ts +1 -0
- package/dist/private/index.js +1 -0
- package/dist/private/prover.d.ts +19 -0
- package/dist/private/prover.js +48 -0
- package/dist/private/shared.d.ts +127 -0
- package/dist/private/shared.js +459 -0
- package/dist/private/tx.d.ts +5 -0
- package/dist/private/tx.js +8 -2
- package/dist/registry.d.ts +5 -0
- package/dist/registry.js +3 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -87,6 +87,22 @@ await priv.send(usdc.token, "cloak:…", parseUnits("20", 6)); // am
|
|
|
87
87
|
await priv.unshieldToken(usdc.token, freshAddress, parseUnits("10", 6)); // 0.25% fee kept
|
|
88
88
|
```
|
|
89
89
|
|
|
90
|
+
Launches from Nov 2 on keep their private balances in one shared launch-token vault (a testnet experiment). There a
|
|
91
|
+
private send doesn't even show which token moved: its relayer is paid from your private HYPE in the same transaction.
|
|
92
|
+
|
|
93
|
+
```ts
|
|
94
|
+
const shared = new SharedVaultClient(
|
|
95
|
+
priv, d.shared!, d.sharedRouter!,
|
|
96
|
+
() => loadSharedProver(d.circuitsUrl), // its own circuit (the token is inside each note), hash-checked
|
|
97
|
+
sharedRelayerSubmitter(d.relayerUrl), d.sharedBlock,
|
|
98
|
+
);
|
|
99
|
+
await shared.buy(token, parseEther("0.25")); // private HYPE → private token, through the Uniswap pool
|
|
100
|
+
await shared.send(token, parseEther("100"), "cloak:…"); // amount, parties and the token itself hidden
|
|
101
|
+
await shared.sell(token, parseEther("50")); // back to private HYPE
|
|
102
|
+
await shared.unshield(token, parseEther("10"), freshAddress);
|
|
103
|
+
console.log(await shared.balances()); // every token this account holds there
|
|
104
|
+
```
|
|
105
|
+
|
|
90
106
|
The private account comes from one EIP-712 signature bound to the chain only (never to a contract), so it and the `cloak:` address never change. The same wallet always restores it, and nothing is stored on a server. In Node, read the circuit files yourself and pass them to `createProver(wasm, zkey)`.
|
|
91
107
|
|
|
92
108
|
## Fees (testnet beta)
|