Just need to know how to update NFT metadata after minting NFT. I am trying to use mpl_token_metadata::instruction::update_metadata_accounts_v2
for this. Don't know the correct way to use it or if there is some other way to update metadata.
pub fn update_nft_metadata(ctx: Context<MintNFT>) -> Result<()> { let program_id = ctx.accounts.token_metadata_program.key(); let metadata_account = ctx.accounts.metadata.key(); let update_authority = ctx.accounts.mint_authority.key(); let new_update_authority: Option<Pubkey> = Some(ctx.accounts.mint_authority.key()); let data: DataV2 = DataV2 { name: ("superNFT").to_string(), symbol: ("SMB").to_string(), uri: ("abc.com").to_string(), seller_fee_basis_points: 1000, creators: None, collection: None, uses: None, }; mpl_token_metadata::instruction::update_metadata_accounts_v2( program_id, metadata_account, update_authority, new_update_authority, Some(data), Some(false), Some(true), ); Ok(()) }