Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( CryptoComDetails = types.ExchangeQueryDetails{ Exchange: exchange_common.EXCHANGE_ID_CRYPTO_COM, Url: "https://api.crypto.com/v2/public/get-ticker", PriceFunction: CryptoComPriceFunction, IsMultiMarket: true, } )
Functions ¶
func CryptoComPriceFunction ¶
func CryptoComPriceFunction( response *http.Response, tickerToExponent map[string]int32, medianizer lib.Medianizer, ) (tickerToPrice map[string]uint64, unavailableTickers map[string]error, err error)
CryptoComPriceFunction transforms an API response from CryptoCom into a map of tickers to prices that have been shifted by a market specific exponent.
Types ¶
type CryptoComResponseBody ¶
type CryptoComResponseBody struct { Code uint32 `json:"code" validate:"required"` Result CryptoComResponseResult `json:"result" validate:"required"` }
CryptoComResponseBody defines the overall CryptoCom response.
type CryptoComResponseResult ¶
type CryptoComResponseResult struct {
Tickers []CryptoComTicker `json:"data" validate:"required"`
}
CryptoComResponseResult defines the `result` field of CryptoCom response.
type CryptoComTicker ¶
type CryptoComTicker struct { Pair string `json:"i" validate:"required"` AskPrice string `json:"k" validate:"required,positive-float-string"` BidPrice string `json:"b" validate:"required,positive-float-string"` LastPrice string `json:"a" validate:"required,positive-float-string"` }
CryptoComTicker is our representation of ticker information returned in CryptoCom response. Need to implement interface `Ticker` in util.go. Note: CryptoCom returns `null` for bids and asks if there are none on the orderbook, in which case we mark the ticker as unavailable.
func (CryptoComTicker) GetAskPrice ¶
func (t CryptoComTicker) GetAskPrice() string
func (CryptoComTicker) GetBidPrice ¶
func (t CryptoComTicker) GetBidPrice() string
func (CryptoComTicker) GetLastPrice ¶
func (t CryptoComTicker) GetLastPrice() string
func (CryptoComTicker) GetPair ¶
func (t CryptoComTicker) GetPair() string
Click to show internal directories.
Click to hide internal directories.