Struct abstract_adapter::state::AdapterContract

source ·
pub struct AdapterContract<Error: ContractError, CustomInitMsg: 'static, CustomExecMsg: 'static, CustomQueryMsg: 'static, Receive: 'static = Empty, SudoMsg: 'static = Empty>
where Self: Handler,
{ pub authorized_addresses: Map<'static, Addr, Vec<Addr>>, pub target_account: Option<AccountBase>, /* private fields */ }
Expand description

The state variables for our AdapterContract.

Fields§

§authorized_addresses: Map<'static, Addr, Vec<Addr>>

Map ProxyAddr -> AuthorizedAddrs

§target_account: Option<AccountBase>

The Account on which commands are executed. Set each time in the abstract_std::adapter::ExecuteMsg::Base handler.

Implementations§

source§

impl<Error: ContractError, CustomInitMsg, CustomExecMsg, CustomQueryMsg, ReceiveMsg, SudoMsg> AdapterContract<Error, CustomInitMsg, CustomExecMsg, CustomQueryMsg, ReceiveMsg, SudoMsg>

Constructor

source

pub const fn new( name: &'static str, version: &'static str, metadata: Option<&'static str> ) -> Self

source

pub fn version(&self) -> &'static str

source

pub fn state(&self, store: &dyn Storage) -> StdResult<AdapterState>

source

pub fn target(&self) -> Result<&Addr, AdapterError>

Return the address of the proxy for the Account associated with this Adapter. Set each time in the abstract_std::adapter::ExecuteMsg::Base handler.

source

pub const fn with_dependencies( self, dependencies: &'static [StaticDependency] ) -> Self

add dependencies to the contract

source

pub const fn with_instantiate( self, instantiate_handler: InstantiateHandlerFn<Self, CustomInitMsg, Error> ) -> Self

source

pub const fn with_execute( self, execute_handler: ExecuteHandlerFn<Self, CustomExecMsg, Error> ) -> Self

source

pub const fn with_query( self, query_handler: QueryHandlerFn<Self, CustomQueryMsg, Error> ) -> Self

source

pub const fn with_replies( self, reply_handlers: &'static [(u64, ReplyHandlerFn<Self, Error>)] ) -> Self

source

pub const fn with_sudo( self, sudo_handler: SudoHandlerFn<Self, SudoMsg, Error> ) -> Self

source

pub const fn with_receive( self, receive_handler: ReceiveHandlerFn<Self, ReceiveMsg, Error> ) -> Self

source

pub const fn with_ibc_callbacks( self, callbacks: &'static [(&'static str, IbcCallbackHandlerFn<Self, Error>)] ) -> Self

add IBC callback handler to contract

source

pub const fn with_module_ibc( self, module_handler: ModuleIbcHandlerFn<Self, Error> ) -> Self

add Module IBC to contract

Trait Implementations§

source§

impl<Error: ContractError, CustomInitMsg, CustomExecMsg, CustomQueryMsg, ReceiveMsg, SudoMsg> AbstractNameService for AdapterContract<Error, CustomInitMsg, CustomExecMsg, CustomQueryMsg, ReceiveMsg, SudoMsg>

source§

fn ans_host(&self, deps: Deps<'_>) -> AbstractSdkResult<AnsHost>

Get the ANS host address.
source§

fn name_service<'a>( &'a self, deps: Deps<'a> ) -> AbstractNameServiceClient<'a, Self>

Construct the name service client.
source§

impl<Error: ContractError, CustomInitMsg, CustomExecMsg, CustomQueryMsg, ReceiveMsg, SudoMsg> AbstractRegistryAccess for AdapterContract<Error, CustomInitMsg, CustomExecMsg, CustomQueryMsg, ReceiveMsg, SudoMsg>

Get the version control contract

source§

fn abstract_registry( &self, deps: Deps<'_> ) -> AbstractSdkResult<VersionControlContract>

Get the address of the registry.
source§

impl<Error: ContractError, CustomInitMsg, CustomExecMsg, CustomQueryMsg, ReceiveMsg, SudoMsg> AccountIdentification for AdapterContract<Error, CustomInitMsg, CustomExecMsg, CustomQueryMsg, ReceiveMsg, SudoMsg>

Retrieve identifying information about the calling Account

source§

fn proxy_address(&self, _deps: Deps<'_>) -> AbstractSdkResult<Addr>

Get the proxy address for the current account.
source§

fn manager_address(&self, _deps: Deps<'_>) -> AbstractSdkResult<Addr>

Get the manager address for the current account.
source§

fn account_base(&self, _deps: Deps<'_>) -> AbstractSdkResult<AccountBase>

Get the AccountBase for the current account.
source§

fn account_id(&self, deps: Deps<'_>) -> Result<AccountId, AbstractSdkError>

Get the Account id for the current account.
source§

impl<Error: ContractError, CustomInitMsg, CustomExecMsg: Serialize + JsonSchema + AdapterExecuteMsg, CustomQueryMsg, ReceiveMsg: Serialize + JsonSchema, SudoMsg> ExecuteEndpoint for AdapterContract<Error, CustomInitMsg, CustomExecMsg, CustomQueryMsg, ReceiveMsg, SudoMsg>

§

type ExecuteMsg = ExecuteMsg<BaseExecuteMsg, AdapterRequestMsg<CustomExecMsg>, ReceiveMsg>

The message type for the Execute entry point.
source§

fn execute( self, deps: DepsMut<'_>, env: Env, info: MessageInfo, msg: Self::ExecuteMsg ) -> Result<Response, Error>

Handler for the Execute endpoint.
source§

impl<Error: ContractError, InitMsg, ExecMsg, QueryMsg, ReceiveMsg, SudoMsg> Handler for AdapterContract<Error, InitMsg, ExecMsg, QueryMsg, ReceiveMsg, SudoMsg>

§

type Error = Error

Error type for the contract
§

type CustomInitMsg = InitMsg

Custom init message for the contract
§

type CustomExecMsg = ExecMsg

Custom execute message for the contract
§

type CustomQueryMsg = QueryMsg

Custom query message for the contract
§

type CustomMigrateMsg = Empty

Custom migrate message for the contract
§

type ReceiveMsg = ReceiveMsg

Receive message for the contract
§

type SudoMsg = SudoMsg

Sudo message for the contract
source§

fn contract(&self) -> &AbstractContract<Self, Error>

Returns the contract object.
source§

fn stored_version( &self, store: &dyn Storage ) -> Result<ContractVersion, AbstractSdkError>

Returns the cw2 contract version.
source§

fn info(&self) -> (&'static str, &'static str, Option<&'static str>)

Returns the static contract info.
source§

fn dependencies(&self) -> &'static [StaticDependency]

Returns the static contract dependencies.
source§

fn maybe_execute_handler( &self ) -> Option<fn(_: DepsMut<'_>, _: Env, _: MessageInfo, _: Self, _: Self::CustomExecMsg) -> Result<Response, Self::Error>>

Get an execute handler if it exists.
source§

fn execute_handler( &self ) -> Result<fn(_: DepsMut<'_>, _: Env, _: MessageInfo, _: Self, _: Self::CustomExecMsg) -> Result<Response, Self::Error>, AbstractSdkError>

Get an execute handler or return an error.
source§

fn maybe_instantiate_handler( &self ) -> Option<fn(_: DepsMut<'_>, _: Env, _: MessageInfo, _: Self, _: Self::CustomInitMsg) -> Result<Response, Self::Error>>

Get a instantiate handler if it exists.
source§

fn instantiate_handler( &self ) -> Result<fn(_: DepsMut<'_>, _: Env, _: MessageInfo, _: Self, _: Self::CustomInitMsg) -> Result<Response, Self::Error>, AbstractSdkError>

Get an instantiate handler or return an error.
source§

fn maybe_query_handler( &self ) -> Option<fn(_: Deps<'_>, _: Env, _: &Self, _: Self::CustomQueryMsg) -> Result<Binary, Self::Error>>

Get a query handler if it exists.
source§

fn query_handler( &self ) -> Result<fn(_: Deps<'_>, _: Env, _: &Self, _: Self::CustomQueryMsg) -> Result<Binary, Self::Error>, AbstractSdkError>

Get a query handler or return an error.
source§

fn maybe_migrate_handler( &self ) -> Option<fn(_: DepsMut<'_>, _: Env, _: Self, _: Self::CustomMigrateMsg) -> Result<Response, Self::Error>>

Get a migrate handler if it exists.
source§

fn migrate_handler( &self ) -> Result<fn(_: DepsMut<'_>, _: Env, _: Self, _: Self::CustomMigrateMsg) -> Result<Response, Self::Error>, AbstractSdkError>

Get a migrate handler or return an error.
source§

fn maybe_sudo_handler( &self ) -> Option<fn(_: DepsMut<'_>, _: Env, _: Self, _: Self::SudoMsg) -> Result<Response, Self::Error>>

Get a sudo handler if it exists.
source§

fn sudo_handler( &self ) -> Result<fn(_: DepsMut<'_>, _: Env, _: Self, _: Self::SudoMsg) -> Result<Response, Self::Error>, AbstractSdkError>

Get a sudo handler or return an error.
source§

fn maybe_receive_handler( &self ) -> Option<fn(_: DepsMut<'_>, _: Env, _: MessageInfo, _: Self, _: Self::ReceiveMsg) -> Result<Response, Self::Error>>

Get a reply handler if it exists.
source§

fn receive_handler( &self ) -> Result<fn(_: DepsMut<'_>, _: Env, _: MessageInfo, _: Self, _: Self::ReceiveMsg) -> Result<Response, Self::Error>, AbstractSdkError>

Get a receive handler or return an error.
source§

fn maybe_ibc_callback_handler( &self, id: &str ) -> Option<fn(_: DepsMut<'_>, _: Env, _: MessageInfo, _: Self, _: IbcResponseMsg) -> Result<Response, Self::Error>>

Get an ibc callback handler if it exists.
source§

fn maybe_module_ibc_handler( &self ) -> Option<fn(_: DepsMut<'_>, _: Env, _: Self, _: ModuleIbcMsg) -> Result<Response, Self::Error>>

Get an IBC module call handler if it exists.
source§

fn maybe_reply_handler( &self, id: u64 ) -> Option<fn(_: DepsMut<'_>, _: Env, _: Self, _: Reply) -> Result<Response, Self::Error>>

Get a reply handler if it exists.
source§

fn reply_handler( &self, id: u64 ) -> Result<fn(_: DepsMut<'_>, _: Env, _: Self, _: Reply) -> Result<Response, Self::Error>, AbstractSdkError>

Get a reply handler or return an error.
source§

impl<Error: ContractError, CustomInitMsg, CustomExecMsg, CustomQueryMsg, ReceiveMsg, SudoMsg> IbcCallbackEndpoint for AdapterContract<Error, CustomInitMsg, CustomExecMsg, CustomQueryMsg, ReceiveMsg, SudoMsg>

source§

fn ibc_client(&self, deps: Deps<'_>) -> Result<Addr, Self::Error>

Queries the IBC Client address.
source§

fn ibc_callback( self, deps: DepsMut<'_>, env: Env, info: MessageInfo, msg: IbcResponseMsg ) -> Result<Response, Self::Error>

Handler for the ExecuteMsg::IbcCallback() variant.
source§

impl<Error: ContractError, CustomInitMsg: Serialize + JsonSchema, CustomExecMsg, CustomQueryMsg, ReceiveMsg, SudoMsg> InstantiateEndpoint for AdapterContract<Error, CustomInitMsg, CustomExecMsg, CustomQueryMsg, ReceiveMsg, SudoMsg>

source§

fn instantiate( self, deps: DepsMut<'_>, env: Env, info: MessageInfo, msg: Self::InstantiateMsg ) -> Result<Response, Error>

Instantiate the api

§

type InstantiateMsg = InstantiateMsg<BaseInstantiateMsg, CustomInitMsg>

The message type for the Instantiate entry point.
source§

impl<Error: ContractError, CustomInitMsg, CustomExecMsg, CustomQueryMsg, ReceiveMsg, SudoMsg> ModuleIbcEndpoint for AdapterContract<Error, CustomInitMsg, CustomExecMsg, CustomQueryMsg, ReceiveMsg, SudoMsg>

source§

fn ibc_host(&self, deps: Deps<'_>) -> Result<Addr, Self::Error>

Get the address of the ibc host associated with this module
source§

fn module_ibc( self, deps: DepsMut<'_>, env: Env, info: MessageInfo, msg: ModuleIbcMsg ) -> Result<Response, Self::Error>

Handler for the ExecuteMsg::ModuleIbc(ModuleIbcMsg) variant.
source§

impl<Error: ContractError, CustomInitMsg, CustomExecMsg, CustomQueryMsg: AdapterQueryMsg, ReceiveMsg, SudoMsg> QueryEndpoint for AdapterContract<Error, CustomInitMsg, CustomExecMsg, CustomQueryMsg, ReceiveMsg, SudoMsg>

Where we dispatch the queries for the AdapterContract These AdapterQueryMsg declarations can be found in abstract_sdk::std::common_module::app_msg

§

type QueryMsg = QueryMsg<BaseQueryMsg, CustomQueryMsg>

The message type for the Query entry point.
source§

fn query( &self, deps: Deps<'_>, env: Env, msg: Self::QueryMsg ) -> Result<Binary, Error>

Handler for the Query endpoint.
source§

impl<Error: ContractError, CustomInitMsg, CustomExecMsg, CustomQueryMsg, ReceiveMsg, SudoMsg> ReceiveEndpoint for AdapterContract<Error, CustomInitMsg, CustomExecMsg, CustomQueryMsg, ReceiveMsg, SudoMsg>

source§

fn receive( self, deps: DepsMut<'_>, env: Env, info: MessageInfo, msg: Self::ReceiveMsg ) -> Result<Response, Self::Error>

Handler for the ExecuteMsg::Receive() variant.
source§

impl<Error: ContractError, CustomInitMsg, CustomExecMsg, CustomQueryMsg, ReceiveMsg, SudoMsg> ReplyEndpoint for AdapterContract<Error, CustomInitMsg, CustomExecMsg, CustomQueryMsg, ReceiveMsg, SudoMsg>

source§

fn reply( self, deps: DepsMut<'_>, env: Env, msg: Reply ) -> Result<Response, Self::Error>

Handler for the Reply endpoint.
source§

impl<Error: ContractError, CustomInitMsg, CustomExecMsg, CustomQueryMsg, ReceiveMsg, SudoMsg> SudoEndpoint for AdapterContract<Error, CustomInitMsg, CustomExecMsg, CustomQueryMsg, ReceiveMsg, SudoMsg>

source§

fn sudo( self, deps: DepsMut<'_>, env: Env, msg: Self::SudoMsg ) -> Result<Response, Self::Error>

Handler for the Sudo endpoint.

Auto Trait Implementations§

§

impl<Error, CustomInitMsg, CustomExecMsg, CustomQueryMsg, Receive, SudoMsg> Freeze for AdapterContract<Error, CustomInitMsg, CustomExecMsg, CustomQueryMsg, Receive, SudoMsg>
where AdapterContract<Error, CustomInitMsg, CustomExecMsg, CustomQueryMsg, Receive, SudoMsg>: Sized,

§

impl<Error, CustomInitMsg, CustomExecMsg, CustomQueryMsg, Receive, SudoMsg> RefUnwindSafe for AdapterContract<Error, CustomInitMsg, CustomExecMsg, CustomQueryMsg, Receive, SudoMsg>
where AdapterContract<Error, CustomInitMsg, CustomExecMsg, CustomQueryMsg, Receive, SudoMsg>: Sized,

§

impl<Error, CustomInitMsg, CustomExecMsg, CustomQueryMsg, Receive, SudoMsg> Send for AdapterContract<Error, CustomInitMsg, CustomExecMsg, CustomQueryMsg, Receive, SudoMsg>
where AdapterContract<Error, CustomInitMsg, CustomExecMsg, CustomQueryMsg, Receive, SudoMsg>: Sized,

§

impl<Error, CustomInitMsg, CustomExecMsg, CustomQueryMsg, Receive, SudoMsg> Sync for AdapterContract<Error, CustomInitMsg, CustomExecMsg, CustomQueryMsg, Receive, SudoMsg>
where AdapterContract<Error, CustomInitMsg, CustomExecMsg, CustomQueryMsg, Receive, SudoMsg>: Sized,

§

impl<Error, CustomInitMsg, CustomExecMsg, CustomQueryMsg, Receive, SudoMsg> Unpin for AdapterContract<Error, CustomInitMsg, CustomExecMsg, CustomQueryMsg, Receive, SudoMsg>
where AdapterContract<Error, CustomInitMsg, CustomExecMsg, CustomQueryMsg, Receive, SudoMsg>: Sized,

§

impl<Error, CustomInitMsg, CustomExecMsg, CustomQueryMsg, Receive, SudoMsg> UnwindSafe for AdapterContract<Error, CustomInitMsg, CustomExecMsg, CustomQueryMsg, Receive, SudoMsg>
where AdapterContract<Error, CustomInitMsg, CustomExecMsg, CustomQueryMsg, Receive, SudoMsg>: Sized,

Blanket Implementations§

source§

impl<T> AbstractResponse for T

source§

fn response(&self, action: impl Into<String>) -> Response

Respond with an abstract-specific event that contains the contract name and the action.
source§

fn custom_response( &self, action: impl Into<String>, attributes: impl IntoIterator<Item = impl Into<Attribute>> ) -> Response

.response() with additional attributes.
source§

impl<T> AccountVerification for T

source§

fn account_registry<'a>( &'a self, deps: Deps<'a> ) -> Result<AccountRegistry<'a, Self>, AbstractSdkError>

API for querying and verifying a sender’s identity in the context of Abstract Accounts. Read more
source§

impl<T> AccountingInterface for T

source§

fn accountant<'a>(&'a self, deps: Deps<'a>) -> Accountant<'a, Self>

API for querying the Account’s asset values and accounting configuration. Read more
source§

impl<T> AdapterInterface for T

source§

fn adapters<'a>(&'a self, deps: Deps<'a>) -> Adapters<'a, Self>

API for accessing Abstract Adapters installed on the account. Read more
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<T> AppInterface for T

source§

fn apps<'a>(&'a self, deps: Deps<'a>) -> Apps<'a, Self>

API for accessing Abstract Apps installed on the account. 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> Dependencies for T
where T: Handler,

source§

fn dependencies(&self) -> &[StaticDependency]

Get the dependencies of the module.
source§

impl<T> Execution for T

source§

fn executor<'a>(&'a self, deps: Deps<'a>) -> Executor<'a, Self>

API for executing AccountActions on the Account. Group your actions together in a single execute call if possible. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> IbcInterface for T

source§

fn ibc_client<'a>(&'a self, deps: Deps<'a>) -> IbcClient<'a, Self>

API for interacting with the Abstract IBC client. Read more
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> ModuleIdentification for T
where T: Handler,

source§

fn module_id(&self) -> &'static str

Get the module identifier.
source§

impl<T> ModuleInterface for T

source§

fn modules<'a>(&'a self, deps: Deps<'a>) -> Modules<'a, Self>

API for retrieving information about installed modules. Read more
source§

impl<T> ModuleRegistryInterface for T

source§

fn module_registry<'a>( &'a self, deps: Deps<'a> ) -> Result<ModuleRegistry<'a, Self>, AbstractSdkError>

API for querying module information from the Abstract version control contract. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> TransferInterface for T

source§

fn bank<'a>(&'a self, deps: Deps<'a>) -> Bank<'a, Self>

API for transferring funds to and from the account. 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.