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

@bosonprotocol/x402-server

v0.3.1

Published

Framework-agnostic x402 resource-server SDK for the Boson Protocol escrow scheme — 402 challenge builder and FullOffer signer hook.

Downloads

1,078

Readme

@bosonprotocol/x402-server

Framework-agnostic resource-server SDK for the Boson Protocol escrow scheme — the server side of x402B.

See docs/boson-impl-05-server-sdk.md for the spec and docs/boson-impl-01-escrow-scheme.md for the wire format.

Status

Pre-release. v0.1 ships only the request-side primitives — the 402 challenge builder, the seller FullOffer signer hook, and the createX402bServer factory that binds them together. Follow-up PRs add:

  • the X-PAYMENT 13-rule validator,
  • the facilitator HTTP client (talks to @bosonprotocol/x402-facilitator),
  • the convenience handlers (commit-and-redeem, complete, dispute/*),
  • a framework adapter (@bosonprotocol/x402-server-express).

Install

pnpm add @bosonprotocol/x402-server @bosonprotocol/x402-core @bosonprotocol/x402-actions

Quick start

import { createX402bServer } from "@bosonprotocol/x402-server";
import { buildChannelRegistry } from "@bosonprotocol/x402-actions";
import { privateKeyToAccount } from "viem/accounts";

const sellerAssistant = privateKeyToAccount(process.env.SELLER_PK as `0x${string}`);

const server = createX402bServer({
  network: "eip155:8453",
  chainId: 8453,
  escrow: "0xDIAMOND...",
  signer: sellerAssistant,
  facilitator: { url: "https://facilitator.example" },
  channelRegistry: buildChannelRegistry({
    channels: ["server", "facilitator", "onchain", "mcp"],
    escrow: "0xDIAMOND...",
    mcp: "boson://seller/12345",
  }),
});

const requirements = await server.buildPaymentRequirements({
  offer: { unsigned: { /* UnsignedFullOffer — see `@bosonprotocol/x402-core/eip712` */ } },
  asset: "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913", // USDC on Base
  amount: "1000000", // 1 USDC (6 decimals)
  tokenAuthStrategies: ["erc3009"],
  recipientId: "did:boson:seller:12345",
  maxTimeoutSeconds: 300,
});

requirements is an EscrowPaymentRequirements ready to embed in a 402 response's accepts[] array.

License

Apache-2.0