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

@obbyx/sdk

v0.4.0

Published

Accept and make x402 payments on Obyte: Express paywall, adapter for the official @x402 servers, paying fetch with spending budgets

Readme

@obbyx/sdk

Accept and make x402 payments on Obyte.

npm i @obbyx/sdk @x402/core obyte
npm i express            # for ObytePaywall

Sell: ObytePaywall (Express)

import express from 'express';
import { HTTPFacilitatorClient } from '@x402/core/http';
import { createLogger } from '@obbyx/obyte/logger';
import { ConsumedProofsStore, ObytePaywall } from '@obbyx/sdk';

const paywall = new ObytePaywall({
  facilitator: new HTTPFacilitatorClient({ url: 'https://your-facilitator.example' }),
  network: 'obyte:testnet',
  payTo: 'YOUR_OBYTE_ADDRESS',
  sellerId: 'my-api',
  secret: process.env.SELLER_SECRET!, // ≥ 32 chars, HMAC key of request bindings
  store: new ConsumedProofsStore('./data/proofs.db'),
  logger: createLogger(),
});

const app = express();
app.use(express.json());
app.post(
  '/api/answer',
  paywall.paid({ price: { amount: '20000' } }, async () => ({ body: { answer: 42 } })),
);

One payment pays one operation (binding over method, URL, body and price); the handler runs once; a repeated request with the same payment gets the stored response. Optional: payment channels (batch), payment-identifier, authorization flow.

Sell with the official @x402/express: ExactObyteServer

import { paymentMiddleware, x402ResourceServer } from '@x402/express';
import { ConsumedProofsStore, ExactObyteServer } from '@obbyx/sdk';

const server = new x402ResourceServer(new HTTPFacilitatorClient({ url })).register(
  'obyte:testnet',
  new ExactObyteServer({
    sellerId: 'api',
    secret: SELLER_SECRET,
    proofs: new ConsumedProofsStore('proofs.db'),
    logger,
  }),
);
app.use(
  paymentMiddleware(
    {
      'GET /x': {
        accepts: { scheme: 'exact', network: 'obyte:testnet', payTo, price: '20000 bytes' },
      },
    },
    server,
  ),
);

Channel payments: register BatchObyteServer the same way, with minChannelTimeoutSeconds equal to the facilitator's MIN_CHANNEL_TIMEOUT_SECONDS, and accept scheme: 'batch-settlement'.

Browser clients (CORS)

const paywall = new ObytePaywall({ ...options, cors: { origins: ['https://app.example'] } });
app.use(paywall.preflight()); // answers OPTIONS without payment

The 402 then carries Access-Control-Allow-Origin and exposes PAYMENT-REQUIRED / PAYMENT-RESPONSE; preflights allow PAYMENT-SIGNATURE.

Buy: payingFetch with budgets

import { SpendingBudget, payingFetch } from '@obbyx/sdk';

const { response, payment } = await payingFetch(
  url,
  { method: 'GET' },
  {
    mechanisms: { exact /*, batch */ }, // from @obbyx/x402-obyte
    network: 'obyte:testnet',
    maxAmount: new Map([['base', 50_000n]]), // per call
    budget: new SpendingBudget({ total: new Map([['base', 1_000_000n]]) }),
    logger,
  },
);

Never pays twice: a pending payment is retried with the same payment; unknown outcomes stay counted against the budget; a channel is used when one is open, otherwise exact.

Docs: github.com/Taump/obbyx. Node.js ≥ 24. MIT.