keeper

package
v0.0.0-...-00bf0a9 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	QueryWars           = "wars"
	QueryWar            = "war"
	QueryBatch          = "batch"
	QueryLastBatch      = "last_batch"
	QueryCurrentPrice   = "current_price"
	QueryCurrentReserve = "current_reserve"
	QueryCustomPrice    = "custom_price"
	QueryBuyPrice       = "buy_price"
	QuerySellReturn     = "sell_return"
	QuerySwapReturn     = "swap_return"
	QueryParams         = "params"
)

Variables

This section is empty.

Functions

func AllInvariants

func AllInvariants(k Keeper) sdk.Invariant

AllInvariants runs all invariants of the wars module.

func NewQuerier

func NewQuerier(keeper Keeper) sdk.Querier

NewQuerier is the module level router for state queries

func RegisterInvariants

func RegisterInvariants(ir sdk.InvariantRegistry, k Keeper)

RegisterInvariants registers all supply invariants

func ReserveInvariant

func ReserveInvariant(k Keeper) sdk.Invariant

func SupplyInvariant

func SupplyInvariant(k Keeper) sdk.Invariant

Types

type Keeper

type Keeper struct {
	BankKeeper   bank.Keeper
	SupplyKeeper supply.Keeper

	StakingKeeper staking.Keeper
	// contains filtered or unexported fields
}

func NewKeeper

func NewKeeper(bankKeeper bank.Keeper, supplyKeeper supply.Keeper,
	accountKeeper auth.AccountKeeper, stakingKeeper staking.Keeper,
	storeKey sdk.StoreKey, paramSpace params.Subspace,
	cdc *codec.Codec) Keeper

func (Keeper) AddBuyOrder

func (k Keeper) AddBuyOrder(ctx sdk.Context, token string, bo types.BuyOrder, buyPrices, sellPrices sdk.DecCoins)

func (Keeper) AddSellOrder

func (k Keeper) AddSellOrder(ctx sdk.Context, token string, so types.SellOrder, buyPrices, sellPrices sdk.DecCoins)

func (Keeper) AddSwapOrder

func (k Keeper) AddSwapOrder(ctx sdk.Context, token string, so types.SwapOrder)

func (Keeper) BatchExists

func (k Keeper) BatchExists(ctx sdk.Context, token string) bool

func (Keeper) CancelUnfulfillableBuys

func (k Keeper) CancelUnfulfillableBuys(ctx sdk.Context, token string) (cancelledOrders int)

func (Keeper) CancelUnfulfillableOrders

func (k Keeper) CancelUnfulfillableOrders(ctx sdk.Context, token string) (cancelledOrders int)

func (Keeper) CheckIfBuyOrderFulfillableAtPrice

func (k Keeper) CheckIfBuyOrderFulfillableAtPrice(ctx sdk.Context, token string, bo types.BuyOrder, prices sdk.DecCoins) error

func (Keeper) DepositReserve

func (k Keeper) DepositReserve(ctx sdk.Context, token string, from sdk.AccAddress, amount sdk.Coins) error

func (Keeper) DepositReserveFromModule

func (k Keeper) DepositReserveFromModule(ctx sdk.Context, token string,
	fromModule string, amount sdk.Coins) error

func (Keeper) GetBatchBuySellPrices

func (k Keeper) GetBatchBuySellPrices(ctx sdk.Context, token string, batch types.Batch) (buyPricesPT, sellPricesPT sdk.DecCoins, err error)

func (Keeper) GetParams

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

GetParams returns the total set of wars parameters.

func (Keeper) GetReserveBalances

func (k Keeper) GetReserveBalances(ctx sdk.Context, token string) sdk.Coins

func (Keeper) GetSupplyAdjustedForBuy

func (k Keeper) GetSupplyAdjustedForBuy(ctx sdk.Context, token string) sdk.Coin

func (Keeper) GetSupplyAdjustedForSell

func (k Keeper) GetSupplyAdjustedForSell(ctx sdk.Context, token string) sdk.Coin

func (Keeper) GetUpdatedBatchPricesAfterBuy

func (k Keeper) GetUpdatedBatchPricesAfterBuy(ctx sdk.Context, token string, bo types.BuyOrder) (buyPrices, sellPrices sdk.DecCoins, err error)

func (Keeper) GetUpdatedBatchPricesAfterSell

func (k Keeper) GetUpdatedBatchPricesAfterSell(ctx sdk.Context, token string, so types.SellOrder) (buyPrices, sellPrices sdk.DecCoins, err error)

func (Keeper) GetWar

func (k Keeper) GetWar(ctx sdk.Context, token string) (war types.War, found bool)

func (Keeper) GetWarIterator

func (k Keeper) GetWarIterator(ctx sdk.Context) sdk.Iterator

func (Keeper) LastBatchExists

func (k Keeper) LastBatchExists(ctx sdk.Context, token string) bool

func (Keeper) Logger

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

Logger returns a module-specific logger.

func (Keeper) MustGetBatch

func (k Keeper) MustGetBatch(ctx sdk.Context, token string) types.Batch

func (Keeper) MustGetLastBatch

func (k Keeper) MustGetLastBatch(ctx sdk.Context, token string) types.Batch

func (Keeper) MustGetWar

func (k Keeper) MustGetWar(ctx sdk.Context, token string) types.War

func (Keeper) MustGetWarByKey

func (k Keeper) MustGetWarByKey(ctx sdk.Context, key []byte) types.War

func (Keeper) PerformBuyAtPrice

func (k Keeper) PerformBuyAtPrice(ctx sdk.Context, token string, bo types.BuyOrder, prices sdk.DecCoins) (err error)

func (Keeper) PerformBuyOrders

func (k Keeper) PerformBuyOrders(ctx sdk.Context, token string)

func (Keeper) PerformOrders

func (k Keeper) PerformOrders(ctx sdk.Context, token string)

func (Keeper) PerformSellAtPrice

func (k Keeper) PerformSellAtPrice(ctx sdk.Context, token string, so types.SellOrder, prices sdk.DecCoins) (err error)

func (Keeper) PerformSellOrders

func (k Keeper) PerformSellOrders(ctx sdk.Context, token string)

func (Keeper) PerformSwap

func (k Keeper) PerformSwap(ctx sdk.Context, token string, so types.SwapOrder) (err error, ok bool)

func (Keeper) PerformSwapOrders

func (k Keeper) PerformSwapOrders(ctx sdk.Context, token string)

func (Keeper) ReservedWarToken

func (k Keeper) ReservedWarToken(ctx sdk.Context, warToken string) bool

func (Keeper) SetBatch

func (k Keeper) SetBatch(ctx sdk.Context, token string, batch types.Batch)

func (Keeper) SetCurrentSupply

func (k Keeper) SetCurrentSupply(ctx sdk.Context, token string, currentSupply sdk.Coin)

func (Keeper) SetLastBatch

func (k Keeper) SetLastBatch(ctx sdk.Context, token string, batch types.Batch)

func (Keeper) SetParams

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

SetParams sets the wars parameters to the param space.

func (Keeper) SetWar

func (k Keeper) SetWar(ctx sdk.Context, token string, war types.War)

func (Keeper) SetWarState

func (k Keeper) SetWarState(ctx sdk.Context, token string, newState string)

func (Keeper) WarExists

func (k Keeper) WarExists(ctx sdk.Context, token string) bool

func (Keeper) WithdrawReserve

func (k Keeper) WithdrawReserve(ctx sdk.Context, token string,
	to sdk.AccAddress, amount sdk.Coins) error

Jump to

Keyboard shortcuts

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