keeper

package
v0.20.2 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2023 License: Apache-2.0 Imports: 21 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"
	QueryAvailableReserve   = "available_reserve"
	QueryCustomPrice        = "custom_price"
	QueryBuyPrice           = "buy_price"
	QuerySellReturn         = "sell_return"
	QuerySwapReturn         = "swap_return"
	QueryAlphaMaximums      = "alpha_maximums"
	QueryParams             = "params"
	QueryBondAccountDetails = "bond_account_details"
)

Variables

This section is empty.

Functions

func AllInvariants

func AllInvariants(k Keeper) sdk.Invariant

AllInvariants runs all invariants of the bonds module.

func AvailableReserveInvariant added in v0.16.0

func AvailableReserveInvariant(k Keeper) sdk.Invariant

func NewMsgServerImpl

func NewMsgServerImpl(keeper Keeper) types.MsgServer

NewMsgServerImpl returns an implementation of the bonds MsgServer interface for the provided Keeper.

func NewQuerier

func NewQuerier(keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) 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 bankkeeper.Keeper

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

func NewKeeper

func NewKeeper(bankKeeper bankkeeper.Keeper, accountKeeper authkeeper.AccountKeeper, stakingKeeper stakingkeeper.Keeper,
	iidKeeper iidkeeper.Keeper, storeKey sdk.StoreKey, paramSpace paramstypes.Subspace, cdc codec.BinaryCodec) Keeper

func (Keeper) AddBuyOrder

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

func (Keeper) AddSellOrder

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

func (Keeper) AddSwapOrder

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

func (Keeper) AvailableReserve added in v0.16.0

func (Keeper) Batch

func (Keeper) BatchExists

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

func (Keeper) Bond

func (Keeper) BondDidExists

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

func (Keeper) BondExists

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

func (Keeper) CancelUnfulfillableBuys

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

func (Keeper) CancelUnfulfillableOrders

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

func (Keeper) CheckIfBuyOrderFulfillableAtPrice

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

func (Keeper) DepositIntoReserve added in v0.16.0

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

func (Keeper) DepositOutcomePayment

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

func (Keeper) DepositReserveFromModule

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

func (Keeper) GetAvailableReserve added in v0.16.0

func (k Keeper) GetAvailableReserve(ctx sdk.Context, bondDid string) sdk.Coins

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 string) (bond types.Bond, found bool)

func (Keeper) GetBondDid

func (k Keeper) GetBondDid(ctx sdk.Context, bondToken string) (bondDid string, 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, bondDid string) sdk.Coins

func (Keeper) GetSupplyAdjustedForAlphaEdit

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

func (Keeper) GetSupplyAdjustedForBuy

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

func (Keeper) GetSupplyAdjustedForSell

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

func (Keeper) GetUpdatedBatchPricesAfterBuy

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

func (Keeper) GetUpdatedBatchPricesAfterSell

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

func (Keeper) HandleBondingFunctionAlphaUpdate added in v0.19.1

func (k Keeper) HandleBondingFunctionAlphaUpdate(ctx sdk.Context, bondDid string)

func (Keeper) LastBatchExists

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

func (Keeper) Logger

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

Logger returns a module-specific logger.

func (Keeper) MoveOutcomePaymentToReserve

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

func (Keeper) MustGetBatch

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

func (Keeper) MustGetBond

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

func (Keeper) Params

func (Keeper) PerformBuyAtPrice

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

func (Keeper) PerformBuyOrders

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

func (Keeper) PerformOrders

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

func (Keeper) PerformSellAtPrice

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

func (Keeper) PerformSellOrders

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

func (Keeper) PerformSwap

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

func (Keeper) PerformSwapOrders

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

func (Keeper) ReservedBondToken

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

func (Keeper) SetBatch

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

func (Keeper) SetBond

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

func (Keeper) SetBondDid

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

func (Keeper) SetBondState

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

func (Keeper) SetCurrentSupply

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

func (Keeper) SetLastBatch

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

func (Keeper) SetParams

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

SetParams sets the total set of bonds parameters.

func (Keeper) UpdateAlpha

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

func (Keeper) WithdrawFromReserve added in v0.16.0

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