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

@untitledfinancial/dpx-x402

v1.0.1

Published

x402 payment middleware for any server framework — gate your API endpoints behind USDC micropayments on Base mainnet

Readme

@untitledfinancial/dpx-x402

Gate any API endpoint behind USDC micropayments on Base mainnet. Agents pay automatically — no account, no API key, no subscription.

npm install @untitledfinancial/dpx-x402

How it works

An agent calls your endpoint. If no payment is attached, your server returns a 402 Payment Required with USDC payment details. The agent signs an EIP-3009 transfer from its funded wallet, retries with the X-Payment header, and your server verifies and responds. The entire loop is machine-to-machine — no human approves anything.

Agent → GET /your-endpoint
Server → 402: { amount: "150000", asset: USDC, payTo: "0x..." }

Agent signs EIP-3009 TransferWithAuthorization
Agent → GET /your-endpoint  (X-Payment: <signed token>)
Server verifies → 200: { your data }  (X-Payment-Response: receipt)

Cloudflare Workers / Hono

import { Hono } from 'hono'
import { DPX } from '@untitledfinancial/dpx-x402/hono'

const app  = new Hono()
const dpx  = DPX.create({
  recipient: '0xYourWalletAddress',
  secretKey: process.env.DPX_SECRET_KEY!,
})

// Gate a route — $0.15 USDC per call
app.get('/signal', dpx.hono.charge({ amount: '0.15' }), (c) =>
  c.json({ regime: 'STABLE', score: 42 })
)

export default app

Next.js App Router

// app/api/signal/route.ts
import { DPX } from '@untitledfinancial/dpx-x402/nextjs'

const dpx = DPX.create({
  recipient: '0xYourWalletAddress',
  secretKey: process.env.DPX_SECRET_KEY!,
})

export const GET = dpx.charge({ amount: '0.15' })(() =>
  Response.json({ regime: 'STABLE', score: 42 })
)

Express / Node.js

import express from 'express'
import { DPX } from '@untitledfinancial/dpx-x402/express'

const app = express()
const dpx = DPX.create({
  recipient: '0xYourWalletAddress',
  secretKey: process.env.DPX_SECRET_KEY!,
})

app.get('/signal', dpx.node.charge({ amount: '0.15' }), (req, res) => {
  res.json({ regime: 'STABLE', score: 42 })
})

Manual mode (raw Fetch API)

import { DPX } from '@untitledfinancial/dpx-x402'

const dpx = DPX.create({
  recipient: '0xYourWalletAddress',
  secretKey: process.env.DPX_SECRET_KEY!,
})

export async function handler(request: Request): Promise<Response> {
  return dpx.charge({ amount: '0.15' })(
    () => Response.json({ regime: 'STABLE', score: 42 })
  )(request)
}

Configuration

DPX.create({
  // Required
  recipient:  '0x...',               // Address that receives USDC payments
  secretKey:  process.env.SECRET!,   // Secret for signing receipts — never expose

  // Optional
  currency:   '0x833589...',         // USDC on Base (default). Override for EURC or other tokens.
  network:    'base',                // 'base' (default) or 'base-sepolia' for testnet
  waitForConfirmation: true,         // Wait for on-chain confirmation (default: true)
                                     // Set false for lower latency (optimistic)
})

Per-route overrides

// Different amount, currency, or recipient per route
dpx.charge({
  amount:    '0.75',
  currency:  '0x...',      // e.g. EURC for EUR-denominated routes
  recipient: '0x...',      // e.g. per-product wallet
})

Payment methods

By default, dpx-x402 accepts USDC on Base mainnet via EIP-3009 TransferWithAuthorization. This is the same mechanism used by DPX Intelligence and all x402-gated DPX endpoints.

Any agent with a funded Base wallet can pay immediately — no new token, no onboarding.

Testnet

Set network: 'base-sepolia' and fund your agent wallet with testnet USDC from the Circle faucet.

What the agent receives

Every verified response includes an X-Payment-Response header:

{
  "paid": true,
  "from": "0x<agent-wallet>",
  "to": "0x<your-wallet>",
  "amount": "0.15",
  "currency": "0x833589...",
  "network": "eip155:8453",
  "verifiedAt": "2026-07-25T14:00:00Z"
}

Agent-side: paying with dpx-x402

If you are building the agent side (the caller), see:

Discovery

After your server is running, add a GET /openapi.json endpoint so agents can discover your API and its payment terms. Tag paid routes with x-payment-info:

{
  "paths": {
    "/signal": {
      "get": {
        "x-payment-info": {
          "offers": [{ "amount": "0.15", "currency": "USDC", "network": "base" }]
        }
      }
    }
  }
}

License

Business Source License 1.1 — see LICENSE.

Built by Untitled_ LuxPerpetua Technologies, Inc.