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

@usebutr/bitcoin

v3.0.0

Published

Wallet Standard + injected (sats-connect / Unisat / OKX) wallet discovery and adapters for butr (Bitcoin).

Readme

@usebutr/bitcoin

Wallet Standard + injected (sats-connect / Unisat / OKX) wallet discovery and adapters for butr (Bitcoin).

Part of butr, a multi-chain wallet discovery and connection-state library. Your application owns the picker UI and chain client.

Install

npm install @usebutr/react @usebutr/core @usebutr/bitcoin zustand @wallet-standard/app

React 19 is a peer dependency of the provider. Discovery does not render a connect modal; add your picker as the provider child. @wallet-standard/app is required for Wallet Standard discovery.

Usage

import type { ReactNode } from "react";
import type { WalletManagerConfig } from "@usebutr/core";
import { discoverBitcoinAdapters } from "@usebutr/bitcoin";
import { WalletManagerProvider } from "@usebutr/react";

const config: WalletManagerConfig = { sources: [discoverBitcoinAdapters] };

export const WalletProvider = ({ children }: { children: ReactNode }) => (
  <WalletManagerProvider config={config}>{children}</WalletManagerProvider>
);

discoverInjectedBitcoinAdapter covers wallets that never announce through Wallet Standard (window.unisat, window.okxwallet.bitcoin, Xverse's sats-connect provider) and discoverLegacyBitcoinAdapter covers window.btc. autoDiscovery(["bitcoin"]) from @usebutr/wallets pairs them with Wallet Standard and lists each wallet once.

Transactions

A method exists only when the wallet can back it, so check before calling:

import { BITCOIN_CHAINS } from "@usebutr/core";

if (wallet.connector.sendTx) {
  const txid = await wallet.connector.sendTx(
    { amount: 10_000n, recipient: "tb1q…" }, // satoshis
    { account: wallet.account, chain: BITCOIN_CHAINS.testnet },
  );
}
  • sendTx(transfer, { account?, chain? }) asks the wallet to build, sign and broadcast a transfer and resolves the txid.
  • signTransaction(psbt, { account?, chain? }) signs PSBT bytes (psbt.toBuffer()) without broadcasting them.
  • signMessage(message, { account? }) signs the message bytes. Injected wallets take text, so bytes that are not valid UTF-8 reject before the wallet is asked. @usebutr/bitcoin/message exports that conversion, bitcoinMessageText(message, wallet), which WalletConnect shares.

Wallet Standard wallets route chain per call and gain switchChain when they advertise more than one Bitcoin network. Injected wallets have one network for the whole wallet: they switch it before acting (Unisat through switchNetwork, Xverse through wallet_changeNetwork), or reject with a ChainMismatch ConnectionError when the provider cannot switch (OKX, window.btc). Unisat-style wallets sign with their active account only, and Xverse sends from its payment address only; any other account rejects.

Balances and receipts need an Esplora or Electrum client, which butr does not ship, so these adapters define neither.

Signers

getSigner() resolves the object the adapter drives, tagged by transport:

const signer = await wallet.connector.getSigner();
switch (signer.kind) {
  case "wallet-standard": // signer.wallet
  case "unisat": // signer.provider, the UniSat-style provider
  case "sats-connect": // signer.provider, Xverse's BitcoinProvider
}

Documentation

License

MIT, copyright 2026 Pedro Filho.