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

undo402

v0.1.4

Published

Pay x402 APIs from an agent, covered by undo402 refunds on Robinhood Chain. SDK and MCP server.

Readme

undo402 for agents

Pay x402 APIs on Robinhood Chain from an agent, with refunds when a paid call fails. Two ways to use it:

  • SDK: a fetch() that answers 402 Payment Required by itself, within spending limits.
  • MCP server: tools for Claude, Cursor and other MCP clients to find covered APIs, call them and track refunds.

Payments are USDG on Robinhood Chain (chain 4663), x402 V2 scheme exact with EIP-3009. Your key stays on your machine; it only signs payment authorizations. Requires Node.js 20 or newer.

SDK

import { createClient, usd } from "undo402";

const client = createClient({
  account: process.env.AGENT_KEY as `0x${string}`, // a 0x private key or a viem account
  maxPerCall: usd(0.05),                          // never pay more than this for one call
  maxTotal: usd(5),                               // stop after this much in total
  allowedPrefixes: ["https://undo402.xyz/s/"],      // only pay covered calls
});

const { response, paid, receipt } = await client.fetch("https://undo402.xyz/s/rhc-token-check?address=0x…");
console.log(response.status, await response.json());
console.log(`paid ${paid} units, track: ${receipt.url}`);

receipt.id is the X-BOND-RECEIPT of the call. If the seller fails after you paid, the refund shows up on receipt.url and lands in the paying wallet.

Limits are counted when a payment is signed. A call over a limit throws PaymentRefused with a code (over_call_limit, over_total_limit, url_not_allowed, no_acceptable_option, unreadable_402) and nothing is signed.

MCP server (local, can pay)

{
  "mcpServers": {
    "undo402": {
      "command": "npx",
      "args": ["-y", "-p", "undo402", "undo402-mcp"],
      "env": {
                "UNDO402_PRIVATE_KEY": "0x…",
        "UNDO402_MAX_PER_CALL_USD": "0.05",
        "UNDO402_MAX_TOTAL_USD": "1"
      }
    }
  }
}

| Variable | | Default | | --- | --- | --- | | UNDO402_GATEWAY | gateway origin | https://undo402.xyz | | UNDO402_PRIVATE_KEY | paying wallet; without it the server can look things up but not pay | none | | UNDO402_MAX_PER_CALL_USD | per-call limit | 0.05 | | UNDO402_MAX_TOTAL_USD | limit for the session | 1 | | UNDO402_ALLOW_ANY_URL | 1 to pay URLs outside the gateway (not covered) | off |

Tools: find_apis, call_api, track_payment, wallet_status.

Use a wallet that holds only what the agent may spend.

MCP server (remote, read-only)

No install: point an MCP client that supports Streamable HTTP at https://undo402.xyz/mcp. Tools: find_apis, get_api, track_payment, system_status. It never pays.