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 theNFTSale
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:
Verify the caller is the sale’s creator.
Check that the sale is still active.
Move additional NFTs into the sale’s asset_ids list.
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