UNPKG

@keplr-ewallet/ewallet-sdk-eth

Version:
34 lines (33 loc) 2.04 kB
import type { Address, AddEthereumChainParameter as Chain } from "viem"; import type { EthSigner } from "../types"; import type { RpcMethod, RpcError, RpcRequestArgs, RpcResponseData, PublicRpcMethod, WalletRpcMethod } from "../rpc"; import type { EIP1193Provider, EWalletEIP1193ProviderOptions, ProviderConnectInfo, ChainWithStatus } from "../provider"; import { ProviderEventEmitter } from "../provider"; export declare class EWalletEIP1193Provider extends ProviderEventEmitter implements EIP1193Provider { protected isInitialized: boolean; protected signer: EthSigner | undefined; protected activeChain: Chain; protected addedChains: ChainWithStatus[]; private lastConnectedEmittedEvent; readonly isEWallet: true; readonly version: string; readonly name: string; ready: Promise<void> | null; constructor(options: EWalletEIP1193ProviderOptions); get chainId(): string; get isConnected(): boolean; request<M extends RpcMethod>(args: RpcRequestArgs<M>): Promise<RpcResponseData<M>>; protected handleRequest<M extends RpcMethod>(args: RpcRequestArgs<M>): Promise<RpcResponseData<M>>; protected handlePublicRpcRequest<M extends PublicRpcMethod>(args: RpcRequestArgs<M>): Promise<RpcResponseData<M>>; protected handleWalletRpcRequest<M extends WalletRpcMethod>(args: RpcRequestArgs<M>): Promise<RpcResponseData<M>>; private _validateActiveChain; private _getAuthenticatedSigner; private _manageChain; protected _init(options: EWalletEIP1193ProviderOptions): Promise<void>; protected validateRequestArgs<M extends RpcMethod>(args: RpcRequestArgs<M>): void; protected _handleConnected(connected: boolean, data: ProviderConnectInfo | RpcError): void; protected isConnectionError(error: any): boolean; protected _handleChainChanged(chainId: string): void; protected _handleAccountsChanged(newAddress: Address[]): void; } export declare function initEWalletEIP1193Provider(options: EWalletEIP1193ProviderOptions): Promise<EWalletEIP1193Provider>;