komple_framework_mint_module/
msg.rs1use crate::state::{CollectionInfo, Config};
2use cosmwasm_schema::{cw_serde, QueryResponses};
3use cosmwasm_std::Binary;
4use cw20::Cw20ReceiveMsg;
5use komple_framework_token_module::{
6 msg::{MetadataInfo, TokenInfo},
7 state::CollectionConfig,
8};
9use komple_framework_types::shared::execute::SharedExecuteMsg;
10use komple_framework_types::shared::query::ResponseWrapper;
11
12#[cw_serde]
13pub struct CollectionFundInfo {
14 pub is_native: bool,
15 pub denom: String,
16 pub cw20_address: Option<String>,
17}
18
19#[cw_serde]
20pub enum ExecuteMsg {
21 CreateCollection {
26 code_id: u64,
27 collection_info: CollectionInfo,
28 collection_config: CollectionConfig,
29 token_info: TokenInfo,
30 metadata_info: MetadataInfo,
31 fund_info: CollectionFundInfo,
32 linked_collections: Option<Vec<u32>>,
33 },
34 UpdatePublicCollectionCreation {
39 public_collection_creation: bool,
40 },
41 UpdateCollectionMintLock {
45 collection_id: u32,
46 lock: bool,
47 },
48 Mint {
53 collection_id: u32,
54 metadata_id: Option<u32>,
55 },
56 AdminMint {
60 collection_id: u32,
61 recipient: String,
62 metadata_id: Option<u32>,
63 },
64 PermissionMint {
68 permission_msg: Binary,
69 mint_msg: MintMsg,
70 },
71 UpdateOperators {
75 addrs: Vec<String>,
76 },
77 UpdateLinkedCollections {
81 collection_id: u32,
82 linked_collections: Vec<u32>,
83 },
84 UpdateCollectionStatus {
88 collection_id: u32,
89 is_blacklist: bool,
90 },
91 LockExecute {},
96 UpdateCreators {
100 addrs: Vec<String>,
101 },
102 Receive(Cw20ReceiveMsg),
103}
104
105impl From<ExecuteMsg> for SharedExecuteMsg {
106 fn from(msg: ExecuteMsg) -> Self {
107 match msg {
108 ExecuteMsg::LockExecute {} => SharedExecuteMsg::LockExecute {},
109 _ => unreachable!("Cannot convert {:?} to SharedExecuteMessage", msg),
110 }
111 }
112}
113
114#[cw_serde]
115pub enum ReceiveMsg {
116 Mint {
117 collection_id: u32,
118 metadata_id: Option<u32>,
119 },
120}
121
122#[cw_serde]
123#[derive(QueryResponses)]
124pub enum QueryMsg {
125 #[returns(ResponseWrapper<Config>)]
127 Config {},
128 #[returns(ResponseWrapper<String>)]
130 CollectionAddress { collection_id: u32 },
131 #[returns(ResponseWrapper<CollectionInfo>)]
133 CollectionInfo { collection_id: u32 },
134 #[returns(ResponseWrapper<Vec<String>>)]
136 Operators {},
137 #[returns(ResponseWrapper<Vec<u32>>)]
139 LinkedCollections { collection_id: u32 },
140 #[returns(ResponseWrapper<Vec<CollectionsResponse>>)]
142 Collections {
143 blacklist: bool,
144 start_after: Option<u32>,
145 limit: Option<u8>,
146 },
147 #[returns(ResponseWrapper<Vec<String>>)]
149 Creators {},
150 #[returns(ResponseWrapper<bool>)]
152 MintLock { collection_id: u32 },
153}
154
155#[cw_serde]
157pub struct MintMsg {
158 pub collection_id: u32,
159 pub recipient: String,
160 pub metadata_id: Option<u32>,
161}
162
163#[cw_serde]
164pub struct MigrateMsg {}
165
166#[cw_serde]
167pub struct CollectionsResponse {
168 pub collection_id: u32,
169 pub address: String,
170}