Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var OkxDetails = types.ExchangeQueryDetails{ Exchange: exchange_common.EXCHANGE_ID_OKX, Url: "https://www.okx.com/api/v5/market/tickers?instType=SPOT", PriceFunction: OkxPriceFunction, IsMultiMarket: true, }
Functions ¶
func OkxPriceFunction ¶
func OkxPriceFunction( response *http.Response, marketPriceExponent map[string]int32, resolver types.Resolver, ) (tickerToPrice map[string]uint64, unavailableTickers map[string]error, err error)
OkxPriceFunction transforms an API response from Okx into a map of tickers to prices that have been shifted by a market specific exponent.
Types ¶
type OkxResponseBody ¶
type OkxResponseBody struct { Code string `json:"code" validate:"required"` Tickers []OkxTicker `json:"data" validate:"required"` }
OkxResponseBody defines the overall Okx response.
type OkxTicker ¶
type OkxTicker struct { Pair string `json:"instId" validate:"required"` AskPrice string `json:"askPx" validate:"required,positive-float-string"` BidPrice string `json:"bidPx" validate:"required,positive-float-string"` LastPrice string `json:"last" validate:"required,positive-float-string"` }
OkxTicker is our representation of ticker information returned in Okx response. OkxTicker implements interface `Ticker` in util.go.
func (OkxTicker) GetAskPrice ¶
func (OkxTicker) GetBidPrice ¶
func (OkxTicker) GetLastPrice ¶
Click to show internal directories.
Click to hide internal directories.