keeper

package
v4.0.0-...-1b6ca0a Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	StepSend            = 1
	StepReceive         = 2
	StepAcknowledgement = 3
)

Functions

This section is empty.

Types

type Keeper

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

Keeper defines the IBC Swap keeper

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec, key sdk.StoreKey, paramSpace paramtypes.Subspace,
	ics4Wrapper types.ICS4Wrapper, channelKeeper types.ChannelKeeper, portKeeper types.PortKeeper,
	authKeeper types.AccountKeeper, bankKeeper types.BankKeeper, scopedKeeper capabilitykeeper.ScopedKeeper,
) Keeper

NewKeeper creates a new IBC transfer Keeper instance

func (Keeper) AuthenticateCapability

func (k Keeper) AuthenticateCapability(ctx sdk.Context, cap *capabilitytypes.Capability, name string) bool

AuthenticateCapability wraps the scopedKeeper's AuthenticateCapability function

func (Keeper) BindPort

func (k Keeper) BindPort(ctx sdk.Context, portID string) error

BindPort defines a wrapper function for the ort Keeper's function in order to expose it to module's InitGenesis function

func (Keeper) CancelSwap

func (Keeper) ClaimCapability

func (k Keeper) ClaimCapability(ctx sdk.Context, cap *capabilitytypes.Capability, name string) error

ClaimCapability allows the swap module that can claim a capability that IBC module passes to it

func (Keeper) EscrowAddress

EscrowAddress implements the EscrowAddress gRPC method

func (Keeper) ExportGenesis

func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState

ExportGenesis exports ibc-transfer module's portID and denom trace info into its genesis state.

func (Keeper) GetAllLimitOrders

func (k Keeper) GetAllLimitOrders(ctx sdk.Context) []types.LimitOrder

GetAllLimitOrders returns the information for all the limit orders.

func (Keeper) GetAllOTCOrders

func (k Keeper) GetAllOTCOrders(ctx sdk.Context) []types.OTCOrder

GetAllOTCOrders returns the information for all the limit orders.

func (Keeper) GetLimitOrder

func (k Keeper) GetLimitOrder(ctx sdk.Context, orderId string) (types.LimitOrder, bool)

GetLimitOrder returns the LimitOrder for the swap module.

func (Keeper) GetOTCOrder

func (k Keeper) GetOTCOrder(ctx sdk.Context, orderId string) (types.OTCOrder, bool)

GetOTCOrder returns the OTCOrder for the swap module.

func (Keeper) GetParams

func (k Keeper) GetParams(ctx sdk.Context) types.Params

GetParams returns the total set of ibc-transfer parameters.

func (Keeper) GetPort

func (k Keeper) GetPort(ctx sdk.Context) string

GetPort returns the portID for the swap module. Used in ExportGenesis

func (Keeper) GetSwapEnabled

func (k Keeper) GetSwapEnabled(ctx sdk.Context) bool

GetSwapEnabled retrieves the send enabled boolean from the paramstore

func (Keeper) GetSwapMaxFeeRate

func (k Keeper) GetSwapMaxFeeRate(ctx sdk.Context) uint32

func (Keeper) HasLimitOrder

func (k Keeper) HasLimitOrder(ctx sdk.Context, orderId string) bool

HasLimitOrder checks if a the key with the given id exists on the store.

func (Keeper) HasOTCOrder

func (k Keeper) HasOTCOrder(ctx sdk.Context, orderId string) bool

HasOTCOrder checks if a the key with the given id exists on the store.

func (Keeper) InitGenesis

func (k Keeper) InitGenesis(ctx sdk.Context, state types.GenesisState)

InitGenesis initializes the ibc-transfer state and binds to PortID.

func (Keeper) IsBound

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

IsBound checks if the transfer module is already bound to the desired port

func (Keeper) IterateLimitOrders

func (k Keeper) IterateLimitOrders(ctx sdk.Context, cb func(order types.LimitOrder) bool)

IterateLimitOrders iterates over the limit orders in the store and performs a callback function.

func (Keeper) IterateOTCOrders

func (k Keeper) IterateOTCOrders(ctx sdk.Context, cb func(order types.OTCOrder) bool)

IterateOTCOrders iterates over the limit orders in the store and performs a callback function.

func (Keeper) Logger

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

Logger returns a module-specific logger.

func (Keeper) MakeSwap

