Coinbene: Add swap endpoints and code cleanup/bugfixes (#403)

* Start Coinbene SWAP implementation

* Flesh out more API endpoints

* Code cleanup

* Add more endpoints, bug fixes and order validation checks

* More endpoints, tests and bugfixes

* Remove omitempty for enabled/available pairs
This commit is contained in:
Adrian Gallagher
2019-12-18 17:36:07 +11:00
committed by GitHub
parent edc07f7839
commit 467d8d91a2
9 changed files with 1797 additions and 502 deletions

View File

@@ -2,6 +2,7 @@ package engine
import (
"errors"
"strings"
"sync/atomic"
"time"
@@ -371,8 +372,12 @@ func (e *ExchangeCurrencyPairSyncer) worker() {
c.Ticker.IsUsingWebsocket = false
c.Ticker.IsUsingREST = true
log.Warnf(log.SyncMgr,
"%s %s: No ticker update after %s, switching from websocket to rest\n",
c.Exchange, FormatCurrency(enabledPairs[i]).String(), e.Cfg.SyncTimeout)
"%s %s %s: No ticker update after %s, switching from websocket to rest\n",
c.Exchange,
FormatCurrency(enabledPairs[i]).String(),
strings.ToUpper(c.AssetType.String()),
e.Cfg.SyncTimeout,
)
switchedToRest = true
e.setProcessing(c.Exchange, c.Pair, c.AssetType, SyncItemTicker, false)
}
@@ -435,8 +440,12 @@ func (e *ExchangeCurrencyPairSyncer) worker() {
c.Orderbook.IsUsingWebsocket = false
c.Orderbook.IsUsingREST = true
log.Warnf(log.SyncMgr,
"%s %s: No orderbook update after %s, switching from websocket to rest\n",
c.Exchange, FormatCurrency(c.Pair).String(), e.Cfg.SyncTimeout)
"%s %s %s: No orderbook update after %s, switching from websocket to rest\n",
c.Exchange,
FormatCurrency(c.Pair).String(),
strings.ToUpper(c.AssetType.String()),
e.Cfg.SyncTimeout,
)
switchedToRest = true
e.setProcessing(c.Exchange, c.Pair, c.AssetType, SyncItemOrderbook, false)
}