keeper

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPriceIDBytes

func GetPriceIDBytes(id uint64) []byte

GetPriceIDBytes returns the byte representation of the ID

func GetPriceIDFromBytes

func GetPriceIDFromBytes(bz []byte) uint64

GetPriceIDFromBytes returns ID in uint64 format from a byte array

func NewMsgServerImpl

func NewMsgServerImpl(keeper Keeper) types.MsgServer

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

Types

type Keeper

type Keeper struct {
	// contains filtered or unexported fields
}

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec,
	storeKey,
	memKey storetypes.StoreKey,
	ps paramtypes.Subspace,

) *Keeper

func (Keeper) AppendPrice

func (k Keeper) AppendPrice(
	ctx sdk.Context,
	price types.Price,
) uint64

AppendPrice appends a price in the store with a new id and update the count

func (Keeper) GetAllPrice

func (k Keeper) GetAllPrice(ctx sdk.Context) (list []types.Price)

GetAllPrice returns all price

func (Keeper) GetParams

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

GetParams get all parameters as types.Params

func (Keeper) GetPrice

func (k Keeper) GetPrice(ctx sdk.Context, id uint64) (val types.Price, found bool)

GetPrice returns a price from its id

func (Keeper) GetPriceCount

func (k Keeper) GetPriceCount(ctx sdk.Context) uint64

GetPriceCount get the total number of price

func (Keeper) GetTokensActualPrice

func (k Keeper) GetTokensActualPrice(ctx sdk.Context) (string, string, error)

TODO Sometimes the osmosis api does not return the stATOM price Set a more reliable stATOM price source

func (Keeper) GetTokensActualPriceInt

func (k Keeper) GetTokensActualPriceInt(ctx sdk.Context) (sdk.Int, sdk.Int, error)

func (Keeper) Logger

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

func (Keeper) Params

func (Keeper) Price

func (Keeper) PriceAll

func (Keeper) RemovePrice

func (k Keeper) RemovePrice(ctx sdk.Context, id uint64)

RemovePrice removes a price from the store

func (Keeper) SetParams

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

SetParams set the params

func (Keeper) SetPrice

func (k Keeper) SetPrice(ctx sdk.Context, price types.Price)

SetPrice set a specific price in the store

func (Keeper) SetPriceCount

func (k Keeper) SetPriceCount(ctx sdk.Context, count uint64)

SetPriceCount set the total number of price

Jump to

Keyboard shortcuts

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