Struct AppContract

Source
pub struct AppContract<Error: ContractError, CustomInitMsg: 'static, CustomExecMsg: 'static, CustomQueryMsg: 'static, CustomMigrateMsg: 'static, SudoMsg: 'static = Empty> {
    pub admin: NestedAdmin,
    /* private fields */
}
Expand description

The state variables for our AppContract.

Fields§

§admin: NestedAdmin

Implementations§

Source§

impl<Error: ContractError, CustomInitMsg, CustomExecMsg, CustomQueryMsg, CustomMigrateMsg, SudoMsg> AppContract<Error, CustomInitMsg, CustomExecMsg, CustomQueryMsg, CustomMigrateMsg, SudoMsg>

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

Source

pub fn base_query( &self, deps: Deps<'_>, query: BaseQueryMsg, ) -> StdResult<Binary>

Source§

impl<Error: ContractError, CustomInitMsg, CustomExecMsg, CustomQueryMsg, CustomMigrateMsg, SudoMsg> AppContract<Error, CustomInitMsg, CustomExecMsg, CustomQueryMsg, CustomMigrateMsg, SudoMsg>

Constructor

Source

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

Source

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

Source

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

Source

pub fn module_info(&self) -> AbstractResult<ModuleInfo>

Source

pub fn load_state(&self, store: &dyn Storage) -> StdResult<AppState>

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_migrate( self, migrate_handler: MigrateHandlerFn<Self, CustomMigrateMsg, 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_ibc_callback( self, callback: 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, CustomMigrateMsg, SudoMsg> AbstractNameService for AppContract<Error, CustomInitMsg, CustomExecMsg, CustomQueryMsg, CustomMigrateMsg, 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, CustomMigrateMsg, SudoMsg> AbstractRegistryAccess for AppContract<Error, CustomInitMsg, CustomExecMsg, CustomQueryMsg, CustomMigrateMsg, SudoMsg>

Source§

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

Get the address of the registry.
Source§

impl<Error: ContractError, CustomInitMsg, CustomExecMsg, CustomQueryMsg, CustomMigrateMsg, SudoMsg> AccountIdentification for AppContract<Error, CustomInitMsg, CustomExecMsg, CustomQueryMsg, CustomMigrateMsg, SudoMsg>

Source§

fn account(&self, deps: Deps<'_>) -> AbstractSdkResult<Account>

Get the account address
Source§

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

Get the Account id for the current account.
Source§

impl<Error: From<StdError> + From<AppError> + From<AbstractSdkError> + From<AbstractError> + 'static, CustomInitMsg, CustomExecMsg: Serialize + JsonSchema + AppExecuteMsg, CustomQueryMsg, CustomMigrateMsg, SudoMsg> ExecuteEndpoint for AppContract<Error, CustomInitMsg, CustomExecMsg, CustomQueryMsg, CustomMigrateMsg, SudoMsg>

Source§

type ExecuteMsg = ExecuteMsg<BaseExecuteMsg, CustomExecMsg>

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, MigrateMsg, SudoMsg> Handler for AppContract<Error, InitMsg, ExecMsg, QueryMsg, MigrateMsg, SudoMsg>

Source§

type Error = Error

Error type for the contract
Source§

type CustomInitMsg = InitMsg

Custom init message for the contract
Source§

type CustomExecMsg = ExecMsg

Custom execute message for the contract
Source§

type CustomQueryMsg = QueryMsg

Custom query message for the contract
Source§

type CustomMigrateMsg = MigrateMsg

Custom migrate message for the contract
Source§

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_ibc_callback_handler( &self, ) -> Option<fn(DepsMut<'_>, Env, Self, Callback, IbcResult) -> Result<Response, Self::Error>>

Get an ibc callback handler if it exists.
Source§

fn maybe_module_ibc_handler( &self, ) -> Option<fn(DepsMut<'_>, Env, Self, ModuleIbcInfo, Binary) -> 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, CustomMigrateMsg, SudoMsg> IbcCallbackEndpoint for AppContract<Error, CustomInitMsg, CustomExecMsg, CustomQueryMsg, CustomMigrateMsg, SudoMsg>

Source§

fn ibc_client_addr(&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 + DeserializeOwned + JsonSchema, CustomExecMsg, CustomQueryMsg, CustomMigrateMsg, SudoMsg> InstantiateEndpoint for AppContract<Error, CustomInitMsg, CustomExecMsg, CustomQueryMsg, CustomMigrateMsg, SudoMsg>

Source§

type InstantiateMsg = InstantiateMsg<BaseInstantiateMsg, <AppContract<Error, CustomInitMsg, CustomExecMsg, CustomQueryMsg, CustomMigrateMsg, SudoMsg> as Handler>::CustomInitMsg>

The message type for the Instantiate entry point.
Source§

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

Handler for the Instantiate endpoint.
Source§

impl<Error: ContractError, CustomInitMsg, CustomExecMsg, CustomQueryMsg, CustomMigrateMsg: Serialize + JsonSchema, SudoMsg> MigrateEndpoint for AppContract<Error, CustomInitMsg, CustomExecMsg, CustomQueryMsg, CustomMigrateMsg, SudoMsg>

Source§

type MigrateMsg = MigrateMsg<BaseMigrateMsg, CustomMigrateMsg>

The message type for the Migrate entry point.
Source§

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

Handler for the Migrate endpoint.
Source§

impl<Error: ContractError, CustomInitMsg, CustomExecMsg, CustomQueryMsg, CustomMigrateMsg, SudoMsg> ModuleIbcEndpoint for AppContract<Error, CustomInitMsg, CustomExecMsg, CustomQueryMsg, CustomMigrateMsg, 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: AppQueryMsg, CustomMigrateMsg, SudoMsg> QueryEndpoint for AppContract<Error, CustomInitMsg, CustomExecMsg, CustomQueryMsg, CustomMigrateMsg, SudoMsg>

Source§

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, CustomMigrateMsg, SudoMsg> ReplyEndpoint for AppContract<Error, CustomInitMsg, CustomExecMsg, CustomQueryMsg, CustomMigrateMsg, 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, CustomMigrateMsg, SudoMsg> SudoEndpoint for AppContract<Error, CustomInitMsg, CustomExecMsg, CustomQueryMsg, CustomMigrateMsg, 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, CustomMigrateMsg, SudoMsg> Freeze for AppContract<Error, CustomInitMsg, CustomExecMsg, CustomQueryMsg, CustomMigrateMsg, SudoMsg>

§

impl<Error, CustomInitMsg, CustomExecMsg, CustomQueryMsg, CustomMigrateMsg, SudoMsg> RefUnwindSafe for AppContract<Error, CustomInitMsg, CustomExecMsg, CustomQueryMsg, CustomMigrateMsg, SudoMsg>

§

impl<Error, CustomInitMsg, CustomExecMsg, CustomQueryMsg, CustomMigrateMsg, SudoMsg> Send for AppContract<Error, CustomInitMsg, CustomExecMsg, CustomQueryMsg, CustomMigrateMsg, SudoMsg>

§

impl<Error, CustomInitMsg, CustomExecMsg, CustomQueryMsg, CustomMigrateMsg, SudoMsg> Sync for AppContract<Error, CustomInitMsg, CustomExecMsg, CustomQueryMsg, CustomMigrateMsg, SudoMsg>

§

impl<Error, CustomInitMsg, CustomExecMsg, CustomQueryMsg, CustomMigrateMsg, SudoMsg> Unpin for AppContract<Error, CustomInitMsg, CustomExecMsg, CustomQueryMsg, CustomMigrateMsg, SudoMsg>

§

impl<Error, CustomInitMsg, CustomExecMsg, CustomQueryMsg, CustomMigrateMsg, SudoMsg> UnwindSafe for AppContract<Error, CustomInitMsg, CustomExecMsg, CustomQueryMsg, CustomMigrateMsg, SudoMsg>

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> AccountExecutor for T

Source§

fn execute_on_account( &self, deps: Deps<'_>, msg: &ExecuteMsg, funds: Vec<Coin>, ) -> Result<CosmosMsg, AbstractSdkError>

Execute method on account contract
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> 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) -> &'static [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 registry contract. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

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>,

Source§

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>,

Source§

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V