0x0::venue

Module representing the market Venue type

Venue allows creator to configure a primary market through which their collection will be sold. Venue enforces that all purchases made through it will draw from an inventory determined at construction.

Venue is an unprotected type that composes the market structure of Listing.

Structs

venue::Venue has store, key

Fields:

Name Type Description
id object::UID
is_live bool

Track whether market is live

is_whitelisted bool

Track which market is whitelisted

Venue object

Venue is a thin wrapper around a generic Market that handles tracking live status and whitelist assertions. Venue itself is not generic as to not require knowledge of the underlying market to perform administrative operations.

Venue is unprotected and relies on safely obtaining a mutable reference.

Methods

public fun new<Market: store>(
    market: Market,
    is_whitelisted: bool,
    ctx: &mut tx_context::TxContext,
): venue::Venue

Create a new Venue

public entry fun init_venue<Market: store>(
    market: Market,
    is_whitelisted: bool,
    ctx: &mut tx_context::TxContext,
)

Initializes a Venue and transfers to transaction sender

public entry fun set_live(
    venue: &mut venue::Venue,
    is_live: bool,
)

Set market's live status

Endpoint is unprotected and relies on safely obtaining a mutable reference to Venue.

public entry fun set_whitelisted(
    venue: &mut venue::Venue,
    is_whitelisted: bool,
)

Set market's whitelist status

Endpoint is unprotected and relies on safely obtaining a mutable reference to Venue.

public fun is_live(venue: &venue::Venue): bool

Get whether the venue is live

public fun is_whitelisted(venue: &venue::Venue): bool

Get whether the venue is whitelisted

public fun borrow_market<Market: store>(
    venue: &venue::Venue,
): &Market

Borrow Venue market

Panics

Panics if incorrect type was provided for the underlying market.

public fun borrow_market_mut<Market: store>(
    venue: &mut venue::Venue,
): &mut Market

Mutably borrow Venue market

Endpoint is unprotected and relies on safely obtaining a mutable reference to Venue.

Panics

Panics if incorrect type was provided for the underlying market.

public fun assert_market<Market: store>(
    venue: &venue::Venue,
): bool

Asserts the type of the underlying market of the Venue

Panics

Panics if incorrect type was provided

public fun assert_is_live(venue: &venue::Venue)

Asserts that Venue is live

Panics

Panics if Venue is not live

public fun assert_is_whitelisted(venue: &venue::Venue)

Asserts that Venue is whitelisted

Panics

Panics if Venue is not whitelisted

public fun assert_is_not_whitelisted(venue: &venue::Venue)

Asserts that Venue is not whitelisted

Panics

Panics if Venue is whitelisted