In the common package added JSONDecode error check. Added verbosity in SendHTTPGetRequest. Updated Nonce package function. Fixed issues in ItBit package and expanded test coverage.

This commit is contained in:
Ryan O'Hara-Reid
2017-09-12 08:37:18 +10:00
parent 939ce3ab21
commit e8c7bf9af4
24 changed files with 601 additions and 241 deletions

View File

@@ -127,7 +127,7 @@ func (b *Bitstamp) GetTicker(currency string, hourly bool) (Ticker, error) {
tickerEndpoint,
common.StringToLower(currency),
)
return response, common.SendHTTPGetRequest(path, true, &response)
return response, common.SendHTTPGetRequest(path, true, b.Verbose, &response)
}
// GetOrderbook Returns a JSON dictionary with "bids" and "asks". Each is a list
@@ -149,7 +149,7 @@ func (b *Bitstamp) GetOrderbook(currency string) (Orderbook, error) {
common.StringToLower(currency),
)
err := common.SendHTTPGetRequest(path, true, &resp)
err := common.SendHTTPGetRequest(path, true, b.Verbose, &resp)
if err != nil {
return Orderbook{}, err
}
@@ -204,7 +204,7 @@ func (b *Bitstamp) GetTransactions(currencyPair string, values url.Values) ([]Tr
values,
)
return transactions, common.SendHTTPGetRequest(path, true, &transactions)
return transactions, common.SendHTTPGetRequest(path, true, b.Verbose, &transactions)
}
// GetEURUSDConversionRate returns the conversion rate between Euro and USD
@@ -212,7 +212,7 @@ func (b *Bitstamp) GetEURUSDConversionRate() (EURUSDConversionRate, error) {
rate := EURUSDConversionRate{}
path := fmt.Sprintf("%s/%s", bitstampAPIURL, bitstampAPIEURUSD)
return rate, common.SendHTTPGetRequest(path, true, &rate)
return rate, common.SendHTTPGetRequest(path, true, b.Verbose, &rate)
}
// GetBalance returns full balance of currency held on the exchange