x402
Add the Herald facilitator to your server. Charge per request, per call, per artifact. Works with any x402 client. Settles on 0G in any ERC20 token.
→ Quickstart for sellersimport { paymentMiddleware, x402ResourceServer } from "@x402/hono"; import { HTTPFacilitatorClient } from "@x402/core/server"; import { ExactEvmScheme } from "@heraldprotocol/x402/server"; const facilitator = new HTTPFacilitatorClient({ url: "https://facilitator.heraldprotocol.xyz", }); app.use(paymentMiddleware({ "GET /weather": { accepts: [{ scheme: "exact", price: "$0.001", network: "eip155:16661", payTo: "0x...", }], }, }, new x402ResourceServer(facilitator) .register("eip155:16661", new ExactEvmScheme())));