Update NFT metadata
Last updated
Was this helpful?
Last updated
Was this helpful?
A TokenUpdateNftsTransaction
updates the metadata property of non-fungible tokens (NFTs) on the Hedera network. The transaction requires signing with the metadata key and will fail otherwise. The new metadata must be a valid byte array and is limited to 100 bytes. All transactions are recorded on the network, providing an auditable history of changes. The metadata key allows updates to existing NFTs in a collection; if no value is provided for a field, it remains unchanged.
🚨 Metadata keys, like other , must be set during the token creation. If metadata keys are not set when the token is created, they cannot be added later, and you won't be able to update the token's metadata.
Token ID
The ID of the NFT to update.
Serial Numbers
The list of serial numbers to be updated.
Metadata
The new metadata of the NFT(s).
Transaction Signing Requirements
Metadata key is required to sign.
Transaction fee payer account key.
Transaction Fees
Please see the transaction and query table for the base transaction fee.
Please use the to estimate your transaction fee cost.
setTokenId(<tokenId>)
TokenID
Required
setSerialNumbers(<[int64]>)
List<int64>
Required
setMetadata(<bytes>)
bytes
Optional
The transaction fee to update the metadata of 1 NFT is $0.001
To update metadata for multiple NFTs in a single call is N x $0.001
(N being the number of NFTs to update). See the full list of token transaction fees .
No, metadata keys are not required for all token types. If your use case will need the ability to update the metadata in the future, the metadata key must be set during token creation. introduces the token metadata field for fungible tokens, providing users the ability to update metadata for both token types (fungible and non-fungible) using the metadata key.
No, this is just like a regular . It will fail if token is paused.
Reference: , ,
Contributors: