use crate::{
base::{
ExecuteMsg as EndpointExecMsg, InstantiateMsg as EndpointInstantiateMsg,
MigrateMsg as EndpointMigrateMsg, QueryMsg as EndpointQueryMsg,
},
objects::{gov_type::TopLevelOwnerResponse, module_version::ModuleDataResponse},
registry::Account,
};
pub type ExecuteMsg<ModuleMsg = Empty> = EndpointExecMsg<BaseExecuteMsg, ModuleMsg>;
pub type QueryMsg<ModuleMsg = Empty> = EndpointQueryMsg<BaseQueryMsg, ModuleMsg>;
pub type InstantiateMsg<ModuleMsg = Empty> = EndpointInstantiateMsg<BaseInstantiateMsg, ModuleMsg>;
pub type MigrateMsg<ModuleMsg = Empty> = EndpointMigrateMsg<BaseMigrateMsg, ModuleMsg>;
use cosmwasm_schema::QueryResponses;
use cosmwasm_std::{Addr, Empty};
#[allow(unused_imports)]
use cw_controllers::AdminResponse;
use serde::Serialize;
pub trait AppExecuteMsg: Serialize {}
impl<T: AppExecuteMsg> From<T> for ExecuteMsg<T> {
fn from(module: T) -> Self {
Self::Module(module)
}
}
impl AppExecuteMsg for Empty {}
pub trait AppQueryMsg: Serialize {}
impl<T: AppQueryMsg> From<T> for QueryMsg<T> {
fn from(module: T) -> Self {
Self::Module(module)
}
}
impl AppQueryMsg for Empty {}
#[cosmwasm_schema::cw_serde]
pub struct BaseInstantiateMsg {
pub account: Account,
}
#[cosmwasm_schema::cw_serde]
#[derive(cw_orch::ExecuteFns)]
pub enum BaseExecuteMsg {}
impl<T> From<BaseExecuteMsg> for ExecuteMsg<T> {
fn from(base: BaseExecuteMsg) -> Self {
Self::Base(base)
}
}
#[cosmwasm_schema::cw_serde]
#[derive(QueryResponses, cw_orch::QueryFns)]
pub enum BaseQueryMsg {
#[returns(AppConfigResponse)]
BaseConfig {},
#[returns(AdminResponse)]
BaseAdmin {},
#[returns(ModuleDataResponse)]
ModuleData {},
#[returns(TopLevelOwnerResponse)]
TopLevelOwner {},
}
impl<T> From<BaseQueryMsg> for QueryMsg<T> {
fn from(base: BaseQueryMsg) -> Self {
Self::Base(base)
}
}
#[cosmwasm_schema::cw_serde]
pub struct AppConfigResponse {
pub account: Addr,
pub ans_host_address: Addr,
pub registry_address: Addr,
}
#[cosmwasm_schema::cw_serde]
pub struct BaseMigrateMsg {}
#[cosmwasm_schema::cw_serde]
pub struct AppState {
pub account: Account,
}