mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-06-02 15:10:46 +00:00
Added helper functions, exchange method to set currencies and bug fixes
This commit is contained in:
@@ -173,7 +173,13 @@ func (g *Gemini) GetTicker(currencyPair string) (Ticker, error) {
|
||||
ticker.Last = resp.Last
|
||||
|
||||
ticker.Volume.Currency, _ = strconv.ParseFloat(resp.Volume[currencyPair[0:3]].(string), 64)
|
||||
ticker.Volume.USD, _ = strconv.ParseFloat(resp.Volume["USD"].(string), 64)
|
||||
|
||||
if common.StringContains(currencyPair, "USD") {
|
||||
ticker.Volume.USD, _ = strconv.ParseFloat(resp.Volume["USD"].(string), 64)
|
||||
} else {
|
||||
ticker.Volume.ETH, _ = strconv.ParseFloat(resp.Volume["ETH"].(string), 64)
|
||||
ticker.Volume.BTC, _ = strconv.ParseFloat(resp.Volume["BTC"].(string), 64)
|
||||
}
|
||||
|
||||
time, _ := resp.Volume["timestamp"].(float64)
|
||||
ticker.Volume.Timestamp = int64(time)
|
||||
|
||||
@@ -8,6 +8,8 @@ type Ticker struct {
|
||||
Volume struct {
|
||||
Currency float64
|
||||
USD float64
|
||||
BTC float64
|
||||
ETH float64
|
||||
Timestamp int64
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user