pricefeed

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2020 License: Apache-2.0 Imports: 16 Imported by: 1

Documentation

Overview

nolint autogenerated code using github.com/rigelrozanski/multitool aliases generated for the following subdirectories: ALIASGEN: github.com/kava-labs/kava/x/pricefeed/types/ ALIASGEN: github.com/kava-labs/kava/x/pricefeed/keeper/

Package pricefeed allows a group of white-listed oracles to post price information of specific markets that are tracked by the system. For each market, the module computes the median of all posted prices by white-listed oracles and takes that as the current price value.

Index

Constants

View Source
const (
	DefaultCodespace              = types.DefaultCodespace
	CodeEmptyInput                = types.CodeEmptyInput
	CodeExpired                   = types.CodeExpired
	CodeInvalidPrice              = types.CodeInvalidPrice
	CodeInvalidAsset              = types.CodeInvalidAsset
	CodeInvalidOracle             = types.CodeInvalidOracle
	EventTypeMarketPriceUpdated   = types.EventTypeMarketPriceUpdated
	EventTypeOracleUpdatedPrice   = types.EventTypeOracleUpdatedPrice
	EventTypeNoValidPrices        = types.EventTypeNoValidPrices
	AttributeValueCategory        = types.AttributeValueCategory
	AttributeMarketID             = types.AttributeMarketID
	AttributeMarketPrice          = types.AttributeMarketPrice
	AttributeOracle               = types.AttributeOracle
	AttributeExpiry               = types.AttributeExpiry
	AttributeKeyPriceUpdateFailed = types.AttributeKeyPriceUpdateFailed
	ModuleName                    = types.ModuleName
	StoreKey                      = types.StoreKey
	RouterKey                     = types.RouterKey
	QuerierRoute                  = types.QuerierRoute
	DefaultParamspace             = types.DefaultParamspace
	RawPriceFeedPrefix            = types.RawPriceFeedPrefix
	CurrentPricePrefix            = types.CurrentPricePrefix
	MarketPrefix                  = types.MarketPrefix
	OraclePrefix                  = types.OraclePrefix
	TypeMsgPostPrice              = types.TypeMsgPostPrice
	QueryPrice                    = types.QueryPrice
	QueryRawPrices                = types.QueryRawPrices
	QueryMarkets                  = types.QueryMarkets
)

Variables

View Source
var (
	// functions aliases
	RegisterCodec       = types.RegisterCodec
	ErrEmptyInput       = types.ErrEmptyInput
	ErrExpired          = types.ErrExpired
	ErrNoValidPrice     = types.ErrNoValidPrice
	ErrInvalidMarket    = types.ErrInvalidMarket
	ErrInvalidOracle    = types.ErrInvalidOracle
	NewGenesisState     = types.NewGenesisState
	DefaultGenesisState = types.DefaultGenesisState
	NewMsgPostPrice     = types.NewMsgPostPrice
	NewParams           = types.NewParams
	DefaultParams       = types.DefaultParams
	ParamKeyTable       = types.ParamKeyTable
	NewKeeper           = keeper.NewKeeper
	NewQuerier          = keeper.NewQuerier

	// variable aliases
	ModuleCdc      = types.ModuleCdc
	KeyMarkets     = types.KeyMarkets
	DefaultMarkets = types.DefaultMarkets
)

Functions

func EndBlocker

func EndBlocker(ctx sdk.Context, k Keeper)

EndBlocker updates the current pricefeed

func HandleMsgPostPrice

func HandleMsgPostPrice(
	ctx sdk.Context,
	k Keeper,
	msg MsgPostPrice) sdk.Result

HandleMsgPostPrice handles prices posted by oracles

func InitGenesis

func InitGenesis(ctx sdk.Context, keeper Keeper, gs GenesisState)

InitGenesis sets distribution information for genesis.

func NewHandler

func NewHandler(k Keeper) sdk.Handler

NewHandler handles all pricefeed type messages

Types

type AppModule

type AppModule struct {
	AppModuleBasic
	AppModuleSimulation
	// contains filtered or unexported fields
}

AppModule app module type

func NewAppModule

func NewAppModule(keeper Keeper) AppModule

