Step 1: Install the SDK
Create a new directory for the tutorial and initialise a project:
mkdir firewall-tutorial && cd firewall-tutorialnpm init -yInstall the SDK:
npm install @ckb-firewall/sdkpnpm add @ckb-firewall/sdkyarn add @ckb-firewall/sdkSet up TypeScript and ESM. Add the following to package.json:
{ "type": "module", "scripts": { "start": "node --experimental-vm-modules check.ts" }}Create a file called check.ts and add this line:
import { fetchRegistryPayload } from "@ckb-firewall/sdk";console.log("SDK loaded:", typeof fetchRegistryPayload);Run it:
npx tsx check.tsYou should see:
SDK loaded: functionIf you see that output, the SDK is installed and the import works. Continue to Step 2.