Skip to content
This repository has been archived by the owner on Feb 16, 2020. It is now read-only.

Commit

Permalink
[GB] improve no trades edge case on binance
Browse files Browse the repository at this point in the history
  • Loading branch information
askmike committed Sep 19, 2018
1 parent 28c466d commit 2271428
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions exchange/wrappers/binance.js
Original file line number Diff line number Diff line change
Expand Up @@ -333,12 +333,17 @@ Trader.prototype.getOrder = function(order, callback) {

const fees = {};

if(!data.length) {
return callback(new Error('Binance did not return any trades'));
}

const trades = _.filter(data, t => {
// note: the API returns a string after creating
return t.orderId == order;
});

if(!trades.length) {
console.log('cannot find trades!', { order, list: data.map(t => t.orderId) });
return callback(new Error('Trades not found'));
}

Expand Down

0 comments on commit 2271428

Please sign in to comment.