Adding NFTs to a Sale

add_nfts_to_sale<CURRENCY>(...) Purpose: Add more NFTs to an existing sale before they’re sold out.

Key Parameters:

  • sale: A mutable reference to the NFTSale object.

  • nfts: Additional NFTs to add.

  • asset_ids: The IDs of the NFTs being added.

  • collection_cap: For authorization checks.

  • sender_balances: User balance objects to ensure the user adding NFTs has them available.

  • ctx: The transaction context.

Process:

  1. Verify the caller is the sale’s creator.

  2. Check that the sale is still active.

  3. Move additional NFTs into the sale’s asset_ids list.

  4. Update nft_count and emit listing events.

Use Cases:

  • A creator initially lists 50 NFTs but later decides to add another 20 NFTs after seeing strong demand.

  • A seller wants to restock a sale as the initial batch sells quickly.

Last updated