Event Emissions

This section covers how the artinals_markets::MARKET contract emits events, enforces security, and provides best practices for seamless integration.

1.1 Offer Created

Triggered when a user creates a sell offer.

moveCopyEditpublic struct OfferCreated has copy, drop, store {
    offer_id: ID,
    offerer: address,
    collection_id: ID,
    offered_asset_ids: vector<u64>,
    requested_currency: TypeName,
    requested_amount: u64,
    timestamp: u64,
    ledger_id: ID
}

Use Case: Indexing sell offers on a marketplace frontend.


1.2 Offer Accepted

Triggered when a sell offer is accepted by a buyer.

moveCopyEditpublic struct OfferAccepted has copy, drop, store {
    offer_id: ID,
    offerer: address,
    accepter: address,
    collection_id: ID,
    offered_asset_ids: vector<u64>,
    requested_currency: TypeName,
    requested_amount: u64,
    timestamp: u64,
    ledger_id: ID
}

Use Case: Updating the order book when an NFT is sold.


1.3 Offer Cancelled

Triggered when a sell offer is cancelled by the seller.

moveCopyEditpublic struct OfferCancelled has copy, drop, store {
    offer_id: ID,
    offerer: address,
    collection_id: ID,
    offered_asset_ids: vector<u64>,
    requested_currency: TypeName,
    requested_amount: u64,
    timestamp: u64
}

Use Case: Removing cancelled offers from the marketplace.


1.4 Buy Offer Created

Triggered when a user places a buy offer.

moveCopyEditpublic struct BuyOfferCreated has copy, drop, store {
    offer_id: ID,
    buyer: address,
    collection_id: ID,
    requested_asset_count: u64,
    offered_currency: TypeName,
    offered_amount: u64,
    timestamp: u64,
    ledger_id: ID
}

Use Case: Enabling buyers to place bids for NFTs.


1.5 Buy Offer Accepted

Triggered when a buy offer is accepted by a seller.

moveCopyEditpublic struct BuyOfferAccepted has copy, drop, store {
    offer_id: ID,
    buyer: address,
    collection_id: ID,
    requested_asset_count: u64,
    offered_currency: TypeName,
    offered_amount: u64,
    timestamp: u64,
    ledger_id: ID
}

Use Case: Ensuring that transactions update instantly in the UI.


1.6 Buy Offer Cancelled

Triggered when a buyer cancels their buy order.

moveCopyEditpublic struct BuyOfferCancelled has copy, drop, store {
    offer_id: ID,
    buyer: address,
    collection_id: ID,
    requested_asset_count: u64,
    offered_currency: TypeName,
    offered_amount: u64,
    timestamp: u64,
    ledger_id: ID
}

Use Case: Removing cancelled buy orders from the order book.


1.7 Batch Transactions

Triggered when multiple buy/sell offers are processed together.

Batch Sell Offers Accepted

moveCopyEditpublic struct BatchOffersAccepted has copy, drop, store {
    accepter: address,
    total_filled: u64,
    total_cost: u64,
    timestamp: u64,
    ledger_id: ID,
    offers: vector<OfferAccepted>
}

Batch Buy Offers Accepted

moveCopyEditpublic struct BatchBuyOffersAccepted has copy, drop, store {
    accepter: address,
    total_filled: u64,
    total_cost: u64,
    timestamp: u64,
    ledger_id: ID,
    offers: vector<BuyOfferAccepted>
}

Use Case: Processing multiple NFT trades in a single transaction.

Last updated