Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

app.gno

1.77 Kb · 30 lines
 1// Package app defines the IBC application callback contract that core invokes.
 2// The interface lives in a pure package so application realms can implement it
 3// without importing core, and core can route packets to them by interface
 4// (dependency inversion: app imports core, core depends only on this contract).
 5package app
 6
 7import "gno.land/p/onbloc/ibc/union/types"
 8
 9// IApp defines the interface for IBC application callbacks. Byte parameters
10// use plain []byte (not the typed Bytes wrapper) so foreign-realm apps can
11// implement the interface without the cross(cur)-realm typed-slice pitfall.
12type IApp interface {
13	OnChannelOpenInit(cur realm, connectionId types.ConnectionId, channelId types.ChannelId, version string, relayer address)
14	OnChannelOpenTry(cur realm, connectionId types.ConnectionId, channelId types.ChannelId, version string, counterpartyVersion string, relayer address)
15	OnChannelOpenAck(cur realm, channelId types.ChannelId, counterpartyChannelId types.ChannelId, counterpartyVersion string, relayer address)
16	OnChannelOpenConfirm(cur realm, channelId types.ChannelId, relayer address)
17	OnChannelCloseInit(cur realm, channelId types.ChannelId, relayer address)
18	OnChannelCloseConfirm(cur realm, channelId types.ChannelId, relayer address)
19	OnRecvPacket(cur realm, packet types.Packet, relayer address, relayerMsg []byte) types.RecvPacketResult
20	OnAcknowledgementPacket(cur realm, packet types.Packet, acknowledgement []byte, relayer address)
21	OnTimeoutPacket(cur realm, packet types.Packet, relayer address)
22
23	IIntentApp
24}
25
26// IIntentApp is implemented by apps that explicitly support the proofless
27// market-maker intent receive path.
28type IIntentApp interface {
29	OnIntentRecvPacket(cur realm, packet types.Packet, marketMaker address, marketMakerMsg []byte) types.RecvPacketResult
30}