abstract_client/
source.rs

1use abstract_std::objects::{namespace::Namespace, AccountId};
2use cosmwasm_std::Addr;
3
4/// Represents the a route to fetch an account from.
5pub enum AccountSource {
6    /// Get the account from a registered [`Namespace`].
7    Namespace(Namespace),
8    /// Get the account from an [`AccountId`].
9    AccountId(AccountId),
10    /// Get the account from the address of an installed App.
11    App(Addr),
12}
13
14impl From<Namespace> for AccountSource {
15    fn from(namespace: Namespace) -> Self {
16        AccountSource::Namespace(namespace)
17    }
18}
19
20impl From<AccountId> for AccountSource {
21    fn from(account_id: AccountId) -> Self {
22        AccountSource::AccountId(account_id)
23    }
24}