keeper

package
v0.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 7, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Keeper

type Keeper struct {
	// contains filtered or unexported fields
}

Keeper defines the swap middleware keeper.

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec,
	msgServiceRouter *baseapp.MsgServiceRouter,
	ics4Wrapper porttypes.ICS4Wrapper,
	bankKeeper types.BankKeeper,
) Keeper

NewKeeper creates a new swap Keeper instance.

func (Keeper) GetAppVersion

func (k Keeper) GetAppVersion(ctx sdk.Context, portID string, channelID string) (string, bool)

func (Keeper) Logger

func (k Keeper) Logger(ctx sdk.Context) log.Logger

Logger returns a module-specific logger.

func (Keeper) RefundPacketToken

func (k Keeper) RefundPacketToken(
	ctx sdk.Context,
	packet channeltypes.Packet,
	data transfertypes.FungibleTokenPacketData,
) error

RefundPacketToken handles the burning or escrow lock up of vouchers when an asset should be refunded. This is only used in the case where we call into the transfer modules OnRecvPacket callback but then the swap fails.

func (Keeper) SendCoins

func (k Keeper) SendCoins(ctx sdk.Context, fromAddr string, toAddr string, amt sdk.Coins) error

SendCoins wraps the BankKeepers SendCoins function so it can be invoked from the middleware.

func (Keeper) SendPacket

func (im Keeper) SendPacket(
	ctx sdk.Context,
	chanCap *capabilitytypes.Capability,
	packet exported.PacketI,
) (err error)

SendPacket wraps IBC ChannelKeeper's SendPacket function.

func (Keeper) Swap

Swap calls into the base app's msg service router so that the appropriate handler is called when sending the swap msg.

func (Keeper) WriteAcknowledgement

func (k Keeper) WriteAcknowledgement(
	ctx sdk.Context,
	chanCap *capabilitytypes.Capability,
	packet ibcexported.PacketI,
	acknowledgement ibcexported.Acknowledgement,
) error

WriteAcknowledgement wraps IBC ChannelKeeper's WriteAcknowledgement function.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL