BTSE: Fix endpoint issues after API update (#341)

This commit is contained in:
Adrian Gallagher
2019-08-21 09:22:31 +10:00
committed by GitHub
parent b3e8be2c75
commit 4f982dcdc9
3 changed files with 12 additions and 7 deletions

View File

@@ -1,8 +1,10 @@
package btse
import "time"
// Market stores market data
type Market struct {
ID string `json:"id"`
Symbol string `json:"symbol"`
BaseCurrency string `json:"base_currency"`
QuoteCurrency string `json:"quote_currency"`
BaseMinSize float64 `json:"base_min_size"`
@@ -51,8 +53,8 @@ type MarketStatistics struct {
// ServerTime stores the server time data
type ServerTime struct {
ISO string `json:"iso"`
Epoch float64 `json:"epoch"`
ISO time.Time `json:"iso"`
Epoch string `json:"epoch"`
}
// CurrencyBalance stores the account info data

View File

@@ -62,7 +62,7 @@ func (b *BTSE) WsHandleData() {
ProductID string `json:"product_id"`
}
if strings.Contains(string(resp.Raw), "connect success") {
if strings.Contains(string(resp.Raw), "Connected. Welcome to BTSE!") {
if b.Verbose {
log.Debugf("%s websocket client successfully connected to %s",
b.Name, b.Websocket.GetWebsocketURL())

View File

@@ -39,16 +39,19 @@ func (b *BTSE) Run() {
} else {
var currencies []string
for _, m := range *markets {
currencies = append(currencies, m.ID)
if m.Status != "active" {
continue
}
currencies = append(currencies, m.Symbol)
}
err = b.UpdateCurrencies(currency.NewPairsFromStrings(currencies),
false,
false)
if err != nil {
log.Errorf("%s Failed to update available currencies.\n", b.Name)
log.Errorf("%s Failed to update available currencies. Error: %s\n",
b.Name, err)
}
}
}
// UpdateTicker updates and returns the ticker for a currency pair