UNPKG

@pokt-network/pocket-js

Version:

Pocket-js core package with the main functionalities to interact with the Pocket Network.

88 lines (87 loc) 2.97 kB
import { BlockID } from "./block-id"; /** * * * @class BlockHeader */ export declare class BlockHeader { /** * * Creates a BlockHeader object using a JSON string * @param {String} json - JSON string. * @returns {BlockHeader} - BlockHeader object. * @memberof BlockHeader */ static fromJSON(json: string): BlockHeader; readonly chainID: string; readonly height: BigInt; readonly time: string; readonly numTXs: BigInt; readonly totalTxs: BigInt; readonly lastBlockID: BlockID; readonly lastCommitHash: string; readonly dataHash: string; readonly validatorsHash: string; readonly nextValidatorsHash: string; readonly consensusHash: string; readonly appHash: string; readonly lastResultsHash: string; readonly evidenceHash: string; readonly proposerAddress: string; /** * BlockHeader. * @constructor * @param {string} chainID - Blockchain ID. * @param {BigInt} height - Block Height. * @param {string} time - Date time. * @param {BigInt} numTXs - Number of transactions in the block. * @param {BigInt} totalTxs - Total transaction count. * @param {BlockID} lastBlockID - Last block Id. * @param {string} lastCommitHash - Last commit hash. * @param {string} dataHash - Data hash. * @param {string} validatorsHash - Validators hash. * @param {string} nextValidatorsHash - Next validators hash. * @param {string} consensusHash - Consensus hash. * @param {string} appHash - App hash. * @param {string} lastResultsHash - Last Results hash. * @param {string} evidenceHash - Evidence hash. * @param {string} proposerAddress - Proposer Address. */ constructor(chainID: string, height: BigInt, time: string, numTXs: BigInt, totalTxs: BigInt, lastBlockID: BlockID, lastCommitHash: string, dataHash: string, validatorsHash: string, nextValidatorsHash: string, consensusHash: string, appHash: string, lastResultsHash: string, evidenceHash: string, proposerAddress: string); /** * * Creates a JSON object with the BlockHeader properties * @returns {JSON} - JSON Object. * @memberof BlockHeader */ toJSON(): { app_hash: string; chain_id: string; consensus_hash: string; data_hash: string; evidence_hash: string; height: number; last_block_id: { hash: string; parts: { hash: string; total: number; }; }; last_commit_hash: string; last_results_hash: string; next_validators_hash: string; num_txs: number; proposer_address: string; time: string; total_txs: number; validators_hash: string; }; /** * * Check if the BlockHeader object is valid * @returns {boolean} - True or false. * @memberof BlockHeader */ isValid(): boolean; }