Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Example request URL: /api/v3/ticker/24hr?symbols=["BTCUSDT","BNBUSDT"] BinanceDetails = types.ExchangeQueryDetails{ Exchange: exchange_common.EXCHANGE_ID_BINANCE, Url: "https://data.binance.com/api/v3/ticker/24hr?symbols=[$]", PriceFunction: BinancePriceFunction, IsMultiMarket: true, } BinanceUSDetails = types.ExchangeQueryDetails{ Exchange: exchange_common.EXCHANGE_ID_BINANCE_US, Url: "https://api.binance.us/api/v3/ticker/24hr?symbols=[$]", PriceFunction: BinancePriceFunction, IsMultiMarket: true, } )
Functions ¶
func BinancePriceFunction ¶
func BinancePriceFunction( response *http.Response, tickerToExponent map[string]int32, medianizer lib.Medianizer, ) (tickerToPrice map[string]uint64, unavailableTickers map[string]error, err error)
BinancePriceFunction transforms an API response from Binance into a map of tickers to prices that have been shifted by a market specific exponent.
Types ¶
type BinanceTicker ¶
type BinanceTicker struct { Pair string `json:"symbol" validate:"required"` AskPrice string `json:"askPrice" validate:"required,positive-float-string"` BidPrice string `json:"bidPrice" validate:"required,positive-float-string"` LastPrice string `json:"lastPrice" validate:"required,positive-float-string"` }
BinanceTicker is our representation of ticker information returned in Binance response. implements interface `Ticker` in util.go.
func (BinanceTicker) GetAskPrice ¶
func (t BinanceTicker) GetAskPrice() string
func (BinanceTicker) GetBidPrice ¶
func (t BinanceTicker) GetBidPrice() string
func (BinanceTicker) GetLastPrice ¶
func (t BinanceTicker) GetLastPrice() string
func (BinanceTicker) GetPair ¶
func (t BinanceTicker) GetPair() string
Click to show internal directories.
Click to hide internal directories.