Module of FixedPriceMarket
It implements a fixed price sale configuration, where all NFTs in the inventory get sold at a fixed price.
NFT creators can decide to use multiple markets to create a tiered market sale by segregating NFTs by different sale segments.
Structs
fixed_price::FixedPriceMarket<FT> has store, key
fixed_price::FixedPriceMarket<FT> has store, key
Fields:
| Name | Type | Description |
|---|---|---|
id
|
object::UID
|
|
price
|
u64
|
Fixed price denominated in fungible-token, |
inventory_id
|
object::ID
|
|
Fixed price market object
fixed_price::Witness has drop
fixed_price::Witness has drop
Witness used to authenticate witness protected endpoints
Methods
public fun new<FT>(
inventory_id: object::ID,
price: u64,
ctx: &mut tx_context::TxContext,
): fixed_price::FixedPriceMarket<FT>
public fun new<FT>(
inventory_id: object::ID,
price: u64,
ctx: &mut tx_context::TxContext,
): fixed_price::FixedPriceMarket<FT>Create a new FixedPriceMarket<FT>
Price is denominated in fungible token, FT, such as SUI.
Requires that Inventory with given ID exists on the Listing that
this market will be inserted into.
public entry fun init_market<FT>(
inventory_id: object::ID,
price: u64,
ctx: &mut tx_context::TxContext,
)
public entry fun init_market<FT>(
inventory_id: object::ID,
price: u64,
ctx: &mut tx_context::TxContext,
)Creates a FixedPriceMarket<FT> and transfers to transaction sender
Price is denominated in fungible token, FT, such as SUI.
Requires that Inventory with given ID exists on the Listing that
this market will be inserted into.
This market can later be consumed by listing::init_venue or
venue::init_venue for later use in a launchpad listing.
public entry fun init_venue<C, FT>(
listing: &mut listing::Listing,
inventory_id: object::ID,
is_whitelisted: bool,
price: u64,
ctx: &mut tx_context::TxContext,
)
public entry fun init_venue<C, FT>(
listing: &mut listing::Listing,
inventory_id: object::ID,
is_whitelisted: bool,
price: u64,
ctx: &mut tx_context::TxContext,
)Initializes a Venue with FixedPriceMarket<FT>
Price is denominated in fungible token, FT, such as SUI.
Requires that Inventory with given ID exists on the Listing that
this market will be inserted into.
Resultant Venue can later be consumed by listing::add_venue for
later use in a launchpad listing.
Panics
Panics if Inventory with given ID does not exist on Listing or
if transaction sender is not the Listing admin.
public fun create_venue<C, FT>(
listing: &mut listing::Listing,
inventory_id: object::ID,
is_whitelisted: bool,
price: u64,
ctx: &mut tx_context::TxContext,
): object::ID
public fun create_venue<C, FT>(
listing: &mut listing::Listing,
inventory_id: object::ID,
is_whitelisted: bool,
price: u64,
ctx: &mut tx_context::TxContext,
): object::IDCreates a Venue with FixedPriceMarket<FT>
Price is denominated in fungible token, FT, such as SUI.
Requires that Inventory with given ID exists on the Listing that
this market will be inserted into.
Resultant Venue can later be consumed by listing::add_venue for
later use in a launchpad listing.
Panics
Panics if Inventory with given ID does not exist on Listing or
if transaction sender is not the Listing admin.
public entry fun buy_nft<C, FT>(
listing: &mut listing::Listing,
venue_id: object::ID,
wallet: &mut coin::Coin<FT>,
ctx: &mut tx_context::TxContext,
)
public entry fun buy_nft<C, FT>(
listing: &mut listing::Listing,
venue_id: object::ID,
wallet: &mut coin::Coin<FT>,
ctx: &mut tx_context::TxContext,
)Buy NFT for non-whitelisted sale
Panics
Panics if Venue does not exist, is not live, or is whitelisted or
wallet does not have the necessary funds.
public entry fun buy_nft_into_safe<C, FT>(
listing: &mut listing::Listing,
venue_id: object::ID,
wallet: &mut coin::Coin<FT>,
buyer_safe: &mut safe::Safe,
ctx: &mut tx_context::TxContext,
)
public entry fun buy_nft_into_safe<C, FT>(
listing: &mut listing::Listing,
venue_id: object::ID,
wallet: &mut coin::Coin<FT>,
buyer_safe: &mut safe::Safe,
ctx: &mut tx_context::TxContext,
)Buy NFT for non-whitelisted sale
Panics
Panics if Venue does not exist, is not live, or is whitelisted or
wallet does not have the necessary funds.
public entry fun create_safe_and_buy_nft<C, FT>(
listing: &mut listing::Listing,
venue_id: object::ID,
wallet: &mut coin::Coin<FT>,
ctx: &mut tx_context::TxContext,
)
public entry fun create_safe_and_buy_nft<C, FT>(
listing: &mut listing::Listing,
venue_id: object::ID,
wallet: &mut coin::Coin<FT>,
ctx: &mut tx_context::TxContext,
)Buy NFT for non-whitelisted sale. Deposits the NFT to a safe and transfers the ownership to the buyer.
Panics
Panics if Venue does not exist, is not live, or is whitelisted or
wallet does not have the necessary funds.
public entry fun buy_whitelisted_nft<C, FT>(
listing: &mut listing::Listing,
venue_id: object::ID,
wallet: &mut coin::Coin<FT>,
whitelist_token: market_whitelist::Certificate,
ctx: &mut tx_context::TxContext,
)
public entry fun buy_whitelisted_nft<C, FT>(
listing: &mut listing::Listing,
venue_id: object::ID,
wallet: &mut coin::Coin<FT>,
whitelist_token: market_whitelist::Certificate,
ctx: &mut tx_context::TxContext,
)Buy NFT for whitelisted sale
Panics
- If
Venuedoes not exist, is not live, or is not whitelisted - If whitelist
Certificatewas not issued for given market
public entry fun buy_whitelisted_nft_into_safe<C, FT>(
listing: &mut listing::Listing,
venue_id: object::ID,
wallet: &mut coin::Coin<FT>,
safe: &mut safe::Safe,
whitelist_token: market_whitelist::Certificate,
ctx: &mut tx_context::TxContext,
)
public entry fun buy_whitelisted_nft_into_safe<C, FT>(
listing: &mut listing::Listing,
venue_id: object::ID,
wallet: &mut coin::Coin<FT>,
safe: &mut safe::Safe,
whitelist_token: market_whitelist::Certificate,
ctx: &mut tx_context::TxContext,
)Buy NFT for whitelisted sale Deposits the NFT to a safe and transfers the ownership to the buyer.
Panics
- If
Venuedoes not exist, is not live, or is not whitelisted - If whitelist
Certificatewas not issued for given market
public entry fun create_safe_and_buy_whitelisted_nft<C, FT>(
listing: &mut listing::Listing,
venue_id: object::ID,
wallet: &mut coin::Coin<FT>,
whitelist_token: market_whitelist::Certificate,
ctx: &mut tx_context::TxContext,
)
public entry fun create_safe_and_buy_whitelisted_nft<C, FT>(
listing: &mut listing::Listing,
venue_id: object::ID,
wallet: &mut coin::Coin<FT>,
whitelist_token: market_whitelist::Certificate,
ctx: &mut tx_context::TxContext,
)Buy NFT for whitelisted sale Deposits the NFT to a safe and transfers the ownership to the buyer.
Panics
- If
Venuedoes not exist, is not live, or is not whitelisted - If whitelist
Certificatewas not issued for given market
public entry fun set_price<FT>(
listing: &mut listing::Listing,
venue_id: object::ID,
new_price: u64,
ctx: &mut tx_context::TxContext,
)
public entry fun set_price<FT>(
listing: &mut listing::Listing,
venue_id: object::ID,
new_price: u64,
ctx: &mut tx_context::TxContext,
)Change market price
Panics
Panics if transaction sender is not Listing admin.
public fun price<FT>(
market: &fixed_price::FixedPriceMarket<FT>,
): u64
public fun price<FT>(
market: &fixed_price::FixedPriceMarket<FT>,
): u64Return market price