Skip to content

Example: wallet-ui

Location: examples/typescript/src/wallet-ui.ts

Run:

Terminal window
cd examples/typescript
npm run wallet-ui
open http://localhost:4173

Environment variables:

VariableDefaultNotes
PORT4173Local server port
CKB_RPC_URLhttps://testnet.ckb.devCKB node RPC URL
CANDIDATE_LOCK_ARGSgovernance key 0Pre-filled clean address

A minimal HTTP server (http.createServer) with a browser UI. The page has two buttons — one prefills a known clean address, the other prefills the first active blacklisted address from the live registry. Clicking Check transfer sends a POST to /api/check, which calls preflightCheck server-side and returns the result as JSON.

SDK patterns:

  • Server-side preflightCheck per request — the SDK runs in the Node.js process, not in the browser
  • The registry payload is fetched once at startup and refreshed on each request
  • firstActiveEntry extracts the first non-expired blacklist entry for the “blocked” demo button