Skip to main content

createCloak(options)

Pass exactly one way to open the account: wallet, wallets, cloakKey or account. There is no endpoint option: the package talks to the one Cloak endpoint it was built with.

Storage

A CloakStorage is any object with get, set and delete returning promises. A stored account key (allowStoredAccount) is only written to a storage that protects secrets.

Request options on every money call

shield, send and withdraw take, besides to/from, token and amount: Amounts are decimal strings in token units ("1.5"). Zero, negatives and more decimals than the token has are refused before anything moves.

Low-level TransactOptions

The low-level functions take one options object. The fields most integrations set: Advanced fields: TransactOptions has no rpc, wallet, signTransaction or feePayer field. A wallet adapter’s signTransaction reaches the SDK through signerFromWalletAdapter.

Runtime values

Environment variables the SDK reads

The SDK reads no environment variable for the endpoint, the RPC or signing. A few operational knobs exist: CLOAK_RELAY_REQUEST_TIMEOUT_MS (default 45 000), CLOAK_RELAY_NETWORK_RETRIES (default 6), CLOAK_SETTLEMENT_CONFIRM_TIMEOUT_MS (default 30 000), and CLOAK_DEBUG for verbose logs. Your own variables (SOLANA_RPC_URL and so on) are read by your code and passed in.