#[non_exhaustive]pub enum IbcMsg {
Transfer {
channel_id: String,
to_address: String,
amount: Coin,
timeout: IbcTimeout,
memo: Option<String>,
},
SendPacket {
channel_id: String,
data: Binary,
timeout: IbcTimeout,
},
WriteAcknowledgement {
channel_id: String,
packet_sequence: u64,
ack: IbcAcknowledgement,
},
CloseChannel {
channel_id: String,
},
}Expand description
These are messages in the IBC lifecycle. Only usable by IBC-enabled contracts (contracts that directly speak the IBC protocol via 6 entry points)
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Transfer
Sends bank tokens owned by the contract to the given address on another chain. The channel must already be established between the ibctransfer module on this chain and a matching module on the remote chain. We cannot select the port_id, this is whatever the local chain has bound the ibctransfer module to.
Fields
amount: Coinpacket data only supports one coin https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/ibc/applications/transfer/v1/transfer.proto#L11-L20
timeout: IbcTimeoutwhen packet times out, measured on remote chain
memo: Option<String>An optional memo. See the blog post “Moving Beyond Simple Token Transfers” for more information.
There is no difference between setting this to None or an empty string.
This field is only supported on chains with CosmWasm >= 2.0 and silently
ignored on older chains.
If you need support for both 1.x and 2.x chain with the same codebase,
it is recommended to use CosmosMsg::Stargate with a custom MsgTransfer
protobuf encoder instead.
SendPacket
Sends an IBC packet with given data over the existing channel. Data should be encoded in a format defined by the channel version, and the module on the other side should know how to parse this.
Fields
timeout: IbcTimeoutwhen packet times out, measured on remote chain
WriteAcknowledgement
Acknowledges a packet that this contract received over IBC.
This allows acknowledging a packet that was not acknowledged yet in the ibc_packet_receive call.
Fields
ack: IbcAcknowledgementThe acknowledgement to send back
CloseChannel
This will close an existing channel that is owned by this contract. Port is auto-assigned to the contract’s IBC port
Trait Implementations§
Source§impl<'de> Deserialize<'de> for IbcMsg
impl<'de> Deserialize<'de> for IbcMsg
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 IbcMsg
impl JsonSchema for IbcMsg
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(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref keyword. Read moreimpl Eq for IbcMsg
impl StructuralPartialEq for IbcMsg
Auto Trait Implementations§
impl Freeze for IbcMsg
impl RefUnwindSafe for IbcMsg
impl Send for IbcMsg
impl Sync for IbcMsg
impl Unpin for IbcMsg
impl UnwindSafe for IbcMsg
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<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