pub struct IbcClient<'a, T: IbcInterface> { /* private fields */ }
Expand description
API for interacting with the Abstract IBC client.
§Example
use abstract_sdk::prelude::*;
let ibc_client: IbcClient<MockModule> = module.ibc_client(deps.as_ref());
Implementations§
Source§impl<T: IbcInterface> IbcClient<'_, T>
impl<T: IbcInterface> IbcClient<'_, T>
Sourcepub fn module_address(&self) -> AbstractSdkResult<Addr>
pub fn module_address(&self) -> AbstractSdkResult<Addr>
Get address of this module
Sourcepub fn module_ibc_action<M: Serialize>(
&self,
host_chain: TruncatedChainId,
target_module: ModuleInfo,
exec_msg: &M,
callback: Option<Callback>,
) -> AbstractSdkResult<CosmosMsg>
pub fn module_ibc_action<M: Serialize>( &self, host_chain: TruncatedChainId, target_module: ModuleInfo, exec_msg: &M, callback: Option<Callback>, ) -> AbstractSdkResult<CosmosMsg>
Send module action from this module to the target module
Sourcepub fn module_ibc_query<B: Serialize, M: Serialize>(
&self,
host_chain: TruncatedChainId,
target_module: InstalledModuleIdentification,
query_msg: &QueryMsg<B, M>,
callback: Callback,
) -> AbstractSdkResult<CosmosMsg>
pub fn module_ibc_query<B: Serialize, M: Serialize>( &self, host_chain: TruncatedChainId, target_module: InstalledModuleIdentification, query_msg: &QueryMsg<B, M>, callback: Callback, ) -> AbstractSdkResult<CosmosMsg>
Send module query from this module to the target module
Use [abstract_std::ibc::IbcResponseMsg::module_query_response
] to parse response
Sourcepub fn ibc_query(
&self,
host_chain: TruncatedChainId,
query: impl Into<QueryRequest<ModuleQuery>>,
callback: Callback,
) -> AbstractSdkResult<CosmosMsg>
pub fn ibc_query( &self, host_chain: TruncatedChainId, query: impl Into<QueryRequest<ModuleQuery>>, callback: Callback, ) -> AbstractSdkResult<CosmosMsg>
Send query from this module to the host chain
Sourcepub fn ibc_queries(
&self,
host_chain: TruncatedChainId,
queries: Vec<QueryRequest<ModuleQuery>>,
callback: Callback,
) -> AbstractSdkResult<CosmosMsg>
pub fn ibc_queries( &self, host_chain: TruncatedChainId, queries: Vec<QueryRequest<ModuleQuery>>, callback: Callback, ) -> AbstractSdkResult<CosmosMsg>
Send queries from this module to the host chain
Sourcepub fn remote_account_addr(
&self,
host_chain: &TruncatedChainId,
) -> AbstractSdkResult<Option<String>>
pub fn remote_account_addr( &self, host_chain: &TruncatedChainId, ) -> AbstractSdkResult<Option<String>>
Address of the remote account Note: only Accounts that are remote to this chain are queryable
Source§impl<T: IbcInterface + AccountExecutor> IbcClient<'_, T>
impl<T: IbcInterface + AccountExecutor> IbcClient<'_, T>
Sourcepub fn execute(
&self,
msg: &ExecuteMsg,
funds: Vec<Coin>,
) -> AbstractSdkResult<CosmosMsg>
pub fn execute( &self, msg: &ExecuteMsg, funds: Vec<Coin>, ) -> AbstractSdkResult<CosmosMsg>
Execute on ibc client
Sourcepub fn create_remote_account(
&self,
host_chain: TruncatedChainId,
) -> AbstractSdkResult<CosmosMsg>
pub fn create_remote_account( &self, host_chain: TruncatedChainId, ) -> AbstractSdkResult<CosmosMsg>
A simple helper to create and register a remote account
Sourcepub fn host_action(
&self,
host_chain: TruncatedChainId,
action: HostAction,
) -> AbstractSdkResult<CosmosMsg>
pub fn host_action( &self, host_chain: TruncatedChainId, action: HostAction, ) -> AbstractSdkResult<CosmosMsg>
Call a HostAction
on the host of the provided host_chain
.
Sourcepub fn ics20_transfer(
&self,
host_chain: TruncatedChainId,
funds: Vec<Coin>,
memo: Option<String>,
receiver: Option<String>,
) -> AbstractSdkResult<CosmosMsg>
pub fn ics20_transfer( &self, host_chain: TruncatedChainId, funds: Vec<Coin>, memo: Option<String>, receiver: Option<String>, ) -> AbstractSdkResult<CosmosMsg>
IbcClient the provided coins from the Account to its account on the receiving_chain
.
Sourcepub fn install_remote_app<M: Serialize>(
&self,
host_chain: TruncatedChainId,
module: ModuleInfo,
init_msg: &M,
) -> AbstractSdkResult<CosmosMsg>
pub fn install_remote_app<M: Serialize>( &self, host_chain: TruncatedChainId, module: ModuleInfo, init_msg: &M, ) -> AbstractSdkResult<CosmosMsg>
A simple helper to install an app on an account
Sourcepub fn install_remote_api<M: Serialize>(
&self,
host_chain: TruncatedChainId,
module: ModuleInfo,
) -> AbstractSdkResult<CosmosMsg>
pub fn install_remote_api<M: Serialize>( &self, host_chain: TruncatedChainId, module: ModuleInfo, ) -> AbstractSdkResult<CosmosMsg>
A simple helper install a remote api Module providing only the chain name
Sourcepub fn execute_on_module<M: Serialize>(
&self,
host_chain: TruncatedChainId,
module_id: String,
exec_msg: &M,
) -> AbstractSdkResult<CosmosMsg>
pub fn execute_on_module<M: Serialize>( &self, host_chain: TruncatedChainId, module_id: String, exec_msg: &M, ) -> AbstractSdkResult<CosmosMsg>
A simple helper to execute on a module Executes the message as the Account of the remote account I.e. can be used to execute admin actions on remote modules.
Sourcepub fn remote_account(
&self,
host_chain: &TruncatedChainId,
) -> AbstractSdkResult<Option<String>>
pub fn remote_account( &self, host_chain: &TruncatedChainId, ) -> AbstractSdkResult<Option<String>>
Address of the remote account Note: only works if account is local
Trait Implementations§
Auto Trait Implementations§
impl<'a, T> Freeze for IbcClient<'a, T>
impl<'a, T> !RefUnwindSafe for IbcClient<'a, T>
impl<'a, T> !Send for IbcClient<'a, T>
impl<'a, T> !Sync for IbcClient<'a, T>
impl<'a, T> Unpin for IbcClient<'a, T>
impl<'a, T> !UnwindSafe for IbcClient<'a, T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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