komple_framework_types/modules/
marketplace.rs

1use cosmwasm_schema::cw_serde;
2use std::fmt;
3
4/// The different types of listing.
5///
6/// Currently only fixed and auction listings are supported.
7#[cw_serde]
8pub enum Listing {
9    Fixed,
10    Auction,
11}
12
13impl Listing {
14    pub fn as_str(&self) -> &'static str {
15        match self {
16            Listing::Fixed => "fixed",
17            Listing::Auction => "auction",
18        }
19    }
20}
21
22impl fmt::Display for Listing {
23    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
24        match self {
25            Listing::Fixed => write!(f, "fixed"),
26            Listing::Auction => write!(f, "auction"),
27        }
28    }
29}
30
31pub const FIXED_LISTING_NAMESPACE: &str = "fixed_listing";