Comparing version 0.1.9 to 0.1.10
@@ -48,2 +48,5 @@ var querystring = require("querystring"); | ||
res.on('end', function() { | ||
if (res.statusCode !== 200) { | ||
return callback(new Error('Bitstamp error ' + res.statusCode + ': ' + buffer)); | ||
} | ||
try { | ||
@@ -99,3 +102,3 @@ var json = JSON.parse(buffer); | ||
args = _.compactObject(args); | ||
var path = '/api/' + action + '/?' + querystring.stringify(args); | ||
var path = '/api/' + action + (querystring.stringify(args) === '' ? '/' : '/?') + querystring.stringify(args); | ||
this._request('get', path, undefined, callback, args) | ||
@@ -106,3 +109,3 @@ } | ||
if(!this.key || !this.secret || !this.client_id) | ||
return callback('Must provide key, secret and client ID to make this API request.'); | ||
return callback(new Error('Must provide key, secret and client ID to make this API request.')); | ||
@@ -149,3 +152,8 @@ var path = '/api/' + action + '/'; | ||
} | ||
this._get('order_book', callback, {group: group}); | ||
var options; | ||
if(typeof limit === 'object') | ||
options = group; | ||
else | ||
options = {group: group}; | ||
this._get('order_book', callback, options); | ||
} | ||
@@ -175,3 +183,8 @@ | ||
} | ||
this._post('user_transactions', callback, {limit: limit}); | ||
var options; | ||
if(typeof limit === 'object') | ||
options = limit; | ||
else | ||
options = {limit: limit}; | ||
this._post('user_transactions', callback, options); | ||
} | ||
@@ -178,0 +191,0 @@ |
{ | ||
"name": "bitstamp", | ||
"version": "0.1.9", | ||
"version": "0.1.10", | ||
"description": "Bitstamp REST API wrapper", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10364
226