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

@@ -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,