Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( HuobiDetails = types.ExchangeQueryDetails{ Exchange: exchange_common.EXCHANGE_ID_HUOBI, Url: "https://api.huobi.pro/market/tickers", PriceFunction: HuobiPriceFunction, IsMultiMarket: true, } )
Functions ¶
func HuobiPriceFunction ¶
func HuobiPriceFunction( response *http.Response, tickerToExponent map[string]int32, medianizer lib.Medianizer, ) (tickerToPrice map[string]uint64, unavailableTickers map[string]error, err error)
HuobiPriceFunction transforms an API response from Huobi into a map of tickers to prices that have been shifted by a market specific exponent.
Types ¶
type HuobiResponseBody ¶
type HuobiResponseBody struct { Status string `json:"status" validate:"required"` Tickers []HuobiTicker `json:"data" validate:"required"` }
HuobiResponseBody defines the overall Huobi response.
type HuobiTicker ¶
type HuobiTicker struct { Pair string `json:"symbol" validate:"required"` AskPrice float64 `json:"ask" validate:"required,gt=0"` BidPrice float64 `json:"bid" validate:"required,gt=0"` LastPrice float64 `json:"close" validate:"required,gt=0"` }
HuobiTicker is our representation of ticker information returned in Huobi response. HuobiTicker implements interface `Ticker` in util.go.
func (HuobiTicker) GetAskPrice ¶
func (t HuobiTicker) GetAskPrice() string
func (HuobiTicker) GetBidPrice ¶
func (t HuobiTicker) GetBidPrice() string
func (HuobiTicker) GetLastPrice ¶
func (t HuobiTicker) GetLastPrice() string
func (HuobiTicker) GetPair ¶
func (t HuobiTicker) GetPair() string
Click to show internal directories.
Click to hide internal directories.