@usebutr/wallets
Batteries-included discovery source: autoDiscovery(), composed multi-platform discovery, combined chains.
Discovery
autoDiscovery(options?: DiscoverOptions): WalletSource
The headline export. Returns a WalletSource that composes EVM (EIP-6963 +
injected fallback), SVM / Sui / Bitcoin (Wallet Standard, plus an injected
fallback for Bitcoin), and Polkadot (injectedWeb3 + Wallet Standard fallback)
discovery. Pass it directly as the discovery prop on WalletManagerProvider:
import { WalletManagerProvider } from "@usebutr/react";
import { autoDiscovery } from "@usebutr/wallets";
// Hoist to module scope so the reference is stable.
const discovery = autoDiscovery();
export function App() {
return <WalletManagerProvider discovery={discovery}>{children}</WalletManagerProvider>;
}DiscoverOptions = { evm?; svm?; sui?; bitcoin?; polkadot?; injected?; injectedBitcoin?; polkadotWalletStandard? }. Omit options to enable
everything. Each fallback defaults to true whenever its primary platform is
enabled (injected follows evm, injectedBitcoin follows bitcoin,
polkadotWalletStandard follows polkadot).
Discovery primitives
discoverWalletAdapters(onAdapter, options?: DiscoverOptions): () => void
Composed multi-platform discovery. Calls onAdapter for each wallet found and
returns an unsubscribe function.
resolveDiscoverOptions(auto: true | DiscoverOptions)
Normalises an options value. true enables everything. Object form is opt-in:
unspecified flags default to false (so {} enables nothing); each fallback
flag defaults to true only when its primary platform is enabled. Returns
{ bitcoin, evm, injected, injectedBitcoin, polkadot, polkadotWalletStandard, sui, svm }.
KNOWN_DISCOVERERS
Registry of the built-in PlatformDiscoverers keyed by ChainPlatform
(bitcoin, evm, polkadot, sui, svm).
createDiscoveryBus(onAdapter): DiscoveryBus
Lower-level multiplexer. Types: DiscoveryBus, DiscoveryPath.
Chains
CHAINS:{ bitcoin: Record<…>, evm: Record<…>, polkadot: Record<…>, sui: Record<…>, svm: Record<…> }.CHAINS_BY_PLATFORM:Record<ChainPlatform, ChainBase[]>. Index withwallet.connector.chainPlatform.
Types
DiscoverOptions, DiscoveryBus, DiscoveryPath.
Source: packages/wallets/src/index.ts.