Artinals Protocol
  • Introduction
    • What is Artinals?
    • Overview of the Modules
    • Key Concepts and Terminology
  • Getting Started
    • Prerequisites
    • Cloning the Repository
    • Building and Testing the Modules
  • ART20
    • Overview and Capabilities
    • Data Structures
      • NFT
      • CollectionCap
      • UserBalance
      • TokenIdCounter
      • Dual IDs
    • Events
      • NFTMintedEvent
      • CollectionCreatedEvent
      • MetadataUpdateEvent
      • BurnEvent
      • TransferEvent
      • Additional Events
    • Functions and Entry Points
      • Initializing the Module
      • Creating Collections
      • Minting ART20 NFTs
      • Updating Metadata
      • Transfer and Burn Operations
      • Batch Operations
      • Deny List Mechanics and Authority
      • Custom Transfers
    • Value Sources (API, Oracle)
    • Best Practices & Examples
  • SALE Module
    • Purpose and Functionality
    • Interdependence
    • Price Index Module
    • Liquidity Module
    • Data Structures
      • NFTSale
      • NFTListing
  • Events
    • SaleCreated
    • NFTPurchased
    • PriceUpdateEvent
    • CurrencyWithdrawn
    • DenyList & Related Events
    • PoolCreatedEvent
    • OrderCanceled
    • OrderExecuted
  • Functions and Entry Points
    • Creating a Sale
    • Adding NFTs to a Sale
    • Purchasing NFTs from a Sale
    • Withdrawing Proceeds
    • Managing Sale State
    • Core Trading Functionality
  • Integrating with ART20
  • Examples & Best Practices
  • MARKET Module
    • Introduction
    • Testnet (Beta)
    • Smart Contract Overview
    • Data Structures
      • Trade Ledger (TradeLedger)
      • Trade Offer (TradeOffer)
      • Buy Offer (BuyOffer)
      • Ledger Registry (LedgerRegistry)
    • Event Structures
      • Offer Created (OfferCreated)
      • Offer Accepted (OfferAccepted)
      • Buy Offer Created (BuyOfferCreated)
      • Buy Offer Accepted (BuyOfferAccepted)
      • Batch Transactions
    • Event Emissions
    • Functions and Entry Points
      • Trade Ledger Management
      • Register Ledger
      • Get Trade Ledger
      • Create Sell Offer
      • Accept Sell Offer
      • Cancel Sell Offer
      • Create Buy Offer
      • Accept Buy Offer
      • Cancel Buy Offer
      • Batch Accept Sell Offers
      • Batch Accept Buy Offers
  • Security Mechanisms
  • TRADE Module
    • Introduction
    • Purpose and Ecosystem Role
    • Data Structures
      • TradingPool
      • LiquidityPosition
      • PriceOracle
      • CollectionPool
    • Events
      • PoolCreated
      • LiquidityAdded
      • LiquidityRemoved
      • TradeExecuted
      • PoolStatusChanged
      • PoolFeesUpdated
    • Functions and Entry Points
      • Creating and Managing Liquidity Pools
      • Adding/Removing Liquidity
      • Swapping NFTs and Tokens
      • Fee Mechanics and Distribution
      • Emergency Operations and Recovery
  • Working with Price Oracles
  • Metrics and Statistics (24h Volumes, TWAP, Price Impact)
  • Integration with SALE and ART20
  • Integration and Workflows
    • Typical User Journeys
      • Creating a Collection and Minting Tokens (ART20)
      • Listing and Selling NFTs (SALE)
      • Providing Liquidity and Trading NFTs (TRADE)
    • Example Scripts and Transactions
    • Interactions Between Modules
  • Security, Permissions, and Deny Lists
    • Introduction
    • Role of Deny List in ART20
    • Creator vs. Owner Permissions
    • Fee Distribution and Authority
    • Best Practices for Secure Deployment
  • Testing and Troubleshooting
    • Running Unit Tests
    • Common Issues and Solutions
    • Debugging and Emitting Debug Events
  • Advanced Topics
    • Value Sources (API Endpoints and Oracle Addresses)
    • Batch Update Operations
    • Customizing Parameters (Fees, Supply, Price Ranges)
    • Extensibility and Future Integrations
  • Appendices
    • Move Language and Sui Concepts
    • Glossary of Terms
    • Code Style and Conventions
  • Building on Top of the Artinals Contract
    • Overview
    • Package ID
    • Import Modules
    • Commom Integration Patterns
    • Best Practices
    • Common Errors and Solutions
Powered by GitBook
On this page
  1. MARKET Module

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.

PreviousBatch TransactionsNextFunctions and Entry Points

Last updated 3 months ago