Documentation ¶
Index ¶
- Constants
- type Keeper
- func (k Keeper) BindPort(ctx sdk.Context, portID string) error
- func (k Keeper) ChanCloseInit(ctx sdk.Context, portID, channelID string) error
- func (k Keeper) ClaimCapability(ctx sdk.Context, cap *capability.Capability, name string) error
- func (k Keeper) GetPort(ctx sdk.Context) string
- func (k Keeper) GetTransferAccount(ctx sdk.Context) authexported.ModuleAccountI
- func (k Keeper) IsBound(ctx sdk.Context, portID string) bool
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) OnAcknowledgementPacket(ctx sdk.Context, packet channeltypes.Packet, ...) error
- func (k Keeper) OnRecvPacket(ctx sdk.Context, packet channeltypes.Packet, ...) error
- func (k Keeper) OnTimeoutPacket(ctx sdk.Context, packet channeltypes.Packet, ...) error
- func (k Keeper) PacketExecuted(ctx sdk.Context, packet channelexported.PacketI, acknowledgement []byte) error
- func (k Keeper) SendTransfer(ctx sdk.Context, sourcePort, sourceChannel string, destHeight uint64, ...) error
Constants ¶
const ( // DefaultPacketTimeoutHeight is the default packet timeout height relative // to the current block height. The timeout is disabled when set to 0. DefaultPacketTimeoutHeight = 1000 // NOTE: in blocks // DefaultPacketTimeoutTimestamp is the default packet timeout timestamp relative // to the current block timestamp. The timeout is disabled when set to 0. DefaultPacketTimeoutTimestamp = 0 // NOTE: in nanoseconds )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
Keeper defines the IBC transfer keeper
func NewKeeper ¶
func NewKeeper( cdc codec.Marshaler, key sdk.StoreKey, channelKeeper types.ChannelKeeper, portKeeper types.PortKeeper, authKeeper types.AccountKeeper, bankKeeper types.BankKeeper, scopedKeeper capability.ScopedKeeper, ) Keeper
NewKeeper creates a new IBC transfer Keeper instance
func (Keeper) BindPort ¶
BindPort defines a wrapper function for the ort Keeper's function in order to expose it to module's InitGenesis function
func (Keeper) ChanCloseInit ¶
ChanCloseInit defines a wrapper function for the channel Keeper's function in order to expose it to the ICS20 trasfer handler.
func (Keeper) ClaimCapability ¶
func (k Keeper) ClaimCapability(ctx sdk.Context, cap *capability.Capability, name string) error
ClaimCapability allows the transfer module that can claim a capability that IBC module passes to it
func (Keeper) GetTransferAccount ¶
func (k Keeper) GetTransferAccount(ctx sdk.Context) authexported.ModuleAccountI
GetTransferAccount returns the ICS20 - transfers ModuleAccount
func (Keeper) OnAcknowledgementPacket ¶
func (k Keeper) OnAcknowledgementPacket(ctx sdk.Context, packet channeltypes.Packet, data types.FungibleTokenPacketData, ack types.FungibleTokenPacketAcknowledgement) error
func (Keeper) OnRecvPacket ¶
func (k Keeper) OnRecvPacket(ctx sdk.Context, packet channeltypes.Packet, data types.FungibleTokenPacketData) error
func (Keeper) OnTimeoutPacket ¶
func (k Keeper) OnTimeoutPacket(ctx sdk.Context, packet channeltypes.Packet, data types.FungibleTokenPacketData) error
func (Keeper) PacketExecuted ¶
func (k Keeper) PacketExecuted(ctx sdk.Context, packet channelexported.PacketI, acknowledgement []byte) error
PacketExecuted defines a wrapper function for the channel Keeper's function in order to expose it to the ICS20 transfer handler. Keeper retreives channel capability and passes it into channel keeper for authentication
func (Keeper) SendTransfer ¶
func (k Keeper) SendTransfer( ctx sdk.Context, sourcePort, sourceChannel string, destHeight uint64, amount sdk.Coins, sender sdk.AccAddress, receiver string, ) error
SendTransfer handles transfer sending logic. There are 2 possible cases:
1. Sender chain is the source chain of the coins (i.e where they were minted): the coins are transferred to an escrow address (i.e locked) on the sender chain and then transferred to the destination chain (i.e not the source chain) via a packet with the corresponding fungible token data.
2. Coins are not native from the sender chain (i.e tokens sent where transferred over through IBC already): the coins are burned and then a packet is sent to the source chain of the tokens.