UNPKG

@hashgraph/sdk

Version:
110 lines (109 loc) 3.14 kB
/** * @typedef {import("long")} Long */ /** * @typedef {object} StakingInfoJson * @property {boolean} declineStakingReward * @property {?string} stakePeriodStart * @property {?string} pendingReward * @property {?string} stakedToMe * @property {?string} stakedAccountId * @property {?string} stakedNodeId */ /** * Staking metadata for an account or a contract returned in CryptoGetInfo or ContractGetInfo queries */ export default class StakingInfo { /** * @internal * @param {HieroProto.proto.IStakingInfo} info * @returns {StakingInfo} */ static _fromProtobuf(info: HieroProto.proto.IStakingInfo): StakingInfo; /** * @param {Uint8Array} bytes * @returns {StakingInfo} */ static fromBytes(bytes: Uint8Array): StakingInfo; /** * @private * @param {object} props * @param {boolean} props.declineStakingReward * @param {?Timestamp} props.stakePeriodStart * @param {?Hbar} props.pendingReward * @param {?Hbar} props.stakedToMe * @param {?AccountId} props.stakedAccountId * @param {?Long} props.stakedNodeId */ private constructor(); /** * If true, this account or contract declined to receive a staking reward. * * @readonly */ readonly declineStakingReward: boolean; /** * The staking period during which either the staking settings for this * account or contract changed (such as starting staking or changing * staked_node_id) or the most recent reward was earned, whichever is * later. If this account or contract is not currently staked to a * node, then this field is not set. * * @readonly */ readonly stakePeriodStart: Timestamp | null; /** * The amount in tinybars that will be received in the next reward * situation. * * @readonly */ readonly pendingReward: Hbar | null; /** * The total of balance of all accounts staked to this account or contract. * * @readonly */ readonly stakedToMe: Hbar | null; /** * The account to which this account or contract is staking. * * @readonly */ readonly stakedAccountId: AccountId | null; /** * The ID of the node this account or contract is staked to. * * @readonly */ readonly stakedNodeId: import("long") | null; /** * @returns {HieroProto.proto.IStakingInfo} */ _toProtobuf(): HieroProto.proto.IStakingInfo; /** * @returns {Uint8Array} */ toBytes(): Uint8Array; /** * @returns {string} */ toString(): string; /** * @returns {StakingInfoJson} */ toJSON(): StakingInfoJson; } export type Long = import("long"); export type StakingInfoJson = { declineStakingReward: boolean; stakePeriodStart: string | null; pendingReward: string | null; stakedToMe: string | null; stakedAccountId: string | null; stakedNodeId: string | null; }; import Timestamp from "./Timestamp.js"; import Hbar from "./Hbar.js"; import AccountId from "./account/AccountId.js"; import * as HieroProto from "@hashgraph/proto";