import { BlockWithFullTransactions, BlockWithTransactionHashes, Log, TransactionReceipt } from '@ethercast/model'; import BigNumber from 'bignumber.js'; import { Method } from './json-rpc-methods'; import { MethodParameter, MethodParameterObject } from './util'; export declare type NumberLike = string | number | BigNumber; export declare type BlockParameter = NumberLike | 'earliest' | 'latest' | 'pending'; export interface LogFilter extends MethodParameterObject { topics?: Array; fromBlock: BlockParameter; toBlock: BlockParameter; address?: string; } export interface SendTransactionParameters extends MethodParameterObject { from: string; to?: string; gas?: NumberLike; gasPrice?: NumberLike; value?: NumberLike; data?: string; nonce?: NumberLike; } /** * This is the interface exposed by all the implementations of the clients */ export default interface EthClient { net_version(): Promise; web3_clientVersion(): Promise; eth_getBlockByHash(hash: string, includeFullTransactions: false): Promise; eth_getBlockByHash(hash: string, includeFullTransactions: true): Promise; eth_getBlockByNumber(blockNumber: BlockParameter, includeFullTransactions: false): Promise; eth_getBlockByNumber(blockNumber: BlockParameter, includeFullTransactions: true): Promise; eth_blockNumber(): Promise; eth_getLogs(filter: LogFilter): Promise; eth_getTransactionReceipt(hash: string): Promise; eth_getTransactionReceipts(hashes: string[]): Promise; eth_sendTransaction(params: SendTransactionParameters): Promise; cmd(method: Method, ...params: MethodParameter[]): Promise; }