Documentation
¶
Index ¶
- Variables
- func BinanceTicker() (float64, error)
- func BinanceVolume() (float64, error)
- func CoinbaseTicker() (float64, error)
- func CoinbaseVolume() (float64, error)
- func ExchangeXLMforUSD(amount float64) float64
- func KrakenTicker() (float64, error)
- func KrakenVolume() (float64, error)
- func XLMUSD() (float64, error)
- type BinanceTickerResponse
- type BinanceVolumeResponse
- type CoinbaseTickerResponse
- type KrakenTickerResponse
Constants ¶
This section is empty.
Variables ¶
var BinanceReq = "https://api.binance.com/api/v1/ticker/price?symbol=XLMUSDT"
BinanceReq is the binance ticker from the API
var BinanceVol = "https://api.binance.com/api/v1/ticker/24hr?symbol=XLMUSDT"
BinanceVol is the binance ticker from the API
var CoinbaseReq = "https://api.pro.coinbase.com/products/XLM-USD/ticker"
CoinbaseReq is the coinbase ticker from the API
var KrakenReq = "https://api.kraken.com/0/public/Ticker?pair=XLMUSD"
KrakenReq is the kraken ticker from the API
Functions ¶
func BinanceTicker ¶
BinanceTicker gets price data from Binance
func BinanceVolume ¶
BinanceVolume gets volume data from Binance
func CoinbaseTicker ¶
CoinbaseTicker gets ticker data from coinbase
func CoinbaseVolume ¶
CoinbaseVolume gets volume data from coinbase
func ExchangeXLMforUSD ¶
ExchangeXLMforUSD retrieves the current price of XLM/USD and then returns the USD amount
Types ¶
type BinanceTickerResponse ¶
BinanceTickerResponse defines the ticker API response from Binanace
type BinanceVolumeResponse ¶
type BinanceVolumeResponse struct {
// there are other fields as well, but we ignore them for now
Symbol string `json:"symbol"`
Volume string `json:"volume"`
}
BinanceVolumeResponse defines the structure of binance's volume endpoint response
type CoinbaseTickerResponse ¶
type CoinbaseTickerResponse struct {
TradeId int `json:"trade_id"`
Price string `json:"price"`
Volume string `json:"volume"`
}
CoinbaseTickerResponse defines the structure of coinbase's ticker endpoitt response
type KrakenTickerResponse ¶
type KrakenTickerResponse struct {
Error []string `json:"error"`
Result struct {
XXLMZUSD struct {
// there's some additional info here but we don't require that
C []string // c = last trade closed array(<price>, <lot volume>),
V []string // volume array(<today>, <last 24 hours>)
}
}
}
KrakenTickerResponse defines the structure of kraken's ticker response