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

local-x402-facilitator

v0.1.5

Published

An x402 facilitator server for local development that works natively with Tenderly Virtual TestNets. Avoiding bottlenecks while testing and creating sandbox environments for x402 development.

Readme

local-x402-facilitator

An x402 facilitator server for local development that works natively with Tenderly Virtual TestNets. Avoiding bottlenecks while testing and creating sandbox environments for x402 development.

Motivation

Working with x402 on Base Sepolia and other testnets typically requires utilising faucets for wallet funding, which can create development bottlenecks. Tenderly Virtual TestNets solve this by providing isolated developer environments with easily funded wallets, while also giving you access to all of Tenderly's blockchain development tooling.

NOTICE: This server is meant solely for local development and is not meant to be used in production environments!.

Usage

The local x402 facilitator is meant to be run as a local server alongside your local development environemnet.

The server can be configured through environment variables or command line arguments. Command line arguments take precedence over environment variables.

You can running using the npx command:

npx local-x402-facilitator --rpc <TENDERLY_TESTNET_RPC_URL>

Or alternatively you can install the npm package and run it using an npm script.

npm install --save-dev local-x402-facilitator
{
    "scripts": {
        "facilitator": "local-x402-facilitator --rpc <TENDERLY_TESTNET_RPC_URL>",
    }
}

Environment Variables

The facilitator server loads the .env file from the root of your project. Create a .env file in the project root with the following variables:

# Optional: Facilitator port (defaults to 8402)
FACILITATOR_PORT=8402

# Optional: Facilitator Wallet Private Key (defaults to pk for 0x4dFbEAb12fEf03583B22a82D4ac338116AaD4a27)
FACILITATOR_WALLET_PRIVATE=

# Optional: Private key for Test Wallet that can used to sign x402Response payloads and is automatically funded when boothing a Virtual TestNet.
TEST_WALLET_PRIVATE_KEY=

# enderly configuration for Virtual TestNets
# If you do not provide a fixed TENDERLY_RPC, then all other Tenderly fields become required

# Tenderly RPC URL (optional) - Recommended setting for those that have paid Tenderly accounts.
TENDERLY_RPC=https://rpc.vnet.tenderly.co/devnet/your-virtual-testnet-id

# Required when TENDERLY_RPC is not provided
# This will then enable dynamic Virtual TestNet creation.
TENDERLY_ACCOUNT_NAME=your-account-name
TENDERLY_PROJECT_NAME=your-project-name
TENDERLY_ACCESS_KEY=your-access-key

Available CLI Options

When running the server using the CLI command, you can alternatively use the following CLI flags.

  • -p, --port <port>: Facilitator port number (env: FACILITATOR_PORT)
  • -r, --rpc <url>: Tenderly RPC URL (env: TENDERLY_RPC)
  • -a, --account <name>: Tenderly account name (env: TENDERLY_ACCOUNT_NAME)
  • -j, --project <name>: Tenderly project name (env: TENDERLY_PROJECT_NAME)
  • -k, --access-key <key>: Tenderly access key (env: TENDERLY_ACCESS_KEY)
  • -h, --help: Display help for command

Usage with x402 Client

This local facilitator server can then be used with the the x402 client library.

import {useFacilitator} from 'x402/verify';

const facilitator = useFacilitator({
    url: 'http://localhost:8402',
});

await facilitator.verify(signedPayload, paymentRequirement);

API Endpoints

By default the facilitator server is available at http://localhost:8402

POST - /verify

import { PaymentPayload, PaymentRequirements } from "x402/types";

type VerifyRequestBody = {
    paymentPayload: PaymentPayload;
    paymentRequirements: PaymentRequirements;
    facilitatorOptions?: CustomFacilitatorOptions;
}

POST - /settle

import { PaymentPayload, PaymentRequirements } from "x402/types";

type SettleRequestBody = {
    paymentPayload: PaymentPayload;
    paymentRequirements: PaymentRequirements;
    facilitatorOptions?: CustomFacilitatorOptions;
}

POST - /test/sign

Requires the TEST_WALLET_PRIVATE_KEY to be defined.

import { x402Response } from "x402/types";

type TestWalletSignBody = x402Response;

Types

You can check the types for PaymentPayload, PaymentRequirements and x402Response in the official x402 types repository.

The below types are the custom types for the local x402 facilitator.

type CustomFacilitatorOptions = {
    rpcUrl?: string; // When this param is provided it overrides the defined RPC URL from the environment used for Facilitator client calls.
    skipBalanceCheck?: boolean; // Disable checking if the facilitator wallet has enough balance on this RPC Url. Set this to `true` to reduce the response time as it doesn't call the RPC Url before performing transactions.
}

Development

Local Development

# Install dependencies
npm install

# Start in development mode
npm run dev

# Build the project
npm run build

# Test the CLI
npm run cli -- --help

Roadmap

| Feature | State | | --- | --- | | Add support for other Networks besides Base | TODO | | Create local studio app for viewing requests | TODO | | Add dynamic creation of new Virtual TestNets when current TestNets reaches free plan block height limit | TODO |