From 591ca5d86fde1b7ac347b1315a38e6794e6ec123 Mon Sep 17 00:00:00 2001 From: alaa-eddine Date: Tue, 27 Jan 2026 20:42:05 +0100 Subject: [PATCH] fixed Binance Provider regression --- src/marketData/Binance/BinanceProvider.class.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/marketData/Binance/BinanceProvider.class.ts b/src/marketData/Binance/BinanceProvider.class.ts index 3836cae..d8f2555 100644 --- a/src/marketData/Binance/BinanceProvider.class.ts +++ b/src/marketData/Binance/BinanceProvider.class.ts @@ -262,7 +262,7 @@ export class BinanceProvider implements IProvider { const needsPagination = this.shouldPaginate(timeframe, limit, sDate, eDate); if (needsPagination) { - if (sDate !== undefined && eDate !== undefined) { + if (sDate && eDate) { // Forward pagination: Fetch all data using interval pagination, then apply limit const allData = await this.getMarketDataInterval(tickerId, timeframe, sDate, eDate); const result = limit ? allData.slice(0, limit) : allData; @@ -289,10 +289,10 @@ export class BinanceProvider implements IProvider { url += `&limit=${Math.min(limit, 1000)}`; // Cap at 1000 for single request } - if (sDate !== undefined) { + if (sDate) { url += `&startTime=${sDate}`; } - if (eDate !== undefined) { + if (eDate) { url += `&endTime=${eDate}`; } @@ -341,7 +341,7 @@ export class BinanceProvider implements IProvider { } // If we have both start and end dates, calculate required candles - if (sDate !== undefined && eDate !== undefined) { + if (sDate && eDate) { const interval = timeframe_to_binance[timeframe.toUpperCase()]; const timeframeDurations = { '1m': 60 * 1000,