Struct abstract_client::Account
source · pub struct Account<Chain: CwEnv> { /* private fields */ }
Expand description
Represents an existing Abstract account.
Get this struct from AbstractClient::account_from_namespace
or create a new account with the AccountBuilder
.
Implementations§
source§impl<Chain: CwEnv> Account<Chain>
impl<Chain: CwEnv> Account<Chain>
sourcepub fn install_on_sub_account(&self) -> bool
pub fn install_on_sub_account(&self) -> bool
Wether this account installs his applications on a sub account
sourcepub fn query_balance(
&self,
denom: impl Into<String>
) -> Result<Uint128, AbstractClientError>
pub fn query_balance( &self, denom: impl Into<String> ) -> Result<Uint128, AbstractClientError>
Query account balance of a given denom
sourcepub fn query_balances(&self) -> Result<Vec<Coin>, AbstractClientError>
pub fn query_balances(&self) -> Result<Vec<Coin>, AbstractClientError>
Query account balances of all denoms
sourcepub fn info(&self) -> Result<AccountInfo<Addr>, AbstractClientError>
pub fn info(&self) -> Result<AccountInfo<Addr>, AbstractClientError>
Query account info
sourcepub fn install_app<M: InstallConfig + From<Contract<Chain>>>(
&self,
configuration: &M::InitMsg,
funds: &[Coin]
) -> Result<Application<Chain, M>, AbstractClientError>
pub fn install_app<M: InstallConfig + From<Contract<Chain>>>( &self, configuration: &M::InitMsg, funds: &[Coin] ) -> Result<Application<Chain, M>, AbstractClientError>
Install an application on the account.
if install_on_sub_account
is true
, the application will be installed on new a sub-account. (default)
sourcepub fn install_adapter<M: InstallConfig<InitMsg = Empty> + From<Contract<Chain>>>(
&self,
funds: &[Coin]
) -> Result<Application<Chain, M>, AbstractClientError>
pub fn install_adapter<M: InstallConfig<InitMsg = Empty> + From<Contract<Chain>>>( &self, funds: &[Coin] ) -> Result<Application<Chain, M>, AbstractClientError>
Install an adapter on current account.
sourcepub fn install_app_with_dependencies<M: DependencyCreation + InstallConfig + From<Contract<Chain>>>(
&self,
module_configuration: &M::InitMsg,
dependencies_config: M::DependenciesConfig,
funds: &[Coin]
) -> Result<Application<Chain, M>, AbstractClientError>
pub fn install_app_with_dependencies<M: DependencyCreation + InstallConfig + From<Contract<Chain>>>( &self, module_configuration: &M::InitMsg, dependencies_config: M::DependenciesConfig, funds: &[Coin] ) -> Result<Application<Chain, M>, AbstractClientError>
Creates a new sub-account on the current account and installs an App module and its dependencies with the provided dependencies config.
The returned Application
is a wrapper around the sub-account and simplifies interaction with the App module.
sourcepub fn upgrade(&self, version: ModuleVersion) -> Result<(), AbstractClientError>
pub fn upgrade(&self, version: ModuleVersion) -> Result<(), AbstractClientError>
Upgrades the account to the latest version
Migrates manager and proxy contracts to their respective new versions.
sourcepub fn ownership(&self) -> Result<Ownership<String>, AbstractClientError>
pub fn ownership(&self) -> Result<Ownership<String>, AbstractClientError>
Returns owner of the account
sourcepub fn owner(&self) -> Result<Addr, AbstractClientError>
pub fn owner(&self) -> Result<Addr, AbstractClientError>
Returns the owner address of the account. If the account is a sub-account, it will return the top-level owner address.
sourcepub fn execute(
&self,
execute_msgs: impl IntoIterator<Item = impl Into<CosmosMsg>>,
funds: &[Coin]
) -> Result<<Chain as TxHandler>::Response, AbstractClientError>
pub fn execute( &self, execute_msgs: impl IntoIterator<Item = impl Into<CosmosMsg>>, funds: &[Coin] ) -> Result<<Chain as TxHandler>::Response, AbstractClientError>
Executes a CosmosMsg
on the proxy of the account.
sourcepub fn set_ibc_status(&self, enabled: bool) -> Result<(), AbstractClientError>
pub fn set_ibc_status(&self, enabled: bool) -> Result<(), AbstractClientError>
Set IBC status on an Account.
sourcepub fn create_ibc_account(
&self,
host_chain: impl Into<String>,
base_asset: Option<AssetEntry>,
namespace: Option<String>,
install_modules: Vec<ModuleInstallConfig>
) -> Result<<Chain as TxHandler>::Response, AbstractClientError>
pub fn create_ibc_account( &self, host_chain: impl Into<String>, base_asset: Option<AssetEntry>, namespace: Option<String>, install_modules: Vec<ModuleInstallConfig> ) -> Result<<Chain as TxHandler>::Response, AbstractClientError>
Executes an ibc action on the proxy of the account
sourcepub fn module_infos(&self) -> Result<ModuleInfosResponse, AbstractClientError>
pub fn module_infos(&self) -> Result<ModuleInfosResponse, AbstractClientError>
Module infos of installed modules on account
sourcepub fn module_addresses(
&self,
ids: Vec<String>
) -> Result<ModuleAddressesResponse, AbstractClientError>
pub fn module_addresses( &self, ids: Vec<String> ) -> Result<ModuleAddressesResponse, AbstractClientError>
Addresses of installed modules on account
sourcepub fn sub_accounts(&self) -> Result<Vec<Account<Chain>>, AbstractClientError>
pub fn sub_accounts(&self) -> Result<Vec<Account<Chain>>, AbstractClientError>
Get Sub Accounts of this account
sourcepub fn proxy(&self) -> Result<Addr, AbstractClientError>
pub fn proxy(&self) -> Result<Addr, AbstractClientError>
Address of the proxy
sourcepub fn manager(&self) -> Result<Addr, AbstractClientError>
pub fn manager(&self) -> Result<Addr, AbstractClientError>
Address of the manager
sourcepub fn application<M: RegisteredModule + From<Contract<Chain>>>(
&self
) -> Result<Application<Chain, M>, AbstractClientError>
pub fn application<M: RegisteredModule + From<Contract<Chain>>>( &self ) -> Result<Application<Chain, M>, AbstractClientError>
Retrieve installed application on account This can’t retrieve sub-account installed applications.
source§impl<Chain: MutCwEnv> Account<Chain>
impl<Chain: MutCwEnv> Account<Chain>
sourcepub fn set_balance(&self, amount: &[Coin]) -> Result<(), AbstractClientError>
pub fn set_balance(&self, amount: &[Coin]) -> Result<(), AbstractClientError>
Set balance for the Proxy
sourcepub fn add_balance(&self, amount: &[Coin]) -> Result<(), AbstractClientError>
pub fn add_balance(&self, amount: &[Coin]) -> Result<(), AbstractClientError>
Add balance to the Proxy
Trait Implementations§
source§impl<Chain: CwEnv> AsRef<AbstractAccount<Chain>> for Account<Chain>
impl<Chain: CwEnv> AsRef<AbstractAccount<Chain>> for Account<Chain>
source§fn as_ref(&self) -> &AbstractAccount<Chain>
fn as_ref(&self) -> &AbstractAccount<Chain>
source§impl<Chain: CwEnv> Environment<Chain> for Account<Chain>
impl<Chain: CwEnv> Environment<Chain> for Account<Chain>
source§fn environment(&self) -> Chain
fn environment(&self) -> Chain
Auto Trait Implementations§
impl<Chain> Freeze for Account<Chain>where
Chain: Freeze,
impl<Chain> RefUnwindSafe for Account<Chain>where
Chain: RefUnwindSafe,
impl<Chain> Send for Account<Chain>where
Chain: Send,
impl<Chain> Sync for Account<Chain>where
Chain: Sync,
impl<Chain> Unpin for Account<Chain>where
Chain: Unpin,
impl<Chain> UnwindSafe for Account<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
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>
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>
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 more