2

I am getting error: Instruction does not support native tokens when trying to initialize a new SPL metadata via:

 // Invoke the create_metadata_account_v3 instruction on the token metadata program
        create_metadata_accounts_v3(
            CpiContext::new(
                ctx.accounts.token_metadata_program.to_account_info(),
                CreateMetadataAccountsV3 {
                    metadata: ctx.accounts.metadata.to_account_info(),
                    mint: ctx.accounts.mint_token.to_account_info(),
                    mint_authority: ctx.accounts.signer.to_account_info(), // <=============== This line fails when signer is used, mint_token PDA doesn't fail
                    update_authority: ctx.accounts.signer.to_account_info(),
                    payer: ctx.accounts.signer.to_account_info(),
                    system_program: ctx.accounts.system_program.to_account_info(),
                    rent: ctx.accounts.rent.to_account_info(),
                },
            )
            .with_signer(signer_seeds),
            DataV2 {
                name: name,
                symbol: symbol,
                uri: uri,
                seller_fee_basis_points: 0,
                creators: None,
                collection: None,
                uses: None,
            },
            true, // is_mutable
            true, // update_authority_is_signer
            None, // collection_details
        )?;

anyone can help explain why I'm getting this error?

1 Answer 1

2

Probably if you create it with_signer the authority needs to be the pda from the seeds. Can you try without?

Here is an example on how to create meta data in a program: https://beta.solpg.io/tutorials/battle-coins

1
  • 1
    I think you are right. with signer requires mint_token pda. thank you!
    – AceGravity
    Commented Jan 9 at 16:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.