Struct abstract_extension::state::ExtensionContract
source · pub struct ExtensionContract<Error: From<StdError> + From<ExtensionError> + 'static, CustomExecMsg: 'static = Empty, CustomInitMsg: 'static = Empty, CustomQueryMsg: 'static = Empty, Receive: 'static = Empty> {
pub traders: Map<'static, Addr, HashSet<Addr>>,
pub target_os: Option<Core>,
/* private fields */
}
Expand description
The state variables for our ExtensionContract.
Fields§
§traders: Map<'static, Addr, HashSet<Addr>>
§target_os: Option<Core>
Stores the extension version
Implementations§
source§impl<Error: From<StdError> + From<ExtensionError>, CustomExecMsg: Serialize + JsonSchema, CustomInitMsg: Serialize + JsonSchema, CustomQueryMsg: Serialize + JsonSchema, ReceiveMsg: Serialize + JsonSchema> ExtensionContract<Error, CustomExecMsg, CustomInitMsg, CustomQueryMsg, ReceiveMsg>
impl<Error: From<StdError> + From<ExtensionError>, CustomExecMsg: Serialize + JsonSchema, CustomInitMsg: Serialize + JsonSchema, CustomQueryMsg: Serialize + JsonSchema, ReceiveMsg: Serialize + JsonSchema> ExtensionContract<Error, CustomExecMsg, CustomInitMsg, CustomQueryMsg, ReceiveMsg>
pub fn export_schema(out_dir: &Path)
source§impl<Error: From<StdError> + From<ExtensionError>, CustomExecMsg, CustomInitMsg, CustomQueryMsg, ReceiveMsg> ExtensionContract<Error, CustomExecMsg, CustomInitMsg, CustomQueryMsg, ReceiveMsg>
impl<Error: From<StdError> + From<ExtensionError>, CustomExecMsg, CustomInitMsg, CustomQueryMsg, ReceiveMsg> ExtensionContract<Error, CustomExecMsg, CustomInitMsg, CustomQueryMsg, ReceiveMsg>
Constructor
pub const fn new(name: &'static str, version: &'static str) -> Self
sourcepub const fn with_dependencies(
self,
dependencies: &'static [&'static str]
) -> Self
pub const fn with_dependencies(
self,
dependencies: &'static [&'static str]
) -> Self
add dependencies to the contract
pub const fn with_replies(
self,
reply_handlers: &'static [(u64, ReplyHandlerFn<Self, Error>)]
) -> Self
sourcepub const fn with_ibc_callbacks(
self,
callbacks: &'static [(&'static str, IbcCallbackHandlerFn<Self, Error>)]
) -> Self
pub const fn with_ibc_callbacks(
self,
callbacks: &'static [(&'static str, IbcCallbackHandlerFn<Self, Error>)]
) -> Self
add IBC callback handler to contract
pub const fn with_instantiate(
self,
instantiate_handler: InstantiateHandlerFn<Self, CustomInitMsg, Error>
) -> Self
pub const fn with_receive(
self,
receive_handler: ReceiveHandlerFn<Self, ReceiveMsg, Error>
) -> Self
pub const fn with_execute(
self,
execute_handler: ExecuteHandlerFn<Self, CustomExecMsg, Error>
) -> Self
pub const fn with_query(
self,
query_handler: QueryHandlerFn<Self, CustomQueryMsg>
) -> Self
pub fn state(&self, store: &dyn Storage) -> StdResult<ExtensionState>
pub fn target(&self) -> Result<&Addr, ExtensionError>
Trait Implementations§
source§impl<Error: From<StdError> + From<ExtensionError>, CustomExecMsg, CustomInitMsg, CustomQueryMsg, ReceiveMsg> AbstractNameService for ExtensionContract<Error, CustomExecMsg, CustomInitMsg, CustomQueryMsg, ReceiveMsg>
impl<Error: From<StdError> + From<ExtensionError>, CustomExecMsg, CustomInitMsg, CustomQueryMsg, ReceiveMsg> AbstractNameService for ExtensionContract<Error, CustomExecMsg, CustomInitMsg, CustomQueryMsg, ReceiveMsg>
source§impl<Error: From<StdError> + From<ExtensionError>, CustomExecMsg: Serialize + JsonSchema, CustomInitMsg, CustomQueryMsg, ReceiveMsg: Serialize + JsonSchema> ExecuteEndpoint for ExtensionContract<Error, CustomExecMsg, CustomInitMsg, CustomQueryMsg, ReceiveMsg>
impl<Error: From<StdError> + From<ExtensionError>, CustomExecMsg: Serialize + JsonSchema, CustomInitMsg, CustomQueryMsg, ReceiveMsg: Serialize + JsonSchema> ExecuteEndpoint for ExtensionContract<Error, CustomExecMsg, CustomInitMsg, CustomQueryMsg, ReceiveMsg>
type ExecuteMsg = ExecuteMsg<BaseExecuteMsg, ExtensionRequestMsg<CustomExecMsg>, ReceiveMsg>
source§fn execute(
self,
deps: DepsMut<'_>,
env: Env,
info: MessageInfo,
msg: Self::ExecuteMsg
) -> Result<Response, Error>
fn execute(
self,
deps: DepsMut<'_>,
env: Env,
info: MessageInfo,
msg: Self::ExecuteMsg
) -> Result<Response, Error>
Entry point for contract execution
source§impl<Error: From<StdError> + From<ExtensionError>, ExecMsg, InitMsg, QueryMsg, Receive> Handler for ExtensionContract<Error, ExecMsg, InitMsg, QueryMsg, Receive>
impl<Error: From<StdError> + From<ExtensionError>, ExecMsg, InitMsg, QueryMsg, Receive> Handler for ExtensionContract<Error, ExecMsg, InitMsg, QueryMsg, Receive>
fn contract(
&self
) -> &AbstractContract<Self, Error, ExecMsg, InitMsg, QueryMsg, Empty, Receive>
type Error = Error
type CustomExecMsg = ExecMsg
type CustomInitMsg = InitMsg
type CustomQueryMsg = QueryMsg
type CustomMigrateMsg = Empty
type ReceiveMsg = Receive
fn stored_version(
&self,
store: &dyn Storage
) -> Result<ContractVersion, StdError>
fn info(&self) -> (&'static str, &'static str)
fn dependencies(&self) -> &'static [&'static str]
fn maybe_execute_handler(
&self
) -> Option<fn(_: DepsMut<'_, Empty>, _: Env, _: MessageInfo, _: Self, _: Self::CustomExecMsg) -> Result<Response<Empty>, Self::Error>>
fn execute_handler(
&self
) -> Result<fn(_: DepsMut<'_, Empty>, _: Env, _: MessageInfo, _: Self, _: Self::CustomExecMsg) -> Result<Response<Empty>, Self::Error>, StdError>
fn maybe_instantiate_handler(
&self
) -> Option<fn(_: DepsMut<'_, Empty>, _: Env, _: MessageInfo, _: Self, _: Self::CustomInitMsg) -> Result<Response<Empty>, Self::Error>>
fn instantiate_handler(
&self
) -> Result<fn(_: DepsMut<'_, Empty>, _: Env, _: MessageInfo, _: Self, _: Self::CustomInitMsg) -> Result<Response<Empty>, Self::Error>, StdError>
fn maybe_query_handler(
&self
) -> Option<fn(_: Deps<'_, Empty>, _: Env, _: &Self, _: Self::CustomQueryMsg) -> Result<Binary, StdError>>
fn query_handler(
&self
) -> Result<fn(_: Deps<'_, Empty>, _: Env, _: &Self, _: Self::CustomQueryMsg) -> Result<Binary, StdError>, StdError>
fn maybe_migrate_handler(
&self
) -> Option<fn(_: DepsMut<'_, Empty>, _: Env, _: Self, _: Self::CustomMigrateMsg) -> Result<Response<Empty>, Self::Error>>
fn migrate_handler(
&self
) -> Result<fn(_: DepsMut<'_, Empty>, _: Env, _: Self, _: Self::CustomMigrateMsg) -> Result<Response<Empty>, Self::Error>, StdError>
fn maybe_receive_handler(
&self
) -> Option<fn(_: DepsMut<'_, Empty>, _: Env, _: MessageInfo, _: Self, _: Self::ReceiveMsg) -> Result<Response<Empty>, Self::Error>>
fn receive_handler(
&self
) -> Result<fn(_: DepsMut<'_, Empty>, _: Env, _: MessageInfo, _: Self, _: Self::ReceiveMsg) -> Result<Response<Empty>, Self::Error>, StdError>
fn maybe_ibc_callback_handler(
&self,
id: &str
) -> Option<fn(_: DepsMut<'_, Empty>, _: Env, _: MessageInfo, _: Self, _: String, _: StdAck) -> Result<Response<Empty>, Self::Error>>
fn maybe_reply_handler(
&self,
id: u64
) -> Option<fn(_: DepsMut<'_, Empty>, _: Env, _: Self, _: Reply) -> Result<Response<Empty>, Self::Error>>
fn reply_handler(
&self,
id: u64
) -> Result<fn(_: DepsMut<'_, Empty>, _: Env, _: Self, _: Reply) -> Result<Response<Empty>, Self::Error>, StdError>
source§impl<Error: From<StdError> + From<ExtensionError>, CustomExecMsg, CustomInitMsg, CustomQueryMsg, ReceiveMsg> IbcCallbackEndpoint for ExtensionContract<Error, CustomExecMsg, CustomInitMsg, CustomQueryMsg, ReceiveMsg>
impl<Error: From<StdError> + From<ExtensionError>, CustomExecMsg, CustomInitMsg, CustomQueryMsg, ReceiveMsg> IbcCallbackEndpoint for ExtensionContract<Error, CustomExecMsg, CustomInitMsg, CustomQueryMsg, ReceiveMsg>
source§fn handle_ibc_callback(
self,
deps: DepsMut<'_, Empty>,
env: Env,
info: MessageInfo,
msg: IbcResponseMsg
) -> Result<Response<Empty>, Self::Error>
fn handle_ibc_callback(
self,
deps: DepsMut<'_, Empty>,
env: Env,
info: MessageInfo,
msg: IbcResponseMsg
) -> Result<Response<Empty>, Self::Error>
Takes request, sets destination and executes request handler
This fn is the only way to get an ApiContract instance which ensures the destination address is set correctly. Read more
source§impl<Error: From<StdError> + From<ExtensionError>, CustomExecMsg, CustomInitMsg, CustomQueryMsg, ReceiveMsg> Identification for ExtensionContract<Error, CustomExecMsg, CustomInitMsg, CustomQueryMsg, ReceiveMsg>
impl<Error: From<StdError> + From<ExtensionError>, CustomExecMsg, CustomInitMsg, CustomQueryMsg, ReceiveMsg> Identification for ExtensionContract<Error, CustomExecMsg, CustomInitMsg, CustomQueryMsg, ReceiveMsg>
Retrieve identifying information about the calling OS
source§impl<Error: From<StdError> + From<ExtensionError>, CustomExecMsg, CustomInitMsg: Serialize + JsonSchema, CustomQueryMsg, ReceiveMsg> InstantiateEndpoint for ExtensionContract<Error, CustomExecMsg, CustomInitMsg, CustomQueryMsg, ReceiveMsg>
impl<Error: From<StdError> + From<ExtensionError>, CustomExecMsg, CustomInitMsg: Serialize + JsonSchema, CustomQueryMsg, ReceiveMsg> InstantiateEndpoint for ExtensionContract<Error, CustomExecMsg, CustomInitMsg, CustomQueryMsg, ReceiveMsg>
source§fn instantiate(
self,
deps: DepsMut<'_>,
env: Env,
info: MessageInfo,
msg: Self::InstantiateMsg
) -> Result<Response, Error>
fn instantiate(
self,
deps: DepsMut<'_>,
env: Env,
info: MessageInfo,
msg: Self::InstantiateMsg
) -> Result<Response, Error>
Instantiate the extension
type InstantiateMsg = InstantiateMsg<BaseInstantiateMsg, CustomInitMsg>
source§impl<Error: From<StdError> + From<ExtensionError>, CustomExecMsg, CustomInitMsg, CustomQueryMsg, ReceiveMsg> QueryEndpoint for ExtensionContract<Error, CustomExecMsg, CustomInitMsg, CustomQueryMsg, ReceiveMsg>
impl<Error: From<StdError> + From<ExtensionError>, CustomExecMsg, CustomInitMsg, CustomQueryMsg, ReceiveMsg> QueryEndpoint for ExtensionContract<Error, CustomExecMsg, CustomInitMsg, CustomQueryMsg, ReceiveMsg>
Where we dispatch the queries for the ExtensionContract
These ExtensionQueryMsg declarations can be found in abstract_sdk::os::common_module::app_msg
source§impl<Error: From<StdError> + From<ExtensionError>, CustomExecMsg, CustomInitMsg, CustomQueryMsg, ReceiveMsg> ReceiveEndpoint for ExtensionContract<Error, CustomExecMsg, CustomInitMsg, CustomQueryMsg, ReceiveMsg>
impl<Error: From<StdError> + From<ExtensionError>, CustomExecMsg, CustomInitMsg, CustomQueryMsg, ReceiveMsg> ReceiveEndpoint for ExtensionContract<Error, CustomExecMsg, CustomInitMsg, CustomQueryMsg, ReceiveMsg>
fn handle_receive(
self,
deps: DepsMut<'_, Empty>,
env: Env,
info: MessageInfo,
msg: Self::ReceiveMsg
) -> Result<Response<Empty>, Self::Error>
source§impl<Error: From<StdError> + From<ExtensionError>, CustomExecMsg, CustomInitMsg, CustomQueryMsg, ReceiveMsg> RegisterAccess for ExtensionContract<Error, CustomExecMsg, CustomInitMsg, CustomQueryMsg, ReceiveMsg>
impl<Error: From<StdError> + From<ExtensionError>, CustomExecMsg, CustomInitMsg, CustomQueryMsg, ReceiveMsg> RegisterAccess for ExtensionContract<Error, CustomExecMsg, CustomInitMsg, CustomQueryMsg, ReceiveMsg>
Get the version control contract