import type { WalletInterface } from '@bsv/sdk';
export interface WalletProviderConfig {
    /** Unique identifier for this provider */
    type: string;
    /** Display name for UI */
    name: string;
    /** Icon URL or data URI */
    icon?: string;
    /** CWI iframe bridge URL — any host that implements CWI over postMessage */
    url?: string;
    /** Custom connect function — overrides url-based iframe bridge */
    connect?: () => Promise<ConnectWalletResult>;
}
export interface ConnectWalletConfig {
    /** Include WalletClient('auto') in the race (default: true).
     *  Detects any BRC-100 wallet: browser extensions (window.CWI),
     *  desktop wallets (localhost), XDM, React Native. */
    autoDetect?: boolean;
    /** Wallet providers to race alongside auto-detect. */
    providers?: WalletProviderConfig[];
}
export interface ConnectWalletResult {
    wallet: WalletInterface;
    /** Which provider connected (e.g. 'brc100' for auto-detect, or the provider's type) */
    provider: string;
    identityKey: string;
    disconnect: () => void;
}
export interface AvailableProvider extends WalletProviderConfig {
    connect: () => Promise<ConnectWalletResult>;
}
/** @deprecated Use ConnectWalletConfig instead */
export type ConnectWalletOptions = ConnectWalletConfig;
export declare function loadLastProvider(): string | null;
/**
 * Get available wallet providers with connect functions.
 * Sorts by last successful provider for faster reconnects.
 */
export declare function getAvailableProviders(config?: ConnectWalletConfig): AvailableProvider[];
/**
 * Connect to a BRC-100 wallet by racing all options in parallel.
 *
 * Auto-detect and all configured providers start simultaneously via
 * Promise.any(). First to authenticate wins. The winning provider
 * type is saved to localStorage for warm reconnects.
 *
 * If the last successful provider is known, it's attempted first
 * before falling back to the full race.
 *
 * Returns null when the race completes with no successful connection
 * (no wallet installed, configured providers can't auto-connect).
 * Callers should treat null as "show the provider picker." Genuine
 * misuse — e.g. autoDetect disabled with no providers — still throws.
 */
export declare function connectWallet(config?: ConnectWalletConfig): Promise<ConnectWalletResult | null>;
//# sourceMappingURL=connectWallet.d.ts.map