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 publisher(&self) -> Result<Publisher<Chain>, AbstractClientError>
pub fn publisher(&self) -> Result<Publisher<Chain>, AbstractClientError>
Retrieves the Publisher
object from an account
This object is used to publish modules to Abstract
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, AbstractClientError>
pub fn info(&self) -> Result<AccountInfo, 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. Errors if this module already installed
Sourcepub fn install_standalone<M: InstallConfig + From<Contract<Chain>>>(
&self,
configuration: &M::InitMsg,
funds: &[Coin],
) -> Result<Application<Chain, M>, AbstractClientError>
pub fn install_standalone<M: InstallConfig + From<Contract<Chain>>>( &self, configuration: &M::InitMsg, funds: &[Coin], ) -> Result<Application<Chain, M>, AbstractClientError>
Install an standalone on the account.
if install_on_sub_account
is true
, the application will be installed on new a sub-account. (default)
Errors if this module already installed
Sourcepub fn install_service<M: InstallConfig + From<Contract<Chain>>>(
&self,
configuration: &M::InitMsg,
funds: &[Coin],
) -> Result<Application<Chain, M>, AbstractClientError>
pub fn install_service<M: InstallConfig + From<Contract<Chain>>>( &self, configuration: &M::InitMsg, funds: &[Coin], ) -> Result<Application<Chain, M>, AbstractClientError>
Install an service on the account.
if install_on_sub_account
is true
, the application will be installed on new a sub-account.
Errors if this module already installed
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. Errors if this module already installed
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.
Errors if this module installed
FIXME: Errors if any of the dependencies modules already installed
Sourcepub fn install_standalone_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_standalone_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 Standalone module and its dependencies with the provided dependencies config. \
The returned Application
is a wrapper around the sub-account and simplifies interaction with the Standalone module.
Sourcepub fn upgrade(
&self,
version: ModuleVersion,
) -> Result<Chain::Response, AbstractClientError>
pub fn upgrade( &self, version: ModuleVersion, ) -> Result<Chain::Response, AbstractClientError>
Upgrades the account to the latest version.
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::Response, AbstractClientError>
pub fn execute( &self, execute_msgs: impl IntoIterator<Item = impl Into<CosmosMsg>>, funds: &[Coin], ) -> Result<Chain::Response, AbstractClientError>
Executes a CosmosMsg
on the account.
Sourcepub fn configure(
&self,
execute_msg: &ExecuteMsg,
funds: &[Coin],
) -> Result<Chain::Response, AbstractClientError>
pub fn configure( &self, execute_msg: &ExecuteMsg, funds: &[Coin], ) -> Result<Chain::Response, AbstractClientError>
Executes a account::ExecuteMsg
on the account.
Sourcepub fn query_module<Q: Serialize + Debug, T: Serialize + DeserializeOwned>(
&self,
module_id: ModuleId<'_>,
msg: &Q,
) -> Result<T, AbstractClientError>
pub fn query_module<Q: Serialize + Debug, T: Serialize + DeserializeOwned>( &self, module_id: ModuleId<'_>, msg: &Q, ) -> Result<T, AbstractClientError>
Queries a module on the account.
Sourcepub fn set_ibc_status(
&self,
enabled: bool,
) -> Result<Chain::Response, AbstractClientError>
pub fn set_ibc_status( &self, enabled: bool, ) -> Result<Chain::Response, AbstractClientError>
Set IBC status on an 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 module_installed(
&self,
id: ModuleId<'_>,
) -> Result<bool, AbstractClientError>
pub fn module_installed( &self, id: ModuleId<'_>, ) -> Result<bool, AbstractClientError>
Check if module installed on account
Sourcepub fn module_version_installed(
&self,
module: ModuleInfo,
) -> Result<bool, AbstractClientError>
pub fn module_version_installed( &self, module: ModuleInfo, ) -> Result<bool, AbstractClientError>
Check if module version installed on account
Sourcepub fn ibc_status(&self) -> Result<bool, AbstractClientError>
pub fn ibc_status(&self) -> Result<bool, AbstractClientError>
Check if module installed on account
Sourcepub fn sub_account_builder(&self) -> AccountBuilder<'_, Chain>
pub fn sub_account_builder(&self) -> AccountBuilder<'_, Chain>
Builder to create a subaccount from this 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 address(&self) -> Result<Addr, AbstractClientError>
pub fn address(&self) -> Result<Addr, AbstractClientError>
Address of the account
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.
Sourcepub fn claim_namespace(
&self,
namespace: impl Into<String>,
) -> Result<Chain::Response, AbstractInterfaceError>
pub fn claim_namespace( &self, namespace: impl Into<String>, ) -> Result<Chain::Response, AbstractInterfaceError>
Claim a namespace for an existing account
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 Account
Sourcepub fn add_balance(&self, amount: &[Coin]) -> Result<(), AbstractClientError>
pub fn add_balance(&self, amount: &[Coin]) -> Result<(), AbstractClientError>
Add balance to the Account
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> 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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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