keeper

package
v4.0.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllInvariants

func AllInvariants(k Keeper) sdk.Invariant

AllInvariants runs all invariants of the bonds module.

func AvailableReserveInvariant

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 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 types.BankKeeper

	StakingKeeper types.StakingKeeper
	// contains filtered or unexported fields
}

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec,
	bankKeeper types.BankKeeper,
	accountKeeper types.AccountKeeper,
	stakingKeeper types.StakingKeeper,
	iidKeeper types.IidKeeper,
	storeKey storetypes.StoreKey,
	paramSpace paramstypes.Subspace,
) 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) 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

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

func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState

ExportGenesis returns the x/bonds module's exported genesis.

func (Keeper) GetAvailableReserve

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) storetypes.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

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

func (Keeper) InitGenesis

func (k Keeper) InitGenesis(ctx sdk.Context, data types.GenesisState)

InitGenesis initializes the x/bonds module's state from a provided genesis state.

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

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