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

@fretumai/wallet

v1.0.0

Published

Drop-in x402 payment SDK for AI agents. Provision wallets, sign payments, and transact autonomously via Fretum.

Readme

@fretumai/wallet

Drop-in x402 payment SDK for AI agents. Give any agent a funded wallet in 2 lines of code.

Install

npm install @fretumai/wallet

Quick Start

import { AgentWallet } from "@fretumai/wallet";

const wallet = new AgentWallet({ apiKey: "fr_..." });

// Any x402 endpoint — auto-handles 402 → sign → retry
const leads = await wallet.post("https://gateway.mcfagentic.com/api/pipeline/generate-leads", {
  industry: "plumbing",
  location: "Dallas, TX",
  count: 3,
});

That's it. The SDK:

  1. Makes the request
  2. If the server returns 402 Payment Required, parses the pricing
  3. Signs the USDC payment via your Fretum wallet
  4. Retries the request with the payment header
  5. Returns the data

Configuration

const wallet = new AgentWallet({
  apiKey: "fr_...",                   // Required: your Fretum API key
  baseUrl: "https://fretum.io/api",   // Optional: Fretum API URL
  walletId: "wallet-uuid",            // Optional: specific wallet to use
  maxPerCall: 0.50,                   // Optional: max USD per call (safety limit)
  autoCreate: true,                   // Optional: auto-create wallet on first use
  label: "my-lead-gen-agent",         // Optional: wallet label
});

API

wallet.fetch(url, init?)Response

Like fetch() but auto-handles x402 payments. Returns the raw Response.

wallet.fetchJSON<T>(url, init?)T

Like fetch() but auto-parses JSON. Throws on non-2xx.

wallet.post<T>(url, body)T

Convenience for POST + JSON body + auto-pay + parse response.

wallet.getWalletInfo()WalletInfo

Get wallet details + USDC balance.

wallet.getClient()FretumClient

Access the low-level Fretum API client for direct calls.

Low-Level Client

For direct API access without auto-pay:

import { FretumClient } from "@fretumai/wallet";

const client = new FretumClient({ apiKey: "fr_..." });

// Wallet management
const wallet = await client.createWallet("my-agent");
const info = await client.getWallet(wallet.walletId);
await client.updateBudgets(wallet.walletId, { maxPerCall: 1.0, dailyLimit: 50 });

// Manual signing
const result = await client.signPayment(wallet.walletId, paymentRequired, targetUrl);

// Discovery
const results = await client.searchRegistry("lead generation");
const rates = await client.getMarketRates();

// Usage
const usage = await client.getUsage(7);
const txns = await client.getTransactions(wallet.walletId);

How It Works

  1. Register at fretum.io to get an API key
  2. Fund your wallet by sending USDC to the wallet address on Base L2
  3. Use this SDK — your agent can now pay for any x402 API on the internet

Budget Controls

Set spending limits to keep agents in check:

const client = wallet.getClient();
await client.updateBudgets(wallet.getWalletId(), {
  maxPerCall: 0.25,   // Max $0.25 per API call
  dailyLimit: 10.00,  // Max $10/day total
});

Webhook Monitoring

Get real-time notifications of agent transactions via webhooks — configure at fretum.io/dashboard.

Events: transaction.signed, transaction.failed, budget.exceeded

License

MIT