import { Address } from 'abitype'; import { providers } from 'ethers'; import { Chain } from '../types'; import { Connector } from './base'; export declare type InjectedConnectorOptions = { /** Name of connector */ name?: string | ((detectedName: string | string[]) => string); /** * MetaMask 10.9.3 emits disconnect event when chain is changed. * This flag prevents the `"disconnect"` event from being emitted upon switching chains. See [GitHub issue](https://github.com/MetaMask/metamask-extension/issues/13375#issuecomment-1027663334) for more info. */ shimChainChangedDisconnect?: boolean; /** * MetaMask and other injected providers do not support programmatic disconnect. * This flag simulates the disconnect behavior by keeping track of connection status in storage. See [GitHub issue](https://github.com/MetaMask/metamask-extension/issues/10353) for more info. * @default true */ shimDisconnect?: boolean; }; export declare class InjectedConnector extends Connector { #private; readonly id: string; readonly name: string; readonly ready: boolean; protected shimDisconnectKey: string; constructor({ chains, options: options_, }?: { chains?: Chain[]; options?: InjectedConnectorOptions; }); connect({ chainId }?: { chainId?: number; }): Promise<{ account: `0x${string}`; chain: { id: number; unsupported: boolean; }; provider: import("../types").Ethereum; }>; disconnect(): Promise; getAccount(): Promise<`0x${string}`>; getChainId(): Promise; getProvider(): Promise; getSigner({ chainId }?: { chainId?: number; }): Promise; isAuthorized(): Promise; switchChain(chainId: number): Promise; watchAsset({ address, decimals, image, symbol, }: { address: Address; decimals?: number; image?: string; symbol: string; }): Promise; protected onAccountsChanged: (accounts: string[]) => void; protected onChainChanged: (chainId: number | string) => void; protected onDisconnect: () => void; protected isUserRejectedRequestError(error: unknown): boolean; }