abstract_core/core/
proxy.rs1use cosmwasm_schema::QueryResponses;
14use cosmwasm_std::{CosmosMsg, Empty, Uint128};
15use cw_asset::{Asset, AssetInfo};
16
17#[allow(unused_imports)]
18use crate::{
19 ibc_client::ExecuteMsg as IbcClientMsg,
20 objects::{
21 account::AccountId,
22 oracle::{AccountValue, Complexity},
23 price_source::{PriceSource, UncheckedPriceSource},
24 AssetEntry,
25 },
26};
27
28pub mod state {
29 use cosmwasm_std::Addr;
30 use cw_controllers::Admin;
31 use cw_storage_plus::Item;
32
33 pub use crate::objects::account::ACCOUNT_ID;
34 use crate::objects::{ans_host::AnsHost, common_namespace::ADMIN_NAMESPACE};
35 #[cosmwasm_schema::cw_serde]
36 pub struct State {
37 pub modules: Vec<Addr>,
38 }
39 pub const ANS_HOST: Item<AnsHost> = Item::new("\u{0}{6}ans_host");
40 pub const STATE: Item<State> = Item::new("\u{0}{5}state");
41 pub const ADMIN: Admin = Admin::new(ADMIN_NAMESPACE);
42}
43
44#[cosmwasm_schema::cw_serde]
45pub struct InstantiateMsg {
46 pub account_id: AccountId,
47 pub ans_host_address: String,
48 pub manager_addr: String,
49 pub base_asset: Option<AssetEntry>,
50}
51
52#[cosmwasm_schema::cw_serde]
53#[cfg_attr(feature = "interface", derive(cw_orch::ExecuteFns))]
54pub enum ExecuteMsg {
55 SetAdmin { admin: String },
57 ModuleAction { msgs: Vec<CosmosMsg<Empty>> },
59 ModuleActionWithData { msg: CosmosMsg<Empty> },
61 IbcAction { msgs: Vec<IbcClientMsg> },
63 AddModules { modules: Vec<String> },
65 RemoveModule { module: String },
67 UpdateAssets {
69 to_add: Vec<(AssetEntry, UncheckedPriceSource)>,
70 to_remove: Vec<AssetEntry>,
71 },
72}
73#[cosmwasm_schema::cw_serde]
74pub struct MigrateMsg {}
75
76#[cosmwasm_schema::cw_serde]
77#[derive(QueryResponses)]
78#[cfg_attr(feature = "interface", derive(cw_orch::QueryFns))]
79pub enum QueryMsg {
80 #[returns(ConfigResponse)]
83 Config {},
84 #[returns(AccountValue)]
87 TotalValue {},
88 #[returns(TokenValueResponse)]
92 TokenValue { identifier: AssetEntry },
93 #[returns(HoldingAmountResponse)]
96 HoldingAmount { identifier: AssetEntry },
97 #[returns(AssetConfigResponse)]
100 AssetConfig { identifier: AssetEntry },
101 #[returns(AssetsConfigResponse)]
104 AssetsConfig {
105 start_after: Option<AssetEntry>,
106 limit: Option<u8>,
107 },
108 #[returns(AssetsInfoResponse)]
111 AssetsInfo {
112 start_after: Option<AssetInfo>,
113 limit: Option<u8>,
114 },
115 #[returns(BaseAssetResponse)]
117 BaseAsset {},
118}
119
120#[cosmwasm_schema::cw_serde]
121pub struct ConfigResponse {
122 pub modules: Vec<String>,
123}
124
125#[cosmwasm_schema::cw_serde]
126pub struct TokenValueResponse {
127 pub value: Uint128,
128}
129
130#[cosmwasm_schema::cw_serde]
131pub struct BaseAssetResponse {
132 pub base_asset: AssetInfo,
133}
134
135#[cosmwasm_schema::cw_serde]
136pub struct HoldingAmountResponse {
137 pub amount: Uint128,
138}
139
140#[cosmwasm_schema::cw_serde]
142pub struct AssetConfigResponse {
143 pub price_source: UncheckedPriceSource,
144}
145
146#[cosmwasm_schema::cw_serde]
148pub struct AssetsInfoResponse {
149 pub assets: Vec<(AssetInfo, OracleAsset)>,
150}
151
152#[cosmwasm_schema::cw_serde]
154pub struct AssetsConfigResponse {
155 pub assets: Vec<(AssetEntry, UncheckedPriceSource)>,
156}
157
158#[cosmwasm_schema::cw_serde]
159pub struct OracleAsset {
160 pub price_source: PriceSource,
161 pub complexity: Complexity,
162}
163#[cosmwasm_schema::cw_serde]
165pub struct ValueQueryMsg {
166 pub asset: AssetInfo,
167 pub amount: Uint128,
168}
169#[cosmwasm_schema::cw_serde]
171pub struct ExternalValueResponse {
172 pub value: Asset,
173}