keeper

package
v0.0.0-...-6de1ec5 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMsgServerImpl

func NewMsgServerImpl(keeper Keeper) oracle.MsgServer

NewMsgServerImpl returns an implementation of the module MsgServer interface.

func NewQueryServerImpl

func NewQueryServerImpl(k Keeper) oracle.QueryServer

NewQueryServerImpl returns an implementation of the module QueryServer.

Types

type AggregatedProviderPrices

type AggregatedProviderPrices map[string]map[string]TickerPrice

AggregatedProviderPrices defines a type alias for a map of provider -> asset -> TickerPrice (e.g. Binance -> ATOM/USD -> 11.98)

type CurrencyPair

type CurrencyPair struct {
	Base  string
	Quote string
}

func (CurrencyPair) String

func (cp CurrencyPair) String() string

type Keeper

type Keeper struct {

	// state management
	Schema  collections.Schema
	Counter collections.Map[string, uint64]
	Prices  collections.Map[string, []byte]
	// contains filtered or unexported fields
}

func NewKeeper

func NewKeeper(cdc codec.BinaryCodec, addressCodec address.Codec, storeService storetypes.KVStoreService, authority string) Keeper

NewKeeper creates a new Keeper instance

func (*Keeper) ExportGenesis

func (k *Keeper) ExportGenesis(ctx context.Context) (*oracle.GenesisState, error)

ExportGenesis exports the module state to a genesis state.

func (Keeper) GetAuthority

func (k Keeper) GetAuthority() string

GetAuthority returns the module's authority.

func (Keeper) GetOraclePrices

func (k Keeper) GetOraclePrices(ctx context.Context) (map[string]math.LegacyDec, error)

func (Keeper) GetSupportedPairs

func (k Keeper) GetSupportedPairs(_ context.Context) []CurrencyPair

func (*Keeper) InitGenesis

func (k *Keeper) InitGenesis(ctx context.Context, data *oracle.GenesisState) error

InitGenesis initializes the module state from a genesis state.

func (Keeper) SetOraclePrices

func (k Keeper) SetOraclePrices(ctx context.Context, prices map[string]math.LegacyDec) error

type Migrator

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

Migrator is a struct for handling in-place state migrations.

func NewMigrator

func NewMigrator(k Keeper) Migrator

NewMigrator returns Migrator instance for the state migration.

type TickerPrice

type TickerPrice struct {
	Price  math.LegacyDec // last trade price
	Volume math.LegacyDec // 24h volume
}

Jump to

Keyboard shortcuts

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