import { BigNumber } from 'bignumber.js'; import { JsonRpcResponse } from '../JsonRpcResponse.dto'; import { AbstractRpcInterface } from './AbstractJsonRpcInterface'; /** * EVM based RPC calls. */ export type BlockNumber = 'latest' | 'earliest' | 'pending' | 'safe' | 'finalized' | string | BigNumber | number; export interface TraceOptions { tracer: 'callTracer' | 'prestateTracer' | 'rawTracer' | 'vmTracer' | string; tracerConfig: { onlyTopCall: boolean; timeout: string; }; } export interface TxPayload { to?: string; from?: string; gas?: string; gasPrice?: string; value?: string; data?: string; } export type TraceType = 'vmTrace' | 'stateDiff' | 'trace'; export interface LogFilter { fromBlock?: string; toBlock?: string; address?: string; topics?: string[]; blockHash?: string; } export interface EvmBasedRpcSuite extends EvmBasedRpcInterface, AbstractRpcInterface { } export interface EvmBasedRpcInterface { blockNumber(): Promise>; call(callObject: TxPayload, blockNumber?: BlockNumber): Promise>; chainId(): Promise>; estimateGas(callObject: TxPayload): Promise>; gasPrice(): Promise>; maxPriorityFeePerGas(): Promise>; getBalance(address: string, blockNumber?: BlockNumber): Promise>; getBlockByHash(blockHash: string, includeTransactions?: boolean): Promise>; getBlockTransactionCountByHash(blockHash: string): Promise>; getBlockByNumber(blockNumber: string | number, includeTransactions?: boolean): Promise>; getBlockTransactionCountByNumber(blockNumber: string | number): Promise>; getCode(address: string, blockNumber?: BlockNumber): Promise>; getLogs(filterObject: LogFilter): Promise>; getProof(address: string, storageKeys: string[], blockNumber?: BlockNumber): Promise>; getStorageAt(address: string, position: string, blockNumber?: BlockNumber): Promise>; getTransactionByBlockHashAndIndex(blockHash: string, index: number): Promise>; getTransactionByBlockNumberAndIndex(blockNumber: string | number, index: number): Promise>; getTransactionByHash(txHash: string): Promise>; getTransactionCount(address: string, blockNumber?: BlockNumber): Promise>; getTransactionReceipt(txHash: string): Promise>; getUncleByBlockHashAndIndex(blockHash: string, index: number): Promise>; getUncleByBlockNumberAndIndex(blockNumber: string | number, index: number): Promise>; getUncleCountByBlockHash(blockHash: string): Promise>; getUncleCountByBlockNumber(blockNumber: string | number): Promise>; protocolVersion(): Promise>; sendRawTransaction(signedTransactionData: string): Promise>; syncing(): Promise>; getTokenDecimals(tokenAddress: string): Promise>; getContractAddress(txHash: string): Promise; clientVersion(): Promise>; sha3(data: string): Promise>; debugGetBadBlocks(): Promise>; debugStorageRangeAt(blockHash: string, txIndex: number, contractAddress: string, startKey: string, maxResult: string): Promise>; debugTraceCall(callObject: TxPayload, blockNumber: BlockNumber, traceOptions?: TraceOptions): Promise>; debugTraceTransaction(txHash: string, traceOptions?: TraceOptions): Promise>; debugTraceBlockByHash(blockHash: string, traceOptions?: TraceOptions): Promise>; debugTraceBlockByNumber(blockHash: string | number, traceOptions?: TraceOptions): Promise>; traceBlock(blockNumber: BlockNumber): Promise>; traceCall(callObject: TxPayload, traceType: TraceType[], blockNumber: BlockNumber): Promise>; traceCallMany(callObject: TxPayload[], traceType: TraceType[][], blockNumber: BlockNumber): Promise>; traceRawTransaction(signedTransactionData: string, traceOptions: TraceType[]): Promise>; traceReplayBlockTransactions(blockNumber: BlockNumber, traceOptions: TraceType[]): Promise>; traceReplayTransaction(txHash: string, traceOptions: TraceType[]): Promise>; traceTransaction(txHash: string): Promise>; txPoolContent(): Promise>; txPoolStatus(): Promise>; txPoolInspect(): Promise>; }