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

@rail402.dev/agent-helpers

v0.1.2

Published

Buyer/agent-side helpers: query the Stellar Bazaar and pay for what you find, with a spend cap.

Readme

@rail402.dev/agent-helpers

Buyer and agent helpers for Stellar x402. Search the Bazaar and pay for what you find, under a required spend cap.

What you need

Node.js 20+, testnet only. To pay you need a funded Stellar account secret that holds the payment asset with a trustline (fund XLM from friendbot, USDC from the Circle faucet). To only search, omit the secret.

Install

npm install @rail402.dev/agent-helpers

Usage

import { searchBazaar, payAndFetch, discoverAndPay } from "@rail402.dev/agent-helpers";

const config = {
  bazaarUrl: "https://facilitator.rail402.dev", // the Bazaar is served at the facilitator's base URL
  stellarSecret: process.env.RAIL402_SECRET,    // omit for search-only
  network: "stellar:testnet",
};

// Search the Bazaar in natural language.
const found = await searchBazaar(config, "summarize a web page");
if (found.ok) console.log(found.data); // resources with price and input schema

// Pay a known URL, under a cap (atomic units, as a string).
const paid = await payAndFetch(config, "https://api.example.com/summarize", { maxAmount: "100000" });
if (paid.ok) console.log(paid.data.body);

// Discover the cheapest match and pay it, still capped.
const out = await discoverAndPay(config, "summarize a web page", { maxAmount: "100000" });

maxAmount is required. It is atomic units as a string (for example "100000" is 0.01 USDC at 7 decimals). The cap is checked against the actual paid quote, not only the unpaid probe.

stellarSigner takes a pre-built ClientStellarSigner (from @x402/stellar) instead of stellarSecret. It works today for any G... account. It is also the seam for paying from a smart contract account (C...), which becomes a one-liner once @x402/stellar forwards a custom authorization path (x402-foundation/x402#3018) and this package bumps to it. Until then a C... account pays through the direct /verify + /settle path with the helper in examples/smart-account-buyer.

Every call returns a Result, never a thrown string:

type Result<T> =
  | { ok: true; data: T }
  | { ok: false; error: { code: string; reason: string; retryable: boolean } };

Exports: searchBazaar, payAndFetch, discoverAndPay, plus parseAmount, formatAtomicAmount, readAssetIdentity, readTrustlinePreflight, isPayableResourceUrl.

Part of Rail402. Apache-2.0.