keeper

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPendingPerpetualOrderIDBytes added in v0.46.0

func GetPendingPerpetualOrderIDBytes(id uint64) []byte

GetPendingPerpetualOrderIDBytes returns the byte representation of the ID

func GetPendingPerpetualOrderIDFromBytes added in v0.46.0

func GetPendingPerpetualOrderIDFromBytes(bz []byte) uint64

GetPendingPerpetualOrderIDFromBytes returns ID in uint64 format from a byte array

func GetPendingSpotOrderIDBytes added in v0.46.0

func GetPendingSpotOrderIDBytes(id uint64) []byte

GetPendingSpotOrderIDBytes returns the byte representation of the ID

func GetPendingSpotOrderIDFromBytes added in v0.46.0

func GetPendingSpotOrderIDFromBytes(bz []byte) uint64

GetPendingSpotOrderIDFromBytes returns ID in uint64 format from a byte array

func NewMsgServerImpl

func NewMsgServerImpl(keeper Keeper) types.MsgServer

NewMsgServerImpl returns an implementation of the MsgServer interface for the provided Keeper.

Types

type Keeper

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

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec,
	storeService store.KVStoreService,
	authority string,
	bank types.BankKeeper,
	amm types.AmmKeeper,
	perpetual types.PerpetualKeeper,
) *Keeper

func (Keeper) AppendPendingPerpetualOrder added in v0.46.0

func (k Keeper) AppendPendingPerpetualOrder(
	ctx sdk.Context,
	pendingPerpetualOrder types.PerpetualOrder,
) uint64

AppendPendingPerpetualOrder appends a pendingPerpetualOrder in the store with a new id and update the count

func (Keeper) AppendPendingSpotOrder added in v0.46.0

func (k Keeper) AppendPendingSpotOrder(
	ctx sdk.Context,
	pendingSpotOrder types.SpotOrder,
) uint64

AppendPendingSpotOrder appends a pendingSpotOrder in the store with a new id and update the count

func (Keeper) ConstructPerpetualOrderExtraInfo added in v0.49.3

func (k Keeper) ConstructPerpetualOrderExtraInfo(ctx sdk.Context, order types.PerpetualOrder) (*types.PerpetualOrderExtraInfo, error)

ConstructPerpetualOrderExtraInfo fills up the extra information of the perpetual order and returns it

func (Keeper) DeleteAllPendingPerpetualOrder added in v0.49.3

func (k Keeper) DeleteAllPendingPerpetualOrder(ctx sdk.Context) (list []types.PerpetualOrder)

DeleteAllPendingPerpetualOrder returns all pendingPerpetualOrder

func (Keeper) DeleteAllPendingSpotOrder added in v0.49.3

func (k Keeper) DeleteAllPendingSpotOrder(ctx sdk.Context) (list []types.SpotOrder)

DeleteAllPendingSpotOrder deleted all pendingSpotOrder

func (Keeper) ExecuteLimitBuyOrder added in v0.46.0

func (k Keeper) ExecuteLimitBuyOrder(ctx sdk.Context, order types.SpotOrder) (*ammtypes.MsgSwapByDenomResponse, error)

ExecuteLimitBuyOrder executes a limit buy order

func (Keeper) ExecuteLimitCloseOrder added in v0.46.0

func (k Keeper) ExecuteLimitCloseOrder(ctx sdk.Context, order types.PerpetualOrder) error

ExecuteLimitCloseOrder executes a limit close order

func (Keeper) ExecuteLimitOpenOrder added in v0.46.0

func (k Keeper) ExecuteLimitOpenOrder(ctx sdk.Context, order types.PerpetualOrder) error

ExecuteLimitOpenOrder executes a limit open order

func (Keeper) ExecuteLimitSellOrder added in v0.46.0

func (k Keeper) ExecuteLimitSellOrder(ctx sdk.Context, order types.SpotOrder) (*ammtypes.MsgSwapByDenomResponse, error)

ExecuteLimitSellOrder executes a limit sell order

func (Keeper) ExecuteMarketBuyOrder added in v0.46.0

func (k Keeper) ExecuteMarketBuyOrder(ctx sdk.Context, order types.SpotOrder) (*ammtypes.MsgSwapByDenomResponse, error)

ExecuteMarketBuyOrder executes a market buy order

func (Keeper) ExecuteMarketCloseOrder added in v0.46.0

func (k Keeper) ExecuteMarketCloseOrder(ctx sdk.Context, order types.PerpetualOrder) error

ExecuteMarketCloseOrder executes a market close order

func (Keeper) ExecuteMarketOpenOrder added in v0.46.0

func (k Keeper) ExecuteMarketOpenOrder(ctx sdk.Context, order types.PerpetualOrder) error

ExecuteMarketOpenOrder executes a market open order

func (Keeper) ExecuteStopLossOrder added in v0.46.0

func (k Keeper) ExecuteStopLossOrder(ctx sdk.Context, order types.SpotOrder) (*ammtypes.MsgSwapByDenomResponse, error)

ExecuteStopLossOrder executes a stop loss order

func (Keeper) GetAllLegacyPendingPerpetualOrder added in v0.48.0

