funhi-chart 1.3.7 → 1.3.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -17,6 +17,7 @@ export declare class CandleManager {
17
17
  createOrUpdate(price: number, timestamp: number): CandleUpdateResult | null;
18
18
  /**
19
19
  * Creates a new candle at bucket boundary
20
+ * Detects gaps and logs them (gaps should be filled by loading from database)
20
21
  */
21
22
  private createNewCandle;
22
23
  /**
@@ -58,6 +59,15 @@ export declare class CandleManager {
58
59
  getCandles(): CandleData[];
59
60
  getCurrentCandle(): CandleData | null;
60
61
  getLastCandleTime(): number;
62
+ /**
63
+ * Detects gaps in candles and returns information about missing time periods
64
+ * Returns array of missing time ranges that should be loaded from database
65
+ */
66
+ detectGaps(): Array<{
67
+ startTime: number;
68
+ endTime: number;
69
+ missingCount: number;
70
+ }>;
61
71
  /**
62
72
  * Loads candles from storage
63
73
  * Merges with existing candles to preserve real-time data
@@ -14,6 +14,8 @@ export declare class FunhiChartController {
14
14
  private updateHandler;
15
15
  private currentTimeframe;
16
16
  private config;
17
+ private gapCheckInterval;
18
+ private readonly GAP_CHECK_INTERVAL_MS;
17
19
  constructor(config: ControllerConfig);
18
20
  /**
19
21
  * Initializes the chart and loads initial data
@@ -55,6 +57,26 @@ export declare class FunhiChartController {
55
57
  * Resizes the chart
56
58
  */
57
59
  resize(): void;
60
+ /**
61
+ * Checks for gaps in candles and loads missing ones from database for current timeframe
62
+ */
63
+ private checkAndFillGaps;
64
+ /**
65
+ * Checks for gaps in candles and loads missing ones from database for a specific timeframe
66
+ */
67
+ private checkAndFillGapsForTimeframe;
68
+ /**
69
+ * Checks for gaps in all timeframes and loads missing candles
70
+ */
71
+ private checkAndFillGapsForAllTimeframes;
72
+ /**
73
+ * Starts periodic gap checking
74
+ */
75
+ private startGapChecking;
76
+ /**
77
+ * Stops periodic gap checking
78
+ */
79
+ private stopGapChecking;
58
80
  /**
59
81
  * Destroys the controller and cleans up resources
60
82
  */