I'm writing code to mint an edition NFT from a master using metaplex. The problem is when I call mint_new_edition_from_master_edition_via_token() it has a parameter called "metadata_mint" and I have no idea what to pass in here. Here's my code:
pub fn create_edition_nft(
ctx: Context<CreateNewEdition>,
edition: u64,
) -> Result<()> {
let edition_info = vec![
ctx.accounts.token_program.to_account_info(),
ctx.accounts.new_metadata.to_account_info(),
ctx.accounts.new_edition.to_account_info(),
ctx.accounts.master_edition.to_account_info(),
ctx.accounts.new_mint.to_account_info(),
ctx.accounts.new_mint_authority.to_account_info(),
ctx.accounts.payer.to_account_info(),
ctx.accounts.token_account_owner.to_account_info(),
ctx.accounts.token_account.to_account_info(),
ctx.accounts.new_metadata_update_authority.to_account_info(),
ctx.accounts.metadata.to_account_info(),
ctx.accounts.system_program.to_account_info(),
ctx.accounts.rent.to_account_info(),
];
msg!("Edition account info added");
invoke(&mint_new_edition_from_master_edition_via_token(
ctx.accounts.token_program.key(), // program_id
ctx.accounts.new_metadata.key(), // new metadata
ctx.accounts.new_edition.key(), //new_edition,
ctx.accounts.master_edition.key(), // master_edition,
ctx.accounts.new_mint.key(), // new_mint,
ctx.accounts.new_mint_authority.key(), // new_mint_authority,
ctx.accounts.payer.key(), // payer,
ctx.accounts.token_account_owner.key(), // token_account_owner,
ctx.accounts.token_account.key(), // token_account
ctx.accounts.new_metadata_update_authority.key(), // new_metadata_update_authority,
ctx.accounts.metadata.key(), // metadata,
ctx.accounts.metadata.key(), // Placeholder - need to figure out what goes here (metadata mint?)
edition, // what edition number
), &edition_info.as_slice())?;
Ok(())
}
Right now I'm just passing in metadata even though it's not the same thing. Would appreciate any help here!