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

@piprail/sdk

v2.0.0

Published

Accept x402 crypto payments across 29 chains — every major EVM chain plus Solana, TON, Tron, NEAR, Sui, Aptos, Algorand, Stellar & XRPL — in a couple of lines. No backend, no database, no fee; payments settle straight to your wallet.

Readme

@piprail/sdk

Accept and make x402 crypto payments — on any EVM chain plus Solana, TON, Tron, NEAR, Sui, Aptos, Algorand, Stellar & the XRP Ledger — in a couple of lines.

No middleman, no database, no fee, no account. Payments settle straight into your wallet, verified locally against your own RPC. Gate a route to make it paid-only; point an agent at a paid URL and it pays itself.

npm install @piprail/sdk viem

📖 Full documentation → docs.piprail.com

The docs are the single, searchable source of truth — every function, option, chain, and example, plus the MCP server, spend controls, discovery, and the complete error model. This README is just the front door.


Charge for an endpoint

import { requirePayment } from '@piprail/sdk'

app.get('/report',
  requirePayment({ chain: 'base', token: 'USDC', amount: '0.05', payTo: '0xYourWallet…' }),
  (_req, res) => res.json({ report: 'TOP SECRET' }),
)

That route now costs 0.05 USDC on Base, paid straight to your wallet. One parameter picks the chain. → Accepting payments

Let an agent pay for it

import { PipRailClient } from '@piprail/sdk'

const client = new PipRailClient({ chain: 'base', wallet: { key: process.env.AGENT_KEY } })

const res = await client.fetch('https://api.example.com/report') // hits the 402, pays it, retries with proof

Pay across chains — one buyer, a wallet per chain

A client is bound to one chain (an EVM key can't sign a Solana tx). To pay a 402 on whatever chain it asks for, give a MultiChainPayer one wallet per chain — it surveys every chain you hold and pays the first one you listed that can settle (your preference; within a chain, the cheapest-gas rail — there's no oracle to compare gas across coins):

import { MultiChainPayer } from '@piprail/sdk'

const payer = MultiChainPayer.fromWallets({
  wallets: {
    base:   { key: process.env.EVM_KEY },     // one EVM key works on every EVM chain
    solana: { key: process.env.SOLANA_KEY },
    xrpl:   { key: process.env.XRPL_SEED },
  },
  policy: { maxAmount: '1.00', maxTotal: '10.00', tokens: ['USDC', 'USDT'] }, // one budget, every chain
})

await payer.planPayment(url) // read-only: every chain ranked, payable-first in your listed order
const res = await payer.get(url) // pays on the first chain that can settle — same spend policy, no manual routing

Built on planAcross / fetchAcross (the same composable primitives, for when you already hold an array of clients). See examples/multi-chain.

The same app can take payments and make them. → Making payments


Documentation

| | | |---|---| | Getting started | Install · quickstart · how it works | | Accepting payments | requirePayment · createPaymentGate · the exact rail | | Making payments | PipRailClient · quote · estimateCost · planPayment · auto-route · MultiChainPayer | | Spend controls | Budgets · time envelope · the spend ledger | | Agent toolkit | paymentTools · the agent guide · NL renderers | | Discovery | Find & be found on the open x402 indexes ($0, no backend) | | Chains & tokens | Every chain, per-family setup & caveats | | Errors | The complete typed error model | | MCP server | Give any AI agent a budget-bound wallet | | Reference | The complete API surface |

Spread the word

PipRail is free, open-source, and has no backend to sell you. If it saved you from building a payments backend, help other developers (and their agents) find it:

Star on GitHub  ·  𝕏 Follow @piprailhq  ·  🌐 piprail.com  ·  📖 docs.piprail.com

License & trademark

The code is MIT — use it, fork it, ship it. PipRail™, the logo, and the @piprail npm scope are trademarks of the PipRail project: build on the code freely, but please don't call a fork "PipRail" or imply it's official. See TRADEMARK.md.