func (Keeper) MarshalLimitOrder

func (k Keeper) MarshalLimitOrder(order types.LimitOrder) ([]byte, error)

MarshalLimitOrder attempts to encode an LimitOrder object and returns the raw encoded bytes.

func (Keeper) MarshalOTCOrder

func (k Keeper) MarshalOTCOrder(order types.OTCOrder) ([]byte, error)

MarshalOTCOrder attempts to encode an OTCOrder object and returns the raw encoded bytes.

func (Keeper) MustMarshalLimitOrder

func (k Keeper) MustMarshalLimitOrder(order types.LimitOrder) []byte

MustMarshalLimitOrder attempts to encode an LimitOrder object and returns the raw encoded bytes. It panics on error.

func (Keeper) MustMarshalOTCOrder

func (k Keeper) MustMarshalOTCOrder(order types.OTCOrder) []byte

MustMarshalOTCOrder attempts to encode an OTCOrder object and returns the raw encoded bytes. It panics on error.

func (Keeper) MustUnmarshalLimitOrder

func (k Keeper) MustUnmarshalLimitOrder(bz []byte) types.LimitOrder

MustUnmarshalLimitOrder attempts to decode and return an LimitOrder object from raw encoded bytes. It panics on error.

func (Keeper) MustUnmarshalOTCOrder

func (k Keeper) MustUnmarshalOTCOrder(bz []byte) types.OTCOrder

MustUnmarshalOTCOrder attempts to decode and return an OTCOrder object from raw encoded bytes. It panics on error.

func (Keeper) OnAcknowledgementPacket

func (k Keeper) OnAcknowledgementPacket(ctx sdk.Context, packet channeltypes.Packet, data *types.AtomicSwapPacketData, ack channeltypes.Acknowledgement) error

func (Keeper) OnReceivedCancel

func (k Keeper) OnReceivedCancel(ctx sdk.Context, packet channeltypes.Packet, msg *types.MsgCancelSwapRequest) error

func (Keeper) OnReceivedMake

func (k Keeper) OnReceivedMake(ctx sdk.Context, packet channeltypes.Packet, msg *types.MsgMakeSwapRequest) error

func (Keeper) OnReceivedTake

func (k Keeper) OnReceivedTake(ctx sdk.Context, packet channeltypes.Packet, msg *types.MsgTakeSwapRequest) error

func (Keeper) OnRecvPacket

func (k Keeper) OnRecvPacket(ctx sdk.Context, packet channeltypes.Packet, data types.AtomicSwapPacketData) error

func (Keeper) OnTimeoutPacket

func (k Keeper) OnTimeoutPacket(ctx sdk.Context, packet channeltypes.Packet, data *types.AtomicSwapPacketData) error

func (Keeper) Params

Params implements the Query/Params gRPC method

func (Keeper) SendSwapPacket

func (k Keeper) SendSwapPacket(
	ctx sdk.Context,
	sourcePort,
	sourceChannel string,
	timeoutHeight clienttypes.Height,
	timeoutTimestamp uint64,
	swapPacket types.AtomicSwapPacketData,
) error

func (Keeper) SetLimitOrder

func (k Keeper) SetLimitOrder(ctx sdk.Context, order types.LimitOrder)

SetLimitOrder sets a new LimitOrder to the store.

func (Keeper) SetOTCOrder

func (k Keeper) SetOTCOrder(ctx sdk.Context, order types.OTCOrder)

SetOTCOrder sets a new OTCOrder to the store.

func (Keeper) SetParams

func (k Keeper) SetParams(ctx sdk.Context, params types.Params)

SetParams sets the total set of ibc-transfer parameters.

func (Keeper) SetPort

func (k Keeper) SetPort(ctx sdk.Context, portID string)

SetPort sets the portID for the swap module. Used in InitGenesis

func (Keeper) TakeSwap

func (Keeper) UnmarshalLimitOrder

func (k Keeper) UnmarshalLimitOrder(bz []byte) (types.LimitOrder, error)

UnmarshalLimitOrder attempts to decode and return an LimitOrder object from raw encoded bytes.

func (Keeper) UnmarshalOTCOrder

func (k Keeper) UnmarshalOTCOrder(bz []byte) (types.OTCOrder, error)

UnmarshalOTCOrder attempts to decode and return an OTCOrder object from raw encoded bytes.

Jump to

Keyboard shortcuts

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