Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrateing to umi from js giving MissingEditionAccount error #120

Open
GrimLothar opened this issue Mar 15, 2024 · 0 comments
Open

Migrateing to umi from js giving MissingEditionAccount error #120

GrimLothar opened this issue Mar 15, 2024 · 0 comments

Comments

@GrimLothar
Copy link

Hey! I'm migrating my old metaplex JS code to UMI. This was my old code to update an NFT's metadata with JS:

    const signerAccount = web3.Keypair.fromSecretKey(new Uint8Array(JSON.parse(keypair.secret_key)))
    const metaplex = Metaplex.make(solConnection).use(keypairIdentity(signerAccount))
    const mintKey = new web3.PublicKey(mint);
    try{
        const nft = await metaplex.nfts().findByMint(mintKey);
        const { nft: updatedNft, transactionId } = await metaplex.nfts().update(nft, {
            uri: uri,
        });
        console.log(`Successfully updated metadata URL`)
        return transactionId
    } catch (e) {
        console.error(e)
    }  

And this is the new one with UMI:

    const signerAccount = web3.Keypair.fromSecretKey(new Uint8Array(JSON.parse(keypair.secret_key)))
    const umi = await createUmiInstance(signerAccount, solConnection.rpcEndpoint);
    const mintKey = new web3.PublicKey(mint);
    try{
        const mintAddress = fromWeb3JsPublicKey(mintKey);
        const initialMetadata = await fetchMetadataFromSeeds(umi, { mint: mintAddress });
        const request = await updateV1(umi, {
            mint: mintAddress,
            authority: umi.payer,
            data: { ...initialMetadata, uri: uri },
        }).sendAndConfirm(umi);

        console.log(`Successfully updated metadata URL`);

        return bs58.encode(Buffer.from(request.signature));
    } catch (e) {
        console.error(e)
    }

The JS one is working as expected, but the UMI one is throwing this error:

      'Program metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s invoke [1]',
      'Program log: IX: Update',
      'Program log: Auth type: Metadata',
      'Program log: This mint account has an edition but none was provided.',
      'Program metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s consumed 21230 of 200000 compute units',
      'Program metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s failed: custom program error: 0x6c'

What am I missing?

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant