Skip to content

Commit

Permalink
spl: Add documentation for burn_nft (#2819)
Browse files Browse the repository at this point in the history
Co-authored-by: acheron <[email protected]>
  • Loading branch information
nabeel99 and acheroncrypto authored Mar 7, 2024
1 parent 3e2cd00 commit 2302833
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions spl/src/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,21 @@ pub fn burn_edition_nft<'info>(
.map_err(Into::into)
}

/// 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.
///
/// ```ignore
/// CpiContext::new(program, BurnNft { .. })
/// .with_remaining_accounts(vec![ctx.accounts.collection_metadata]);
/// ```
pub fn burn_nft<'info>(
ctx: CpiContext<'_, '_, '_, 'info, BurnNft<'info>>,
collection_metadata: Option<Pubkey>,
Expand Down

0 comments on commit 2302833

Please sign in to comment.