abstract_std/native/
module_factory.rspub mod state {
use cw_storage_plus::Item;
use crate::{objects::storage_namespaces, registry::Account};
pub const CURRENT_BASE: Item<Account> =
Item::new(storage_namespaces::module_factory::CURRENT_BASE);
}
use cosmwasm_schema::QueryResponses;
use cosmwasm_std::{Addr, Binary, Coin};
use crate::objects::module::ModuleInfo;
#[cosmwasm_schema::cw_serde]
pub struct InstantiateMsg {
pub admin: String,
}
#[cw_ownable::cw_ownable_execute]
#[cosmwasm_schema::cw_serde]
#[derive(cw_orch::ExecuteFns)]
pub enum ExecuteMsg {
InstallModules {
modules: Vec<FactoryModuleInstallConfig>,
salt: Binary,
},
}
#[non_exhaustive]
#[cosmwasm_schema::cw_serde]
pub struct FactoryModuleInstallConfig {
pub module: ModuleInfo,
pub init_msg: Option<Binary>,
}
impl FactoryModuleInstallConfig {
pub fn new(module: ModuleInfo, init_msg: Option<Binary>) -> Self {
Self { module, init_msg }
}
}
#[cw_ownable::cw_ownable_query]
#[cosmwasm_schema::cw_serde]
#[derive(QueryResponses, cw_orch::QueryFns)]
pub enum QueryMsg {
#[returns(ConfigResponse)]
Config {},
#[returns(SimulateInstallModulesResponse)]
SimulateInstallModules { modules: Vec<ModuleInfo> },
}
#[cosmwasm_schema::cw_serde]
pub struct ConfigResponse {
pub ans_host_address: Addr,
pub registry_address: Addr,
}
#[cosmwasm_schema::cw_serde]
pub struct SimulateInstallModulesResponse {
pub total_required_funds: Vec<Coin>,
pub monetization_funds: Vec<(String, Coin)>,
pub initialization_funds: Vec<(String, Vec<Coin>)>,
}
#[cosmwasm_schema::cw_serde]
pub enum MigrateMsg {
Instantiate(InstantiateMsg),
Migrate {},
}