Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( BinanceDetails = types.ExchangeQueryDetails{ Exchange: exchange_common.EXCHANGE_ID_BINANCE, Url: "https://data.binance.com/api/v3/ticker/24hr", PriceFunction: BinancePriceFunction, IsMultiMarket: true, } BinanceUSDetails = types.ExchangeQueryDetails{ Exchange: exchange_common.EXCHANGE_ID_BINANCE_US, Url: "https://api.binance.us/api/v3/ticker/24hr", PriceFunction: BinancePriceFunction, IsMultiMarket: true, } )
Functions ¶
func BinancePriceFunction ¶
func BinancePriceFunction( response *http.Response, tickerToExponent map[string]int32, resolver types.Resolver, ) (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. It 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.