import { BlockWithFullTransactions, BlockWithTransactionHashes, TransactionReceipt } from '@ethercast/model'; import BigNumber from 'bignumber.js'; import EthClient, { BlockParameter, LogFilter, SendTransactionParameters } from './eth-client'; import { Method } from './json-rpc-methods'; import { MethodParameter } from './util'; import WebSocket from 'isomorphic-ws'; /** * This client interacts with the JSON RPC via a WebSocket connection */ export default class EthWebSocketClient implements EthClient { static Connect(nodeUrl: string, timeoutMs?: number): Promise; private readonly ws; private nextRequestId; constructor({ ws }: { ws: WebSocket; }); 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; net_version(): Promise; eth_getTransactionReceipt(hash: string): Promise; eth_getTransactionReceipts(hashes: string[]): Promise; eth_sendTransaction(params: SendTransactionParameters): Promise; cmd(method: Method, ...params: MethodParameter[]): Promise; }