pricefeed

package
v0.0.0-...-93f430d Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const BaseURL = "http://localhost:1317"

BaseURL is the base url for kava's rest-server

Variables

This section is empty.

Functions

func ExecutePostingIteration

func ExecutePostingIteration(
	coins []string,
	accAddress sdk.AccAddress,
	chainID string,
	cdc *amino.Codec,
	oracleName string,
	passphrase string,
	cliCtx context.CLIContext,
	rpcURL string,
) error

ExecutePostingIteration gets the current coin prices and posts them to kava

func GetAssetList

func GetAssetList()

GetAssetList gets a list of assets on kava

func GetAssetPrice

func GetAssetPrice(symbol string)

GetAssetPrice gets an asset's current price on kava

Types

type Asset

type Asset struct {
	Symbol           string
	Price            float64
	TargetMarketCode string
}

Asset struct

func GetCoinGeckoPrices

func GetCoinGeckoPrices(symbols []string, convert string) []Asset

GetCoinGeckoPrices gets prices for an array of coins by their symbols

type CoinGeckoMarket

type CoinGeckoMarket struct {
	Name                string `json:"name"`
	Identifier          string `json:"identifier"`
	HasTradingIncentive bool   `json:"has_trading_incentive"`
	CoinID              string `json:"coin_id"`
}

CoinGeckoMarket struct

type CoinGeckoTicker

type CoinGeckoTicker struct {
	Base   string          `json:"base"`
	Target string          `json:"target"`
	Market CoinGeckoMarket `json:"market"`
	Last   float64         `json:"last"`
	CoinID string          `json:"coin_id"`
}

CoinGeckoTicker struct

type CoinGeckoTickers

type CoinGeckoTickers struct {
	Name    string            `json:"name"`
	Tickers []CoinGeckoTicker `json:"tickers"`
}

CoinGeckoTickers struct

type MarketsRes

type MarketsRes struct {
	Height string   `json:"height"`
	Result []string `json:"result"`
}

MarketsRes struct

Jump to

Keyboard shortcuts

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