use crate::Manager;
pub use abstract_core::proxy::{ExecuteMsgFns as ProxyExecFns, QueryMsgFns as ProxyQueryFns};
use abstract_core::{
objects::{price_source::UncheckedPriceSource, AssetEntry},
proxy::*,
MANAGER, PROXY,
};
use boot_core::{contract, Contract, ContractInstance, CwEnv};
#[contract(InstantiateMsg, ExecuteMsg, QueryMsg, MigrateMsg)]
pub struct Proxy<Chain>;
impl<Chain: CwEnv> Proxy<Chain> {
pub fn new(name: &str, chain: Chain) -> Self {
let mut contract = Contract::new(name, chain);
contract = contract.with_wasm_path("abstract_proxy");
Self(contract)
}
pub fn set_proxy_asset(
&self,
to_add: Vec<(AssetEntry, UncheckedPriceSource)>,
) -> Result<(), crate::AbstractBootError> {
let manager = Manager::new(MANAGER, self.get_chain().clone());
manager.execute_on_module(
PROXY,
ExecuteMsg::UpdateAssets {
to_add,
to_remove: vec![],
},
)?;
Ok(())
}
}