From 99aa219d7bbd18bc984d16ca409338f17bf88144 Mon Sep 17 00:00:00 2001 From: hareland Date: Thu, 6 Feb 2025 11:14:19 +0100 Subject: [PATCH 1/2] CY-2049: Ensure we do not receive empty tx --- index.js | 4 ++-- package.json | 2 +- test/unit/listTransactions.test.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) 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.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' })); From 8ca0542550106f6f566e2eae319549c2b3e87d7a Mon Sep 17 00:00:00 2001 From: hareland Date: Thu, 6 Feb 2025 11:22:05 +0100 Subject: [PATCH 2/2] CY-2049: bump version --- package-lock.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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": {