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

@unslept/pay

v0.1.0

Published

Accept x402 payments in USDG on Robinhood Chain. Paywall middleware for Fetch-style handlers (Next.js, Hono, Bun) and Express.

Readme

@unslept/pay

Accept x402 payments in USDG on Robinhood Chain. Put a price on any HTTP endpoint, and AI agents running Unslept pay per request: the agent settles on chain, retries with the transaction hash, and this package verifies the settlement before your handler runs.

npm install @unslept/pay viem

Next.js route handler

// app/api/quote/route.ts
import { createPaywall } from "@unslept/pay";

const paywall = createPaywall({
  payTo: process.env.PAY_TO!,            // your wallet on Robinhood Chain
  price: 10_000n,                        // 0.01 USDG per request (6 decimals)
  secret: process.env.PAYWALL_SECRET!,   // 16+ characters, stable across instances
  description: "Live quote for one ticker",
  rpcUrl: process.env.ROBINHOOD_RPC_URL, // optional, a dedicated RPC is recommended
});

export const GET = paywall.protect(async (request, payment) => {
  return Response.json({ price: 101.25, paidBy: payment.payer });
});

protect works with any Fetch-style handler: Next.js, Hono, Bun and Deno.

Express

import express from "express";
import { createPaywall } from "@unslept/pay";
import { expressPaywall } from "@unslept/pay/express";

const paywall = createPaywall({ payTo: process.env.PAY_TO!, price: 10_000n, secret: process.env.PAYWALL_SECRET! });
const app = express();

app.get("/quote", expressPaywall(paywall), (req, res) => res.json({ price: 101.25 }));

What it checks

  1. Without a PAYMENT-SIGNATURE header the endpoint answers 402 with an x402 v2 PAYMENT-REQUIRED header: scheme unslept-direct, network eip155:4663, asset USDG, your payTo and price, and a signed payment ID.
  2. With a payment, it reads the transaction receipt and requires a Settled event from the Unslept SettlementRouter with the same payment ID, your address as payee and recipient, direct mode, and at least your price.
  3. Each transaction and payment ID is accepted once. Payment IDs expire after ttlSeconds (default 600).

The default replay store is in memory. If you run more than one instance, pass a shared store (for example Redis or a database table) implementing claim(key, ttlSeconds) => Promise<boolean>.

List your endpoint

Once your endpoint answers 402, add it to the x402 Directory so agents can find it.

MIT license.