butr
Connectors

Overview

Every connector plugs in through the same createConnector seam — discovered, or registered explicitly.

A connector is a WalletAdapter. They reach butr two ways, both through WalletManagerProvider:

  • Discovered — browser wallets announce themselves. @usebutr/evm listens for EIP-6963; @usebutr/svm, @usebutr/sui, and @usebutr/bitcoin listen for the Wallet Standard (@usebutr/bitcoin also tries injected fallbacks like window.unisat and sats-connect). @usebutr/wallets composes all of them via autoDiscovery(). You don't register these by hand.
  • Registered explicitly — WalletConnect and Ledger aren't browser-injected. You build the adapter once and return it from createConnector. Both now ship per-platform builders for EVM, SVM, Sui, and Bitcoin.
ConnectorPackagePlatformsDiscoveryNotes
Injected EVM@usebutr/evmevmEIP-6963 + injected fallbackMetaMask, Rabby, Brave, …
Solana Wallet Standard@usebutr/svmsvmWallet StandardPhantom, Solflare, Backpack, …
Sui Wallet Standard@usebutr/suisuiWallet StandardSlush, Phantom Sui, Suiet, Surf, …
Bitcoin Wallet Standard@usebutr/bitcoinbitcoinWallet Standard + injected fallbackPhantom, Magic Eden, Leather, Unisat, Xverse, …
Polkadot injectedWeb3@usebutr/polkadotpolkadotinjectedWeb3 + Wallet StandardPolkadot.js, Talisman, SubWallet, …
WalletConnect@usebutr/walletconnectevm svm sui bitcoinexplicitMobile wallets; needs a Reown project id
Ledger@usebutr/ledgerevm svm sui bitcoinexplicitWebUSB, Chromium-only, signing-only

Registering an explicit connector follows the same shape every time. Build the adapter at module scope (it's async), then wire it through the unified provider:

import { WalletManagerProvider } from "@usebutr/react";
import { autoDiscovery } from "@usebutr/wallets";
import { createWalletConnectAdapters } from "@usebutr/walletconnect";

const discovery = autoDiscovery();
const [wc] = await createWalletConnectAdapters({
  projectId,
  namespaces: { evm: ["eip155:1"] },
  onPairingUri,
});
const extra = new Map([[wc.id, wc]]);

<WalletManagerProvider
  discovery={discovery}
  connectors={[{ id: wc.id, name: wc.name, chainPlatform: wc.chainPlatform }]}
  createConnector={(id) => extra.get(id) ?? null}
>
  {children}
</WalletManagerProvider>;

When both discovery and createConnector are present, an id is resolved from discovered adapters first, then createConnector.