keeper

package
v2.0.1-0...-ba8258b Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2024 License: Apache-2.0 Imports: 16 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, 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,
	metadata *types.SwapMetadata,
) 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, toAddr string, amt sdk.Coins) error

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

func (Keeper) SendPacket

func (k Keeper) SendPacket(
	ctx sdk.Context,
	chanCap *capabilitytypes.Capability,
	sourcePort string,
	sourceChannel string,
	timeoutHeight clienttypes.Height,
	timeoutTimestamp uint64,
	data []byte,
) (sequence uint64, err error)

SendPacket wraps IBC ChannelKeeper's SendPacket function.

func (Keeper) Swap

func (k Keeper) Swap(
	ctx sdk.Context,
	originalCreator string,
	msg *dextypes.MsgPlaceLimitOrder,
) (*dextypes.MsgPlaceLimitOrderResponse, error)

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