abstract_core/base.rs
1use cosmwasm_schema::QueryResponses;
2use cosmwasm_std::Empty;
3
4use crate::ibc::IbcResponseMsg;
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, ReceiveMsg = Empty> {
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 /// Receive endpoint for CW20 / external service integrations
18 Receive(ReceiveMsg),
19}
20// ANCHOR_END: exec
21
22// ANCHOR: init
23#[cosmwasm_schema::cw_serde]
24pub struct InstantiateMsg<BaseMsg, CustomInitMsg = Empty> {
25 /// base instantiate information
26 pub base: BaseMsg,
27 /// custom instantiate msg
28 pub module: CustomInitMsg,
29}
30// ANCHOR_END: init
31
32// ANCHOR: query
33#[cosmwasm_schema::cw_serde]
34#[derive(QueryResponses)]
35#[query_responses(nested)]
36pub enum QueryMsg<BaseMsg, CustomQueryMsg = Empty> {
37 /// A query to the base.
38 Base(BaseMsg),
39 /// Custom query
40 Module(CustomQueryMsg),
41}
42// ANCHOR_END: query
43
44// ANCHOR: migrate
45#[cosmwasm_schema::cw_serde]
46pub struct MigrateMsg<BaseMsg = Empty, CustomMigrateMsg = Empty> {
47 /// base migrate information
48 pub base: BaseMsg,
49 /// custom migrate msg
50 pub module: CustomMigrateMsg,
51}
52// ANCHOR_END: migrate