Skip to main content
Use Cursor with a strict SDK-first ruleset so generated code is immediately usable in real Cloak apps.

Project rules

Create .cursor/rules.md in your app root:

Cloak SDK Rules (Current)

This project uses @cloak.ag/sdk for private Solana transactions.

Primary APIs

Use UTXO helpers as default:
  • transact
  • partialWithdraw
  • fullWithdraw
  • swapWithChange
Always handle lamports as bigint.

Security constraints

  • Never log secrets (UTXO keys, viewing keys, wallet signatures).
  • Never downgrade encrypted local storage flows.
  • Never bypass viewing-key registration requirements.

Program ID

  • c1oak6tetxYnNfvXKFkpn1d98FxtK7B68vBQLYQpWKp
Set programId explicitly in config.

Fees

  • Fixed: 5_000_000
  • Variable: amount * 3 / 1000
  • Applied on-chain for withdrawals/swaps.

Error handling

  • Treat stale-root errors as retryable.
  • Distinguish network, RPC rate-limit, and validation errors.
  • Surface user-safe messages in UI.

UX expectations

  • Compliance history: cache-first, rescan on explicit user action.
  • Show progress for proof generation and scanner phases.
  • Keep deposit/send/swap/withdraw handlers deterministic and testable.

References

  • /sdk/quickstart
  • /sdk/utxo-transactions
  • /sdk/wallet-integration
  • /sdk/api-reference
  • /services/relay-api
  • /architecture/viewing-keys-compliance

Prompt recipes

Create a production-ready React integration for @cloak.ag/sdk in this codebase.Deliver:
  • useCloak hook (deposit/send/withdraw/swap)
  • compliance history loader (cache-first + rescan)
  • typed errors + progress states
  • minimal tests for amount and fee calculations
Use only current SDK APIs and existing project conventions.
Audit the current repo for mismatches with current Cloak SDK runtime model.Patch all mismatches and return:
  1. files changed,
  2. exact API contract updates,
  3. verification commands and results.
Implement a user-facing privacy history page with:
  • transaction table using fee/net/runningBalance
  • summary cards
  • encrypted cache integration
  • explicit clear-cache + rescan control
  • smooth modal timing (no first-paint flash)