createCloak drives these
wallets through their byte-level solana:signMessage and solana:signTransaction features, so you
need no @solana/web3.js and no wallet adapter.
Prerequisites
- A browser app with a bundler (Next.js, Vite).
@cloak.dev/sdk0.2.20 and@wallet-standard/app.- A mainnet RPC URL. See Network and RPC.
1. Find the wallet
installed as a picker in a real app. Each entry has a name and an icon.
2. Open the account
3. Shield, send and withdraw
With @solana/wallet-adapter-react
If your app already uses the wallet adapter, pass useWallet() instead. A Wallet Standard wallet
behind the adapter is still driven through its standard features:
Transaction format and wallet changes
- Shields are v0 versioned transactions with address lookup tables. A wallet that can only sign legacy transactions cannot shield.
- Some wallets add instructions (compute budget, guard instructions) to what they sign. The SDK
submits the transaction the wallet returns. A SOL shield is close to Solana’s 1,232-byte packet
limit, so additions can push it over. If users of one wallet hit a size error when shielding,
the low-level API’s
transactionVersion: 1builds a Transaction V1 with a 4,096-byte limit, for wallets whosesolana:signTransactionfeature lists version1. See Low-level API. - The SDK submits. It never calls the wallet’s sign-and-send feature, so the transaction goes through your RPC.
Errors you will see
The full list is in Error codes.
Related
- Your first private transaction: a complete React walkthrough.
- Hardware wallets: Ledger behind Phantom or Solflare.