NewAppModule creates a new AppModule object

func (AppModule) BeginBlock

func (AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock)

BeginBlock module begin-block

func (AppModule) EndBlock

EndBlock module end-block

func (AppModule) ExportGenesis

func (am AppModule) ExportGenesis(ctx sdk.Context) json.RawMessage

ExportGenesis module export genesis

func (AppModule) InitGenesis

func (am AppModule) InitGenesis(ctx sdk.Context, data json.RawMessage) []abci.ValidatorUpdate

InitGenesis module init-genesis

func (AppModule) Name

func (AppModule) Name() string

Name module name

func (AppModule) NewHandler

func (am AppModule) NewHandler() sdk.Handler

NewHandler module handler

func (AppModule) NewQuerierHandler

func (am AppModule) NewQuerierHandler() sdk.Querier

NewQuerierHandler module querier

func (AppModule) QuerierRoute

func (AppModule) QuerierRoute() string

QuerierRoute module querier route name

func (AppModule) RegisterInvariants

func (AppModule) RegisterInvariants(_ sdk.InvariantRegistry)

RegisterInvariants register module invariants

func (AppModule) Route

func (AppModule) Route() string

Route module message route name

type AppModuleBasic

type AppModuleBasic struct{}

AppModuleBasic app module basics object

func (AppModuleBasic) DefaultGenesis

func (AppModuleBasic) DefaultGenesis() json.RawMessage

DefaultGenesis default genesis state

func (AppModuleBasic) GetQueryCmd

func (AppModuleBasic) GetQueryCmd(cdc *codec.Codec) *cobra.Command

GetQueryCmd get the root query command of this module

func (AppModuleBasic) GetTxCmd

func (AppModuleBasic) GetTxCmd(cdc *codec.Codec) *cobra.Command

GetTxCmd get the root tx command of this module

func (AppModuleBasic) Name

func (AppModuleBasic) Name() string

Name get module name

func (AppModuleBasic) RegisterCodec

func (AppModuleBasic) RegisterCodec(cdc *codec.Codec)

RegisterCodec register module codec

func (AppModuleBasic) RegisterRESTRoutes

func (AppModuleBasic) RegisterRESTRoutes(ctx context.CLIContext, rtr *mux.Router)

RegisterRESTRoutes register rest routes

func (AppModuleBasic) ValidateGenesis

func (AppModuleBasic) ValidateGenesis(bz json.RawMessage) error

ValidateGenesis module validate genesis

type AppModuleSimulation added in v0.5.0

type AppModuleSimulation struct{}

AppModuleSimulation defines the module simulation functions used by the pricefeed module.

func (AppModuleSimulation) GenerateGenesisState added in v0.5.0

func (AppModuleSimulation) GenerateGenesisState(simState *module.SimulationState)

GenerateGenesisState creates a randomized GenState of the pricefeed module

func (AppModuleSimulation) RandomizedParams added in v0.5.0

func (AppModuleSimulation) RandomizedParams(r *rand.Rand) []sim.ParamChange

RandomizedParams creates randomized pricefeed param changes for the simulator.

func (AppModuleSimulation) RegisterStoreDecoder added in v0.5.0

func (AppModuleSimulation) RegisterStoreDecoder(sdr sdk.StoreDecoderRegistry)

RegisterStoreDecoder registers a decoder for pricefeed module's types

type CurrentPrice

type CurrentPrice = types.CurrentPrice

type GenesisState

type GenesisState = types.GenesisState

func ExportGenesis

func ExportGenesis(ctx sdk.Context, keeper Keeper) GenesisState

ExportGenesis returns a GenesisState for a given context and keeper.

type Keeper

type Keeper = keeper.Keeper

type Market

type Market = types.Market

type Markets

type Markets = types.Markets

type MsgPostPrice

type MsgPostPrice = types.MsgPostPrice

type Params

type Params = types.Params

type PostedPrice

type PostedPrice = types.PostedPrice

type QueryWithMarketIDParams

type QueryWithMarketIDParams = types.QueryWithMarketIDParams

type SortDecs

type SortDecs = types.SortDecs

Directories

Path Synopsis
client
cli

Jump to

Keyboard shortcuts

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