Interface for IBC packet lifecycle callbacks in smart contracts
Ack
and Timeout
callbacks allow contracts to execute custom logic on the basis of how the packet lifecycle completes. The sender of an IBC transfer packet may specify a contract to be called when the packet lifecycle completes. This contract must implement the expected entrypoints for onPacketAcknowledgement
and onPacketTimeout
.
Critically, only the IBC packet sender can set the callback.
onPacketAcknowledgement
onPacketAcknowledgement(string memory channelId, string memory portId, uint64 sequence, bytes memory data, bytes memory acknowledgement)
Description: Callback function invoked on the source chain after a packet lifecycle is completed and acknowledgement is processed. The contract implementing this interface receives packet information and acknowledgement data to execute custom callback logic.
onPacketTimeout
onPacketTimeout(string memory channelId, string memory portId, uint64 sequence, bytes memory data)
Description: Callback function invoked on the source chain after a packet lifecycle is completed and the packet has timed out. The contract implementing this interface receives packet information to execute custom timeout handling logic.