java.lang.Object
com.hedera.hashgraph.sdk.TokenNftAllowance
Class to encapsulate the nft methods for token allowance's.
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal @Nullable BooleanIf true, the spender has access to all of the owner's NFT units of type tokenId (currently owned and any in the future).final @Nullable AccountIdThe account ID of the spender who is granted approvedForAll allowance and granting approval on an NFT serial to another spender.final @Nullable AccountIdThe account ID of the token owner (ie.The list of serial numbers that the spender is permitted to transfer.final @Nullable AccountIdThe account ID of the token allowance spenderfinal @Nullable TokenIdThe NFT token type that the allowance pertains to -
Constructor Summary
ConstructorsConstructorDescriptionTokenNftAllowance(@Nullable TokenId tokenId, @Nullable AccountId ownerAccountId, @Nullable AccountId spenderAccountId, @Nullable AccountId delegatingSpender, Collection<Long> serialNumbers, @Nullable Boolean allSerials) Constructor. -
Method Summary
Modifier and TypeMethodDescription(package private) static TokenNftAllowancecopyFrom(TokenNftAllowance allowance) Create a copy of a nft token allowance object.static TokenNftAllowancefromBytes(byte[] bytes) Create a nft token allowance from a byte array.(package private) static TokenNftAllowancefromProtobuf(NftAllowance allowanceProto) Create a nft token allowance from a protobuf.byte[]toBytes()Create the byte array.(package private) NftAllowanceCreate the protobuf.(package private) NftRemoveAllowanceCreate the protobuf.toString()(package private) voidvalidateChecksums(Client client) Validate the configured client.
-
Field Details
-
tokenId
The NFT token type that the allowance pertains to -
ownerAccountId
The account ID of the token owner (ie. the grantor of the allowance) -
spenderAccountId
The account ID of the token allowance spender -
delegatingSpender
The account ID of the spender who is granted approvedForAll allowance and granting approval on an NFT serial to another spender. -
serialNumbers
The list of serial numbers that the spender is permitted to transfer. -
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 idownerAccountId- the grantor's account idspenderAccountId- the spender's account iddelegatingSpender- the delegating spender's account idserialNumbers- the list of serial numbersallSerials- grant for all serial's
-
-
Method Details
-
copyFrom
Create a copy of a nft token allowance object.- Parameters:
allowance- the nft token allowance to copy- Returns:
- a new copy
-
fromProtobuf
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
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
-