UNPKG

@pokt-network/pocket-js

Version:

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

100 lines (99 loc) 3.01 kB
import { Node } from "./node"; import { RelayResponse } from "./output"; /** * * * @class ConsensusNode */ export declare class ConsensusNode { /** * * Creates a ConsensusNode object using a JSON string * @param {String} json - JSON string. * @returns {ConsensusNode} - ConsensusNode object. * @memberof ConsensusNode */ static fromJSON(json: string): ConsensusNode; readonly node: Node; status: boolean; readonly relayResponse: RelayResponse; /** * Consensus node. * @constructor * @param {Node} node - Signature. * @param {boolean} status - True if the response is accepted or false if not. * @param {RelayResponse} relayResponse - Relay Response. */ constructor(node: Node, status: boolean, relayResponse: RelayResponse); /** * * Creates a JSON object with the ConsensusNode properties * @returns {JSON} - JSON Object. * @memberof ConsensusNode */ toJSON(): { node: { address: string; chains: string[]; public_key: string; jailed: boolean; service_url: URL; status: string; tokens: number; unstaking_time: string | undefined; }; status: boolean; relay_response: { response: { payload: string; signature: string; proof: { entropy: number; session_block_height: number; servicer_pub_key: string; blockchain: string; aat: { version: string; app_pub_key: string; client_pub_key: string; signature: string; }; signature: string; request_hash: string; }; }; request: { payload: { data: string; method: string; path: string; headers: Record<string, string> | null | undefined; }; meta: { block_height: number; }; proof: { entropy: number; session_block_height: number; servicer_pub_key: string; blockchain: string; aat: { version: string; app_pub_key: string; client_pub_key: string; signature: string; }; signature: string; request_hash: string; }; }; }; }; /** * * Check if the ConsensusNode object is valid * @returns {boolean} - True or false. * @memberof ConsensusNode */ isValid(): boolean; }