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

@nanosession/x402

v0.2.0

Published

x402 adapter for NanoSession - Nano cryptocurrency payment mechanism

Downloads

22

Readme

@nanosession/x402

This package provides the official adapter between the NanoSession protocol and the Coinbase x402 ecosystem.

It implements the core SchemeNetworkServer, SchemeNetworkFacilitator, and SchemeNetworkClient interfaces required by @x402/core and @x402/next, allowing you to use Nano (XNO) seamlessly within standard x402 middlewares.

Why this package?

The core NanoSession packages (@nanosession/client, @nanosession/facilitator) are built to be standalone, lightweight, and completely free of external x402 abstractions. They handle the raw mechanics of Nano block tracking, spent sets, and cryptography.

@nanosession/x402 exists to bridge those core primitives into the polymorphic world of the official x402 libraries.

If you are building a native Nano application and only care about Nano, use @nanosession/client and @nanosession/facilitator directly.

If you are building a generic Web3 application using @x402/next or @x402/express that accepts USDC on Base, SOL on Solana, and XNO on Nano simultaneously, use this package to plug NanoSession into that ecosystem.

Installation

npm install @nanosession/x402

Usage

Server / Middleware Implementation

Use ExactNanoScheme to register Nano's parsing capabilities with your x402 Server setup.

import { ExactNanoScheme } from '@nanosession/x402/server';

const nanoScheme = new ExactNanoScheme();

// Register with your `@x402/next` or `@x402/express` config...

Facilitator Implementation

Wrap the native NanoSessionFacilitatorHandler using ExactNanoFacilitator.

import { ExactNanoFacilitator } from '@nanosession/x402/facilitator';
import { NanoRpcClient } from '@nanosession/rpc';

const rpcClient = new NanoRpcClient({ endpoints: ['https://rpc.nano.to'] });

const nanoFacilitator = new ExactNanoFacilitator({
  rpcClient
});

// Pass to your `@x402/core` Facilitator registry

Client Implementation

Wrap the native NanoSessionPaymentHandler using ExactNanoClient.

import { ExactNanoClient } from '@nanosession/x402/client';
import { NanoRpcClient } from '@nanosession/rpc';

const rpcClient = new NanoRpcClient({ endpoints: ['https://rpc.nano.to'] });

const nanoClient = new ExactNanoClient({
  rpcClient,
  seed: process.env.NANO_SEED
});

// Pass to your `@x402/core` Client registry

Architecture

This adapter handles key translation duties:

  1. Price Parsing: Converts decimal USD/FIAT values into appropriate Nano raw amounts (30 decimals) via ExactNanoScheme.
  2. Type Wrapping: Translates the generic PaymentRequirements and PaymentPayload objects from @x402/core into the specific NanoSession formats required by the core protocol logic.
  3. Execution Mapping: Proxies the verify, settle, and createPaymentPayload lifecycle methods down to the native NanoSessionFacilitatorHandler and NanoSessionPaymentHandler.

x402 Extensions

The adapter passes extensions through to the underlying NanoSession handlers without modification. This means x402 core extensions like payment-identifier (idempotency keys) work transparently when used with this adapter.

@nanosession/core provides utility helpers for declaring, appending, and extracting payment identifiers — see the root README for usage.

Documentation

Full protocol specification and guides: https://csi.ninzin.net/x402.NanoSession/

License

MIT