java.lang.Object
com.hedera.hashgraph.sdk.Executable<TokenUpdateNftsTransaction,Transaction,TransactionResponse,TransactionResponse>
com.hedera.hashgraph.sdk.Transaction<TokenUpdateNftsTransaction>
com.hedera.hashgraph.sdk.TokenUpdateNftsTransaction
Modify the metadata field for an individual non-fungible/unique token (NFT).
Updating the metadata of an NFT SHALL NOT affect ownership or
the ability to transfer that NFT.
This transaction SHALL affect only the specific serial numbered tokens identified. This transaction SHALL modify individual token metadata.
This transaction MUST be signed by the token `metadata_key`.
The token `metadata_key` MUST be a valid `Key`.
The token `metadata_key` MUST NOT be an empty `KeyList`. ### Block Stream Effects None
This transaction SHALL affect only the specific serial numbered tokens identified. This transaction SHALL modify individual token metadata.
This transaction MUST be signed by the token `metadata_key`.
The token `metadata_key` MUST be a valid `Key`.
The token `metadata_key` MUST NOT be an empty `KeyList`. ### Block Stream Effects None
-
Nested Class Summary
Nested classes/interfaces inherited from class com.hedera.hashgraph.sdk.Transaction
Transaction.SignableNodeTransactionBodyBytesNested classes/interfaces inherited from class com.hedera.hashgraph.sdk.Executable
Executable.GrpcRequest -
Field Summary
Fields inherited from class com.hedera.hashgraph.sdk.Transaction
customFeeLimits, DEFAULT_AUTO_RENEW_PERIOD, defaultMaxTransactionFee, DUMMY_ACCOUNT_ID, DUMMY_TRANSACTION_ID, frozenBodyBuilder, innerSignedTransactions, outerTransactions, publicKeys, regenerateTransactionId, signers, sigPairLists, sourceTransactionBody, transactionIdsFields inherited from class com.hedera.hashgraph.sdk.Executable
attemptedAllNodes, blockingUnaryCall, grpcDeadline, logger, maxAttempts, maxBackoff, minBackoff, nodeAccountIds, nodes, random, RST_STREAM -
Constructor Summary
ConstructorsConstructorDescriptionConstructor.Constructor. -
Method Summary
Modifier and TypeMethodDescriptionaddSerial(long serial) Add a serial number to the list of serial numbers.(package private) TokenUpdateNftsTransactionBody.Builderbuild()Build the transaction body.byte[]Extract the metadata.(package private) io.grpc.MethodDescriptor<Transaction, TransactionResponse> Called to direct the invocation of the query to the appropriate gRPC service.Extract the list of serial numbers.Extract the token id.(package private) voidInitialize from the transaction body.(package private) voidonFreeze(TransactionBody.Builder bodyBuilder) Called inTransaction.freezeWith(Client)just before the transaction body is built.(package private) voidonScheduled(SchedulableTransactionBody.Builder scheduled) Called inTransaction.schedule()when converting transaction into a scheduled version.setMetadata(byte[] metadata) A new value for the metadata.setSerials(List<Long> serials) A list of serial numbers to be updated.setTokenId(TokenId tokenId) A token identifier.
This is the token type (i.e.(package private) voidvalidateChecksums(Client client) Methods inherited from class com.hedera.hashgraph.sdk.Transaction
addSignature, addSignature, batchify, buildAllTransactions, buildTransaction, doSchedule, estimateFee, freeze, freezeWith, fromBytes, fromScheduledTransaction, generateTransactionIds, getBatchKey, getDefaultMaxTransactionFee, getExecutionState, getHighVolume, getMaxTransactionFee, getRegenerateTransactionId, getRequiredChunks, getSignableNodeBodyBytesList, getSignatures, getSignaturesAtOffset, getTransactionBodySize, getTransactionHash, getTransactionHashPerNode, getTransactionId, getTransactionIdInternal, getTransactionMemo, getTransactionSize, getTransactionValidDuration, hash, isBatchedAndNotBatchTransaction, isFrozen, keyAlreadySigned, makeRequest, mapResponse, mapResponseStatus, onExecute, onExecuteAsync, regenerateTransactionId, requireNotFrozen, requireOneNodeAccountId, schedule, setBatchKey, setHighVolume, setMaxTransactionFee, setNodeAccountIds, setRegenerateTransactionId, setTransactionId, setTransactionMemo, setTransactionValidDuration, sign, signTransaction, signWith, signWithOperator, spawnBodyBuilder, toBytes, toString, wipeTransactionListsMethods inherited from class com.hedera.hashgraph.sdk.Executable
advanceRequest, checkNodeAccountIds, execute, execute, executeAsync, executeAsync, executeAsync, executeAsync, executeAsync, executeAsync, getGrpcRequest, getMaxAttempts, getMaxBackoff, getMaxRetry, getMinBackoff, getNodeAccountIds, getNodeForExecute, grpcDeadline, logTransaction, mergeFromClient, setGrpcDeadline, setLogger, setMaxAttempts, setMaxBackoff, setMaxRetry, setMinBackoff, setNodesFromNodeAccountIds, setRequestListener, setResponseListener, shouldRetryExceptionally
-
Constructor Details
-
TokenUpdateNftsTransaction
public TokenUpdateNftsTransaction()Constructor. -
TokenUpdateNftsTransaction
TokenUpdateNftsTransaction(LinkedHashMap<TransactionId, LinkedHashMap<AccountId, throws com.google.protobuf.InvalidProtocolBufferExceptionTransaction>> txs) Constructor.- Parameters:
txs- Compound list of transaction id's list of (AccountId, Transaction) records- Throws:
com.google.protobuf.InvalidProtocolBufferException- when there is an issue with the protobuf
-
TokenUpdateNftsTransaction
TokenUpdateNftsTransaction(TransactionBody txBody)
-
-
Method Details
-
getTokenId
Extract the token id.- Returns:
- the token id
-
setTokenId
A token identifier.
This is the token type (i.e. collection) for which to update NFTs.This field is REQUIRED.
The identified token MUST exist, MUST NOT be paused, MUST have the type non-fungible/unique, and MUST have a valid `metadata_key`.- Parameters:
tokenId- the token id- Returns:
this
-
getSerials
Extract the list of serial numbers.- Returns:
- the list of serial numbers
-
setSerials
A list of serial numbers to be updated.This field is REQUIRED.
This list MUST have at least one(1) entry.
This list MUST NOT have more than ten(10) entries.- Parameters:
serials- the list of serial numbers- Returns:
this
-
addSerial
Add a serial number to the list of serial numbers.- Parameters:
serial- the serial number to add- Returns:
this
-
getMetadata
@Nullable public byte[] getMetadata()Extract the metadata.- Returns:
- the metadata
-
setMetadata
A new value for the metadata.If this field is not set, the metadata SHALL NOT change.
This value, if set, MUST NOT exceed 100 bytes.- Parameters:
metadata- the metadata- Returns:
this
-
initFromTransactionBody
void initFromTransactionBody()Initialize from the transaction body. -
build
Build the transaction body.- Returns:
TokenUpdateNftsTransactionBody
-
validateChecksums
- Specified by:
validateChecksumsin classTransaction<TokenUpdateNftsTransaction>- Throws:
BadEntityIdException
-
getMethodDescriptor
io.grpc.MethodDescriptor<Transaction,TransactionResponse> getMethodDescriptor()Description copied from class:ExecutableCalled to direct the invocation of the query to the appropriate gRPC service.- Specified by:
getMethodDescriptorin classExecutable<TokenUpdateNftsTransaction,Transaction, TransactionResponse, TransactionResponse>
-
onFreeze
Description copied from class:TransactionCalled inTransaction.freezeWith(Client)just before the transaction body is built. The intent is for the derived class to assign their data variant to the transaction body.- Specified by:
onFreezein classTransaction<TokenUpdateNftsTransaction>
-
onScheduled
Description copied from class:TransactionCalled inTransaction.schedule()when converting transaction into a scheduled version.- Specified by:
onScheduledin classTransaction<TokenUpdateNftsTransaction>
-