keeper

package
v0.0.0-...-4ed9d07 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	QueryBonds          = "bonds"
	QueryBond           = "bond"
	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 bonds 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) BondExists

func (k Keeper) BondExists(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) GetBond

func (k Keeper) GetBond(ctx sdk.Context, token string) (bond types.Bond, found bool)

func (Keeper) GetBondIterator

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

func (Keeper) GetParams

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

GetParams returns the total set of bonds 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) 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) MustGetBond

func (k Keeper) MustGetBond(ctx sdk.Context, token string) types.Bond

func (Keeper) MustGetBondByKey

func (k Keeper) MustGetBondByKey(ctx sdk.Context, key []byte) types.Bond

func (Keeper) MustGetLastBatch

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

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) ReservedBondToken

func (k Keeper) ReservedBondToken(ctx sdk.Context, bondToken string) bool

func (Keeper) SetBatch

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

func (Keeper) SetBond

func (k Keeper) SetBond(ctx sdk.Context, token string, bond types.Bond)

func (Keeper) SetBondState

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

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 bonds parameters to the param space.

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