Documentation
¶
Index ¶
- Variables
- func BuildPricePrefix(id uint32, denom string, height int64) ([]byte, error)
- type Keeper
- type Querier
- func (k Querier) Params(ctx context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- func (k Querier) PriceFeedConfig(ctx context.Context, request *types.QueryPriceFeedConfigRequest) (*types.QueryPriceFeedConfigResponse, error)
- func (k Querier) Prices(ctx context.Context, request *types.QueryPricesRequest) (*types.QueryPricesResponse, error)
- type SetParamsHook
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 ¶
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)
// Test helpers
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 (k Querier) Params(ctx context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
func (Querier) PriceFeedConfig ¶
func (k Querier) PriceFeedConfig(ctx context.Context, request *types.QueryPriceFeedConfigRequest) (*types.QueryPriceFeedConfigResponse, error)
func (Querier) Prices ¶
func (k Querier) Prices(ctx context.Context, request *types.QueryPricesRequest) (*types.QueryPricesResponse, error)
Click to show internal directories.
Click to hide internal directories.