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

botwallets

v0.3.0

Published

Bitcoin ecash wallets for bots - simple Cashu wallet API for autonomous agents

Readme

botwallets

Bitcoin ecash wallets for bots. Simple Cashu wallet API for Telegram, Slack, CLI, and autonomous agents.

Install

npm install botwallets
npx botwallets init

Quick Start

Telegram Bot

import { createBot } from 'botwallets';
import { TelegramAdapter } from 'botwallets/telegram';

const bot = createBot({
  adapter: new TelegramAdapter({ token: process.env.BOT_TOKEN! }),
});

await bot.start();

Users get /balance, /send, /receive, /fund, /claim, and /history commands automatically.

Direct Wallet API

import { addWallet, destroyAll } from 'botwallets';

const alice = await addWallet({ walletId: 'alice' });
const bob   = await addWallet({ walletId: 'bob' });

const token = await alice.send(10, { sender: 'alice', receiver: 'bob' });
const received = await bob.receive(token, { sender: 'alice', receiver: 'bob' });
console.log('Bob received:', received, 'sats');

destroyAll();

CLI (for scripts and Lobster workflows)

npx botwallets cli balance                    # {"balance": 500}
npx botwallets cli send 100 --receiver alice  # {"amount": 100, "token": "cashuA..."}
npx botwallets cli receive <token>            # {"received": 100, "balance": 600}
npx botwallets cli mint 1000                  # {"quoteId": "...", "invoice": "lnbc..."}
npx botwallets cli pay <invoice>              # {"paid": true, "fee": 1}

Platform Adapters

Built-in support for Telegram and Slack. Add any platform by implementing the Adapter interface:

import { createBot } from 'botwallets';
import type { Adapter } from 'botwallets';

class MyAdapter implements Adapter {
  readonly platform = 'my-platform';
  register(handler) { /* wire events to handler */ }
  async start() { /* connect */ }
  async stop() { /* disconnect */ }
}

const bot = createBot({ adapter: new MyAdapter() });
await bot.start();

Generate starter code:

npx botwallets generate telegram
npx botwallets generate slack
npx botwallets generate custom
npx botwallets generate lobster

API

Top-level

| Function | Description | |---|---| | addWallet(config) | Create or open a wallet by ID | | createBot(config) | Create a bot with a platform adapter | | destroyAll() | Close all open wallets and DB connections |

BotWallet

| Method | Returns | Description | |---|---|---| | getBalance() | number | Current balance in sats | | send(amount, memo?) | Promise<string> | Send ecash, returns a token | | receive(token, memo?) | Promise<number> | Receive ecash, returns amount | | createMintInvoice(amount) | Promise<MintInvoice> | Lightning invoice to fund wallet | | checkMintQuote(quoteId) | Promise<number \| null> | Check if funding invoice was paid | | payInvoice(invoice, memo?) | Promise<MeltResult> | Pay a Lightning invoice | | getTransactions(options?) | Promise<TransactionRecord[]> | Query transaction history | | getInfo() | WalletInfo | Wallet metadata | | destroy() | void | Close this wallet |

Error Types

  • InsufficientBalanceError — balance too low for send/pay
  • MintConnectionError — can't reach the mint
  • InvalidTokenError — token is malformed or already spent

How It Works

botwallets uses Cashu ecash — bearer tokens backed by Bitcoin on the Lightning Network. Wallets hold ecash proofs locally in SQLite. Sending means giving a token; receiving means swapping it at the mint for fresh proofs.

Your Bot  →  botwallets  →  Cashu Mint  →  Lightning Network

The default test mint (testnut.cashu.space) uses fake sats for development. For production, connect to a mint you trust.

License

MIT