Class TokenNftAllowance

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

public class TokenNftAllowance extends Object
Class to encapsulate the nft methods for token allowance's.
  • Field Details

    • tokenId

      @Nullable public final TokenId tokenId
      The NFT token type that the allowance pertains to
    • ownerAccountId

      @Nullable public final AccountId ownerAccountId
      The account ID of the token owner (ie. the grantor of the allowance)
    • spenderAccountId

      @Nullable public final AccountId spenderAccountId
      The account ID of the token allowance spender
    • delegatingSpender

      @Nullable public final AccountId delegatingSpender
      The account ID of the spender who is granted approvedForAll allowance and granting approval on an NFT serial to another spender.
    • serialNumbers

      public final List<Long> serialNumbers
      The list of serial numbers that the spender is permitted to transfer.
    • allSerials

      @Nullable public final Boolean allSerials
      If true, the spender has access to all of the owner's NFT units of type tokenId (currently owned and any in the future).
  • Constructor Details

    • TokenNftAllowance

      TokenNftAllowance(@Nullable TokenId tokenId, @Nullable AccountId ownerAccountId, @Nullable AccountId spenderAccountId, @Nullable AccountId delegatingSpender, Collection<Long> serialNumbers, @Nullable Boolean allSerials)
      Constructor.
      Parameters:
      tokenId - the token id
      ownerAccountId - the grantor's account id
      spenderAccountId - the spender's account id
      delegatingSpender - the delegating spender's account id
      serialNumbers - the list of serial numbers
      allSerials - grant for all serial's
  • Method Details

    • copyFrom

      static TokenNftAllowance copyFrom(TokenNftAllowance allowance)
      Create a copy of a nft token allowance object.
      Parameters:
      allowance - the nft token allowance to copj
      Returns:
      a new copy
    • fromProtobuf

      static TokenNftAllowance fromProtobuf(NftAllowance allowanceProto)
      Create a nft token allowance from a protobuf.
      Parameters:
      allowanceProto - the protobuf
      Returns:
      the nft token allowance
    • fromBytes

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

      void validateChecksums(Client client) throws BadEntityIdException
      Validate the configured client.
      Parameters:
      client - the configured client
      Throws:
      BadEntityIdException - if entity ID is formatted poorly
    • toProtobuf

      NftAllowance toProtobuf()
      Create the protobuf.
      Returns:
      the protobuf representation
    • toRemoveProtobuf

      NftRemoveAllowance toRemoveProtobuf()
      Create the protobuf.
      Returns:
      the remove protobuf
    • toBytes

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

      public String toString()
      Overrides:
      toString in class Object