import type { Address, WalletClient } from 'viem'; import { BaseConnector } from './base.js'; import { ConnectorType, type EIP6963ConnectorOptions, type EIP6963ProviderDetail } from './types.js'; /** * EIP6963 连接器 * 支持通过 EIP6963 标准自动发现的钱包 */ export declare class EIP6963Connector extends BaseConnector { readonly id: string; readonly name: string; readonly type = ConnectorType.EIP6963; readonly icon?: string; private provider; private providerDetail; constructor(options: EIP6963ConnectorOptions); /** * 检查连接器是否准备就绪 */ get ready(): boolean; /** * 连接钱包 */ connect(chainId?: number): Promise<{ address: Address; addresses?: Address[]; chainId: number; }>; /** * 断开连接 */ disconnect(): Promise; /** * 获取当前账户 */ getAccount(): Promise
; /** * 获取所有账户 */ getAccounts(): Promise; /** * 切换账户(注:大多数钱包不支持程序化切换,这里只是更新本地状态) */ switchAccount(address: Address): Promise; /** * 获取当前链ID */ getChainId(): Promise; /** * 获取 WalletClient 实例 */ getWalletClient(config?: { chainId?: number; }): Promise; /** * 切换链 */ switchChain(chainId: number): Promise; /** * 检查是否已授权 */ isAuthorized(): Promise; /** * 设置事件监听 */ private eventListenersSetup; private isSwitchingChain; private setupEventListeners; /** * 获取元数据 */ getMetadata(): { rdns: string; uuid: string; id: string; name: string; type: ConnectorType; icon?: string; downloadUrl?: string; }; } /** * 监听 EIP6963 钱包发现事件 */ export declare function watchEIP6963Wallets(callback: (wallets: EIP6963ProviderDetail[]) => void): () => void;