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

route402-guard

v0.1.0

Published

Deterministic pre-sign firewall, rolling-window budget lock, and EIP-7702/x402 guardrails for autonomous agents.

Readme

route402-guard

Deterministic pre-sign firewall, rolling-window budget lock, and EIP-7702 / x402 guardrails for autonomous AI agents. Zero runtime dependencies; runs in Node.js, Bun, Cloudflare Workers, and browsers.

Why?

Production agentic payment rails suffer from four recurring failure modes:

  1. Parallel race double-spends (x402#4198) — two concurrent calls 20 ms apart pass client-side checks and sign separate nonces.
  2. Multi-replica & calendar-reset budget bypasses — process-local counters reset on restart or diverge across replicas; unpriced tokens (e.g. EURC) get logged as $0.
  3. EIP-7702 & unlimited approval traps — blind delegation or MAX_UINT256 ERC-20 / Permit2 approvals drain wallets.
  4. Misordered seller x402 offers — agents pick a $1.00 mainnet offer placed first instead of a policy-compliant $0.01 offer.

route402-guard isolates LLM reasoning to the advisory layer and enforces signing rules deterministically before any private key or enclave is invoked.

3-Line Quickstart

import { createPreSignFirewall, guardSigner } from "route402-guard";

const firewall = createPreSignFirewall({
  maxRolling24hAtomicUsd6: 150_000_000n, // $150.00 rolling 24h cap (atomic 6-dec USD)
  maxPerCallAtomicUsd6: 5_000_000n,      // $5.00 max per call
  allowedNetworks: ["eip155:8453"],      // Base mainnet only
  allowedRecipients: ["0x488cbDad29E60d8Bae53FFF4c4252C9711dF9784"],
});

const safeSign = guardSigner(firewall, (intent) => wallet.signAndPay(intent));

If the wrapped signer throws (e.g. RPC timeout), guardSigner automatically releases the budget hold so retries do not burn quota.

Safe x402 Offer Selection

const best = firewall.selectBestX402Offer(paymentRequired.accepts);
if (!best) throw new Error("No policy-compliant x402 payment offer");

Multi-Replica Production Store

By default, InMemoryBudgetStore provides atomic single-process locking and CAIP-10 wallet normalization. For multi-replica deployments, pass a custom BudgetStore backed by Redis, Postgres, or a Cloudflare Durable Object implementing acquireHold, commitHold, and releaseHold.

License

Apache-2.0