Examples
These are complete, runnable programs that demonstrate the SDK and CLI in realistic contexts. All TypeScript examples fetch from the live testnet registry at https://testnet.ckb.dev — nothing is mocked.
Prerequisites
Section titled “Prerequisites”- Node.js 20+ for TypeScript examples
- Rust 1.70+ (MSRV) for the Rust example
- An internet connection to reach
https://testnet.ckb.dev - No CKB account or on-chain funds required — all examples are read-only
TypeScript examples
Section titled “TypeScript examples”Clone the repository and install:
git clone https://github.com/digitaldrreamer/ckb-transaction-firewallcd ckb-transaction-firewall/examples/typescriptnpm install wallet-feedback A wallet send flow: clean recipient approved, blacklisted recipient blocked, missing dep rejected. The most fundamental SDK pattern.
wallet-ui A browser UI served by a local HTTP server. Enter any lock args and see a live firewall decision via /api/check.
blacklisted-transfer-safety A credentialless safety test: proves the firewall blocks a transfer to an actually-active blacklisted destination from the live registry.
agent-preflight An AI agent (Mistral) given a proposePayment tool. The firewall check runs inside the tool — the agent cannot bypass it.
Rust example
Section titled “Rust example”cd ckb-transaction-firewall/examples/rustcargo run --bin preflight_service preflight-service A Rust backend service that checks incoming transaction candidates and forwards only clean ones to the signing queue.