import { ethers, BigNumber, Wallet } from 'ethers'; import { SocketParams } from '../Logger'; interface TransactionParams { from?: string; to: string; gas?: string; gasPrice?: string; value?: string; data: string; nonce?: string; type?: number; maxFeePerGas?: string; maxPriorityFeePerGas?: string; } /** * Wraps the `ether` wallet / signer abstraction so it's compatible with the wallet middleware of * `eth-json-rpc-middleware`. */ declare class WalletWrapper { chainId: number; defaultGasPrice: number; defaultGasLimit: number; estimateGasLimit: boolean; estimateGasPrice: boolean; ethGasPriceFactor: boolean; forceEIP155: boolean; forceType2Txs: boolean; gasPriceFactor: number; gasLimitFactor: number; interleaveBlocks: number; lastKnownBlock: number; provider: ethers.providers.JsonRpcProvider; wallets: Wallet[]; constructor(interleave_blocks: number, gas_price: number, gas_limit: number, estimate_gas_limit: boolean, estimate_gas_price: boolean, gas_price_factor: number, gas_limit_factor: number, force_eip_155: boolean, force_eip_1559: boolean, eth_gas_price_factor: boolean); /** * Populate essential transaction parameters, self-estimating gas price and/or gas limit if required. * @param socket Socket parms where the RPC call is coming from. * @param params Input params, to be validated and completed, if necessary. * @returns */ composeTransaction(socket: SocketParams, params: TransactionParams): Promise; /** * Check for possible rollbacks on the EVM side. * @param socket Socket parms where the RPC call is coming from * @returns Last known block number. */ checkRollbacks(socket: SocketParams): Promise; /** * Gets addresses of all managed wallets. */ getAccounts(): Promise; /** * Get block by number. Bypass eventual exceptions. */ getBlockByNumber(socket: SocketParams, params: string): Promise; /** * Calculates suitable gas price depending on tx params, and gateway settings. * * @param params Transaction params * @returns Estimated gas price, as BigNumber */ getGasPrice(): Promise; /** * Calculates suitable gas limit depending on tx params, and gateway settings. * * @param params Transaction params * @returns Estimated gas limit, as BigNumber */ getGasLimit(tx: ethers.providers.TransactionRequest): Promise; getNetwork(): Promise; /** * Get wallet of the given's address, if managed */ getWalletByAddress(address: string): Promise; /** * Gets eth filter changes. Only EthBlockFilters are currently supported. */ mockEthFilterChanges(socket: SocketParams, id: string): Promise; processEthEstimateGas(socket: SocketParams, params: TransactionParams): Promise; processEthGasPrice(_socket: SocketParams, _params: TransactionParams): Promise; /** * Surrogates call to provider, after estimating/setting gas, if necessary. */ processEthCall(socket: SocketParams, params: TransactionParams): Promise; /** * Signs a message using the wallet's private key. * * @remark Return type is made `any` here because the result needs to be a String, not a `Record`. */ processEthSignMessage(address: string, message: string, socket: SocketParams): Promise; /** * Signs transaction using wallet's private key, before forwarding to provider. * * @remark Return type is made `any` here because the result needs to be a String, not a `Record`. */ processTransaction(socket: SocketParams, params: TransactionParams): Promise; } export { WalletWrapper }; //# sourceMappingURL=wrapper.d.ts.map