Documentation ¶
Index ¶
- func NewQuerier(k Keeper, legacyQuerierCdc *codec.LegacyAmino) sdk.Querier
- type Keeper
- func (k Keeper) CalculateMedianPrice(ctx sdk.Context, prices types.CurrentPrices) sdk.Dec
- func (k Keeper) GetAuthorizedAddresses(ctx sdk.Context) []sdk.AccAddress
- func (k Keeper) GetCurrentPrice(ctx sdk.Context, marketID string) (types.CurrentPrice, error)
- func (k Keeper) GetCurrentPrices(ctx sdk.Context) types.CurrentPrices
- func (k Keeper) GetMarket(ctx sdk.Context, marketID string) (types.Market, bool)
- func (k Keeper) GetMarkets(ctx sdk.Context) []types.Market
- func (k Keeper) GetOracle(ctx sdk.Context, marketID string, address sdk.AccAddress) (sdk.AccAddress, error)
- func (k Keeper) GetOracles(ctx sdk.Context, marketID string) ([]sdk.AccAddress, error)
- func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)
- func (k Keeper) GetRawPrices(ctx sdk.Context, marketID string) (types.PostedPrices, error)
- func (k Keeper) IterateCurrentPrices(ctx sdk.Context, cb func(cp types.CurrentPrice) (stop bool))
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) MarketAll(c context.Context, req *types.QueryAllMarketRequest) (*types.QueryAllMarketResponse, error)
- func (k Keeper) OracleAll(c context.Context, req *types.QueryAllOracleRequest) (*types.QueryAllOracleResponse, error)
- func (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- func (k Keeper) Price(c context.Context, req *types.QueryGetPriceRequest) (*types.QueryGetPriceResponse, error)
- func (k Keeper) PriceAll(c context.Context, req *types.QueryAllPriceRequest) (*types.QueryAllPriceResponse, error)
- func (k Keeper) RawPriceAll(c context.Context, req *types.QueryAllRawPriceRequest) (*types.QueryAllRawPriceResponse, error)
- func (k Keeper) SetCurrentPrices(ctx sdk.Context, marketID string) error
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k Keeper) SetPrice(ctx sdk.Context, oracle sdk.AccAddress, marketID string, price sdk.Dec, ...) (types.PostedPrice, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewQuerier ¶
func NewQuerier(k Keeper, legacyQuerierCdc *codec.LegacyAmino) sdk.Querier
Types ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
func (Keeper) CalculateMedianPrice ¶
CalculateMedianPrice calculates the median prices for the input prices.
func (Keeper) GetAuthorizedAddresses ¶ added in v0.2.0
func (k Keeper) GetAuthorizedAddresses(ctx sdk.Context) []sdk.AccAddress
GetAuthorizedAddresses returns a list of addresses that have special authorization within this module, eg the oracles of all markets.
func (Keeper) GetCurrentPrice ¶
GetCurrentPrice fetches the current median price of all oracles for a specific market
func (Keeper) GetCurrentPrices ¶ added in v0.2.0
func (k Keeper) GetCurrentPrices(ctx sdk.Context) types.CurrentPrices
GetCurrentPrices returns all current price objects from the store
func (Keeper) GetMarkets ¶
GetMarkets returns the markets from params
func (Keeper) GetOracle ¶
func (k Keeper) GetOracle(ctx sdk.Context, marketID string, address sdk.AccAddress) (sdk.AccAddress, error)
GetOracle returns the oracle from the store or an error if not found
func (Keeper) GetOracles ¶
GetOracles returns the oracles in the pricefeed store
func (Keeper) GetRawPrices ¶
GetRawPrices fetches the set of all prices posted by oracles for an asset
func (Keeper) IterateCurrentPrices ¶ added in v0.2.0
IterateCurrentPrices iterates over all current price objects in the store and performs a callback function
func (Keeper) MarketAll ¶ added in v0.2.0
func (k Keeper) MarketAll(c context.Context, req *types.QueryAllMarketRequest) (*types.QueryAllMarketResponse, error)
func (Keeper) OracleAll ¶ added in v0.2.0
func (k Keeper) OracleAll(c context.Context, req *types.QueryAllOracleRequest) (*types.QueryAllOracleResponse, error)
func (Keeper) Params ¶ added in v0.2.0
func (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
func (Keeper) Price ¶ added in v0.2.0
func (k Keeper) Price(c context.Context, req *types.QueryGetPriceRequest) (*types.QueryGetPriceResponse, error)
func (Keeper) PriceAll ¶ added in v0.2.0
func (k Keeper) PriceAll(c context.Context, req *types.QueryAllPriceRequest) (*types.QueryAllPriceResponse, error)
func (Keeper) RawPriceAll ¶ added in v0.2.0
func (k Keeper) RawPriceAll(c context.Context, req *types.QueryAllRawPriceRequest) (*types.QueryAllRawPriceResponse, error)
func (Keeper) SetCurrentPrices ¶
SetCurrentPrices updates the price of an asset to the median of all valid oracle inputs