Skip to content

Commit

Permalink
document bitstamps getOrder return behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
askmike committed Jul 26, 2017
1 parent f99f11a commit 9eb726d
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions exchanges/bitstamp.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,14 @@ Trader.prototype.getOrder = function(id, callback) {
var order = _.find(data, o => o.order_id === +id);

if(!order) {
var price = 0;
var amount = 0;
var date = moment(0);
return callback(err, {price, amount, date});
// if the order was cancelled we are unable
// to retrieve it, assume that this is what
// is happening.
return callback(err, {
price: 0,
amount: 0,
date: moment(0)
});
}

var price = parseFloat( order[this.market] );
Expand Down

0 comments on commit 9eb726d

Please sign in to comment.