diff --git a/backend/CHANGELOG.md b/backend/CHANGELOG.md index c82e5e8..cb1207f 100644 --- a/backend/CHANGELOG.md +++ b/backend/CHANGELOG.md @@ -1,4 +1,7 @@ # Changelog +## [4.1.2] - 2025-06-05 +- Fetch from coingecko only if coingecko-token-repository records are available else skip calling the api + ## [4.1.1] - 2025-05-24 - Fixed bug of comparing chainId as string for skipping type2 to legacy txn diff --git a/backend/package.json b/backend/package.json index 68d3a4f..bbacadd 100644 --- a/backend/package.json +++ b/backend/package.json @@ -1,6 +1,6 @@ { "name": "arka", - "version": "4.1.1", + "version": "4.1.2", "description": "ARKA - (Albanian for Cashier's case) is the first open source Paymaster as a service software", "type": "module", "directories": { diff --git a/backend/src/server.ts b/backend/src/server.ts index 17071cf..45ec37f 100644 --- a/backend/src/server.ts +++ b/backend/src/server.ts @@ -91,6 +91,10 @@ const initializeServer = async (): Promise => { const getAndSetCoingeckoPrice = async () => { const records = await coingeckoRepo.findAll(); const tokenIds = records.map(record => record.coinId); + if (tokenIds.length === 0) { + server.log.info('No token ids found in coingecko tokens repository'); + return; + } const coingecko = new CoingeckoService(); const data = await coingecko.fetchPriceByCoinID(tokenIds, server.log);