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

@x402r/cli

v0.2.0

Published

One-shot CLI for paying x402 / x402r endpoints. Wallet-agnostic: raw key, JSON-RPC signer, or custom module.

Readme

@x402r/cli

One-shot CLI for paying x402 / x402r HTTP 402 endpoints. Wallet-agnostic: raw private key, JSON-RPC signer, or a custom signer module. Zero provider SDK dependencies.

Install

Use npx — no project install required.

npx @x402r/[email protected] pay <url> [options]

Surface

x402r pay <url> [signer flags] [--max-amount N] [--rpc <url>] [--chain <eip155:id>] [--json]

Exactly one signer source must resolve. CLI flag > env var.

| Source | Flag | Env | |-------------------|-------------------------------------------------|--------------------------------| | Raw key | --key 0x... | PRIVATE_KEY | | Remote RPC signer | --signer-url <url> --signer-address 0x... | SIGNER_URL, SIGNER_ADDRESS | | Custom module | --signer-module <pkg-or-path> | SIGNER_MODULE |

Env var names are unprefixed to match the Foundry / Hardhat / x402-reference convention. The flag form is available when you want to avoid collisions.

Exit codes

| Code | Meaning | |------|---------| | 0 | success | | 1 | network error | | 2 | malformed 402 / unusable accepts[] | | 3 | price exceeds --max-amount guard | | 4 | signature rejected | | 5 | settlement failed (merchant 4xx/5xx after payment, or facilitator error) | | 6 | signer resolution failed (none, multiple, or partially-configured sources) |

--json envelope

{
  "body": "<merchant response body>",
  "status": 200,
  "tx": "0x…",
  "elapsedMs": 1234,
  "signer": { "kind": "key", "address": "0x…" }
}

signer is omitted when the URL returned non-402 (no payment was made).

Examples

Raw key

PRIVATE_KEY=0x... \
  npx @x402r/[email protected] pay https://example.com/paid

JSON-RPC signer

Anything speaking eth_signTypedData_v4 works: Privy wallet RPC, Turnkey, Fireblocks, Safe, a local cast wallet endpoint, a hardware wallet exposed over an RPC bridge, etc.

npx @x402r/[email protected] pay https://example.com/paid \
  --signer-url https://signer.example/rpc \
  --signer-address 0x...

Custom module — Privy (@privy-io/server-auth)

// privy-signer.js
import { PrivyClient } from '@privy-io/server-auth'
import { createViemAccount } from '@privy-io/server-auth/viem'

export default async function () {
  const privy = new PrivyClient(process.env.PRIVY_APP_ID, process.env.PRIVY_APP_SECRET)
  return createViemAccount({
    walletId: process.env.PRIVY_WALLET_ID,
    address: process.env.PRIVY_WALLET_ADDRESS,
    privy,
  })
}
npx @x402r/[email protected] pay https://example.com/paid \
  --signer-module ./privy-signer.js

Custom module — Coinbase CDP server wallet

// cdp-signer.js
import { CdpClient } from '@coinbase/cdp-sdk'
import { toAccount } from 'viem/accounts'

export default async function () {
  const cdp = new CdpClient()
  const acct = await cdp.evm.getOrCreateAccount({ name: process.env.CDP_ACCOUNT_NAME })
  return toAccount(acct)
}
npx @x402r/[email protected] pay https://example.com/paid \
  --signer-module ./cdp-signer.js

Signer module contract

The module's default export is a factory () => Promise<Account> that returns a viem Account. The CLI only needs signTypedData — transaction broadcasting is handled by the facilitator.

Notes

  • Wallet-agnostic by design: the CLI carries zero Privy / CDP / Turnkey dependencies. Provider SDKs are loaded only when --signer-module points at a user-authored shim.
  • Pinned-version invocation (npx @x402r/[email protected]) is recommended so agent skill wrappers can wildcard-allow exact command shapes.
  • Supports Base and Base Sepolia out of the box. Any EVM chain known to viem/chains works; unknown chain IDs require --rpc <url>.