import { default as EventEmitter } from 'eventemitter3'; import { Signer } from 'ethers/lib/ethers'; import { Chain } from '../types'; export declare type ConnectorData = { account?: string; chain?: { id: number; unsupported: boolean; }; provider?: Provider; }; export interface ConnectorEvents { change(data: ConnectorData): void; connect(data: ConnectorData): void; message({ type, data }: { type: string; data?: unknown; }): void; disconnect(): void; error(error: Error): void; } export 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[]; /** Options to use with connector */ readonly options: Options; /** Whether connector is usable */ abstract readonly ready: boolean; constructor({ chains, options, }: { chains?: Chain[]; options: Options; }); abstract connect(): Promise>; abstract disconnect(): Promise; abstract getAccount(): Promise; abstract getChainId(): Promise; abstract getProvider(create?: boolean): Promise; abstract getSigner(): Promise; abstract isAuthorized(): Promise; switchChain?(chainId: number): Promise; watchAsset?(asset: { address: string; image?: string; symbol: string; }): Promise; protected abstract onAccountsChanged(accounts: string[]): void; protected abstract onChainChanged(chain: number | string): void; protected abstract onDisconnect(error: Error): void; protected getBlockExplorerUrls(chain: Chain): any[]; protected isChainUnsupported(chainId: number): boolean; }