butr
API reference

@usebutr/wallets

autoDiscovery(): one wallet source for every platform, and the composed discovery behind it.

autoDiscovery(platforms?, options?): WalletSource

The one-call source for WalletManagerConfig.sources. It composes EVM (EIP-6963 plus the window.ethereum fallback), Solana and Sui (Wallet Standard), Bitcoin (Wallet Standard plus the injected fallbacks) and Polkadot (injectedWeb3 plus the Wallet Standard fallback), deduplicated by adapter id.

import type { WalletManagerConfig } from "@usebutr/core";
import { WalletManagerProvider } from "@usebutr/react";
import { autoDiscovery } from "@usebutr/wallets";

const config: WalletManagerConfig = { sources: [autoDiscovery()] };

export const Providers = ({ children }: { children: React.ReactNode }) => (
  <WalletManagerProvider config={config}>{children}</WalletManagerProvider>
);
ArgumentTypeDefault
platformsReadonlyArray<ChainPlatform>Every platform. autoDiscovery(["evm", "svm"]) discovers only those; an empty list warns and finds nothing.
options.fallbacksbooleantrue. false skips each platform's secondary channel: window.ethereum, the injected Bitcoin wallets, and Polkadot's Wallet Standard path.
autoDiscovery(undefined, { fallbacks: false }); // every platform, standards only

A single-platform app can pass that package's discover*Adapters export instead and keep the other platforms out of its bundle.

discoverWalletAdapters(onAdapter, options?): () => void

The composed discovery autoDiscovery wraps: calls onAdapter once per adapter id and returns the unsubscribe. DiscoverOptions is { fallbacks?: boolean; platforms?: ReadonlyArray<ChainPlatform> }.

Importing the package loads every platform package, so WalletSigner carries their signer kinds (eip1193, wallet-standard, unisat, sats-connect, polkadot-injected) even in an app that imports nothing else. Chain registries (CHAINS_BY_PLATFORM, EVM_CHAINS, …) live in @usebutr/core.

Types

DiscoverOptions.

Source: packages/wallets/src/index.ts.