Struct abstract_interface::Manager
source · pub struct Manager<Chain>(/* private fields */);
Implementations§
source§impl<Chain: CwEnv> Manager<Chain>
impl<Chain: CwEnv> Manager<Chain>
pub fn upgrade_module<M: Serialize>( &self, module_id: &str, migrate_msg: &M ) -> Result<(), AbstractInterfaceError>
pub fn replace_api( &self, module_id: &str, funds: Option<&[Coin]> ) -> Result<(), AbstractInterfaceError>
pub fn install_modules( &self, modules: Vec<ModuleInstallConfig>, funds: Option<&[Coin]> ) -> Result<Chain::Response, AbstractInterfaceError>
pub fn install_modules_auto( &self, modules: Vec<ModuleInstallConfig> ) -> Result<Chain::Response, AbstractInterfaceError>
pub fn install_module<TInitMsg: Serialize>( &self, module_id: &str, init_msg: Option<&TInitMsg>, funds: Option<&[Coin]> ) -> Result<Chain::Response, AbstractInterfaceError>
pub fn install_module_version<M: Serialize>( &self, module_id: &str, version: ModuleVersion, init_msg: Option<&M>, funds: Option<&[Coin]> ) -> Result<Chain::Response, AbstractInterfaceError>
pub fn execute_on_module( &self, module: &str, msg: impl Serialize ) -> Result<<Chain as TxHandler>::Response, AbstractInterfaceError>
sourcepub fn module_info(
&self,
module_id: &str
) -> Result<Option<ManagerModuleInfo>, AbstractInterfaceError>
pub fn module_info( &self, module_id: &str ) -> Result<Option<ManagerModuleInfo>, AbstractInterfaceError>
Return the module info installed on the manager
sourcepub fn module_address(
&self,
module_id: impl Into<String>
) -> Result<Addr, AbstractInterfaceError>
pub fn module_address( &self, module_id: impl Into<String> ) -> Result<Addr, AbstractInterfaceError>
Get the address of a module Will err when not installed.
pub fn is_module_installed( &self, module_id: &str ) -> Result<bool, AbstractInterfaceError>
sourcepub fn register_remote_account(
&self,
host_chain: &str
) -> Result<<Chain as TxHandler>::Response, AbstractInterfaceError>
pub fn register_remote_account( &self, host_chain: &str ) -> Result<<Chain as TxHandler>::Response, AbstractInterfaceError>
Helper to create remote accounts
pub fn execute_on_remote( &self, host_chain: &str, msg: ExecuteMsg ) -> Result<<Chain as TxHandler>::Response, AbstractInterfaceError>
pub fn execute_on_remote_module( &self, host_chain: &str, module_id: &str, msg: Binary ) -> Result<<Chain as TxHandler>::Response, AbstractInterfaceError>
pub fn send_all_funds_back( &self, host_chain: &str ) -> Result<<Chain as TxHandler>::Response, AbstractInterfaceError>
Trait Implementations§
source§impl<Chain: ChainState> ContractInstance<Chain> for Manager<Chain>
impl<Chain: ChainState> ContractInstance<Chain> for Manager<Chain>
source§fn as_instance(&self) -> &Contract<Chain>
fn as_instance(&self) -> &Contract<Chain>
Return a reference to the underlying contract instance.
source§fn as_instance_mut(&mut self) -> &mut Contract<Chain>
fn as_instance_mut(&mut self) -> &mut Contract<Chain>
Return a mutable reference to the underlying contract instance.
source§fn set_address(&self, address: &Addr)
fn set_address(&self, address: &Addr)
Sets the address for the contract. Useful when the contract is already initialized
and not registered in the configured state file.
source§fn set_default_address(&mut self, address: &Addr)
fn set_default_address(&mut self, address: &Addr)
Sets a default address for the contract. If the contract already has an address registered in the state, this won’t be used.
This is mostly used to ship address with a cw-orch package.
source§fn set_code_id(&self, code_id: u64)
fn set_code_id(&self, code_id: u64)
Sets the code_id for the contract. Useful when the contract is already initialized
and not registered in the configured state file.
source§fn set_default_code_id(&mut self, code_id: u64)
fn set_default_code_id(&mut self, code_id: u64)
Sets a default address for the contract. If the contract already has an address registered in the state, this won’t be used.
This is mostly used to ship address with a cw-orch package.
source§impl<Chain> ExecutableContract for Manager<Chain>
impl<Chain> ExecutableContract for Manager<Chain>
§type ExecuteMsg = ExecuteMsg
type ExecuteMsg = ExecuteMsg
Execute message for the contract.
source§impl<Chain> InstantiableContract for Manager<Chain>
impl<Chain> InstantiableContract for Manager<Chain>
§type InstantiateMsg = InstantiateMsg
type InstantiateMsg = InstantiateMsg
Instantiate message for the contract.
source§impl<Chain> MigratableContract for Manager<Chain>
impl<Chain> MigratableContract for Manager<Chain>
§type MigrateMsg = MigrateMsg
type MigrateMsg = MigrateMsg
Migrate message for the contract.
source§impl<Chain> QueryableContract for Manager<Chain>
impl<Chain> QueryableContract for Manager<Chain>
source§impl<Chain: CwEnv> Uploadable for Manager<Chain>
impl<Chain: CwEnv> Uploadable for Manager<Chain>
Auto Trait Implementations§
impl<Chain> Freeze for Manager<Chain>where
Chain: Freeze,
impl<Chain> RefUnwindSafe for Manager<Chain>where
Chain: RefUnwindSafe,
impl<Chain> Send for Manager<Chain>where
Chain: Send,
impl<Chain> Sync for Manager<Chain>where
Chain: Sync,
impl<Chain> Unpin for Manager<Chain>where
Chain: Unpin,
impl<Chain> UnwindSafe for Manager<Chain>where
Chain: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T, Chain> ConditionalMigrate<Chain> for T
impl<T, Chain> ConditionalMigrate<Chain> for T
source§fn migrate_if_needed(
&self,
migrate_msg: &Self::MigrateMsg
) -> Result<Option<<Chain as TxHandler>::Response>, CwEnvError>
fn migrate_if_needed( &self, migrate_msg: &Self::MigrateMsg ) -> Result<Option<<Chain as TxHandler>::Response>, CwEnvError>
Only migrate the contract if it is not on the latest code-id yet
source§fn upload_and_migrate_if_needed(
&self,
migrate_msg: &Self::MigrateMsg
) -> Result<Option<Vec<<Chain as TxHandler>::Response>>, CwEnvError>
fn upload_and_migrate_if_needed( &self, migrate_msg: &Self::MigrateMsg ) -> Result<Option<Vec<<Chain as TxHandler>::Response>>, CwEnvError>
Uploads the contract if the local contract hash is different from the latest on-chain code hash.
Proceeds to migrates the contract if the contract is not running the latest code.
source§impl<T, Chain> ConditionalUpload<Chain> for Twhere
Chain: CwEnv,
T: CwOrchUpload<Chain>,
impl<T, Chain> ConditionalUpload<Chain> for Twhere
Chain: CwEnv,
T: CwOrchUpload<Chain>,
source§fn upload_if_needed(
&self
) -> Result<Option<<Chain as TxHandler>::Response>, CwEnvError>
fn upload_if_needed( &self ) -> Result<Option<<Chain as TxHandler>::Response>, CwEnvError>
Only upload the contract if it is not uploaded yet (checksum does not match)
source§fn latest_is_uploaded(&self) -> Result<bool, CwEnvError>
fn latest_is_uploaded(&self) -> Result<bool, CwEnvError>
Returns whether the checksum of the WASM file matches the checksum of the latest uploaded code for this contract.
source§fn is_running_latest(&self) -> Result<bool, CwEnvError>
fn is_running_latest(&self) -> Result<bool, CwEnvError>
Returns whether the contract is running the latest uploaded code for it
source§impl<T, Chain> CwOrchExecute<Chain> for T
impl<T, Chain> CwOrchExecute<Chain> for T
source§fn execute(
&self,
execute_msg: &Self::ExecuteMsg,
coins: Option<&[Coin]>
) -> Result<<Chain as TxHandler>::Response, CwEnvError>
fn execute( &self, execute_msg: &Self::ExecuteMsg, coins: Option<&[Coin]> ) -> Result<<Chain as TxHandler>::Response, CwEnvError>
Send a ExecuteMsg to the contract.
source§impl<T, Chain> CwOrchInstantiate<Chain> for T
impl<T, Chain> CwOrchInstantiate<Chain> for T
source§fn instantiate(
&self,
instantiate_msg: &Self::InstantiateMsg,
admin: Option<&Addr>,
coins: Option<&[Coin]>
) -> Result<<Chain as TxHandler>::Response, CwEnvError>
fn instantiate( &self, instantiate_msg: &Self::InstantiateMsg, admin: Option<&Addr>, coins: Option<&[Coin]> ) -> Result<<Chain as TxHandler>::Response, CwEnvError>
Instantiates the contract.
source§fn instantiate2(
&self,
instantiate_msg: &Self::InstantiateMsg,
admin: Option<&Addr>,
coins: Option<&[Coin]>,
salt: Binary
) -> Result<<Chain as TxHandler>::Response, CwEnvError>
fn instantiate2( &self, instantiate_msg: &Self::InstantiateMsg, admin: Option<&Addr>, coins: Option<&[Coin]>, salt: Binary ) -> Result<<Chain as TxHandler>::Response, CwEnvError>
Instantiates the contract using instantiate2
source§impl<T, Chain> CwOrchMigrate<Chain> for T
impl<T, Chain> CwOrchMigrate<Chain> for T
source§fn migrate(
&self,
migrate_msg: &Self::MigrateMsg,
new_code_id: u64
) -> Result<<Chain as TxHandler>::Response, CwEnvError>
fn migrate( &self, migrate_msg: &Self::MigrateMsg, new_code_id: u64 ) -> Result<<Chain as TxHandler>::Response, CwEnvError>
Migrate the contract.
source§impl<T, Chain> CwOrchQuery<Chain> for T
impl<T, Chain> CwOrchQuery<Chain> for T
source§impl<T, Chain> CwOrchUpload<Chain> for T
impl<T, Chain> CwOrchUpload<Chain> for T
source§impl<SupportedContract, Chain> ExecuteMsgFns<Chain> for SupportedContract
impl<SupportedContract, Chain> ExecuteMsgFns<Chain> for SupportedContract
source§fn exec_on_module(
&self,
exec_msg: Binary,
module_id: String,
coins: &[Coin]
) -> Result<<Chain as TxHandler>::Response, CwEnvError>
fn exec_on_module( &self, exec_msg: Binary, module_id: String, coins: &[Coin] ) -> Result<<Chain as TxHandler>::Response, CwEnvError>
Automatically generated wrapper around ExecuteMsg::ExecOnModule variant
source§fn update_internal_config(
&self,
arg0: Binary
) -> Result<<Chain as TxHandler>::Response, CwEnvError>
fn update_internal_config( &self, arg0: Binary ) -> Result<<Chain as TxHandler>::Response, CwEnvError>
Automatically generated wrapper around ExecuteMsg::UpdateInternalConfig variant
source§fn install_modules(
&self,
modules: Vec<ModuleInstallConfig>,
coins: &[Coin]
) -> Result<<Chain as TxHandler>::Response, CwEnvError>
fn install_modules( &self, modules: Vec<ModuleInstallConfig>, coins: &[Coin] ) -> Result<<Chain as TxHandler>::Response, CwEnvError>
Automatically generated wrapper around ExecuteMsg::InstallModules variant
source§fn uninstall_module(
&self,
module_id: String
) -> Result<<Chain as TxHandler>::Response, CwEnvError>
fn uninstall_module( &self, module_id: String ) -> Result<<Chain as TxHandler>::Response, CwEnvError>
Automatically generated wrapper around ExecuteMsg::UninstallModule variant
source§fn upgrade(
&self,
modules: Vec<(ModuleInfo, Option<Binary>)>
) -> Result<<Chain as TxHandler>::Response, CwEnvError>
fn upgrade( &self, modules: Vec<(ModuleInfo, Option<Binary>)> ) -> Result<<Chain as TxHandler>::Response, CwEnvError>
Automatically generated wrapper around ExecuteMsg::Upgrade variant
source§fn create_sub_account(
&self,
install_modules: Vec<ModuleInstallConfig>,
name: String,
account_id: Option<u32>,
base_asset: Option<AssetEntry>,
description: Option<String>,
link: Option<String>,
namespace: Option<String>,
coins: &[Coin]
) -> Result<<Chain as TxHandler>::Response, CwEnvError>
fn create_sub_account( &self, install_modules: Vec<ModuleInstallConfig>, name: String, account_id: Option<u32>, base_asset: Option<AssetEntry>, description: Option<String>, link: Option<String>, namespace: Option<String>, coins: &[Coin] ) -> Result<<Chain as TxHandler>::Response, CwEnvError>
Automatically generated wrapper around ExecuteMsg::CreateSubAccount variant
source§fn update_info(
&self,
description: Option<String>,
link: Option<String>,
name: Option<String>
) -> Result<<Chain as TxHandler>::Response, CwEnvError>
fn update_info( &self, description: Option<String>, link: Option<String>, name: Option<String> ) -> Result<<Chain as TxHandler>::Response, CwEnvError>
Automatically generated wrapper around ExecuteMsg::UpdateInfo variant
source§fn propose_owner(
&self,
owner: GovernanceDetails<String>
) -> Result<<Chain as TxHandler>::Response, CwEnvError>
fn propose_owner( &self, owner: GovernanceDetails<String> ) -> Result<<Chain as TxHandler>::Response, CwEnvError>
Automatically generated wrapper around ExecuteMsg::ProposeOwner variant
source§fn update_status(
&self,
is_suspended: Option<bool>
) -> Result<<Chain as TxHandler>::Response, CwEnvError>
fn update_status( &self, is_suspended: Option<bool> ) -> Result<<Chain as TxHandler>::Response, CwEnvError>
Automatically generated wrapper around ExecuteMsg::UpdateStatus variant
source§fn update_settings(
&self,
ibc_enabled: Option<bool>
) -> Result<<Chain as TxHandler>::Response, CwEnvError>
fn update_settings( &self, ibc_enabled: Option<bool> ) -> Result<<Chain as TxHandler>::Response, CwEnvError>
Automatically generated wrapper around ExecuteMsg::UpdateSettings variant
source§fn update_sub_account(
&self,
arg0: UpdateSubAccountAction
) -> Result<<Chain as TxHandler>::Response, CwEnvError>
fn update_sub_account( &self, arg0: UpdateSubAccountAction ) -> Result<<Chain as TxHandler>::Response, CwEnvError>
Automatically generated wrapper around ExecuteMsg::UpdateSubAccount variant
source§fn callback(
&self,
arg0: CallbackMsg
) -> Result<<Chain as TxHandler>::Response, CwEnvError>
fn callback( &self, arg0: CallbackMsg ) -> Result<<Chain as TxHandler>::Response, CwEnvError>
Automatically generated wrapper around ExecuteMsg::Callback variant
source§fn update_ownership(
&self,
arg0: Action
) -> Result<<Chain as TxHandler>::Response, CwEnvError>
fn update_ownership( &self, arg0: Action ) -> Result<<Chain as TxHandler>::Response, CwEnvError>
Automatically generated wrapper around ExecuteMsg::UpdateOwnership variant
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§impl<SupportedContract, Chain> QueryMsgFns<Chain> for SupportedContract
impl<SupportedContract, Chain> QueryMsgFns<Chain> for SupportedContract
source§fn module_versions(
&self,
ids: Vec<String>
) -> Result<ModuleVersionsResponse, CwEnvError>
fn module_versions( &self, ids: Vec<String> ) -> Result<ModuleVersionsResponse, CwEnvError>
Automatically generated wrapper around QueryMsg::ModuleVersions variant
source§fn module_addresses(
&self,
ids: Vec<String>
) -> Result<ModuleAddressesResponse, CwEnvError>
fn module_addresses( &self, ids: Vec<String> ) -> Result<ModuleAddressesResponse, CwEnvError>
Automatically generated wrapper around QueryMsg::ModuleAddresses variant
source§fn module_infos(
&self,
limit: Option<u8>,
start_after: Option<String>
) -> Result<ModuleInfosResponse, CwEnvError>
fn module_infos( &self, limit: Option<u8>, start_after: Option<String> ) -> Result<ModuleInfosResponse, CwEnvError>
Automatically generated wrapper around QueryMsg::ModuleInfos variant
source§fn config(&self) -> Result<ConfigResponse, CwEnvError>
fn config(&self) -> Result<ConfigResponse, CwEnvError>
Automatically generated wrapper around QueryMsg::Config variant
source§fn info(&self) -> Result<InfoResponse, CwEnvError>
fn info(&self) -> Result<InfoResponse, CwEnvError>
Automatically generated wrapper around QueryMsg::Info variant
source§fn sub_account_ids(
&self,
limit: Option<u8>,
start_after: Option<u32>
) -> Result<SubAccountIdsResponse, CwEnvError>
fn sub_account_ids( &self, limit: Option<u8>, start_after: Option<u32> ) -> Result<SubAccountIdsResponse, CwEnvError>
Automatically generated wrapper around QueryMsg::SubAccountIds variant
source§fn top_level_owner(&self) -> Result<TopLevelOwnerResponse, CwEnvError>
fn top_level_owner(&self) -> Result<TopLevelOwnerResponse, CwEnvError>
Automatically generated wrapper around QueryMsg::TopLevelOwner variant