UNPKG

@pokt-network/pocket-js

Version:

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

57 lines (56 loc) 1.92 kB
import { StakingStatus } from "./staking-status"; /** * * * @class Node */ export declare class Node { static fromJSON(json: string): Node; readonly address: string; readonly publicKey: string; readonly outputAddress: string; readonly jailed: boolean; readonly status: StakingStatus; readonly stakedTokens: BigInt; readonly serviceURL: URL; readonly chains: string[]; readonly unstakingCompletionTimestamp: string | undefined; alreadyInConsensus: boolean; /** * Creates a Node. * @constructor * @param {string} address - Node address hex. * @param {string} publicKey - Node public key hex. * @param {string} outputAddress - Output address hex. * @param {boolean} jailed - True or false if the validator been jailed. * @param {StakingStatus} status - Validator staking status * @param {BigInt} stakedTokens - How many tokens are staked * @param {URL} serviceURL - Service node URL * @param {string[]} chains - A list of blockchain hash * @param {string} unstakingCompletionTimestamp - If unstaking, the minimum time for the validator to complete unstaking */ constructor(address: string, publicKey: string, outputAddress: string, jailed: boolean, status: StakingStatus, stakedTokens: BigInt, serviceURL: string, chains?: string[], unstakingCompletionTimestamp?: string); /** * * Creates a JSON object with the Node properties * @returns {JSON} - JSON Object. * @memberof Node */ toJSON(): { address: string; chains: string[]; public_key: string; jailed: boolean; service_url: URL; status: string; tokens: number; unstaking_time: string | undefined; }; /** * * Verify if all properties are valid * @returns {boolean} - True or false. * @memberof Node */ isValid(): boolean; }