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

@@ -97,7 +97,7 @@ func (b *BTCMarkets) GetTicker(symbol string) (Ticker, error) {
path := fmt.Sprintf("/market/%s/AUD/tick", common.StringToUpper(symbol))
return ticker,
common.SendHTTPGetRequest(btcMarketsAPIURL+path, true, &ticker)
common.SendHTTPGetRequest(btcMarketsAPIURL+path, true, b.Verbose, &ticker)
}
// GetOrderbook returns current orderbook
@@ -107,7 +107,7 @@ func (b *BTCMarkets) GetOrderbook(symbol string) (Orderbook, error) {
path := fmt.Sprintf("/market/%s/AUD/orderbook", common.StringToUpper(symbol))
return orderbook,
common.SendHTTPGetRequest(btcMarketsAPIURL+path, true, &orderbook)
common.SendHTTPGetRequest(btcMarketsAPIURL+path, true, b.Verbose, &orderbook)
}
// GetTrades returns executed trades on the exchange
@@ -117,7 +117,7 @@ func (b *BTCMarkets) GetTrades(symbol string, values url.Values) ([]Trade, error
trades := []Trade{}
path := common.EncodeURLValues(fmt.Sprintf("%s/market/%s/AUD/trades", btcMarketsAPIURL, symbol), values)
return trades, common.SendHTTPGetRequest(path, true, &trades)
return trades, common.SendHTTPGetRequest(path, true, b.Verbose, &trades)
}
// NewOrder requests a new order and returns an ID