abstract_std/
base.rs

1use cosmwasm_schema::QueryResponses;
2use cosmwasm_std::Empty;
3
4use crate::ibc::{IbcResponseMsg, ModuleIbcMsg};
5
6// ANCHOR: exec
7/// Wrapper around all possible messages that can be sent to the module.
8#[cosmwasm_schema::cw_serde]
9pub enum ExecuteMsg<BaseMsg, CustomExecMsg> {
10    /// A configuration message, defined by the base.
11    Base(BaseMsg),
12    /// An app request defined by a base consumer.
13    Module(CustomExecMsg),
14    /// IbcReceive to process IBC callbacks
15    /// In order to trust this, the apps and adapters verify this comes from the ibc-client contract.
16    IbcCallback(IbcResponseMsg),
17    /// ModuleIbc endpoint to receive messages from modules on other chains  
18    /// In order to trust this, the apps and adapters verify this comes from the ibc-host contract.
19    /// They should also trust the sending chain
20    ModuleIbc(ModuleIbcMsg),
21}
22// ANCHOR_END: exec
23
24// ANCHOR: init
25#[cosmwasm_schema::cw_serde]
26pub struct InstantiateMsg<BaseMsg, CustomInitMsg = Empty> {
27    /// base instantiate information
28    pub base: BaseMsg,
29    /// custom instantiate msg
30    pub module: CustomInitMsg,
31}
32// ANCHOR_END: init
33
34// ANCHOR: query
35#[cosmwasm_schema::cw_serde]
36#[derive(QueryResponses)]
37#[query_responses(nested)]
38pub enum QueryMsg<BaseMsg, CustomQueryMsg = Empty> {
39    /// A query to the base.
40    Base(BaseMsg),
41    /// Custom query
42    Module(CustomQueryMsg),
43}
44// ANCHOR_END: query
45
46// ANCHOR: migrate
47#[cosmwasm_schema::cw_serde]
48pub struct MigrateMsg<BaseMsg = Empty, CustomMigrateMsg = Empty> {
49    /// base migrate information
50    pub base: BaseMsg,
51    /// custom migrate msg
52    pub module: CustomMigrateMsg,
53}
54// ANCHOR_END: migrate