java.lang.Object
com.hedera.hashgraph.sdk.StakingInfo
Staking metadata for an account or a contract returned in CryptoGetInfo or ContractGetInfo queries
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal booleanIf true, the contract declines receiving a staking reward.final HbarThe amount in Hbar that will be received in the next reward situation.final AccountIdThe account to which this account or contract is staking.final LongThe ID of the node this account or contract is staked to.final HbarThe total of balance of all accounts staked to this account or contract.final InstantThe 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. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StakingInfofromBytes(byte[] bytes) Convert a byte array to a staking info object.(package private) static StakingInfofromProtobuf(StakingInfo info) byte[]toBytes()Convert the staking info object to a byte array.(package private) StakingInfotoString()
-
Field Details
-
declineStakingReward
public final boolean declineStakingRewardIf true, the contract declines receiving a staking reward. The default value is false. -
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
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.
-
-
Constructor Details
-
StakingInfo
public StakingInfo(boolean declineStakingReward, Instant stakePeriodStart, Hbar pendingReward, Hbar stakedToMe, @Nullable AccountId stakedAccountId, @Nullable Long stakedNodeId) Constructor- Parameters:
declineStakingReward- the declineStakingRewardstakePeriodStart- the stakePeriodStartpendingReward- the amount in Hbar that will be received in the next reward situationstakedToMe- the total of balance of all accounts staked to this account or contractstakedAccountId- the account to which this account or contract is stakingstakedNodeId- the ID of the node this account or contract is staked to
-
-
Method Details
-
fromProtobuf
-
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
-