Record Class StakeAccount

java.lang.Object
java.lang.Record
software.sava.solana.programs.stake.StakeAccount

public record StakeAccount(software.sava.core.accounts.PublicKey address, StakeState state, long rentExemptReserve, software.sava.core.accounts.PublicKey stakeAuthority, software.sava.core.accounts.PublicKey withdrawAuthority, LockUp lockup, software.sava.core.accounts.PublicKey voterPublicKey, long stake, long activationEpoch, long deActivationEpoch, double warmupCoolDownRate, long creditsObserved, byte stakeFlags) extends Record
  • Field Details

    • BYTES

      public static final int BYTES
      See Also:
    • DATA_SIZE_FILTER

      public static final software.sava.core.rpc.Filter DATA_SIZE_FILTER
    • STATE_OFFSET

      public static final int STATE_OFFSET
      See Also:
    • RENT_EXEMPT_RESERVE_OFFSET

      public static final int RENT_EXEMPT_RESERVE_OFFSET
      See Also:
    • STAKE_AUTHORITY_OFFSET

      public static final int STAKE_AUTHORITY_OFFSET
      See Also:
    • WITHDRAW_AUTHORITY_OFFSET

      public static final int WITHDRAW_AUTHORITY_OFFSET
      See Also:
    • LOCKUP_OFFSET

      public static final int LOCKUP_OFFSET
      See Also:
    • LOCKUP_TIMESTAMP_OFFSET

      public static final int LOCKUP_TIMESTAMP_OFFSET
      See Also:
    • LOCKUP_EPOCH_OFFSET

      public static final int LOCKUP_EPOCH_OFFSET
      See Also:
    • LOCKUP_CUSTODIAN_OFFSET

      public static final int LOCKUP_CUSTODIAN_OFFSET
      See Also:
    • VOTER_PUBLIC_KEY_OFFSET

      public static final int VOTER_PUBLIC_KEY_OFFSET
      See Also:
    • STAKE_OFFSET

      public static final int STAKE_OFFSET
      See Also:
    • ACTIVATION_EPOCH_OFFSET

      public static final int ACTIVATION_EPOCH_OFFSET
      See Also:
    • DE_ACTIVATION_EPOCH_OFFSET

      public static final int DE_ACTIVATION_EPOCH_OFFSET
      See Also:
    • WARMUP_COOLDOWN_RATE_OFFSET

      public static final int WARMUP_COOLDOWN_RATE_OFFSET
      See Also:
    • CREDITS_OBSERVED_OFFSET

      public static final int CREDITS_OBSERVED_OFFSET
      See Also:
    • STAKE_FLAGS_OFFSET

      public static final int STAKE_FLAGS_OFFSET
      See Also:
    • MUST_FULLY_ACTIVATE_BEFORE_DEACTIVATION_IS_PERMITTED

      public static final int MUST_FULLY_ACTIVATE_BEFORE_DEACTIVATION_IS_PERMITTED
      See Also:
    • FACTORY

      public static final BiFunction<software.sava.core.accounts.PublicKey,byte[],StakeAccount> FACTORY
  • Constructor Details

    • StakeAccount

      public StakeAccount(software.sava.core.accounts.PublicKey address, StakeState state, long rentExemptReserve, software.sava.core.accounts.PublicKey stakeAuthority, software.sava.core.accounts.PublicKey withdrawAuthority, LockUp lockup, software.sava.core.accounts.PublicKey voterPublicKey, long stake, long activationEpoch, long deActivationEpoch, double warmupCoolDownRate, long creditsObserved, byte stakeFlags)
      Creates an instance of a StakeAccount record class.
      Parameters:
      address - the value for the address record component
      state - the value for the state record component
      rentExemptReserve - the value for the rentExemptReserve record component
      stakeAuthority - the value for the stakeAuthority record component
      withdrawAuthority - the value for the withdrawAuthority record component
      lockup - the value for the lockup record component
      voterPublicKey - the value for the voterPublicKey record component
      stake - the value for the stake record component
      activationEpoch - the value for the activationEpoch record component
      deActivationEpoch - the value for the deActivationEpoch record component
      warmupCoolDownRate - the value for the warmupCoolDownRate record component
      creditsObserved - the value for the creditsObserved record component
      stakeFlags - the value for the stakeFlags record component
  • Method Details

    • state

      public StakeAccount.State state(long currentEpoch)
    • createStateFilter

      public static software.sava.core.rpc.Filter createStateFilter(StakeState state)
    • createStakeAuthorityFilter

      public static software.sava.core.rpc.Filter createStakeAuthorityFilter(software.sava.core.accounts.PublicKey stakeAuthority)
    • createWithdrawAuthorityFilter

      public static software.sava.core.rpc.Filter createWithdrawAuthorityFilter(software.sava.core.accounts.PublicKey stakeAuthority)
    • createCustodianFilter

      public static software.sava.core.rpc.Filter createCustodianFilter(software.sava.core.accounts.PublicKey custodian)
    • createVoterFilter

      public static software.sava.core.rpc.Filter createVoterFilter(software.sava.core.accounts.PublicKey voterPublicKey)
    • isSet

      public boolean isSet(int mask)
    • read

      public static StakeAccount read(byte[] data, int offset)
    • read

      public static StakeAccount read(software.sava.core.accounts.PublicKey address, byte[] data)
    • read

      public static StakeAccount read(software.sava.core.accounts.PublicKey address, byte[] data, int offset)
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • address

      public software.sava.core.accounts.PublicKey address()
      Returns the value of the address record component.
      Returns:
      the value of the address record component
    • state

      public StakeState state()
      Returns the value of the state record component.
      Returns:
      the value of the state record component
    • rentExemptReserve

      public long rentExemptReserve()
      Returns the value of the rentExemptReserve record component.
      Returns:
      the value of the rentExemptReserve record component
    • stakeAuthority

      public software.sava.core.accounts.PublicKey stakeAuthority()
      Returns the value of the stakeAuthority record component.
      Returns:
      the value of the stakeAuthority record component
    • withdrawAuthority

      public software.sava.core.accounts.PublicKey withdrawAuthority()
      Returns the value of the withdrawAuthority record component.
      Returns:
      the value of the withdrawAuthority record component
    • lockup

      public LockUp lockup()
      Returns the value of the lockup record component.
      Returns:
      the value of the lockup record component
    • voterPublicKey

      public software.sava.core.accounts.PublicKey voterPublicKey()
      Returns the value of the voterPublicKey record component.
      Returns:
      the value of the voterPublicKey record component
    • stake

      public long stake()
      Returns the value of the stake record component.
      Returns:
      the value of the stake record component
    • activationEpoch

      public long activationEpoch()
      Returns the value of the activationEpoch record component.
      Returns:
      the value of the activationEpoch record component
    • deActivationEpoch

      public long deActivationEpoch()
      Returns the value of the deActivationEpoch record component.
      Returns:
      the value of the deActivationEpoch record component
    • warmupCoolDownRate

      public double warmupCoolDownRate()
      Returns the value of the warmupCoolDownRate record component.
      Returns:
      the value of the warmupCoolDownRate record component
    • creditsObserved

      public long creditsObserved()
      Returns the value of the creditsObserved record component.
      Returns:
      the value of the creditsObserved record component
    • stakeFlags

      public byte stakeFlags()
      Returns the value of the stakeFlags record component.
      Returns:
      the value of the stakeFlags record component