mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-17 15:09:59 +00:00
localbitcoins fixes (#177)
* General LocalBitcoin fixes * Added override variables to config for exchange packages to allow different API URL's
This commit is contained in:
@@ -126,6 +126,8 @@ func (b *Bitmex) SetDefaults() {
|
||||
request.NewRateLimit(time.Second, bitmexUnauthRate),
|
||||
common.NewHTTPClientWithTimeout(exchange.DefaultHTTPTimeout))
|
||||
b.shutdown = b.NewRoutineManagement()
|
||||
b.APIUrlDefault = bitmexAPIURL
|
||||
b.APIUrl = b.APIUrlDefault
|
||||
}
|
||||
|
||||
// Setup takes in the supplied exchange configuration details and sets params
|
||||
@@ -150,6 +152,14 @@ func (b *Bitmex) Setup(exch config.ExchangeConfig) {
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
err = b.SetAutoPairDefaults()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
err = b.SetAPIURL(exch)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -797,7 +807,7 @@ func (b *Bitmex) GetWalletSummary(currency string) ([]TransactionInfo, error) {
|
||||
// SendHTTPRequest sends an unauthenticated HTTP request
|
||||
func (b *Bitmex) SendHTTPRequest(path string, params Parameter, result interface{}) error {
|
||||
var respCheck interface{}
|
||||
path = bitmexAPIURL + path
|
||||
path = b.APIUrl + path
|
||||
if params != nil {
|
||||
if !params.IsNil() {
|
||||
encodedPath, err := params.ToURLVals(path)
|
||||
@@ -856,7 +866,7 @@ func (b *Bitmex) SendAuthenticatedHTTPRequest(verb, path string, params Paramete
|
||||
var respCheck interface{}
|
||||
|
||||
err := b.SendPayload(verb,
|
||||
bitmexAPIURL+path,
|
||||
b.APIUrl+path,
|
||||
headers,
|
||||
bytes.NewBuffer([]byte(payload)),
|
||||
&respCheck,
|
||||
|
||||
Reference in New Issue
Block a user