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

tessel-sdk

v0.2.0

Published

Tessel SDK: contract ABIs, route finder, bin distribution math, and x402 (EIP-3009, USDG) paywall and payer.

Readme

tessel-sdk

Shared code for the Tessel site, agents and bots: contract ABIs, the route finder, bin distribution helpers, and an x402 client for buying Tessel pool data and quotes in USDG.

Buy data over x402

  1. Read the free discovery document: GET <site>/api/x402. It lists the network, the USDG asset, payTo, and each paid resource with its price.
  2. Call a resource without payment. It answers 402 with the price in the PAYMENT-REQUIRED header (v2) and in the body (v1).
  3. Sign a USDG TransferWithAuthorization (EIP-3009) for exactly that price to payTo, and send the request again with the PAYMENT-SIGNATURE (v2) or X-PAYMENT (v1) header.
  4. The server settles the payment on chain and only then returns 200 with { data, payment }, where payment holds the payer, the transaction hash and the network.

X402Payer does steps 2–4 for you:

import { Wallet } from "ethers";
import { X402Payer } from "tessel-sdk/payer";
import { createProvider } from "tessel-sdk/relayer";

const provider = createProvider(RPC_URL, CHAIN_ID);
const payer = new X402Payer({
  signer: new Wallet(PAYER_KEY, provider),
  provider,
  chainId: CHAIN_ID,
  usdg: ASSET,        // "asset" from the discovery document
  maxPrice: 10_000n,  // never sign more than 0.01 USDG per request
});

const pre = await payer.preview(url);  // price, balance, canProceed, reasons
const res = await payer.pay(url);      // { response, paid, transaction }
const { data } = await res.response.json();

Rules the payer follows: it refuses a price above maxPrice without signing, checks the USDG balance first, and only signs for USDG on the chain you gave it.

Rules the server follows:

  • Nothing is charged for bad parameters or when the chain cannot be read.
  • A signed payment is charged once at most. Sending it again to the same resource returns the data again; sending it to another resource is refused.
  • Payments must be addressed to payTo, for at least the price, inside the time window.

A full example is agents/src/x402-bot.ts (pnpm run bot WETH USDG in agents/).

Other exports

| Import | What | |---|---| | tessel-sdk/deployments | contract addresses per chain id | | tessel-sdk/abis | ABIs generated from contracts/out (pnpm gen:abi in web/) | | tessel-sdk/routes | candidatePaths, quoteRoutes: direct and two-hop routes, quoted on chain through the router | | tessel-sdk/binDist | idForPrice, priceForId, distribute for spot, curve and bid-ask shapes | | tessel-sdk/x402 | the x402 "exact" scheme: requirements, signing, verification, paywall | | tessel-sdk/x402-store | settlement records: memoryStore, sqlStore | | tessel-sdk/relayer | providers and the settlement relayer signer |

Tests

pnpm test runs the unit tests. The end-to-end test runs against a live site: X402_E2E_API=http://localhost:3100 X402_E2E_PAYER_KEY=<key with USDG> npx tsx --test test/x402.e2e.test.mjs.