@cloak.dev/sdk 0.2.10 → 0.2.11
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/CHANGELOG.md +11 -0
- package/README.md +5 -3
- package/dist/index.cjs +12 -5
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +12 -5
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,17 @@ the README's "Version and compatibility" section and in the git history.
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.2.11]
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
* `signerFromTransactionBytes` now sends the transaction the wallet returned when the wallet changed
|
|
15
|
+
the message, as `signerFromWalletAdapter` always has. 0.2.10 refused any changed message ("Wallet
|
|
16
|
+
returned a transaction whose message differs from the one it was asked to sign"), which broke every
|
|
17
|
+
V1 deposit from a wallet that adds its own guard instructions, Solflare's being the reason V1
|
|
18
|
+
deposits exist. The returned transaction must still carry the wallet's own signature, and a
|
|
19
|
+
wallet may not change a message another signer has already signed.
|
|
20
|
+
|
|
10
21
|
## [0.2.10]
|
|
11
22
|
|
|
12
23
|
### Added
|
package/README.md
CHANGED
|
@@ -5,13 +5,13 @@ per-mint pool, send privately inside the pool, withdraw to any address, or swap
|
|
|
5
5
|
USDC/USDT with the output landing in a public token account. Groth16 proofs are generated
|
|
6
6
|
client-side (snarkjs) and verified on-chain by the Cloak program.
|
|
7
7
|
|
|
8
|
-
Version 0.2.
|
|
8
|
+
Version 0.2.11 targets the mainnet program deployed on 2026-08-24 and the ceremony-frozen
|
|
9
9
|
`cloak-transaction-0.2.0` circuit bundle. See [Version and compatibility](#version-and-compatibility).
|
|
10
10
|
|
|
11
11
|
## Installation
|
|
12
12
|
|
|
13
13
|
```bash
|
|
14
|
-
npm install @cloak.dev/sdk@^0.2.
|
|
14
|
+
npm install @cloak.dev/sdk@^0.2.11
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
The SDK is built on [`@solana/kit`](https://github.com/anza-xyz/kit) and re-exports the pieces an
|
|
@@ -790,7 +790,7 @@ relay endpoint and the localhost-RPC check.
|
|
|
790
790
|
|
|
791
791
|
## Version and compatibility
|
|
792
792
|
|
|
793
|
-
- SDK 0.2.
|
|
793
|
+
- SDK 0.2.11 pairs with the mainnet program at `zh1eLd6rSphLejbFfJEneUwzHRfMKxgzrgkfwA6qRkW`
|
|
794
794
|
(deployed 2026-08-24) and the 0.2.0 circuit bundle — the program and circuit bundle are unchanged
|
|
795
795
|
since 0.2.0; only the SDK package version has moved. The 0.2.5 flows were exercised on mainnet on
|
|
796
796
|
2026-08-25: deposit, private send and withdraw on SOL, USDC and USDT; swaps SOL to USDC and USDT;
|
|
@@ -819,6 +819,8 @@ relay endpoint and the localhost-RPC check.
|
|
|
819
819
|
Wallet Standard `solana:signTransaction` shape), so a wallet that supports Transaction V1 can sign
|
|
820
820
|
a `transactionVersion: 1` deposit. It changes no wire format, hash or existing signature (see
|
|
821
821
|
[CHANGELOG.md](CHANGELOG.md)).
|
|
822
|
+
- 0.2.11 lets that bridge send a transaction the wallet added its own instructions to (Solflare's
|
|
823
|
+
guard instructions); 0.2.10 refused it (see [CHANGELOG.md](CHANGELOG.md)).
|
|
822
824
|
- Proofs generated with the 0.1.x circuits are rejected by the mainnet program. SDK 0.1.x builds
|
|
823
825
|
(which ship the 0.1.0 bundle) are not usable against it; upgrade to 0.2.x.
|
|
824
826
|
- The note-based `CloakSDK` class is removed in 0.2.0. It targeted the pre-0.2.0 instruction layout
|
package/dist/index.cjs
CHANGED
|
@@ -14857,13 +14857,20 @@ function signerFromTransactionBytes(wallet) {
|
|
|
14857
14857
|
for (const transaction of transactions) {
|
|
14858
14858
|
const signedBytes = await wallet.signTransaction(transactionBytes(transaction));
|
|
14859
14859
|
const decoded = transactionFromBytes(signedBytes);
|
|
14860
|
-
if (!bytesEqual2(new Uint8Array(decoded.messageBytes), new Uint8Array(transaction.messageBytes))) {
|
|
14861
|
-
throw new Error("Wallet returned a transaction whose message differs from the one it was asked to sign");
|
|
14862
|
-
}
|
|
14863
14860
|
if (!decoded.signatures[walletAddress]) {
|
|
14864
14861
|
throw new Error("Wallet returned a transaction without its own signature");
|
|
14865
14862
|
}
|
|
14866
|
-
|
|
14863
|
+
if (bytesEqual2(new Uint8Array(decoded.messageBytes), new Uint8Array(transaction.messageBytes))) {
|
|
14864
|
+
out.push({ ...transaction, signatures: { ...transaction.signatures, ...decoded.signatures } });
|
|
14865
|
+
} else {
|
|
14866
|
+
const otherSigned = Object.entries(transaction.signatures).some(
|
|
14867
|
+
([address2, signature]) => address2 !== walletAddress && signature != null
|
|
14868
|
+
);
|
|
14869
|
+
if (otherSigned) {
|
|
14870
|
+
throw new Error("Wallet changed a transaction that another signer had already signed");
|
|
14871
|
+
}
|
|
14872
|
+
out.push({ ...transaction, ...decoded });
|
|
14873
|
+
}
|
|
14867
14874
|
}
|
|
14868
14875
|
return out;
|
|
14869
14876
|
}
|
|
@@ -15772,7 +15779,7 @@ async function withShieldRetries(attempt, hooks = {}) {
|
|
|
15772
15779
|
}
|
|
15773
15780
|
|
|
15774
15781
|
// src/index.ts
|
|
15775
|
-
var VERSION = "0.2.
|
|
15782
|
+
var VERSION = "0.2.11";
|
|
15776
15783
|
var SCANNER_SUPPORTS_TRANSACT_SWAP = true;
|
|
15777
15784
|
// Annotate the CommonJS export names for ESM import in node:
|
|
15778
15785
|
0 && (module.exports = {
|
package/dist/index.d.cts
CHANGED
|
@@ -6559,7 +6559,7 @@ declare function withShieldRetries<T>(attempt: (attemptNo: number) => Promise<T>
|
|
|
6559
6559
|
* @packageDocumentation
|
|
6560
6560
|
*/
|
|
6561
6561
|
|
|
6562
|
-
declare const VERSION = "0.2.
|
|
6562
|
+
declare const VERSION = "0.2.11";
|
|
6563
6563
|
/** True when scanner supports TransactSwap (tag 1). Check this to verify the correct SDK bundle is loaded. */
|
|
6564
6564
|
declare const SCANNER_SUPPORTS_TRANSACT_SWAP = true;
|
|
6565
6565
|
|
package/dist/index.d.ts
CHANGED
|
@@ -6559,7 +6559,7 @@ declare function withShieldRetries<T>(attempt: (attemptNo: number) => Promise<T>
|
|
|
6559
6559
|
* @packageDocumentation
|
|
6560
6560
|
*/
|
|
6561
6561
|
|
|
6562
|
-
declare const VERSION = "0.2.
|
|
6562
|
+
declare const VERSION = "0.2.11";
|
|
6563
6563
|
/** True when scanner supports TransactSwap (tag 1). Check this to verify the correct SDK bundle is loaded. */
|
|
6564
6564
|
declare const SCANNER_SUPPORTS_TRANSACT_SWAP = true;
|
|
6565
6565
|
|
package/dist/index.js
CHANGED
|
@@ -13945,13 +13945,20 @@ function signerFromTransactionBytes(wallet) {
|
|
|
13945
13945
|
for (const transaction of transactions) {
|
|
13946
13946
|
const signedBytes = await wallet.signTransaction(transactionBytes(transaction));
|
|
13947
13947
|
const decoded = transactionFromBytes(signedBytes);
|
|
13948
|
-
if (!bytesEqual2(new Uint8Array(decoded.messageBytes), new Uint8Array(transaction.messageBytes))) {
|
|
13949
|
-
throw new Error("Wallet returned a transaction whose message differs from the one it was asked to sign");
|
|
13950
|
-
}
|
|
13951
13948
|
if (!decoded.signatures[walletAddress]) {
|
|
13952
13949
|
throw new Error("Wallet returned a transaction without its own signature");
|
|
13953
13950
|
}
|
|
13954
|
-
|
|
13951
|
+
if (bytesEqual2(new Uint8Array(decoded.messageBytes), new Uint8Array(transaction.messageBytes))) {
|
|
13952
|
+
out.push({ ...transaction, signatures: { ...transaction.signatures, ...decoded.signatures } });
|
|
13953
|
+
} else {
|
|
13954
|
+
const otherSigned = Object.entries(transaction.signatures).some(
|
|
13955
|
+
([address2, signature]) => address2 !== walletAddress && signature != null
|
|
13956
|
+
);
|
|
13957
|
+
if (otherSigned) {
|
|
13958
|
+
throw new Error("Wallet changed a transaction that another signer had already signed");
|
|
13959
|
+
}
|
|
13960
|
+
out.push({ ...transaction, ...decoded });
|
|
13961
|
+
}
|
|
13955
13962
|
}
|
|
13956
13963
|
return out;
|
|
13957
13964
|
}
|
|
@@ -14865,7 +14872,7 @@ async function withShieldRetries(attempt, hooks = {}) {
|
|
|
14865
14872
|
}
|
|
14866
14873
|
|
|
14867
14874
|
// src/index.ts
|
|
14868
|
-
var VERSION = "0.2.
|
|
14875
|
+
var VERSION = "0.2.11";
|
|
14869
14876
|
var SCANNER_SUPPORTS_TRANSACT_SWAP = true;
|
|
14870
14877
|
export {
|
|
14871
14878
|
AccountRole,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloak.dev/sdk",
|
|
3
3
|
"description": "Shield, send, and swap on Solana privately — TypeScript SDK with UTXO-based zero-knowledge transactions",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.11",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
7
7
|
"module": "dist/index.js",
|