@@ -75,13 +75,52 @@ pub enum IbcMsg {
75
75
/// This will close an existing channel that is owned by this contract.
76
76
/// Port is auto-assigned to the contract's IBC port
77
77
CloseChannel { channel_id : String } ,
78
+ /// Incentivizes the next IBC packet sent after this message with a fee.
79
+ /// Note that this does not necessarily have to be a packet sent by this contract.
80
+ /// The fees are taken from the contract's balance immediately and locked until the packet is handled.
81
+ ///
82
+ /// # Example
83
+ ///
84
+ /// Most commonly, you will attach this message to a response right before sending a packet using
85
+ /// [`IbcMsg::SendPacket`] or [`IbcMsg::Transfer`].
86
+ ///
87
+ /// ```rust
88
+ /// # use cosmwasm_std::{IbcMsg, IbcEndpoint, IbcFee, IbcTimeout, Coin, CosmosMsg, Response, Timestamp};
89
+ ///
90
+ /// let incentivize = IbcMsg::PayPacketFee {
91
+ /// src: IbcEndpoint {
92
+ /// port_id: "transfer".to_string(),
93
+ /// channel_id: "source-channel".to_string(),
94
+ /// },
95
+ /// fee: IbcFee {
96
+ /// recv_fee: vec![Coin::new(100u32, "token")],
97
+ /// ..IbcFee::default()
98
+ /// },
99
+ /// relayers: vec![],
100
+ /// };
101
+ /// let transfer = IbcMsg::Transfer {
102
+ /// channel_id: "source-channel".to_string(),
103
+ /// to_address: "receiver".to_string(),
104
+ /// amount: Coin::new(100u32, "token"),
105
+ /// timeout: IbcTimeout::with_timestamp(Timestamp::from_nanos(0)),
106
+ /// memo: None,
107
+ /// };
108
+ ///
109
+ /// # #[cfg(feature = "stargate")]
110
+ /// let _: Response = Response::new()
111
+ /// .add_message(CosmosMsg::Ibc(incentivize))
112
+ /// .add_message(CosmosMsg::Ibc(transfer));
113
+ /// ```
78
114
PayPacketFee {
79
115
src : IbcEndpoint ,
80
116
fee : IbcFee ,
81
117
/// Allowlist of relayer addresses that can receive the fee.
82
118
/// This is currently not implemented and *must* be empty.
83
119
relayers : Vec < String > ,
84
120
} ,
121
+ /// Incentivizes the existing IBC packet with the given port, channel and sequence with a fee.
122
+ /// Note that this does not necessarily have to be a packet sent by this contract.
123
+ /// The fees are taken from the contract's balance immediately and locked until the packet is handled.
85
124
PayPacketFeeAsync {
86
125
src : IbcEndpoint ,
87
126
sequence : u64 ,
@@ -92,7 +131,7 @@ pub enum IbcMsg {
92
131
} ,
93
132
}
94
133
95
- #[ derive( Serialize , Deserialize , Clone , Debug , PartialEq , Eq , JsonSchema ) ]
134
+ #[ derive( Serialize , Deserialize , Default , Clone , Debug , PartialEq , Eq , JsonSchema ) ]
96
135
pub struct IbcFee {
97
136
// the packet receive fee
98
137
pub recv_fee : Vec < Coin > ,
0 commit comments