diff --git a/index.js b/index.js index 7615706..fb5a167 100644 --- a/index.js +++ b/index.js @@ -562,11 +562,11 @@ Kraken.prototype._listTransactionsRecursive = function (type, start, knownTransa const msg = err.cause ? err.cause.message : err.message; if(msg.match(new RegExp('Invalid currency \'[A-Z]{2,4}\'', 'g'))){ this.logger.info(err, msg); - return null; //convertFromKrakenTransaction can also return null so we just continue with that as "invalid" + return null; } throw err; } - }); + }).filter(item => item !== null); // Merge our newly converted transactions with the ones from previous calls const allTransactions = transactions.concat(knownTransactions); diff --git a/package-lock.json b/package-lock.json index 8bc17f3..5141420 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "kraken-exc", - "version": "2.5.4", + "version": "2.5.5", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index def0349..eae0036 100644 --- a/package.json +++ b/package.json @@ -43,5 +43,5 @@ "test": "LOG_LEVEL=fatal mocha --config .mocharc.json", "test-watch": "LOG_LEVEL=info mocha --config .mocharc.json --watch" }, - "version": "2.5.4" + "version": "2.5.5" } diff --git a/test/unit/listTransactions.test.js b/test/unit/listTransactions.test.js index 51d4843..b8a90f5 100644 --- a/test/unit/listTransactions.test.js +++ b/test/unit/listTransactions.test.js @@ -380,7 +380,7 @@ describe('listTransactions', () => { currency: 'BTC', type: 'deposit', raw: depositRawObject - }, null //this is the invalid currency + } ]; const withdrawalReqStub = reqStub.withArgs(sinon.match.any, 'Ledgers', sinon.match({ type: 'withdrawal' }));