npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

x402-fl

v0.1.0

Published

Local x402 facilitator dev tool, spin up Anvil + facilitator for local x402 development

Readme

x402-fl

npm version License: MIT

Local x402 facilitator for development and testing. Forks Base mainnet with Foundry Anvil and runs a local facilitator server.

Warning: This is for local development only. Do NOT use in production. It uses Anvil's well-known deterministic private keys, which are publicly known and have zero security.

Note: Currently only USDC on Base is supported. Custom ERC-20 token support is on the roadmap.

What it does

x402-fl spins up a complete local x402 payment environment in one command:

  1. Forks Base mainnet using Anvil (so you get real USDC contract state)
  2. Starts a local facilitator server that can verify and settle x402 payments
  3. Provides a fund command to mint USDC to any address via Anvil storage manipulation

Prerequisites

Quick Start

Try it instantly with npx:

npx x402-fl dev

Or install globally:

npm install -g x402-fl
x402-fl dev

This starts Anvil on port 8545 and launches the facilitator on port 4022.

From source

git clone https://github.com/anthropics/x402-fl.git
cd x402-fl
pnpm install
pnpm dev

Fund an account with 100 USDC:

x402-fl fund 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 100

CLI Commands

dev

Start Anvil fork + facilitator server for local x402 development.

x402-fl dev [options]

| Flag | Default | Description | | ----------------------- | -------------------------- | ------------------------------------------------------------- | | --port <number> | 4022 | Facilitator HTTP port | | --anvil-port <number> | 8545 | Anvil RPC port | | --rpc-url <url> | https://mainnet.base.org | Base RPC URL to fork | | -v | | Show facilitator request logs | | -vv | | Show facilitator request logs and Anvil process logs | | --private-key <key> | | Custom facilitator private key (prefer default Anvil account) |

Warning: --private-key is not recommended

Note: anvil state is not persisted.

fund

Fund any address with USDC on the local Anvil fork.

x402-fl fund <address> <amount> [options]

| Argument / Flag | Default | Description | | ----------------------- | -------- | ---------------------------------------------------------------- | | <address> | required | 0x-prefixed Ethereum address to fund | | <amount> | required | USDC amount in major units (human-readable, e.g. 100 or 1.5) | | --anvil-port <number> | 8545 | Anvil RPC port |

balance

Check USDC balance for an address on the local Anvil fork.

x402-fl balance <address> [options]

| Argument / Flag | Default | Description | | ----------------------- | -------- | ---------------------------- | | <address> | required | 0x-prefixed Ethereum address | | --anvil-port <number> | 8545 | Anvil RPC port |

Facilitator API Endpoints

The facilitator server exposes the following HTTP endpoints (default http://localhost:4022):

POST /verify

Verify an x402 payment payload without settling it.

Request body:

{
  "paymentPayload": { ... },
  "paymentRequirements": { ... }
}

Response: Verification result from the facilitator.

POST /settle

Settle (execute) a verified x402 payment on-chain.

Request body:

{
  "paymentPayload": { ... },
  "paymentRequirements": { ... }
}

Response: Settlement result with transaction details.

GET /supported

List supported payment schemes and networks.

Response:

{ ... }

GET /health

Health check endpoint.

Response:

{
  "status": "ok",
  "network": "base-mainnet",
  "facilitator": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"
}

Test Accounts

The facilitator uses Anvil's default deterministic account (index 0). Do not use these keys for anything real.

| Role | Address | | ----------- | -------------------------------------------- | | Facilitator | 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 |

Any address can be funded using x402-fl fund.

Roadmap

  • [ ] Custom ERC-20 token support
  • [ ] Custom Fork url
  • [ ] Custom Fork block height
  • [ ] Dockerised anvil node (fallback when foundry is not installed)
  • [ ] Testcontainers for facilitator + anvil for deterministic testing env

Issues

Found a bug or have a feature request? Open an issue.

License

MIT