import EventEmitter from 'eventemitter3'; import { EIP1193Provider, Transport, Chain, Account, WalletClient as WalletClient$1, Address } from 'viem'; import { Chain as Chain$1 } from 'viem/chains'; type InjectedProviderFlags = { isApexWallet?: true; isAvalanche?: true; isBackpack?: true; isBifrost?: true; isBitKeep?: true; isBitski?: true; isBlockWallet?: true; isBraveWallet?: true; isCoin98?: true; isCoinbaseWallet?: true; isDawn?: true; isDefiant?: true; isDesig?: true; isEnkrypt?: true; isExodus?: true; isFordefi?: true; isFrame?: true; isFrontier?: true; isGamestop?: true; isHaloWallet?: true; isHaqqWallet?: true; isHyperPay?: true; isImToken?: true; isKuCoinWallet?: true; isMathWallet?: true; isMetaMask?: true; isNovaWallet?: true; isOkxWallet?: true; isOKExWallet?: true; isOneInchAndroidWallet?: true; isOneInchIOSWallet?: true; isOpera?: true; isPhantom?: true; isPortal?: true; isRabby?: true; isRainbow?: true; isStatus?: true; isSubWallet?: true; isTalisman?: true; isTally?: true; isTokenPocket?: true; isTokenary?: true; isTrust?: true; isTrustWallet?: true; isTTWallet?: true; isXDEFI?: true; isZeal?: true; isZerion?: true; }; type InjectedProviders = InjectedProviderFlags & { isMetaMask: true; /** Only exists in MetaMask as of 2022/04/03 */ _events: { connect?: () => void; }; /** Only exists in MetaMask as of 2022/04/03 */ _state?: { accounts?: string[]; initialized?: boolean; isConnected?: boolean; isPermanentlyDisconnected?: boolean; isUnlocked?: boolean; }; }; interface WindowProvider extends InjectedProviders, EIP1193Provider { providers?: WindowProvider[]; } type WalletClient = WalletClient$1; type Storage = { getItem(key: string, defaultState?: T | null): T | null; setItem(key: string, value: T | null): void; removeItem(key: string): void; }; type ConnectorData = { account?: Address; chain?: { id: number; unsupported: boolean; }; }; interface ConnectorEvents { change(data: ConnectorData): void; connect(data: ConnectorData): void; message({ type, data }: { type: string; data?: unknown; }): void; disconnect(): void; error(error: Error): void; } declare abstract class Connector extends EventEmitter { /** Unique connector id */ abstract readonly id: string; /** Connector name */ abstract readonly name: string; /** Chains connector supports */ readonly chains: Chain$1[]; /** Options to use with connector */ readonly options: Options; /** Connector storage. */ protected storage?: Storage; /** Whether connector is usable */ abstract readonly ready: boolean; constructor({ chains, options, }: { chains?: Chain$1[]; options: Options; }); abstract connect(config?: { chainId?: number; }): Promise>; abstract disconnect(): Promise; abstract getAccount(): Promise
; abstract getChainId(): Promise; abstract getProvider(config?: { chainId?: number; }): Promise; abstract getWalletClient(config?: { chainId?: number; }): Promise; abstract isAuthorized(): Promise; switchChain?(chainId: number): Promise; watchAsset?(asset: { address: string; decimals?: number; image?: string; symbol: string; }): Promise; protected abstract onAccountsChanged(accounts: Address[]): void; protected abstract onChainChanged(chain: number | string): void; protected abstract onDisconnect(error: Error): void; protected getBlockExplorerUrls(chain: Chain$1): string[] | undefined; protected isChainUnsupported(chainId: number): boolean; setStorage(storage: Storage): void; } export { Connector as C, WindowProvider as W, ConnectorData as a, ConnectorEvents as b, WalletClient as c };