import RPCClient from "../rpcclient"; import Namespace from "./namespace"; /** * Read the state of the Ellcrys blockchain * on a client. * * @export * @class State */ export default class State extends Namespace { /** * Creates an instance of State. * * @param {RPCClient} client * @memberof State */ constructor(client: RPCClient); /** * Get a block by number * * @param {number} num The block number/height * @returns {Promise} * @memberof State */ getBlock(num: number): Promise; /** * Get a block by block Hash * * @param {string} blockHash The hash of the block. * @returns {Promise} * @memberof State */ getBlockByHash(blockHash: string): Promise; /** * Get the current difficulty and total difficulty * of the network. * * @returns * @memberof State */ getDifficulty(): Promise; /** * Get all the account on the network * * @returns {Promise} * @memberof State */ listAccounts(): Promise; /** * Get a list of re-organization events * that have occurred from the node's * perspective * * @returns {Promise} * @memberof State */ getReOrgs(): Promise; /** * Get a list of top accounts on the network. * * @param {number} limit The maximum number of top accounts to return * @returns {Promise} * @memberof State */ listTopAccounts(limit: number): Promise; /** * Get a specific account on the network * * @param {string} address The address of the accounts * @returns {Promise} * @memberof State */ getAccount(address: string): Promise; /** * Get the nonce of a given address * * @param {string} address The address whose nonce will be fetched * @returns {Promise} * @memberof State */ getAccountNonce(address: string): Promise; /** * Get a transaction by its hash * * @param {string} txHash The transaction's hash * @returns {Promise} * @memberof State */ getTransaction(txHash: string): Promise; /** * Get all the known branches on the node * * @returns {Promise} * @memberof State */ getBranches(): Promise; /** * Get orphan blocks on the node * * @returns {Promise} * @memberof State */ getOrphans(): Promise; /** * Get the best chain on the node * * @returns {Promise} * @memberof State */ getBestChain(): Promise; /** * Returns raw db objects (Debug only) * * @param {JSON} filter Filter parameters * @returns {Promise} * @memberof State */ getObjects(filter: JSON): Promise; }