Issues updating existing NFTs #72
-
Hi @lorisleiva (I'm alph42 from discord). Thanks for both making this package and offering to help! ContextI mint NFTs currently using the old metaplex/js package. I then manually add them to a collection using the mpl-token-metadata package. OpenSea has picked up the collection and displays it, which is great, but I have a few "test" NFTs in my collection (see if you can spot them) and I'd like them not to display, and I want to clean up the collection anyways. Even after resetting verified=0 using metaboss, the NFTs were still showing up (which is an issue with OpenSea's implementation I believe) so I decided to try out js-next since it seems like I should be able to easily update any metadata including removing the collection struct entirely. Isses
Code const connection = new web3.Connection(web3.clusterApiUrl("mainnet-beta"));
const keypair = await web3.Keypair.fromSecretKey(
base58.decode("UpdateAuthorityKey")
);
const metaplex = Metaplex.make(connection)
.use(keypairIdentity(keypair))
.use(bundlrStorage());
const mint = new web3.PublicKey("7wh23HUPrpYMMKgrQm38ZnpzER2AkDuABcTakeu2gTVv"); // Mint exists
// const mint = new web3.PublicKey("BCeZe5hpwNBTq5euBi6WWvAWtuF2cpukfQUTcNa8wCPn"); // "burnt" nft but still has the collection in the metadata
const nft = await metaplex.nfts().findNftByMint(mint)
console.log(nft)
const { nft: updatedNft } = await metaplex.nfts().updateNft(nft, {
name: "Test Update",
});
console.log(updatedNft); Error message (for 2)
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 8 replies
-
Hey Aaron 👋 Thanks for the detailed explanation, I think it makes a lot of sense. Also, searching through the test NFTs in your collection on NFT made me laugh. 😅 Regarding your points:
Thanks again for these findings, that's super helpful! 🍺 |
Beta Was this translation helpful? Give feedback.
Hey Aaron 👋
Thanks for the detailed explanation, I think it makes a lot of sense. Also, searching through the test NFTs in your collection on NFT made me laugh. 😅
Regarding your points:
Yes, this is the current expected behaviour but I can see why it would be annoying not to be able to retrieve an NFT because its URI is invalid. I will create a separate issue for this and fix it. To be precise, running the
metadataTask
explicitly will still throw an error for invalid URIs but I'll make sure to catch this error when runningfindNftByMint
so it doesn't block users from accessing them.That's because
getLatestBlockhash
used to be calledgetRecentBlockhash
and is now deprecated. My guess …