func (k Keeper) GetAllLegacyPendingPerpetualOrder(ctx sdk.Context) (list []types.LegacyPerpetualOrder)

func (Keeper) GetAllPendingPerpetualOrder added in v0.46.0

func (k Keeper) GetAllPendingPerpetualOrder(ctx sdk.Context) (list []types.PerpetualOrder)

GetAllPendingPerpetualOrder returns all pendingPerpetualOrder

func (Keeper) GetAllPendingSpotOrder added in v0.46.0

func (k Keeper) GetAllPendingSpotOrder(ctx sdk.Context) (list []types.SpotOrder)

GetAllPendingSpotOrder returns all pendingSpotOrder

func (Keeper) GetAllSortedPerpetualOrder added in v0.46.0

func (k Keeper) GetAllSortedPerpetualOrder(ctx sdk.Context) (list [][]uint64, err error)

func (Keeper) GetAllSortedSpotOrder added in v0.46.0

func (k Keeper) GetAllSortedSpotOrder(ctx sdk.Context) (list [][]uint64, err error)

GetAllSortedSpotOrder returns all sortedSpotOrder

func (Keeper) GetAssetPriceFromDenomInToDenomOut added in v0.46.0

func (k Keeper) GetAssetPriceFromDenomInToDenomOut(ctx sdk.Context, denomIn, denomOut string) (sdkmath.LegacyDec, error)

GetAssetPriceFromDenomInToDenomOut returns the price of an asset from a denom to another denom

func (Keeper) GetParams

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

GetParams get all parameters as types.Params

func (Keeper) GetPendingPerpetualOrder added in v0.46.0

func (k Keeper) GetPendingPerpetualOrder(ctx sdk.Context, id uint64) (val types.PerpetualOrder, found bool)

GetPendingPerpetualOrder returns a pendingPerpetualOrder from its id

func (Keeper) GetPendingPerpetualOrderCount added in v0.46.0

func (k Keeper) GetPendingPerpetualOrderCount(ctx sdk.Context) uint64

GetPendingPerpetualOrderCount get the total number of pendingPerpetualOrder

func (Keeper) GetPendingPerpetualOrdersForAddress added in v0.48.0

func (k Keeper) GetPendingPerpetualOrdersForAddress(ctx sdk.Context, address string, status *types.Status, pagination *query.PageRequest) ([]types.PerpetualOrder, *query.PageResponse, error)

func (Keeper) GetPendingSpotOrder added in v0.46.0

func (k Keeper) GetPendingSpotOrder(ctx sdk.Context, id uint64) (val types.SpotOrder, found bool)

GetPendingSpotOrder returns a pendingSpotOrder from its id

func (Keeper) GetPendingSpotOrderCount added in v0.46.0

func (k Keeper) GetPendingSpotOrderCount(ctx sdk.Context) uint64

GetPendingSpotOrderCount get the total number of pendingSpotOrder

func (Keeper) GetPendingSpotOrdersForAddress added in v0.48.0

func (k Keeper) GetPendingSpotOrdersForAddress(ctx sdk.Context, address string, status *types.Status, pagination *query.PageRequest) ([]types.SpotOrder, *query.PageResponse, error)

func (Keeper) Logger

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

func (Keeper) Params

func (Keeper) PendingPerpetualOrder added in v0.46.0

func (Keeper) PendingPerpetualOrderAll added in v0.46.0

func (Keeper) PendingSpotOrder added in v0.46.0

func (Keeper) PendingSpotOrderAll added in v0.46.0

func (Keeper) PendingSpotOrderForAddress added in v0.48.0

func (Keeper) RemovePendingPerpetualOrder added in v0.46.0

func (k Keeper) RemovePendingPerpetualOrder(ctx sdk.Context, id uint64)

RemovePendingPerpetualOrder removes a pendingPerpetualOrder from the store

func (Keeper) RemovePendingSpotOrder added in v0.46.0

func (k Keeper) RemovePendingSpotOrder(ctx sdk.Context, id uint64)

RemovePendingSpotOrder removes a pendingSpotOrder from the store

func (Keeper) SetParams

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

SetParams set the params

func (Keeper) SetPendingPerpetualOrder added in v0.46.0

func (k Keeper) SetPendingPerpetualOrder(ctx sdk.Context, pendingPerpetualOrder types.PerpetualOrder)

SetPendingPerpetualOrder set a specific pendingPerpetualOrder in the store

func (Keeper) SetPendingPerpetualOrderCount added in v0.46.0

func (k Keeper) SetPendingPerpetualOrderCount(ctx sdk.Context, count uint64)

SetPendingPerpetualOrderCount set the total number of pendingPerpetualOrder

func (Keeper) SetPendingSpotOrder added in v0.46.0

func (k Keeper) SetPendingSpotOrder(ctx sdk.Context, pendingSpotOrder types.SpotOrder)

SetPendingSpotOrder set a specific pendingSpotOrder in the store

func (Keeper) SetPendingSpotOrderCount added in v0.46.0

func (k Keeper) SetPendingSpotOrderCount(ctx sdk.Context, count uint64)

SetPendingSpotOrderCount set the total number of pendingSpotOrder

Jump to

Keyboard shortcuts

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