Class TokenNftInfo

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

public class TokenNftInfo extends Object
  • Field Details

    • nftId

      public final NftId nftId
      The ID of the NFT
    • accountId

      public final AccountId accountId
      The current owner of the NFT
    • creationTime

      public final Instant creationTime
      The effective consensus timestamp at which the NFT was minted
    • metadata

      public final byte[] metadata
      Represents the unique metadata of the NFT
    • ledgerId

      public final LedgerId ledgerId
      The ledger ID the response was returned from; please see HIP-198 for the network-specific IDs.
    • spenderId

      @Nullable public final AccountId spenderId
      If an allowance is granted for the NFT, its corresponding spender account
  • Constructor Details

    • TokenNftInfo

      TokenNftInfo(NftId nftId, AccountId accountId, Instant creationTime, byte[] metadata, LedgerId ledgerId, @Nullable AccountId spenderId)
      Constructor.
      Parameters:
      nftId - the id of the nft
      accountId - the current owner of the nft
      creationTime - the effective consensus time
      metadata - the unique metadata
      ledgerId - the ledger id of the response
      spenderId - the spender of the allowance (null if not an allowance)
  • Method Details

    • fromProtobuf

      static TokenNftInfo fromProtobuf(TokenNftInfo info)
      Create token nft info from a protobuf.
      Parameters:
      info - the protobuf
      Returns:
      the new token nft info
    • fromBytes

      public static TokenNftInfo fromBytes(byte[] bytes) throws com.google.protobuf.InvalidProtocolBufferException
      Create token nft info from byte array.
      Parameters:
      bytes - the byte array
      Returns:
      the new token nft info
      Throws:
      com.google.protobuf.InvalidProtocolBufferException - when there is an issue with the protobuf
    • toProtobuf

      TokenNftInfo toProtobuf()
      Create the protobuf.
      Returns:
      the protobuf representation
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toBytes

      public byte[] toBytes()
      Create the byte array.
      Returns:
      the byte array representation