Skip to content

Commit

Permalink
Add IBC fees to IbcMsg::Transfer and ::SendPacket
Browse files Browse the repository at this point in the history
  • Loading branch information
webmaster128 committed Jun 27, 2023
1 parent 7943fa8 commit f74623e
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions packages/std/src/ibc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<IbcFee>,
},
/// Sends an IBC packet with given data over the existing channel.
/// Data should be encoded in a format defined by the channel version,
Expand All @@ -45,12 +52,29 @@ 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<IbcFee>,
},
/// 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 },
}

#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, Eq, JsonSchema)]
pub struct IbcFee {
/// The packet receive fee
pub recv: Vec<Coin>,
/// The packet acknowledgement fee
pub ack: Vec<Coin>,
/// The packet timeout fee
pub timeout: Vec<Coin>,
}

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)]
pub struct IbcEndpoint {
pub port_id: String,
Expand Down

0 comments on commit f74623e

Please sign in to comment.