keeper

package
v0.0.0-...-25b3476 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	DefaultParamspace = types.ModuleName
)

Default parameter namespace

Variables

This section is empty.

Functions

func NewQuerier

func NewQuerier(k Keeper) sdk.Querier

func ParamKeyTable

func ParamKeyTable() params.KeyTable

ParamTable for staking module

Types

type Keeper

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

func NewKeeper

func NewKeeper(cdc *codec.Codec, key sdk.StoreKey, tokenKeeper types.TokenKeeper,
	rk types.ReceiptKeeper, sk types.SupplyKeeper, tk types.TransferKeeper, paramstore params.Subspace, feeCollectorName string) Keeper

func (Keeper) AddLiquidity

func (k Keeper) AddLiquidity(ctx sdk.Context, from sdk.CUAddress, dexID uint32, tokenA, tokenB sdk.Symbol,
	tokenAAmount, tokenBAmount, minTokenAAmount, minTokenBAmount sdk.Int) sdk.Result

func (Keeper) BindReferer

func (k Keeper) BindReferer(ctx sdk.Context, addr, referer sdk.CUAddress)

func (Keeper) CalculateLPEarning

func (k Keeper) CalculateLPEarning(ctx sdk.Context, addr sdk.CUAddress, dexID uint32, tokenA, tokenB sdk.Symbol) sdk.Int

func (Keeper) CalculateTradeEarning

func (k Keeper) CalculateTradeEarning(ctx sdk.Context, addr sdk.CUAddress, dexID uint32, tokenA, tokenB sdk.Symbol) (sdk.Int, sdk.Int, *types.TradeReward)

func (Keeper) CancelOrders

func (k Keeper) CancelOrders(ctx sdk.Context, from sdk.CUAddress, orderIDs []string) sdk.Result

func (Keeper) CheckSymbol

func (k Keeper) CheckSymbol(ctx sdk.Context, symbol sdk.Symbol) (sdk.Token, sdk.Result)

func (Keeper) ClaimLPEarning

func (k Keeper) ClaimLPEarning(ctx sdk.Context, addr sdk.CUAddress, dexID uint32, tokenA, tokenB sdk.Symbol) sdk.Result

func (Keeper) ClaimTradeEarning

func (k Keeper) ClaimTradeEarning(ctx sdk.Context, addr sdk.CUAddress, dexID uint32, tokenA, tokenB sdk.Symbol) sdk.Result

func (Keeper) ExpireOrder

func (k Keeper) ExpireOrder(ctx sdk.Context, order *types.Order)

func (Keeper) GetAddrUnfinishedOrders

func (k Keeper) GetAddrUnfinishedOrders(ctx sdk.Context, addr sdk.CUAddress, dexID uint32, tokenA, tokenB sdk.Symbol) []*types.Order

func (Keeper) GetAllDex

func (k Keeper) GetAllDex(ctx sdk.Context) []*types.Dex

func (Keeper) GetAllOrders

func (k Keeper) GetAllOrders(dexID uint32, baseSymbol, quoteSymbol sdk.Symbol) ([]*types.Order, []*types.Order)

func (Keeper) GetAllTradingPairs

func (k Keeper) GetAllTradingPairs(ctx sdk.Context, dexID *uint32) []*types.TradingPair

func (Keeper) GetDex

func (k Keeper) GetDex(ctx sdk.Context, id uint32) *types.Dex

func (Keeper) GetLiquidity

func (k Keeper) GetLiquidity(ctx sdk.Context, addr sdk.CUAddress, dexID uint32, tokenA, tokenB sdk.Symbol) sdk.Int

func (Keeper) GetOrder

func (k Keeper) GetOrder(ctx sdk.Context, orderID string) *types.Order

func (Keeper) GetPairTradeReward

func (k Keeper) GetPairTradeReward(ctx sdk.Context, dexID uint32, tokenA, tokenB sdk.Symbol) *types.TradeReward

func (Keeper) GetParams

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

Get all parameteras as types.Params

func (Keeper) GetReferer

func (k Keeper) GetReferer(ctx sdk.Context, addr sdk.CUAddress) (ret sdk.CUAddress)

func (Keeper) GetTradingPair

