keeper

package
v0.19.9 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2021 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanUpKlines

func CleanUpKlines(stop chan struct{}, o *orm.ORM, conf *config.Config)

nolint

func NewQuerier

func NewQuerier(keeper Keeper) sdk.Querier

NewQuerier is the module level router for state queries

Types

type Keeper

type Keeper struct {
	OrderKeeper types.OrderKeeper // The reference to the OrderKeeper to get deals
	TokenKeeper types.TokenKeeper // The reference to the TokenKeeper to get fee details

	Orm *orm.ORM

	Config *config.Config
	Logger log.Logger

	Cache *cache.Cache // Memory cache
	// contains filtered or unexported fields
}

Keeper maintains the link to data storage and exposes getter/setter methods for the various parts of the state machine

func NewKeeper

func NewKeeper(orderKeeper types.OrderKeeper, tokenKeeper types.TokenKeeper, dexKeeper types.DexKeeper, swapKeeper types.SwapKeeper,
	farmKeeper types.FarmKeeper, mintKeeper types.MintKeeper, marketKeeper types.MarketKeeper, cdc *codec.Codec, logger log.Logger, cfg *config.Config) Keeper

NewKeeper creates new instances of the nameservice Keeper

func (Keeper) EmitAllWsItems

func (k Keeper) EmitAllWsItems(ctx sdk.Context)

Emit all of the WSItems as tendermint events

func (Keeper) Flush

func (k Keeper) Flush()

Flush temporary cache

func (Keeper) GetCandles

func (k Keeper) GetCandles(product string, granularity, size int) (r [][]string, err error)

nolint

func (Keeper) GetCandlesWithTime

func (k Keeper) GetCandlesWithTime(product string, granularity, size int, ts int64) (r [][]string, err error)

nolint

func (Keeper) GetDeals

func (k Keeper) GetDeals(ctx sdk.Context, sender, product, side string, start, end int64, offset, limit int) ([]types.Deal, int)

nolint

func (Keeper) GetDexFees

func (k Keeper) GetDexFees(ctx sdk.Context, dexHandlingAddr, product string, offset, limit int) ([]types.DexFees, int)

nolint

func (Keeper) GetFeeDetails

func (k Keeper) GetFeeDetails(ctx sdk.Context, addr string, offset, limit int) ([]token.FeeDetail, int)

nolint

func (Keeper) GetOrderList

func (k Keeper) GetOrderList(ctx sdk.Context, addr, product, side string, open bool,
	offset, limit int, startTS, endTS int64, hideNoFill bool) ([]types.Order, int)

nolint

func (Keeper) GetTickers

func (k Keeper) GetTickers(products []string, count int) []types.Ticker

nolint

func (Keeper) GetTransactionList

func (k Keeper) GetTransactionList(ctx sdk.Context, addr string, txType, startTime, endTime int64, offset, limit int) ([]types.Transaction, int)

nolint

func (Keeper) OnFarmClaim

func (k Keeper) OnFarmClaim(ctx sdk.Context, address sdk.AccAddress, poolName string, claimedCoins sdk.SysCoins)

func (Keeper) OnSwapCreateExchange

func (k Keeper) OnSwapCreateExchange(ctx sdk.Context, swapTokenPair ammswap.SwapTokenPair)

func (Keeper) OnSwapToken

func (k Keeper) OnSwapToken(ctx sdk.Context, address sdk.AccAddress, swapTokenPair ammswap.SwapTokenPair, sellAmount sdk.SysCoin, buyAmount sdk.SysCoin)

func (Keeper) Stop

func (k Keeper) Stop()

Stop close database

func (Keeper) SyncTx

func (k Keeper) SyncTx(ctx sdk.Context, tx *auth.StdTx, txHash string, timestamp int64)

SyncTx generate transaction and add it to cache, called at DeliverTx

func (Keeper) UpdateTickersBuffer

func (k Keeper) UpdateTickersBuffer(startTS, endTS int64, productList []string)

UpdateTickersBuffer calculate and update the products ticker

Jump to

Keyboard shortcuts

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