diff --git a/packages/std/src/ibc.rs b/packages/std/src/ibc.rs index 1ce06432a6..740c74db3a 100644 --- a/packages/std/src/ibc.rs +++ b/packages/std/src/ibc.rs @@ -36,6 +36,13 @@ pub enum IbcMsg { amount: Coin, /// when packet times out, measured on remote chain timeout: IbcTimeout, + /// When set, a [MsgPayPacketFee] with the provided fee is created and + /// emitted before the packet is sent. + /// `signer` gets filled automatically with the contract address. + /// No relayer restrictions will be in place. + /// + /// [MsgPayPacketFee]: https://github.com/cosmos/ibc-go/blob/v7.2.0/proto/ibc/applications/fee/v1/tx.proto#L76-L93 + packet_fee: Option, }, /// Sends an IBC packet with given data over the existing channel. /// Data should be encoded in a format defined by the channel version, @@ -45,12 +52,35 @@ pub enum IbcMsg { data: Binary, /// when packet times out, measured on remote chain timeout: IbcTimeout, + /// When set, a [MsgPayPacketFee] with the provided fee is created and + /// emitted before the packet is sent. + /// `signer` gets filled automatically with the contract address. + /// No relayer restrictions will be in place. + /// + /// [MsgPayPacketFee]: https://github.com/cosmos/ibc-go/blob/v7.2.0/proto/ibc/applications/fee/v1/tx.proto#L76-L93 + packet_fee: Option, }, /// This will close an existing channel that is owned by this contract. /// Port is auto-assigned to the contract's IBC port CloseChannel { channel_id: String }, } +/// An [ICS-29] IBC fee. +/// +/// This is mapped to an [ibc.applications.fee.v1.Fee]. +/// +/// [ICS-29]: https://github.com/cosmos/ibc-go/blob/v7.2.0/docs/middleware/ics29-fee/overview.md +/// [ibc.applications.fee.v1.Fee]: https://github.com/cosmos/ibc-go/blob/v7.2.0/proto/ibc/applications/fee/v1/fee.proto#L11-L31 +#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, Eq, JsonSchema)] +pub struct IbcFee { + /// The packet receive fee + pub recv: Vec, + /// The packet acknowledgement fee + pub ack: Vec, + /// The packet timeout fee + pub timeout: Vec, +} + #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] pub struct IbcEndpoint { pub port_id: String,