func (k Keeper) GetTradingPair(ctx sdk.Context, dexID uint32, tokenA, tokenB sdk.Symbol) *types.TradingPair

func (Keeper) InitMatchingManager

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

func (Keeper) IteratorAllUnfinishedOrder

func (k Keeper) IteratorAllUnfinishedOrder(ctx sdk.Context, f func(*types.Order))

func (Keeper) LPMiningRewardRate

func (k Keeper) LPMiningRewardRate(ctx sdk.Context) (res sdk.Dec)

func (Keeper) LPMiningWeights

func (k Keeper) LPMiningWeights(ctx sdk.Context) (res []*types.MiningWeight)

func (Keeper) LimitSwap

func (k Keeper) LimitSwap(ctx sdk.Context, dexID uint32, orderID string, from, referer, receiver sdk.CUAddress, amountIn sdk.Int,
	price sdk.Dec, baseSymbol, quoteSymbol sdk.Symbol, side int, expiredAt int64) sdk.Result

func (Keeper) LimitSwapMatchingGas

func (k Keeper) LimitSwapMatchingGas(ctx sdk.Context) (res sdk.Uint)

func (Keeper) LpRewardRate

func (k Keeper) LpRewardRate(ctx sdk.Context) (res sdk.Dec)

func (Keeper) MatchingOrders

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

func (Keeper) MaxFeeRate

func (k Keeper) MaxFeeRate(ctx sdk.Context) (res sdk.Dec)

func (Keeper) MinimumLiquidity

func (k Keeper) MinimumLiquidity(ctx sdk.Context) (res sdk.Int)

func (Keeper) Mining

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

func (Keeper) RefererTransactionBonusRate

func (k Keeper) RefererTransactionBonusRate(ctx sdk.Context) (res sdk.Dec)

func (Keeper) RemoveLiquidity

func (k Keeper) RemoveLiquidity(ctx sdk.Context, from sdk.CUAddress, dexID uint32, tokenA, tokenB sdk.Symbol, liquidity sdk.Int,
	minTokenAAmount, minTokenBAmount sdk.Int) sdk.Result

func (Keeper) Repurchase

func (k Keeper) Repurchase(ctx sdk.Context) sdk.Int

func (Keeper) RepurchaseDuration

func (k Keeper) RepurchaseDuration(ctx sdk.Context) (res int64)

func (Keeper) RepurchaseRate

func (k Keeper) RepurchaseRate(ctx sdk.Context) (res sdk.Dec)

func (Keeper) RepurchaseRoutingToken

func (k Keeper) RepurchaseRoutingToken(ctx sdk.Context) (res string)

func (Keeper) RepurchaseToken

func (k Keeper) RepurchaseToken(ctx sdk.Context) (res string)

func (Keeper) SaveDex

func (k Keeper) SaveDex(ctx sdk.Context, dex *types.Dex) *types.Dex

func (Keeper) SaveTradingPair

func (k Keeper) SaveTradingPair(ctx sdk.Context, pair *types.TradingPair)

func (Keeper) SetDexID

func (k Keeper) SetDexID(ctx sdk.Context, dexID uint32)

func (Keeper) SetParams

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

set the params

func (Keeper) SortTokens

func (k Keeper) SortTokens(ctx sdk.Context, symbolA, symbolB sdk.Symbol) (sdk.Symbol, sdk.Symbol, sdk.Result)

func (Keeper) SwapExactIn

func (k Keeper) SwapExactIn(ctx sdk.Context, dexID uint32, from, referer, receiver sdk.CUAddress, amountIn, minAmountOut sdk.Int,
	path []sdk.Symbol) sdk.Result

func (Keeper) SwapExactOut

func (k Keeper) SwapExactOut(ctx sdk.Context, dexID uint32, from, referer, receiver sdk.CUAddress, amountOut, maxAmountIn sdk.Int,
	path []sdk.Symbol) sdk.Result

func (Keeper) TradeMiningWeights

func (k Keeper) TradeMiningWeights(ctx sdk.Context) (res []*types.MiningWeight)

func (Keeper) UpdateOrdersInMatching

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

Jump to

Keyboard shortcuts

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