TypeScript SDK
The TypeScript SDK is the application-layer check. It parses a BLKL registry payload from a matching registry cell dep and rejects outputs that target blacklisted destinations.
Published on npm as @ckb-firewall/sdk.
Install
Section titled “Install”npm install @ckb-firewall/sdkpnpm add @ckb-firewall/sdkyarn add @ckb-firewall/sdkBasic usage
Section titled “Basic usage”import { TransactionFirewall } from "@ckb-firewall/sdk";
const firewall = new TransactionFirewall({ registryScript: { codeHash: "0x...", hashType: "type", args: "0x...", },});
const result = firewall.checkTransaction({ cellDeps: [{ type: registryScript, data: registryData }], outputs: [{ lockArgs: "0x..." }],});
if (!result.ok) { console.error(result.code, result.reason);}Important rules
Section titled “Important rules”- The SDK is synchronous.
- It does not fetch RPC data for you.
- You must provide the live registry cell data yourself.
- The registry dep must match the configured
registryScriptexactly.
Result codes
Section titled “Result codes”The SDK returns a structured ok: true or ok: false decision.
8MissingRegistryCellDep9InvalidRegistryData10RegistryNotSorted11BlacklistedLockArgs12BlacklistedTypeArgs17AmbiguousRegistryCellDep
See Error codes for the contract-side mapping.