Accept Buy Offer

Function:

public fun accept_buy_offer<CURRENCY>(
    ledger: &mut TradeLedger,
    offer_id: ID,
    mut nfts: vector<NFT>,
    mut sender_balances: vector<UserBalance>,
    collection_cap: &CollectionCap,
    amount_to_sell: u64,
    clock: &Clock,
    ctx: &mut TxContext
)

Description:

  • NFT holders can sell their NFTs to an active buy offer.

  • The seller receives payment in CURRENCY.

  • The NFTs are transferred to the buyer.

Validations:

  • The buy offer must be open.

  • The seller must own the NFTs.

  • The amount must not exceed the requested amount.

Last updated