@pokt-network/pocket-js
Version:
Pocket-js core package with the main functionalities to interact with the Pocket Network.
75 lines (74 loc) • 3.48 kB
TypeScript
/**
*
*
* @class NodeParams
*/
export declare class NodeParams {
/**
*
* Creates a NodeParams object using a JSON string
* @param {String} json - JSON string.
* @returns {NodeParams} - NodeParams object.
* @memberof NodeParams
*/
static fromJSON(json: string): NodeParams;
readonly daoAllocation: BigInt;
readonly maxValidators: BigInt;
readonly proposerAllocation: BigInt;
readonly sessionBlockFrequency: BigInt;
readonly unstakingTime: BigInt;
readonly stakeDenom: string;
readonly stakeMinimum: BigInt;
readonly maxEvidenceAge: BigInt;
readonly signedBlocksWindow: BigInt;
readonly minSignedPerWindow: number;
readonly downtimeJailDuration: BigInt;
readonly slashFractionDoubleSign: number;
readonly slashFractionDowntime: number;
/**
* NodeParams.
* @constructor
* @param {BigInt} daoAllocation - Award percentage of the mint for the DAO.
* @param {BigInt} maxValidators - Maximum number of validators in the network at any given block.
* @param {BigInt} proposerAllocation - Award percentage of the mint for the proposer.
* @param {BigInt} sessionBlockFrequency - How many blocks are in a session.
* @param {BigInt} unstakingTime - How much time must pass between the begin_unstaking_tx and the node transitioning to unstaked status.
* @param {string} stakeDenom - The monetary denomination of the coins in the network `uPOKT`.
* @param {BigInt} stakeMinimum - Minimum amount of uPOKT needed to stake in the network as a node.
* @param {BigInt} maxEvidenceAge - Maximum age of tendermint evidence that is still valid (currently not implemented in Cosmos or Pocket-Core).
* @param {BigInt} signedBlocksWindow - Window of time in blocks (unit) used for signature verification -> specifically in not signing (missing) blocks.
* @param {number} minSignedPerWindow - Minimum number of blocks the node must sign per window.
* @param {BigInt} downtimeJailDuration - Minimum amount of time node must spend in jail after missing blocks.
* @param {number} slashFractionDoubleSign - The factor of which a node is slashed for a double sign.
* @param {number} slashFractionDowntime - The factor of which a node is slashed for a double sign.
*/
constructor(daoAllocation: BigInt, maxValidators: BigInt, proposerAllocation: BigInt, sessionBlockFrequency: BigInt, unstakingTime: BigInt, stakeDenom: string, stakeMinimum: BigInt, maxEvidenceAge: BigInt, signedBlocksWindow: BigInt, minSignedPerWindow: number, downtimeJailDuration: BigInt, slashFractionDoubleSign: number, slashFractionDowntime: number);
/**
*
* Creates a JSON object with the NodeParams properties
* @returns {JSON} - JSON Object.
* @memberof NodeParams
*/
toJSON(): {
dao_allocation: number;
max_validators: number;
proposer_allocation: number;
session_block_frequency: number;
downtime_jail_duration: number;
max_evidence_age: number;
min_signed_per_window: number;
signed_blocks_window: number;
slash_fraction_double_sign: number;
slash_fraction_downtime: number;
stake_denom: string;
stake_minimum: number;
unstaking_time: number;
};
/**
*
* Check if the NodeParams object is valid
* @returns {boolean} - True or false.
* @memberof NodeParams
*/
isValid(): boolean;
}