keeper

package
v1.4.3 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	QueryBonds          = "bonds"
	QueryBondsDetailed  = "bonds_detailed"
	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"
	QueryAlphaMaximums  = "alpha_maximums"
	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
	DidKeeper     did.Keeper
	// contains filtered or unexported fields
}

func NewKeeper

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

func (Keeper) AddBuyOrder

func (k Keeper) AddBuyOrder(ctx sdk.Context, bondDid did.Did, bo types.BuyOrder, buyPrices, sellPrices sdk.DecCoins)

func (Keeper) AddSellOrder

func (k Keeper) AddSellOrder(ctx sdk.Context, bondDid did.Did, so types.SellOrder, buyPrices, sellPrices sdk.DecCoins)

func (Keeper) AddSwapOrder

func (k Keeper) AddSwapOrder(ctx sdk.Context, bondDid did.Did, so types.SwapOrder)

func (Keeper) BatchExists

func (k Keeper) BatchExists(ctx sdk.Context, bondDid did.Did) bool

func (Keeper) BondDidExists

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

func (Keeper) BondExists

func (k Keeper) BondExists(ctx sdk.Context, bondDid did.Did) bool

func (Keeper) CancelUnfulfillableBuys

func (k Keeper) CancelUnfulfillableBuys(ctx sdk.Context, bondDid did.Did) (cancelledOrders int)

func (Keeper) CancelUnfulfillableOrders

func (k Keeper) CancelUnfulfillableOrders(ctx sdk.Context, bondDid did.Did) (cancelledOrders int)

func (Keeper) CheckIfBuyOrderFulfillableAtPrice

func (k Keeper) CheckIfBuyOrderFulfillableAtPrice(ctx sdk.Context, bondDid did.Did, bo types.BuyOrder, prices sdk.DecCoins) error

func (Keeper) DepositOutcomePayment added in v0.14.2

func (k Keeper) DepositOutcomePayment(ctx sdk.Context, bondDid did.Did,
	from sdk.AccAddress, amount sdk.Coins) error

func (Keeper) DepositReserve added in v0.12.2

func (k Keeper) DepositReserve(ctx sdk.Context, bondDid did.Did,
	from sdk.AccAddress, amount sdk.Coins) error

func (Keeper) DepositReserveFromModule added in v0.12.2

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

func (Keeper) GetBatchBuySellPrices

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

func (Keeper) GetBond

func (k Keeper) GetBond(ctx sdk.Context, bondDid did.Did) (bond types.Bond, found bool)

func (Keeper) GetBondDid

func (k Keeper) GetBondDid(ctx sdk.Context, bondToken string) (bondDid did.Did, found bool)

func (Keeper) GetBondIterator

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

func (Keeper) GetParams added in v0.13.0

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, bondDid did.Did) sdk.Coins

func (Keeper) GetSupplyAdjustedForAlphaEdit added in v0.14.2

func (k Keeper) GetSupplyAdjustedForAlphaEdit(ctx sdk.Context, bondDid did.Did) sdk.Coin

func (Keeper) GetSupplyAdjustedForBuy

func (k Keeper) GetSupplyAdjustedForBuy(ctx sdk.Context, bondDid did.Did) sdk.Coin

func (Keeper) GetSupplyAdjustedForSell

func (k Keeper) GetSupplyAdjustedForSell(ctx sdk.Context, bondDid did.Did) sdk.Coin

func (Keeper) GetUpdatedBatchPricesAfterBuy

func (k Keeper) GetUpdatedBatchPricesAfterBuy(ctx sdk.Context, bondDid did.Did, bo types.BuyOrder) (buyPrices, sellPrices sdk.DecCoins, err error)

func (Keeper) GetUpdatedBatchPricesAfterSell

func (k Keeper) GetUpdatedBatchPricesAfterSell(ctx sdk.Context, bondDid did.Did, so types.SellOrder) (buyPrices, sellPrices sdk.DecCoins, err error)

func (Keeper) LastBatchExists

func (k Keeper) LastBatchExists(ctx sdk.Context, bondDid did.Did) bool

func (Keeper) Logger

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

Logger returns a module-specific logger.

func (Keeper) MoveOutcomePaymentToReserve added in v0.14.2

func (k Keeper) MoveOutcomePaymentToReserve(ctx sdk.Context, bondDid did.Did)

func (Keeper) MustGetBatch

func (k Keeper) MustGetBatch(ctx sdk.Context, bondDid did.Did) types.Batch

func (Keeper) MustGetBond

func (k Keeper) MustGetBond(ctx sdk.Context, bondDid did.Did) 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, bondDid did.Did) types.Batch

func (Keeper) PerformBuyAtPrice

func (k Keeper) PerformBuyAtPrice(ctx sdk.Context, bondDid did.Did, bo types.BuyOrder, prices sdk.DecCoins) (err error)

func (Keeper) PerformBuyOrders

func (k Keeper) PerformBuyOrders(ctx sdk.Context, bondDid did.Did)

func (Keeper) PerformOrders

func (k Keeper) PerformOrders(ctx sdk.Context, bondDid did.Did)

func (Keeper) PerformSellAtPrice

func (k Keeper) PerformSellAtPrice(ctx sdk.Context, bondDid did.Did, so types.SellOrder, prices sdk.DecCoins) (err error)

func (Keeper) PerformSellOrders

func (k Keeper) PerformSellOrders(ctx sdk.Context, bondDid did.Did)

func (Keeper) PerformSwap

func (k Keeper) PerformSwap(ctx sdk.Context, bondDid did.Did, so types.SwapOrder) (err error, ok bool)

func (Keeper) PerformSwapOrders

func (k Keeper) PerformSwapOrders(ctx sdk.Context, bondDid did.Did)

func (Keeper) ReservedBondToken added in v0.13.0

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

func (Keeper) SetBatch

func (k Keeper) SetBatch(ctx sdk.Context, bondDid did.Did, batch types.Batch)

func (Keeper) SetBond

func (k Keeper) SetBond(ctx sdk.Context, bondDid did.Did, bond types.Bond)

func (Keeper) SetBondDid

func (k Keeper) SetBondDid(ctx sdk.Context, bondToken string, bondDid did.Did)

func (Keeper) SetBondState added in v0.12.2

func (k Keeper) SetBondState(ctx sdk.Context, bondDid did.Did, newState types.BondState)

func (Keeper) SetCurrentSupply

func (k Keeper) SetCurrentSupply(ctx sdk.Context, bondDid did.Did, currentSupply sdk.Coin)

func (Keeper) SetLastBatch

func (k Keeper) SetLastBatch(ctx sdk.Context, bondDid did.Did, batch types.Batch)

func (Keeper) SetParams added in v0.13.0

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

SetParams sets the total set of bonds parameters.

func (Keeper) UpdateAlpha added in v0.14.2

func (k Keeper) UpdateAlpha(ctx sdk.Context, bondDid did.Did)

func (Keeper) WithdrawReserve added in v0.12.2

func (k Keeper) WithdrawReserve(ctx sdk.Context, bondDid did.Did,
	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