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:
soxipy
2018-08-27 07:19:29 +03:00
committed by Ryan O'Hara-Reid
parent ca0c22f422
commit fb4e2d1452
35 changed files with 885 additions and 355 deletions

View File

@@ -62,7 +62,12 @@ func (c *COINUT) SetDefaults() {
c.AssetTypes = []string{ticker.Spot}
c.SupportsAutoPairUpdating = true
c.SupportsRESTTickerBatching = false
c.Requester = request.New(c.Name, request.NewRateLimit(time.Second, coinutAuthRate), request.NewRateLimit(time.Second, coinutUnauthRate), common.NewHTTPClientWithTimeout(exchange.DefaultHTTPTimeout))
c.Requester = request.New(c.Name,
request.NewRateLimit(time.Second, coinutAuthRate),
request.NewRateLimit(time.Second, coinutUnauthRate),
common.NewHTTPClientWithTimeout(exchange.DefaultHTTPTimeout))
c.APIUrlDefault = coinutAPIURL
c.APIUrl = c.APIUrlDefault
}
// Setup sets the current exchange configuration
@@ -93,6 +98,10 @@ func (c *COINUT) Setup(exch config.ExchangeConfig) {
if err != nil {
log.Fatal(err)
}
err = c.SetAPIURL(exch)
if err != nil {
log.Fatal(err)
}
}
}
@@ -307,5 +316,5 @@ func (c *COINUT) SendHTTPRequest(apiRequest string, params map[string]interface{
}
headers["Content-Type"] = "application/json"
return c.SendPayload("POST", coinutAPIURL, headers, bytes.NewBuffer(payload), result, authenticated, c.Verbose)
return c.SendPayload("POST", c.APIUrl, headers, bytes.NewBuffer(payload), result, authenticated, c.Verbose)
}