komple_framework_hub_module/
msg.rs

1use crate::state::HubInfo;
2use cosmwasm_schema::{cw_serde, QueryResponses};
3use cosmwasm_std::Binary;
4use komple_framework_types::shared::query::ResponseWrapper;
5
6/// Message to be sent along the ```RegisterMsg``` for instantiation.
7#[cw_serde]
8pub struct InstantiateMsg {
9    /// Hub info is the general information about the hub.
10    pub hub_info: HubInfo,
11    /// Marbu fee module is the optional address for defining the fee module address for Marbu projects.
12    pub marbu_fee_module: Option<String>,
13}
14
15#[cw_serde]
16pub enum ExecuteMsg {
17    /// Admin message.
18    ///
19    /// Adds a new module to the hub registry.
20    /// Saves the module address to it's storage.
21    RegisterModule {
22        code_id: u64,
23        module: String,
24        msg: Option<Binary>,
25    },
26    /// Admin message.
27    ///
28    /// Updates the general hub information.
29    UpdateHubInfo {
30        name: String,
31        description: String,
32        image: String,
33        external_link: Option<String>,
34    },
35    /// Admin message.
36    ///
37    /// Removes a module from the hub module registry.
38    DeregisterModule { module: String },
39    /// Admin message.
40    ///
41    /// Updates the operators of this contract.
42    UpdateOperators { addrs: Vec<String> },
43    /// Admin message.
44    ///
45    /// Migrate the contracts available in framework.
46    MigrateContracts {
47        code_id: u64,
48        contract_address: String,
49        msg: Binary,
50    },
51}
52
53#[cw_serde]
54#[derive(QueryResponses)]
55pub enum QueryMsg {
56    /// Gets the contract's config.
57    #[returns(ResponseWrapper<ConfigResponse>)]
58    Config {},
59    /// Resolves the module address for the given module.
60    #[returns(ResponseWrapper<String>)]
61    ModuleAddress { module: String },
62    /// Lists the module names and addresses registered in the hub.
63    #[returns(ResponseWrapper<Vec<ModulesResponse>>)]
64    Modules {
65        start_after: Option<String>,
66        limit: Option<u8>,
67    },
68    /// Gets the operators of this contract.
69    #[returns(ResponseWrapper<Vec<String>>)]
70    Operators {},
71}
72
73#[cw_serde]
74pub struct ConfigResponse {
75    pub admin: String,
76    pub hub_info: HubInfo,
77}
78
79#[cw_serde]
80pub struct ModulesResponse {
81    pub name: String,
82    pub address: String,
83}
84
85#[cw_serde]
86pub struct MigrateMsg {}