Skip to content

Commit

Permalink
poloniex fetchMyTrades parser fix for delisted symbols
Browse files Browse the repository at this point in the history
  • Loading branch information
kroitor committed Oct 13, 2018
1 parent 478c55f commit aefa524
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions js/poloniex.js
Original file line number Diff line number Diff line change
Expand Up @@ -526,11 +526,23 @@ module.exports = class poloniex extends Exchange {
for (let i = 0; i < ids.length; i++) {
let id = ids[i];
let market = undefined;
if (id in this.markets_by_id)
if (id in this.markets_by_id) {
market = this.markets_by_id[id];
let trades = this.parseTrades (response[id], market);
for (let j = 0; j < trades.length; j++) {
result.push (trades[j]);
let trades = this.parseTrades (response[id], market);
for (let j = 0; j < trades.length; j++) {
result.push (trades[j]);
}
} else {
let [ baseId, quoteId ] = id.split ('_');
let base = this.commonCurrencyCode (baseId);
let quote = this.commonCurrencyCode (quoteId);
let symbol = base + '/' + quote;
let trades = response[id];
for (let j = 0; j < trades.length; j++) {
result.push (this.extend (this.parseTrade (trades[j]), {
'symbol': symbol,
}));
}
}
}
}
Expand Down

0 comments on commit aefa524

Please sign in to comment.