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

@te-btc/agent-wallet

v0.1.0

Published

Agent-native Cashu wallet — budget enforcement, proof storage, L402 auto-pay

Readme

@te-btc/agent-wallet

Agent-native Cashu wallet for Node.js/Bun. Purpose-built for AI agent micropayments — not a browser wallet.

What

A programmatic Cashu wallet designed for machine-to-machine payments. Handles proof-of-service token generation, budget enforcement, streaming micropayments, and conditional token workflows. Built on Coco for multi-mint state management with better-sqlite3 for high-velocity proof storage.

Status

v0.1.0 — Production-ready (169 tests passing, dual ESM/CJS build)

Quick Start

import { AgentWallet } from '@te-btc/agent-wallet';

const wallet = new AgentWallet({
  mintUrl: 'https://mint.arxmint.io',
  budget: { dailySats: 10000, perRequestSats: 500 },
  storage: 'sqlite', // or 'memory' for ephemeral agents
});

await wallet.fund(50000);                        // mint via LN invoice
await wallet.payL402(invoiceUrl);                 // atomic L402 payment
const receipt = await wallet.payForService(task); // PoS-locked conditional payment
wallet.exportAuditLog();                          // every sat accounted for

Key Features

| Feature | Description | |---------|-------------| | Proof pool management | Background consolidation/splitting to maintain exact-change capability for streaming micropayments | | Policy engine | Hold → settle → release lifecycle. Hard spend caps, capability allowlists, velocity circuit breakers | | Budget enforcement | Daily/per-request sat limits. Rejects operations exceeding limits before any network call | | Conditional tokens | PoS (proof-of-service), escrow (2-of-3 multisig), time-locked subscriptions — when connected to ArxMint mint | | Key isolation | Private keys never share memory with LLM. LN: Remote Signer (restricted Macaroon over LNC). Cashu: TEE/MPC for bearer proof protection | | Disaster recovery | NIP-60/NIP-61 encrypted proof backup to Nostr relays. Container crash → restore from Nostr | | Audit logging | Structured log of every satoshi in/out. Conditional vs. unconditional spend tracking | | Multi-mint ready | Coco handles per-mint proof isolation. Swap backend to @te-btc/multi-mint-router when scaling |

Architecture

src/
├── core/
│   ├── wallet.ts          # AgentWallet class — main entry point
│   ├── types.ts           # Config, budget, audit types
│   └── errors.ts          # Typed error hierarchy
├── storage/
│   ├── interface.ts       # IProofStore abstraction
│   ├── sqlite.ts          # better-sqlite3 implementation
│   └── memory.ts          # In-memory Map for ephemeral agents
├── policy/
│   ├── budget.ts          # Daily/per-request limit enforcement
│   ├── velocity.ts        # Circuit breaker for recursive spending loops
│   └── allowlist.ts       # Capability allowlists (which endpoints/mints)
├── proofs/
│   ├── pool.ts            # Proof pool manager — consolidation, splitting, denomination tracking
│   └── backup.ts          # NIP-60/NIP-61 Nostr relay backup/restore
├── conditions/
│   ├── pos.ts             # Proof-of-service token generation
│   ├── escrow.ts          # 2-of-3 multisig escrow participation
│   └── timelock.ts        # Time-locked subscription tokens
├── audit/
│   └── logger.ts          # Structured audit log (every sat in/out)
└── index.ts               # Public API

Dependencies

| Package | Role | |---------|------| | @cashu/coco | Multi-mint state management, proof lifecycle, NUT-13 derivation counters | | @cashu/cashu-ts | Core wallet crypto, BDHKE (via Coco) | | @noble/curves | Schnorr signing for P2PK/escrow witness generation | | @noble/hashes | SHA-256 for PoS output hashing | | better-sqlite3 | Synchronous SQLite — zero context-switching for micropayment streams |

Docs

| Document | Location | |----------|----------| | Full project spec | internal/docs/projects/agent-wallet.md | | Research #3 (Agent + L402) | internal/docs/BUILD_POSSIBILITIES/research/3-Agent Cashu L402 Integration Research.md | | Build Possibilities | internal/docs/BUILD_POSSIBILITIES/BUILD_POSSIBILITIES.md |

License

MIT