Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( CoinbaseProDetails = types.ExchangeQueryDetails{ Exchange: exchange_common.EXCHANGE_ID_COINBASE_PRO, Url: "https://api.pro.coinbase.com/products/$/ticker", PriceFunction: CoinbaseProPriceFunction, } )
Functions ¶
func CoinbaseProPriceFunction ¶
func CoinbaseProPriceFunction( response *http.Response, tickerToExponent map[string]int32, medianizer lib.Medianizer, ) (tickerToPrice map[string]uint64, unavailableTickers map[string]error, err error)
CoinbaseProPriceFunction transforms an API response from CoinbasePro into a map of tickers to prices that have been shifted by a market specific exponent.
Types ¶
type CoinbaseProTicker ¶
type CoinbaseProTicker struct { // `Pair` is not part of API response but can be set manually to reuse existing helper functions. Pair string `validate:"required"` AskPrice string `json:"ask" validate:"required,positive-float-string"` BidPrice string `json:"bid" validate:"required,positive-float-string"` LastPrice string `json:"price" validate:"required,positive-float-string"` }
CoinbaseProTicker is our representation of ticker information returned in CoinbasePro response. CoinbaseProTicker implements interface `Ticker` in util.go.
func (CoinbaseProTicker) GetAskPrice ¶
func (t CoinbaseProTicker) GetAskPrice() string
func (CoinbaseProTicker) GetBidPrice ¶
func (t CoinbaseProTicker) GetBidPrice() string
func (CoinbaseProTicker) GetLastPrice ¶
func (t CoinbaseProTicker) GetLastPrice() string
func (CoinbaseProTicker) GetPair ¶
func (t CoinbaseProTicker) GetPair() string
Click to show internal directories.
Click to hide internal directories.