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/evmlistens for EIP-6963;@usebutr/svm,@usebutr/sui, and@usebutr/bitcoinlisten for the Wallet Standard (@usebutr/bitcoinalso tries injected fallbacks likewindow.unisatandsats-connect).@usebutr/walletscomposes all of them viaautoDiscovery(). 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.
| Connector | Package | Platforms | Discovery | Notes |
|---|---|---|---|---|
| Injected EVM | @usebutr/evm | evm | EIP-6963 + injected fallback | MetaMask, Rabby, Brave, … |
| Solana Wallet Standard | @usebutr/svm | svm | Wallet Standard | Phantom, Solflare, Backpack, … |
| Sui Wallet Standard | @usebutr/sui | sui | Wallet Standard | Slush, Phantom Sui, Suiet, Surf, … |
| Bitcoin Wallet Standard | @usebutr/bitcoin | bitcoin | Wallet Standard + injected fallback | Phantom, Magic Eden, Leather, Unisat, Xverse, … |
| Polkadot injectedWeb3 | @usebutr/polkadot | polkadot | injectedWeb3 + Wallet Standard | Polkadot.js, Talisman, SubWallet, … |
| WalletConnect | @usebutr/walletconnect | evm svm sui bitcoin | explicit | Mobile wallets; needs a Reown project id |
| Ledger | @usebutr/ledger | evm svm sui bitcoin | explicit | WebUSB, 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.