Record Class TokenAccount

java.lang.Object
java.lang.Record
software.sava.core.accounts.token.TokenAccount
All Implemented Interfaces:
Borsh, Serializable

public record TokenAccount(PublicKey address, PublicKey mint, PublicKey owner, long amount, int delegateOption, PublicKey delegate, AccountState state, int isNativeOption, long isNative, long delegatedAmount, int closeAuthorityOption, PublicKey closeAuthority) extends Record implements Borsh
  • Field Details

  • Constructor Details

    • TokenAccount

      public TokenAccount(PublicKey address, PublicKey mint, PublicKey owner, long amount, int delegateOption, PublicKey delegate, AccountState state, int isNativeOption, long isNative, long delegatedAmount, int closeAuthorityOption, PublicKey closeAuthority)
      Creates an instance of a TokenAccount record class.
      Parameters:
      address - the value for the address record component
      mint - the value for the mint record component
      owner - the value for the owner record component
      amount - the value for the amount record component
      delegateOption - the value for the delegateOption record component
      delegate - the value for the delegate record component
      state - the value for the state record component
      isNativeOption - the value for the isNativeOption record component
      isNative - the value for the isNative record component
      delegatedAmount - the value for the delegatedAmount record component
      closeAuthorityOption - the value for the closeAuthorityOption record component
      closeAuthority - the value for the closeAuthority record component
  • Method Details

    • createMintFilter

      public static Filter createMintFilter(PublicKey mint)
    • createOwnerFilter

      public static Filter createOwnerFilter(PublicKey owner)
    • createDelegateFilter

      public static Filter createDelegateFilter(PublicKey delegate)
    • createCloseAuthorityFilter

      public static Filter createCloseAuthorityFilter(PublicKey closeAuthority)
    • read

      public static TokenAccount read(PublicKey publicKey, byte[] data)
    • read

      public static TokenAccount read(PublicKey publicKey, byte[] data, int offset)
    • 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.
    • address

      public PublicKey address()
      Returns the value of the address record component.
      Returns:
      the value of the address record component
    • mint

      public PublicKey mint()
      Returns the value of the mint record component.
      Returns:
      the value of the mint record component
    • owner

      public PublicKey owner()
      Returns the value of the owner record component.
      Returns:
      the value of the owner record component
    • amount

      public long amount()
      Returns the value of the amount record component.
      Returns:
      the value of the amount record component
    • delegateOption

      public int delegateOption()
      Returns the value of the delegateOption record component.
      Returns:
      the value of the delegateOption record component
    • delegate

      public PublicKey delegate()
      Returns the value of the delegate record component.
      Returns:
      the value of the delegate record component
    • state

      public AccountState state()
      Returns the value of the state record component.
      Returns:
      the value of the state record component
    • isNativeOption

      public int isNativeOption()
      Returns the value of the isNativeOption record component.
      Returns:
      the value of the isNativeOption record component
    • isNative

      public long isNative()
      Returns the value of the isNative record component.
      Returns:
      the value of the isNative record component
    • delegatedAmount

      public long delegatedAmount()
      Returns the value of the delegatedAmount record component.
      Returns:
      the value of the delegatedAmount record component
    • closeAuthorityOption

      public int closeAuthorityOption()
      Returns the value of the closeAuthorityOption record component.
      Returns:
      the value of the closeAuthorityOption record component
    • closeAuthority

      public PublicKey closeAuthority()
      Returns the value of the closeAuthority record component.
      Returns:
      the value of the closeAuthority record component