Install & usage

bash
npm install @wasit-dev/core

Requires Node.js 24 or newer. Ships ESM only ("type": "module"), with TypeScript types included.

ts
import {
  runX402ReadChecks,
  runX402PaymentChecks,
  summarize,
  checkStatus,
} from "@wasit-dev/core";

const readResults = await runX402ReadChecks({
  target: "https://your-service.example.com/paid",
});

// With a testnet payer key, also exercise the payment flow.
// X402-06 settles a real payment; X402-07 attempts one with a corrupted signature.
const paidResults = await runX402PaymentChecks({
  target: "https://your-service.example.com/paid",
  network: "stellar:testnet",
  payerSecretKey: process.env.STELLAR_PRIVATE_KEY,
});

const summary = summarize([...readResults, ...paidResults]);
console.log(summary.exitCode); // 0 conformant, 1 non-conformant, 2 no verdict

Every check function returns Promise<CheckResult[]> and never rejects for a target-side problem — a check that couldn't run (unreachable target, bad config) comes back as an ERROR or SKIP result, not a thrown error.