1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
use crate::{
ibc_client::ExecuteMsg as IbcClientMsg,
objects::{
core::OsId,
proxy_asset::{ProxyAsset, UncheckedProxyAsset},
AssetEntry,
},
};
use cosmwasm_schema::QueryResponses;
use cosmwasm_std::{CosmosMsg, Empty, Uint128};
pub mod state {
pub use crate::objects::core::OS_ID;
use cw_controllers::Admin;
use cosmwasm_std::Addr;
use cw_storage_plus::{Item, Map};
use crate::objects::{
ans_host::AnsHost, asset_entry::AssetEntry, common_namespace::ADMIN_NAMESPACE,
proxy_asset::ProxyAsset,
};
#[cosmwasm_schema::cw_serde]
pub struct State {
pub modules: Vec<Addr>,
}
pub const ANS_HOST: Item<AnsHost> = Item::new("\u{0}{6}ans_host");
pub const STATE: Item<State> = Item::new("\u{0}{5}state");
pub const ADMIN: Admin = Admin::new(ADMIN_NAMESPACE);
pub const VAULT_ASSETS: Map<&AssetEntry, ProxyAsset> = Map::new("proxy_assets");
}
#[cosmwasm_schema::cw_serde]
pub struct InstantiateMsg {
pub os_id: OsId,
pub ans_host_address: String,
}
#[cosmwasm_schema::cw_serde]
#[cfg_attr(feature = "boot", derive(boot_core::ExecuteFns))]
pub enum ExecuteMsg {
SetAdmin { admin: String },
ModuleAction { msgs: Vec<CosmosMsg<Empty>> },
IbcAction { msgs: Vec<IbcClientMsg> },
AddModule { module: String },
RemoveModule { module: String },
UpdateAssets {
to_add: Vec<UncheckedProxyAsset>,
to_remove: Vec<String>,
},
}
#[cosmwasm_schema::cw_serde]
pub struct MigrateMsg {}
#[cosmwasm_schema::cw_serde]
#[derive(QueryResponses)]
#[cfg_attr(feature = "boot", derive(boot_core::QueryFns))]
pub enum QueryMsg {
#[returns(ConfigResponse)]
Config {},
#[returns(TotalValueResponse)]
TotalValue {},
#[returns(TokenValueResponse)]
TokenValue {
identifier: String,
amount: Option<Uint128>,
},
#[returns(HoldingValueResponse)]
HoldingValue { identifier: String },
#[returns(HoldingAmountResponse)]
HoldingAmount { identifier: String },
#[returns(AssetConfigResponse)]
AssetConfig { identifier: String },
#[returns(AssetsResponse)]
Assets {
start_after: Option<String>,
limit: Option<u8>,
},
#[returns(ValidityResponse)]
CheckValidity {},
#[returns(BaseAssetResponse)]
BaseAsset {},
}
#[cosmwasm_schema::cw_serde]
pub struct ConfigResponse {
pub modules: Vec<String>,
}
#[cosmwasm_schema::cw_serde]
pub struct TotalValueResponse {
pub value: Uint128,
}
#[cosmwasm_schema::cw_serde]
pub struct TokenValueResponse {
pub value: Uint128,
}
#[cosmwasm_schema::cw_serde]
pub struct HoldingValueResponse {
pub value: Uint128,
}
#[cosmwasm_schema::cw_serde]
pub struct ValidityResponse {
pub unresolvable_assets: Option<Vec<AssetEntry>>,
pub missing_dependencies: Option<Vec<AssetEntry>>,
}
#[cosmwasm_schema::cw_serde]
pub struct BaseAssetResponse {
pub base_asset: ProxyAsset,
}
#[cosmwasm_schema::cw_serde]
pub struct HoldingAmountResponse {
pub amount: Uint128,
}
#[cosmwasm_schema::cw_serde]
pub struct AssetConfigResponse {
pub proxy_asset: ProxyAsset,
}
#[cosmwasm_schema::cw_serde]
pub struct AssetsResponse {
pub assets: Vec<(AssetEntry, ProxyAsset)>,
}
#[cosmwasm_schema::cw_serde]
pub struct ValueQueryMsg {
pub asset: AssetEntry,
pub amount: Uint128,
}
#[cosmwasm_schema::cw_serde]
pub struct ExternalValueResponse {
pub value: Uint128,
}