Skip to content

Commit 04ce6f2

Browse files
committed
Add more information to destination callback transfer case
1 parent ebabe8d commit 04ce6f2

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

packages/std/src/ibc/callbacks.rs

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -191,14 +191,25 @@ impl IbcTimeoutCallbackMsg {
191191
pub struct IbcDestinationCallbackMsg {
192192
pub packet: IbcPacket,
193193
pub ack: IbcAcknowledgement,
194-
/// When the underlying packet is a transfer message and the receiver is the contract that receives
195-
/// the callback, this field contains the coins that were transferred. Otherwise it is empty.
196-
///
197-
/// When the callback is executed, the transfer is completed already and the coins are now owned
198-
/// by the contract.
194+
/// When the underlying packet is a successful transfer message,
195+
/// this field contains information about the transfer. Otherwise it is empty.
199196
///
200197
/// This is always empty on chains using CosmWasm < 3.0
201198
#[serde(default)]
199+
pub transfer: Option<TransferCallback>,
200+
}
201+
202+
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)]
203+
pub struct TransferCallback {
204+
/// The address of the contract that received the callback.
205+
/// Note that this is *not* a valid address on the destination chain.
206+
pub sender: String,
207+
/// Receiver of the transfer.
208+
pub receiver: Addr,
209+
/// The funds that were transferred.
210+
///
211+
/// When the callback is executed, the transfer is completed already and the coins are now owned
212+
/// by the receiver.
202213
pub funds: Vec<Coin>,
203214
}
204215

0 commit comments

Comments
 (0)