/// import { ChainInfo, EthSignType, Keplr, Keplr as IKeplr, KeplrIntereactionOptions, KeplrMode, KeplrSignOptions, Key, BroadcastMode, AminoSignResponse, StdSignDoc, OfflineAminoSigner, StdSignature, StdTx, DirectSignResponse, OfflineDirectSigner, ICNSAdr36Signatures, ChainInfoWithoutEndpoints, SecretUtils, SettledResponses, DirectAuxSignResponse, IEthereumProvider, EIP6963ProviderInfo, IStarknetProvider, SupportedPaymentType, IBitcoinProvider, Network as BitcoinNetwork, BitcoinSignMessageType, ChainType as BitcoinChainType, SignPsbtOptions, Inscription } from "@keplr-wallet/types"; import { Result } from "@keplr-wallet/router"; import Long from "long"; import { KeplrCoreTypes } from "./core-types"; import EventEmitter from "events"; import type { Call, DeployAccountSignerDetails, InvocationsSignerDetails } from "starknet"; export interface ProxyRequest { type: string; id: string; method: keyof (Keplr & KeplrCoreTypes); args: any[]; ethereumProviderMethod?: keyof IEthereumProvider; starknetProviderMethod?: keyof IStarknetProvider; bitcoinProviderMethod?: keyof IBitcoinProvider; } export interface ProxyRequestResponse { type: "proxy-request-response"; id: string; result: Result | undefined; } export declare function injectKeplrToWindow(keplr: IKeplr): void; /** * InjectedKeplr would be injected to the webpage. * In the webpage, it can't request any messages to the extension because it doesn't have any API related to the extension. * So, to request some methods of the extension, this will proxy the request to the content script that is injected to webpage on the extension level. * This will use `window.postMessage` to interact with the content script. */ export declare class InjectedKeplr implements IKeplr, KeplrCoreTypes { protected readonly metaId: string | undefined; readonly version: string; readonly mode: KeplrMode; protected readonly onStarknetStateChange: (state: { selectedAddress: string | null; chainId: string | null; rpc: string | null; }) => void; protected readonly onStarknetAccountChange: (state: { selectedAddress: string | null; }) => void; protected readonly eventListener: { addMessageListener: (fn: (e: any) => void) => void; removeMessageListener: (fn: (e: any) => void) => void; postMessage: (message: any) => void; }; protected readonly parseMessage: ((message: any) => any) | undefined; protected readonly eip6963ProviderInfo: EIP6963ProviderInfo | undefined; protected readonly starknetProviderInfo: { id: string; name: string; icon: string; }; static startProxy(keplr: IKeplr & KeplrCoreTypes, metaId: string | undefined, eventListener?: { addMessageListener: (fn: (e: any) => void) => void; removeMessageListener: (fn: (e: any) => void) => void; postMessage: (message: any) => void; }, parseMessage?: (message: any) => any): () => void; protected requestMethod(method: keyof (IKeplr & KeplrCoreTypes), args: any[]): Promise; protected enigmaUtils: Map; defaultOptions: KeplrIntereactionOptions; constructor(metaId: string | undefined, version: string, mode: KeplrMode, onStarknetStateChange: (state: { selectedAddress: string | null; chainId: string | null; rpc: string | null; }) => void, onStarknetAccountChange: (state: { selectedAddress: string | null; }) => void, eventListener: { addMessageListener: (fn: (e: any) => void) => void; removeMessageListener: (fn: (e: any) => void) => void; postMessage: (message: any) => void; }, parseMessage: ((message: any) => any) | undefined, eip6963ProviderInfo: EIP6963ProviderInfo | undefined, starknetProviderInfo: { id: string; name: string; icon: string; }); ping(): Promise; enable(chainIds: string | string[]): Promise; disable(chainIds?: string | string[]): Promise; experimentalSuggestChain(chainInfo: ChainInfo): Promise; getKey(chainId: string): Promise; getKeysSettled(chainIds: string[]): Promise>; sendTx(chainId: string, tx: StdTx | Uint8Array, mode: BroadcastMode): Promise; signAmino(chainId: string, signer: string, signDoc: StdSignDoc, signOptions?: KeplrSignOptions): Promise; signDirect(chainId: string, signer: string, signDoc: { bodyBytes?: Uint8Array | null; authInfoBytes?: Uint8Array | null; chainId?: string | null; accountNumber?: Long | null; }, signOptions?: KeplrSignOptions): Promise; signDirectAux(chainId: string, signer: string, signDoc: { bodyBytes?: Uint8Array | null; publicKey?: { typeUrl: string; value: Uint8Array; } | null; chainId?: string | null; accountNumber?: Long | null; sequence?: Long | null; }, signOptions?: Exclude): Promise; signArbitrary(chainId: string, signer: string, data: string | Uint8Array): Promise; signICNSAdr36(chainId: string, contractAddress: string, owner: string, username: string, addressChainIds: string[]): Promise; verifyArbitrary(chainId: string, signer: string, data: string | Uint8Array, signature: StdSignature): Promise; signFigureMarketsAuth(chainId: string, signer: string, message: string): Promise<{ signedMessage: string; signature: StdSignature; }>; signDirectWithMessages(chainId: string, signer: string, messages: string[], signDirectWithMessagesOptions: { memo?: string; sync?: boolean; timeoutHeight?: number; gasAdjustment?: number; }): Promise<{ txHash: string; }>; signEthereum(chainId: string, signer: string, data: string | Uint8Array, type: EthSignType): Promise; getOfflineSigner(chainId: string, signOptions?: KeplrSignOptions): OfflineAminoSigner & OfflineDirectSigner; getOfflineSignerOnlyAmino(chainId: string, signOptions?: KeplrSignOptions): OfflineAminoSigner; getOfflineSignerAuto(chainId: string, signOptions?: KeplrSignOptions): Promise; suggestToken(chainId: string, contractAddress: string, viewingKey?: string): Promise; getSecret20ViewingKey(chainId: string, contractAddress: string): Promise; getEnigmaPubKey(chainId: string): Promise; getEnigmaTxEncryptionKey(chainId: string, nonce: Uint8Array): Promise; enigmaEncrypt(chainId: string, contractCodeHash: string, msg: object): Promise; enigmaDecrypt(chainId: string, ciphertext: Uint8Array, nonce: Uint8Array): Promise; getEnigmaUtils(chainId: string): SecretUtils; experimentalSignEIP712CosmosTx_v0(chainId: string, signer: string, eip712: { types: Record; domain: Record; primaryType: string; }, signDoc: StdSignDoc, signOptions?: KeplrSignOptions): Promise; getChainInfosWithoutEndpoints(): Promise; getChainInfoWithoutEndpoints(chainId: string): Promise; __core__getAnalyticsId(): Promise; changeKeyRingName({ defaultName, editable, }: { defaultName: string; editable?: boolean; }): Promise; getAllWallets(): Promise<{ id: string; name: string; isSelected: boolean; addresses: { [chainId: string]: string; }; }[]>; switchAccount(id: string): Promise; __core__privilageSignAminoWithdrawRewards(chainId: string, signer: string, signDoc: StdSignDoc): Promise; __core__privilageSignAminoDelegate(chainId: string, signer: string, signDoc: StdSignDoc): Promise; __core__privilageSignAminoExecuteCosmWasm(chainId: string, signer: string, signDoc: StdSignDoc): Promise; sendEthereumTx(chainId: string, tx: Uint8Array): Promise; suggestERC20(chainId: string, contractAddress: string): Promise; __core__webpageClosed(): Promise; getStarknetKey(chainId: string): Promise<{ name: string; hexAddress: string; pubKey: Uint8Array; address: Uint8Array; isNanoLedger: boolean; }>; getStarknetKeysSettled(chainIds: string[]): Promise>; signStarknetTx(chainId: string, transactions: Call[], details: InvocationsSignerDetails): Promise<{ transactions: Call[]; details: InvocationsSignerDetails; signature: string[]; }>; signStarknetDeployAccountTransaction(chainId: string, transaction: DeployAccountSignerDetails): Promise<{ transaction: DeployAccountSignerDetails; signature: string[]; }>; generateStarknetProvider(): IStarknetProvider; getBitcoinKey(chainId: string): Promise<{ name: string; pubKey: Uint8Array; address: string; paymentType: SupportedPaymentType; isNanoLedger: boolean; }>; getBitcoinKeysSettled(chainIds: string[]): Promise>; signPsbt(chainId: string, psbtHex: string, options?: SignPsbtOptions): Promise; signPsbts(chainId: string, psbtsHexes: string[], options?: SignPsbtOptions): Promise; readonly ethereum: EthereumProvider; readonly starknet: IStarknetProvider; readonly bitcoin: BitcoinProvider; } declare class EthereumProvider extends EventEmitter implements IEthereumProvider { protected readonly metaId: string | undefined; protected readonly injectedKeplr: () => InjectedKeplr; protected readonly eventListener: { addMessageListener: (fn: (e: any) => void) => void; removeMessageListener: (fn: (e: any) => void) => void; postMessage: (message: any) => void; }; protected readonly parseMessage?: ((message: any) => any) | undefined; protected readonly eip6963ProviderInfo?: EIP6963ProviderInfo | undefined; chainId: string | null; networkVersion: string | null; selectedAddress: string | null; isKeplr: boolean; isMetaMask: boolean; protected _isConnected: boolean; protected _currentChainId: string | null; constructor(metaId: string | undefined, injectedKeplr: () => InjectedKeplr, eventListener?: { addMessageListener: (fn: (e: any) => void) => void; removeMessageListener: (fn: (e: any) => void) => void; postMessage: (message: any) => void; }, parseMessage?: ((message: any) => any) | undefined, eip6963ProviderInfo?: EIP6963ProviderInfo | undefined); protected _requestMethod: (method: keyof IEthereumProvider, args: Record) => Promise; protected _initProviderState: () => Promise; protected _handleConnect: (evmChainId: number) => Promise; protected _handleDisconnect: () => Promise; protected _handleChainChanged: (evmChainId: number) => Promise; protected _handleAccountsChanged: (selectedAddress: string | null) => Promise; isConnected(): boolean; request: ({ method, params, chainId, }: { method: string; params?: readonly unknown[] | Record | undefined; chainId?: string | undefined; }) => Promise; enable: () => Promise; net_version: () => Promise; } export declare class BitcoinProvider extends EventEmitter implements IBitcoinProvider { protected readonly _injectedKeplr: () => InjectedKeplr; protected readonly _eventListener: { addMessageListener: (fn: (e: any) => void) => void; removeMessageListener: (fn: (e: any) => void) => void; postMessage: (message: any) => void; }; protected readonly _parseMessage?: ((message: any) => any) | undefined; constructor(_injectedKeplr: () => InjectedKeplr, _eventListener?: { addMessageListener: (fn: (e: any) => void) => void; removeMessageListener: (fn: (e: any) => void) => void; postMessage: (message: any) => void; }, _parseMessage?: ((message: any) => any) | undefined); protected _requestMethod(method: keyof IBitcoinProvider, args: Record): Promise; getAccounts(): Promise; requestAccounts(): Promise; disconnect(): Promise; getNetwork(): Promise; switchNetwork(network: BitcoinNetwork): Promise; getChain(): Promise<{ enum: BitcoinChainType; name: string; network: BitcoinNetwork; }>; switchChain(chain: BitcoinChainType): Promise; getPublicKey(): Promise; getBalance(): Promise<{ confirmed: number; unconfirmed: number; total: number; }>; getInscriptions(offset?: number, limit?: number): Promise<{ total: number; list: Inscription[]; }>; signMessage(message: string, type?: BitcoinSignMessageType): Promise; sendBitcoin(to: string, amount: number): Promise; pushTx(rawTxHex: string): Promise; pushPsbt(psbtHex: string): Promise; signPsbt(psbtHex: string, options?: SignPsbtOptions): Promise; signPsbts(psbtsHexes: string[], options?: SignPsbtOptions): Promise; getAddress(): Promise; connectWallet(): Promise; protected _handleNetworkChanged: (network: BitcoinNetwork) => Promise; protected _handleAccountsChanged: (accounts: string[] | null) => Promise; } export {};