Struct abstract_interface::AbstractAccount

source ·
pub struct AbstractAccount<Chain: CwEnv> {
    pub manager: Manager<Chain>,
    pub proxy: Proxy<Chain>,
}

Fields§

§manager: Manager<Chain>§proxy: Proxy<Chain>

Implementations§

source§

impl<Chain: CwEnv> AbstractAccount<Chain>

source§

impl<Chain: CwEnv> AbstractAccount<Chain>

source

pub fn new(abstract_deployment: &Abstract<Chain>, account_id: AccountId) -> Self

source

pub fn register( &self, version_control: &VersionControl<Chain>, ) -> Result<(), AbstractInterfaceError>

Register the account core contracts in the version control

source

pub fn install_module<TInitMsg: Serialize>( &self, module_id: &str, init_msg: Option<&TInitMsg>, funds: Option<&[Coin]>, ) -> Result<Chain::Response, AbstractInterfaceError>

source

pub fn install_modules( &self, modules: Vec<ModuleInstallConfig>, funds: Option<&[Coin]>, ) -> Result<Chain::Response, AbstractInterfaceError>

source

pub fn install_modules_auto( &self, modules: Vec<ModuleInstallConfig>, ) -> Result<Chain::Response, AbstractInterfaceError>

source

pub fn expect_modules( &self, module_addrs: Vec<String>, ) -> Result<Vec<ManagerModuleInfo>, AbstractInterfaceError>

Assert that the Account has the expected modules with the provided expected_module_addrs installed. Note that the proxy is automatically included in the assertions. Returns the Vec<ManagerModuleInfo> from the manager

source

pub fn is_module_installed( &self, module_id: &str, ) -> Result<bool, AbstractInterfaceError>

source

pub fn expect_whitelist( &self, whitelisted_addrs: Vec<String>, ) -> Result<Vec<String>, AbstractInterfaceError>

Checks that the proxy’s whitelist includes the expected module addresses. Automatically includes the manager in the expected whitelist.

source

pub fn id(&self) -> Result<AccountId, AbstractInterfaceError>

Gets the account ID of the account.

source

pub fn install_adapter<CustomInitMsg: Serialize, T: AdapterDeployer<Chain, CustomInitMsg>>( &self, adapter: &T, funds: Option<&[Coin]>, ) -> Result<Addr, AbstractInterfaceError>

Installs an adapter from an adapter object

source

pub fn install_app<CustomInitMsg: Serialize, T: ContractInstance<Chain>>( &self, app: &T, custom_init_msg: &CustomInitMsg, funds: Option<&[Coin]>, ) -> Result<Addr, AbstractInterfaceError>

Installs an app from an app object

source

pub fn install_standalone<CustomInitMsg: Serialize, T: ContractInstance<Chain>>( &self, standalone: &T, custom_init_msg: &CustomInitMsg, funds: Option<&[Coin]>, ) -> Result<Addr, AbstractInterfaceError>

Installs an standalone from an standalone object

source

pub fn register_remote_account( &self, host_chain: TruncatedChainId, ) -> Result<<Chain as TxHandler>::Response, AbstractInterfaceError>

source

pub fn create_remote_account( &self, account_details: AccountDetails, host_chain: TruncatedChainId, ) -> Result<<Chain as TxHandler>::Response, AbstractInterfaceError>

source

pub fn create_sub_account( &self, account_details: AccountDetails, funds: Option<&[Coin]>, ) -> Result<AbstractAccount<Chain>, AbstractInterfaceError>

source

pub fn upload_and_register_if_needed( &self, version_control: &VersionControl<Chain>, ) -> Result<bool, AbstractInterfaceError>

source

pub fn upgrade( &self, abstract_deployment: &Abstract<Chain>, ) -> Result<bool, AbstractInterfaceError>

Attempts to upgrade the Account returns true if any migrations were performed.

source

pub fn claim_namespace( &self, namespace: impl Into<String>, ) -> Result<Chain::Response, AbstractInterfaceError>

Trait Implementations§

source§

impl<Chain: CwEnv> AsRef<AbstractAccount<Chain>> for AbstractAccount<Chain>

source§

fn as_ref(&self) -> &AbstractAccount<Chain>

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<Chain: Clone + CwEnv> Clone for AbstractAccount<Chain>

source§

fn clone(&self) -> AbstractAccount<Chain>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<Chain: CwEnv> Display for AbstractAccount<Chain>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<Chain> Freeze for AbstractAccount<Chain>
where Chain: Freeze,

§

impl<Chain> RefUnwindSafe for AbstractAccount<Chain>
where Chain: RefUnwindSafe,

§

impl<Chain> Send for AbstractAccount<Chain>
where Chain: Send,

§

impl<Chain> Sync for AbstractAccount<Chain>
where Chain: Sync,

§

impl<Chain> Unpin for AbstractAccount<Chain>
where Chain: Unpin,

§

impl<Chain> UnwindSafe for AbstractAccount<Chain>
where Chain: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<U> As for U

source§

fn as_<T>(self) -> T
where T: CastFrom<U>,

Casts 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
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> DynClone for T
where T: Clone,

source§

fn __clone_box(&self, _: Private) -> *mut ()

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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 more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.