updateTokenURI

This function is an abstracted layer of the setTokenURI extension , which means it uses setTokenURI under the hood. While the setTokenURI method only takes in a uri string, this extension takes in a user-friendly NFTInput , upload that content to IPFS and pass the IPFS URI (of said NFTInput ) to the underlying setTokenURI method.

This extension does not validate the NFTInput so make sure you are passing the proper content that you want to update.

Example

import { updateTokenURI } from "thirdweb/extensions/erc1155";
const transaction = updateTokenURI({
tokenId: 0n,
nft: {
name: "new name",
description: "new description",
image: "https://image-host.com/new-image.png",
},
});

Parameters

Returns

the prepared transaction from setTokenURI