import { Transaction } from '../../transactions/index' import { Query } from './query'; import { RPCRequest } from './rpc' import { AxiosRequestConfig } from 'axios' import { Fixed8 } from '../../utils'; export class RPCClient { constructor(net: string, version?: string) net: string history: Query[] latency: number lastSeenHeight: number /**Returns the latency gotten by sending a bestBlockHeight request. */ ping(): Promise /** Takes an Query object and executes it. Adds the Query object to history. */ execute(query: Query, config: AxiosRequestConfig): Promise /** Creates a query with the given req and immediately executes it. */ query(req: RPCRequest, config: AxiosRequestConfig): Promise /** Gets the state of an account given an address. */ getAccountState(addr: string): Promise /** Gets the state of an asset given an id. */ getAssetState(assetId: string): Promise /** Gets the block hash at a given height. */ getBlock(indexOrHash: string | number, verbose?: number): Promise /** Gets the block hash at a given height. */ getBlockHash(index: number): Promise /** Get the latest block hash. */ getBestBlockHash(): Promise /** Get the current block height. */ getBlockCount(): Promise /** Get the system fees of a block. */ getBlockSysFee(index: number): Promise /** Gets the number of peers this node is connected to. */ getConnectionCount(): Promise /** Gets the state of the contract at the given scriptHash. */ getContractState(scriptHash: string): Promise /** Gets a list of all peers that this node has discovered. */ getPeers(): Promise /** Gets a list of all transaction hashes waiting to be processed. */ getRawMemPool(): Promise /** Gets a transaction based on its hash. */ getRawTransaction(txid: string, verbose?: number): Promise /** Gets the corresponding value of a key in the storage of a contract address. */ getStorage(scriptHash: string, key: string): Promise /** Gets the transaction output given a transaction id and index */ getTxOut(txid: string, index: number): Promise /** Gets the version of the MODULE node. This method will never be blocked by version. This method will also update the current Client's version to the one received. */ getVersion(): Promise /** Calls a smart contract with the given parameters. This method is a local invoke, results are not reflected on the blockchain. */ invoke(scriptHash: string, params: Array): Promise /** Submits a contract method call with parameters for the node to run. This method is a local invoke, results are not reflected on the blockchain. */ invokeFunction(scriptHash: string, operation: string, params: Array): Promise /** Submits a script for the node to run. This method is a local invoke, results are not reflected on the blockchain. */ invokeScript(script: string): Promise /** Sends a serialized transaction to the network. */ sendRawTransaction(transaction: Transaction | string): Promise /** Submits a serialized block to the network. */ submitBlock(block: string): Promise /** Checks if the provided address is a valid MODULE address. */ validateAddress(addr: string): Promise /** Get available reward balance from MODULE node. */ getRewardBalance(fcHashs: string[]): Promise }