marbu-customization-module 0.2.0-alpha

Komple Framework module for marketplace customization in Marbu.
Documentation
use cosmwasm_schema::{cw_serde, QueryResponses};
use cosmwasm_std::Binary;

use crate::state::{Config, Data};

use komple_framework_types::shared::{execute::SharedExecuteMsg, query::ResponseWrapper};

#[cw_serde]
pub enum ExecuteMsg {
    /// Set a single data entry
    SetData { key: String, value: Binary },
    /// Set multiple data entries
    SetDataBatch { data: Vec<Data> },
    /// Hub message.
    ///
    /// Lock the execute entry point.
    /// Can only be called by the hub module.
    LockExecute {},
}

impl From<ExecuteMsg> for SharedExecuteMsg {
    fn from(msg: ExecuteMsg) -> Self {
        match msg {
            ExecuteMsg::LockExecute {} => SharedExecuteMsg::LockExecute {},
            _ => unreachable!("Cannot convert {:?} to SharedExecuteMessage", msg),
        }
    }
}

#[cw_serde]
#[derive(QueryResponses)]
pub enum QueryMsg {
    #[returns(ResponseWrapper<Config>)]
    Config {},
    // Get a single data entry
    #[returns(ResponseWrapper<Option<Binary>>)]
    GetData { key: String },
    // Get multiple data entries by keys
    #[returns(ResponseWrapper<Vec<Option<Binary>>>)]
    GetDataBatch { keys: Vec<String> },
    // Get all keys
    #[returns(ResponseWrapper<Vec<String>>)]
    ListKeys {},
}

#[cw_serde]
pub struct MigrateMsg {}