Class StakingInfo

java.lang.Object
com.hedera.hashgraph.sdk.StakingInfo

public class StakingInfo extends Object
Staking metadata for an account or a contract returned in CryptoGetInfo or ContractGetInfo queries
  • Field Details

    • declineStakingReward

      public final boolean declineStakingReward
      If true, the contract declines receiving a staking reward. The default value is false.
    • stakePeriodStart

      public final Instant stakePeriodStart
      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.
    • pendingReward

      public final Hbar pendingReward
      The amount in Hbar that will be received in the next reward situation.
    • stakedToMe

      public final Hbar stakedToMe
      The total of balance of all accounts staked to this account or contract.
    • stakedAccountId

      @Nullable public final AccountId stakedAccountId
      The account to which this account or contract is staking.
    • stakedNodeId

      @Nullable public final Long stakedNodeId
      The ID of the node this account or contract is staked to.
  • Constructor Details

    • StakingInfo

      public StakingInfo(boolean declineStakingReward, Instant stakePeriodStart, Hbar pendingReward, Hbar stakedToMe, @Nullable AccountId stakedAccountId, @Nullable Long stakedNodeId)
      Constructor
      Parameters:
      declineStakingReward - the declineStakingReward
      stakePeriodStart - the stakePeriodStart
      pendingReward - the amount in Hbar that will be received in the next reward situation
      stakedToMe - the total of balance of all accounts staked to this account or contract
      stakedAccountId - the account to which this account or contract is staking
      stakedNodeId - the ID of the node this account or contract is staked to
  • Method Details

    • fromProtobuf

      static StakingInfo fromProtobuf(StakingInfo info)
    • fromBytes

      public static StakingInfo fromBytes(byte[] bytes) throws com.google.protobuf.InvalidProtocolBufferException
      Convert a byte array to a staking info object.
      Parameters:
      bytes - the byte array
      Returns:
      the converted staking info object
      Throws:
      com.google.protobuf.InvalidProtocolBufferException - when there is an issue with the protobuf
    • toProtobuf

      StakingInfo toProtobuf()
    • toBytes

      public byte[] toBytes()
      Convert the staking info object to a byte array.
      Returns:
      the converted staking info object
    • toString

      public String toString()
      Overrides:
      toString in class Object