Record Class ConfidentialTransferAccount

java.lang.Object
java.lang.Record
software.sava.core.accounts.token.extensions.ConfidentialTransferAccount
All Implemented Interfaces:
AccountTokenExtension, TokenExtension, Serializable

public record ConfidentialTransferAccount(boolean approved, PublicKey elgamalPubkey, byte[] pendingBalanceLo, byte[] pendingBalanceHi, byte[] availableBalance, byte[] decryptableAvailableBalance, boolean allowConfidentialCredits, boolean allowNonConfidentialCredits, long pendingBalanceCreditCounter, long maximumPendingBalanceCreditCounter, long expectedPendingBalanceCreditCounter, long actualPendingBalanceCreditCounter) extends Record implements AccountTokenExtension
  • Field Details

    • MAXIMUM_DEPOSIT_TRANSFER_AMOUNT

      public static final long MAXIMUM_DEPOSIT_TRANSFER_AMOUNT
      See Also:
    • PENDING_BALANCE_LO_BIT_LENGTH

      public static final int PENDING_BALANCE_LO_BIT_LENGTH
      See Also:
    • DEFAULT_MAXIMUM_PENDING_BALANCE_CREDIT_COUNTER

      public static final int DEFAULT_MAXIMUM_PENDING_BALANCE_CREDIT_COUNTER
      See Also:
    • BYTES

      public static final int BYTES
      See Also:
  • Constructor Details

    • ConfidentialTransferAccount

      public ConfidentialTransferAccount(boolean approved, PublicKey elgamalPubkey, byte[] pendingBalanceLo, byte[] pendingBalanceHi, byte[] availableBalance, byte[] decryptableAvailableBalance, boolean allowConfidentialCredits, boolean allowNonConfidentialCredits, long pendingBalanceCreditCounter, long maximumPendingBalanceCreditCounter, long expectedPendingBalanceCreditCounter, long actualPendingBalanceCreditCounter)
      Creates an instance of a ConfidentialTransferAccount record class.
      Parameters:
      approved - the value for the approved record component
      elgamalPubkey - the value for the elgamalPubkey record component
      pendingBalanceLo - the value for the pendingBalanceLo record component
      pendingBalanceHi - the value for the pendingBalanceHi record component
      availableBalance - the value for the availableBalance record component
      decryptableAvailableBalance - the value for the decryptableAvailableBalance record component
      allowConfidentialCredits - the value for the allowConfidentialCredits record component
      allowNonConfidentialCredits - the value for the allowNonConfidentialCredits record component
      pendingBalanceCreditCounter - the value for the pendingBalanceCreditCounter record component
      maximumPendingBalanceCreditCounter - the value for the maximumPendingBalanceCreditCounter record component
      expectedPendingBalanceCreditCounter - the value for the expectedPendingBalanceCreditCounter record component
      actualPendingBalanceCreditCounter - the value for the actualPendingBalanceCreditCounter record component
  • Method Details

    • read

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

      public ExtensionType extensionType()
      Specified by:
      extensionType in interface TokenExtension
    • write

      public int write(byte[] data, int offset)
      Specified by:
      write in interface Serializable
    • l

      public int l()
      Specified by:
      l in interface Serializable
    • 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.
    • approved

      public boolean approved()
      Returns the value of the approved record component.
      Returns:
      the value of the approved record component
    • elgamalPubkey

      public PublicKey elgamalPubkey()
      Returns the value of the elgamalPubkey record component.
      Returns:
      the value of the elgamalPubkey record component
    • pendingBalanceLo

      public byte[] pendingBalanceLo()
      Returns the value of the pendingBalanceLo record component.
      Returns:
      the value of the pendingBalanceLo record component
    • pendingBalanceHi

      public byte[] pendingBalanceHi()
      Returns the value of the pendingBalanceHi record component.
      Returns:
      the value of the pendingBalanceHi record component
    • availableBalance

      public byte[] availableBalance()
      Returns the value of the availableBalance record component.
      Returns:
      the value of the availableBalance record component
    • decryptableAvailableBalance

      public byte[] decryptableAvailableBalance()
      Returns the value of the decryptableAvailableBalance record component.
      Returns:
      the value of the decryptableAvailableBalance record component
    • allowConfidentialCredits

      public boolean allowConfidentialCredits()
      Returns the value of the allowConfidentialCredits record component.
      Returns:
      the value of the allowConfidentialCredits record component
    • allowNonConfidentialCredits

      public boolean allowNonConfidentialCredits()
      Returns the value of the allowNonConfidentialCredits record component.
      Returns:
      the value of the allowNonConfidentialCredits record component
    • pendingBalanceCreditCounter

      public long pendingBalanceCreditCounter()
      Returns the value of the pendingBalanceCreditCounter record component.
      Returns:
      the value of the pendingBalanceCreditCounter record component
    • maximumPendingBalanceCreditCounter

      public long maximumPendingBalanceCreditCounter()
      Returns the value of the maximumPendingBalanceCreditCounter record component.
      Returns:
      the value of the maximumPendingBalanceCreditCounter record component
    • expectedPendingBalanceCreditCounter

      public long expectedPendingBalanceCreditCounter()
      Returns the value of the expectedPendingBalanceCreditCounter record component.
      Returns:
      the value of the expectedPendingBalanceCreditCounter record component
    • actualPendingBalanceCreditCounter

      public long actualPendingBalanceCreditCounter()
      Returns the value of the actualPendingBalanceCreditCounter record component.
      Returns:
      the value of the actualPendingBalanceCreditCounter record component