keeper

package
v2.1.0-a7 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2026 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	PriceDataIDKey       codec.KeyCodec[types.PriceDataID]       = priceDataIDCodec{}
	DataIDKey            codec.KeyCodec[types.DataID]            = dataIDCodec{}
	PriceDataRecordIDKey codec.KeyCodec[types.PriceDataRecordID] = priceDataRecordIDCodec{}
)

PriceDataRecordIDKey is the codec instance to use when creating a Map

View Source
var (
	PricesPrefix           = collections.NewPrefix([]byte{0x11, 0x00})
	LatestPricesPrefix     = collections.NewPrefix([]byte{0x11, 0x01})
	AggregatedPricesPrefix = collections.NewPrefix([]byte{0x11, 0x02})
	PricesHealthPrefix     = collections.NewPrefix([]byte{0x11, 0x03})

	SourcesSeqPrefix = collections.NewPrefix([]byte{0x12, 0x00})
	SourcesIDPrefix  = collections.NewPrefix([]byte{0x12, 0x02})

	ParamsKey = collections.NewPrefix(0x09) // key for oracle module params
)

Functions

func BuildPricePrefix

func BuildPricePrefix(id uint32, denom string, height int64) ([]byte, error)

Types

type Keeper

type Keeper interface {
	StoreKey() storetypes.StoreKey
	Codec() codec.BinaryCodec
	GetAuthority() string
	NewQuerier() Querier
	BeginBlocker(ctx context.Context) error
	EndBlocker(ctx context.Context) error
	GetParams(sdk.Context) (types.Params, error)
	SetParams(sdk.Context, types.Params) error

	AddPriceEntry(sdk.Context, sdk.Address, types.DataID, types.PriceDataState) error
	GetAggregatedPrice(ctx sdk.Context, denom string) (sdkmath.LegacyDec, error)
	SetAggregatedPrice(sdk.Context, types.DataID, types.AggregatedPrice) error
	SetPriceHealth(sdk.Context, types.DataID, types.PriceHealth) error
}

func NewKeeper

func NewKeeper(cdc codec.BinaryCodec, skey *storetypes.KVStoreKey, authority string) Keeper

NewKeeper creates and returns an instance of take keeper

type Querier

type Querier struct {
	Keeper
}

Querier is used as Keeper will have duplicate methods if used directly, and gRPC names take precedence over keeper

func (Querier) Params

func (Querier) Prices

type SetParamsHook

type SetParamsHook func(sdk.Context, types.Params)

Jump to

Keyboard shortcuts

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