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 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: ContractInstance<Chain> + InstallConfig + From<Contract<Chain>>>(
&self,
configuration: &M::InitMsg,
funds: &[Coin]
) -> Result<Application<Chain, M>, AbstractClientError>
pub fn install_app<M: ContractInstance<Chain> + InstallConfig + From<Contract<Chain>>>( &self, configuration: &M::InitMsg, funds: &[Coin] ) -> Result<Application<Chain, M>, AbstractClientError>
Install an application on the account. This creates a new sub-account and installs the application on it.
sourcepub fn install_adapter<M: ContractInstance<Chain> + InstallConfig<InitMsg = Empty> + From<Contract<Chain>>>(
&self,
funds: &[Coin]
) -> Result<Application<Chain, M>, AbstractClientError>
pub fn install_adapter<M: ContractInstance<Chain> + InstallConfig<InitMsg = Empty> + From<Contract<Chain>>>( &self, funds: &[Coin] ) -> Result<Application<Chain, M>, AbstractClientError>
Install an application on current account.
sourcepub fn install_app_with_dependencies<M: ContractInstance<Chain> + DependencyCreation + InstallConfig + From<Contract<Chain>> + Clone>(
&self,
module_configuration: &M::InitMsg,
dependencies_config: M::DependenciesConfig,
funds: &[Coin]
) -> Result<Application<Chain, M>, AbstractClientError>
pub fn install_app_with_dependencies<M: ContractInstance<Chain> + DependencyCreation + InstallConfig + From<Contract<Chain>> + Clone>( &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 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 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 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
source§impl<Chain: MutCwEnv> Account<Chain>
impl<Chain: MutCwEnv> Account<Chain>
sourcepub fn set_balance(&self, amount: Vec<Coin>) -> Result<(), AbstractClientError>
pub fn set_balance(&self, amount: Vec<Coin>) -> Result<(), AbstractClientError>
Set balance for the Proxy
sourcepub fn add_balance(&self, amount: Vec<Coin>) -> Result<(), AbstractClientError>
pub fn add_balance(&self, amount: Vec<Coin>) -> Result<(), AbstractClientError>
Add balance to the Proxy
Trait Implementations§
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> 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§
§impl<U> As for U
impl<U> As for U
§fn as_<T>(self) -> Twhere
T: CastFrom<U>,
fn as_<T>(self) -> Twhere
T: CastFrom<U>,
self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more