tsx. It opens the account from a key the
script holds, then shields, sends privately and withdraws.
Prerequisites
- Node 22 or later.
- A mainnet RPC URL.
- A Solana keypair file holding a few USDC and a little SOL. Use a wallet you can afford to experiment with: Cloak has no test network.
Setup
The script
index.ts
Run it
Expected output
The account and quote lines below were observed on mainnet on 2026-11-30 with a fresh key. Your address differs, and the fee follows the pool’s live config.CloakError [balance.insufficient] and
moves nothing.
Next
- Backend orchestration: the same calls as a service.
- createCloak: every call and option.