komple_framework_marketplace_module/
msg.rs1use crate::state::{Config, FixedListing};
2use cosmwasm_schema::{cw_serde, QueryResponses};
3use cosmwasm_std::Uint128;
4use cw20::Cw20ReceiveMsg;
5use komple_framework_types::modules::marketplace::Listing;
6use komple_framework_types::shared::execute::SharedExecuteMsg;
7use komple_framework_types::shared::query::ResponseWrapper;
8
9#[cw_serde]
11pub struct InstantiateMsg {
12 pub fund_info: MarketplaceFundInfo,
13}
14
15#[cw_serde]
16pub struct MarketplaceFundInfo {
17 pub is_native: bool,
18 pub denom: String,
19 pub cw20_address: Option<String>,
20}
21
22#[cw_serde]
23pub enum ExecuteMsg {
24 UpdateBuyLock {
29 lock: bool,
30 },
31 ListFixedToken {
37 collection_id: u32,
38 token_id: u32,
39 price: Uint128,
40 },
41 DelistFixedToken {
45 collection_id: u32,
46 token_id: u32,
47 },
48 UpdatePrice {
52 listing_type: Listing,
53 collection_id: u32,
54 token_id: u32,
55 price: Uint128,
56 },
57 Buy {
61 listing_type: Listing,
62 collection_id: u32,
63 token_id: u32,
64 },
65 PermissionBuy {
69 listing_type: Listing,
70 collection_id: u32,
71 token_id: u32,
72 buyer: String,
73 },
74 UpdateOperators {
78 addrs: Vec<String>,
79 },
80 LockExecute {},
85 Receive(Cw20ReceiveMsg),
86}
87
88impl From<ExecuteMsg> for SharedExecuteMsg {
89 fn from(msg: ExecuteMsg) -> Self {
90 match msg {
91 ExecuteMsg::LockExecute {} => SharedExecuteMsg::LockExecute {},
92 _ => unreachable!("Cannot convert {:?} to SharedExecuteMessage", msg),
93 }
94 }
95}
96
97#[cw_serde]
98pub enum ReceiveMsg {
99 Buy {
100 listing_type: Listing,
101 collection_id: u32,
102 token_id: u32,
103 },
104}
105
106#[cw_serde]
107#[derive(QueryResponses)]
108pub enum QueryMsg {
109 #[returns(ResponseWrapper<Config>)]
111 Config {},
112 #[returns(ResponseWrapper<FixedListing>)]
114 FixedListing { collection_id: u32, token_id: u32 },
115 #[returns(ResponseWrapper<Vec<FixedListing>>)]
117 FixedListings {
118 collection_id: u32,
119 start_after: Option<u32>,
120 limit: Option<u32>,
121 },
122 #[returns(ResponseWrapper<Vec<String>>)]
124 Operators {},
125}
126
127#[cw_serde]
128pub struct MigrateMsg {}