pub struct IbcDestinationCallbackMsg {
pub packet: IbcPacket,
pub ack: IbcAcknowledgement,
pub transfer: Option<IbcTransferCallback>,
}Expand description
The message type of the IBC destination callback.
The IBC destination callback is needed for cases where someone triggers the sending of an
IBC packet through some other message (i.e. not through crate::IbcMsg::SendPacket) and
your contract needs to know that it received this.
A prominent example is the crate::IbcMsg::Transfer message. Without callbacks, you cannot know
that someone sent you IBC coins.
It is important to validate that the packet and acknowledgement are what you expect them to be. For example for a transfer message, the receiver is not necessarily the contract itself.
The callback is called when the packet is being acknowledged on the destination chain. This happens for both synchronous and asynchronous acknowledgements.
Note that there are some prerequisites that need to be fulfilled to receive destination callbacks:
- The contract must implement the
ibc_destination_callbackentrypoint. - The IBC application in the destination chain must have support for the callbacks middleware.
- You have to add serialized
IbcCallbackRequestto a specific field of the message. ForIbcMsg::Transfer, this is thememofield and it needs to be json-encoded.
Fields§
§packet: IbcPacket§ack: IbcAcknowledgement§transfer: Option<IbcTransferCallback>When the underlying packet is a successful transfer message, this field contains information about the transfer. Otherwise it is empty.
This is always empty on chains using CosmWasm < 3.0
Trait Implementations§
Source§impl Clone for IbcDestinationCallbackMsg
impl Clone for IbcDestinationCallbackMsg
Source§fn clone(&self) -> IbcDestinationCallbackMsg
fn clone(&self) -> IbcDestinationCallbackMsg
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for IbcDestinationCallbackMsg
impl Debug for IbcDestinationCallbackMsg
Source§impl<'de> Deserialize<'de> for IbcDestinationCallbackMsg
impl<'de> Deserialize<'de> for IbcDestinationCallbackMsg
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for IbcDestinationCallbackMsg
impl JsonSchema for IbcDestinationCallbackMsg
Source§fn schema_name() -> String
fn schema_name() -> String
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref keyword. Read moreSource§impl Schemaifier for IbcDestinationCallbackMsg
impl Schemaifier for IbcDestinationCallbackMsg
fn visit_schema(visitor: &mut SchemaVisitor) -> DefinitionReference
fn id() -> Identifier
impl Eq for IbcDestinationCallbackMsg
impl StructuralPartialEq for IbcDestinationCallbackMsg
Auto Trait Implementations§
impl Freeze for IbcDestinationCallbackMsg
impl RefUnwindSafe for IbcDestinationCallbackMsg
impl Send for IbcDestinationCallbackMsg
impl Sync for IbcDestinationCallbackMsg
impl Unpin for IbcDestinationCallbackMsg
impl UnwindSafe for IbcDestinationCallbackMsg
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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