mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-06-04 23:16:54 +00:00
New features and bug fixes
- Modifications made to the request package. Planned improvements will be sending requests on intervals, rate limiter back off support, dynamic tuning and requests packaged into a request job group. - Can modify each exchanges individual HTTP client (e.g timeout and transport settings). - Bot now uses an exchange config HTTP timeout value. - Bot now uses a global HTTP timeout (configurable). - Batched ticker request support for exchanges. - Ticker and Orderbook fetching now are spanned accross multiple go routines and regulated by a sync wait group. - Fixes hack used to load exchanges, now uses a sync wait group. - Ticker and Orderbook storage and fetching now uses mutex locks. - New pair function for finding different pairs between two supplied pair arrays. This is used for currency pair updates for exchange which support dynamic updating. - Shows removal/additions of dynamic updates currencies.
This commit is contained in:
@@ -4,7 +4,6 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"log"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strconv"
|
||||
"strings"
|
||||
@@ -46,7 +45,6 @@ const (
|
||||
type WEX struct {
|
||||
exchange.Base
|
||||
Ticker map[string]Ticker
|
||||
*request.Handler
|
||||
}
|
||||
|
||||
// SetDefaults sets current default value for WEX
|
||||
@@ -65,8 +63,8 @@ func (w *WEX) SetDefaults() {
|
||||
w.ConfigCurrencyPairFormat.Uppercase = true
|
||||
w.AssetTypes = []string{ticker.Spot}
|
||||
w.SupportsAutoPairUpdating = false
|
||||
w.Handler = new(request.Handler)
|
||||
w.SetRequestHandler(w.Name, wexAuthRate, wexUnauthRate, new(http.Client))
|
||||
w.SupportsRESTTickerBatching = true
|
||||
w.Requester = request.New(w.Name, request.NewRateLimit(time.Second, wexAuthRate), request.NewRateLimit(time.Second, wexUnauthRate), common.NewHTTPClientWithTimeout(exchange.DefaultHTTPTimeout))
|
||||
}
|
||||
|
||||
// Setup sets exchange configuration parameters for WEX
|
||||
@@ -77,6 +75,7 @@ func (w *WEX) Setup(exch config.ExchangeConfig) {
|
||||
w.Enabled = true
|
||||
w.AuthenticatedAPISupport = exch.AuthenticatedAPISupport
|
||||
w.SetAPIKeys(exch.APIKey, exch.APISecret, "", false)
|
||||
w.SetHTTPClientTimeout(exch.HTTPTimeout)
|
||||
w.RESTPollingDelay = exch.RESTPollingDelay
|
||||
w.Verbose = exch.Verbose
|
||||
w.Websocket = exch.Websocket
|
||||
|
||||
@@ -3,6 +3,7 @@ package wex
|
||||
import (
|
||||
"errors"
|
||||
"log"
|
||||
"sync"
|
||||
|
||||
"github.com/thrasher-/gocryptotrader/common"
|
||||
"github.com/thrasher-/gocryptotrader/currency/pair"
|
||||
@@ -12,8 +13,12 @@ import (
|
||||
)
|
||||
|
||||
// Start starts the WEX go routine
|
||||
func (w *WEX) Start() {
|
||||
go w.Run()
|
||||
func (w *WEX) Start(wg *sync.WaitGroup) {
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
w.Run()
|
||||
wg.Done()
|
||||
}()
|
||||
}
|
||||
|
||||
// Run implements the WEX wrapper
|
||||
|
||||
Reference in New Issue
Block a user