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

@aifinpay/agent

v1.8.4

Published

Unified agent-economy SDK for autonomous AI agents — chain-opaque AiFinPayAgent surface (call/openSession/balance/verify) over Solana and EVM execution environments (Polygon default; Base, Optimism, Unichain, BOT Chain, XRPL EVM splitter settlement).

Readme

@aifinpay/agent (Node / TypeScript)

Non-custodial x402 payment client for autonomous AI agents on AiFinPay — canonical domain aifinpay.io (the legacy aifinpay.company host is retired). SDK settlement: since 1.3.0, direct fee-on-top splitter settlement (AiFinPayAgent.call()) works on Polygon (default), Base, Optimism, Unichain, BOT Chain and XRPL EVM (native-token path only — no ERC-20/USDC settlement yet), plus Solana; the backend-quoted invoice flow (/api/b2b/pay-with-split) remains Polygon + Solana. The protocol is live across 13 networks — see aifinpay.io/llms.txt.

The Ed25519 keypair is generated locally with tweetnacl and never leaves your process. The SDK only sends a one-time SHA-256 + Ed25519 signature in the x-signature header to authenticate against AiFinPay-protected endpoints.

Install

# install (latest)
npm install @aifinpay/agent
# or pnpm add @aifinpay/agent
# or yarn add @aifinpay/agent

# stable (when 1.0 ships)
npm install @aifinpay/agent

Quick start

import { Agent } from "@aifinpay/agent";

// Generate a fresh keypair locally — never transmitted
const agent = Agent.new();
console.log("Fund this address:", agent.address);
console.log("Save this secret:", agent.secretB58); // store securely!

// Wait until the wallet has at least $0.01 worth on-chain
await agent.waitForFunding({ minUsdCents: 1 });

// Request an invoice for a Seat (USDC on Solana)
const invoice = await agent.reserveSeatInvoice({
  amountUsd: 1.0,
  asset: "USDC",
});
// Build + sign + submit the on-chain tx with @solana/web3.js or viem.
// `invoice.raw` has program_id, treasury_vault, mints, nonce, etc.

// Once the Seat is on-chain, gated endpoints just work:
const res = await agent.get("https://aifinpay.io/api/stats");
console.log(await res.json());

Loading an existing keypair

// from solana-keygen JSON file (Node only)
const agent = await Agent.fromKeypairFile("./agent-wallet.json");

// from base58 secret string (works in browser too)
const agent2 = Agent.fromSecretB58("3RvZm7Gw...");

How x402 auth works under the hood

For every gated request the SDK:

  1. GET /nonce → receives a one-time UUID with 60s TTL.
  2. computes SHA-256("AiFinPay-x402:{nonce}:{pubkey}").
  3. signs with Ed25519, base58-encodes the signature.
  4. retries the original request with headers:
    • x-agent-pubkey: <base58 pubkey>
    • x-nonce: <uuid>
    • x-signature: <base58 sig>

The server verifies the signature, checks the agent has a live Seat PDA on-chain, and serves the resource.

Privacy

  • The server never sees your private key. Period.
  • Nonces are consumed on use; replay-resistant.
  • All transactions are public and on-chain — Solana + Polygon mainnet.

License

MIT.