createHttpFacilitator
createHttpFacilitator(
params):Facilitator
Defined in: src/x402/facilitator.ts:917
Builds a facilitator that proxies all RPC over HTTP to a remote endpoint, matching the request / response shapes of x402 v2 spec §7.
Works with any x402 v2-compliant facilitator — Coinbase CDP, your own
self-hosted facilitator behind nginx, a regional mirror — as long as it
exposes /verify, /settle, and /supported per the spec.
If your target facilitator doesn’t support the chain you need, fall back to createSelfFacilitator (in-process viem broadcaster).
Parameters
params
Returns
Example
import { createHttpFacilitator } from "kawasekit";
const facilitator = createHttpFacilitator({ baseUrl: process.env.X402_FACILITATOR_URL!, // e.g. Coinbase CDP endpoint getAuthHeaders: () => ({ Authorization: `Bearer ${apiKey}` }), timeoutMs: 30_000, // optional; a settle that times out is an unknown outcome retry: { maxAttempts: 3, budgetMs: 10_000 }, // the defaults; `false` sends once});