0x0::marketplace

Module of a Marketplace type.

Marketplaces are platforms that facilitate the listing of NFT collections to the public, by facilitating a primary market UI. NFT Creators can create Listings to sell their NFTs to the public and can decide to partner with a Marketplace such that these are sold through the Marketplace UI. In order for the Marketplace to be remunerated, the Listing must be attached to a Marketplace.

Marketplaces and dApps that want to offer a launchpad service should create a Marketplace object.

After the creation of the Marketplace a Listing for the NFT listing needs to be created by the creator of the NFT Collection. Then, the Listing admin should request to join the marketplace launchpad, pending acceptance.

Whilst the Marketplace stipulates a default fee policy, the marketplace admin can decide to create a custom fee policy for each Listing.

The Listing acts as the object that configures the primary NFT listing strategy, that is the primary market sale. Primary market sales can take many shapes, depending on the business level requirements.

Structs

marketplace::Marketplace has store, key

Fields:

Name Type Description
id object::UID
admin address

The address of the marketplace administrator

receiver address

Receiver of marketplace fees

default_fee object_box::ObjectBox

Methods

public fun new<F: store + key>(
    admin: address,
    receiver: address,
    default_fee: F,
    ctx: &mut tx_context::TxContext,
): marketplace::Marketplace

Initialises a Marketplace object and returns it

public entry fun init_marketplace<F: store + key>(
    admin: address,
    receiver: address,
    default_fee: F,
    ctx: &mut tx_context::TxContext,
)

Initialises a Marketplace object and shares it

public fun receiver(marketplace: &marketplace::Marketplace): 
    address

Get the Marketplace's receiver address

public fun admin(marketplace: &marketplace::Marketplace): 
    address

Get the Marketplace's admin address

public fun default_fee(marketplace: &marketplace::Marketplace): 
    &object_box::ObjectBox

Get the Marketplace's default_fee

public fun assert_marketplace_admin(
    marketplace: &marketplace::Marketplace,
    ctx: &mut tx_context::TxContext,
)