Project rules
Create.cursor/rules.md in your app root:
View .cursor/rules.md template
View .cursor/rules.md template
Cloak SDK Rules (Current)
This project uses@cloak.ag/sdk for private Solana transactions.Primary APIs
Use UTXO helpers as default:transactpartialWithdrawfullWithdrawswapWithChange
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
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
Generate full SDK integration scaffold
Generate full SDK integration scaffold
Create a production-ready React integration for
@cloak.ag/sdk in this codebase.Deliver:useCloakhook (deposit/send/withdraw/swap)- compliance history loader (cache-first + rescan)
- typed errors + progress states
- minimal tests for amount and fee calculations
Patch existing code to current SDK contract
Patch existing code to current SDK contract
Audit the current repo for mismatches with current Cloak SDK runtime model.Patch all mismatches and return:
- files changed,
- exact API contract updates,
- verification commands and results.
Build a polished history page
Build a polished history page
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)