Function anchor_spl::metadata::burn_nft
source · pub fn burn_nft<'info>(
ctx: CpiContext<'_, '_, '_, 'info, BurnNft<'info>>,
collection_metadata: Option<Pubkey>
) -> Result<()>
Available on crate feature
metadata
only.Expand description
Burn an NFT by closing its token, metadata and edition accounts.
The lamports of the closed accounts will be transferred to the owner.
§Note
This instruction takes an optional collection_metadata
argument, if this argument is
Some
, the ctx
argument should also include the collection_metadata
account in its
remaining accounts, otherwise the CPI will fail because BurnNft
only includes required
accounts.
ⓘ
CpiContext::new(program, BurnNft { .. })
.with_remaining_accounts(vec![ctx.accounts.collection_metadata]);