@gainsnetwork/sdk 1.8.6 → 1.8.8-rc1

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.
Files changed (92) hide show
  1. package/lib/constants.js +5 -4
  2. package/lib/markets/commodities.js +1 -1
  3. package/lib/markets/forex.js +4 -2
  4. package/lib/markets/indices.js +1 -1
  5. package/lib/markets/schedules/builders.d.ts +1 -1
  6. package/lib/markets/schedules/builders.js +83 -28
  7. package/lib/markets/schedules/checkers.js +2 -2
  8. package/lib/markets/schedules/holidays.js +31 -6
  9. package/lib/markets/stocks.js +1 -1
  10. package/package.json +1 -1
  11. package/lib/contracts/types/generated/GFarmTradingStorageV5.d.ts +0 -1911
  12. package/lib/contracts/types/generated/GFarmTradingStorageV5.js +0 -2
  13. package/lib/contracts/types/generated/GNSBorrowingFees.d.ts +0 -1067
  14. package/lib/contracts/types/generated/GNSBorrowingFees.js +0 -2
  15. package/lib/contracts/types/generated/GNSBorrowingFeesV6_3_2.d.ts +0 -979
  16. package/lib/contracts/types/generated/GNSBorrowingFeesV6_3_2.js +0 -2
  17. package/lib/contracts/types/generated/GNSBorrowingFeesV6_4.d.ts +0 -1058
  18. package/lib/contracts/types/generated/GNSBorrowingFeesV6_4.js +0 -2
  19. package/lib/contracts/types/generated/GNSNftRewardsV6.d.ts +0 -533
  20. package/lib/contracts/types/generated/GNSNftRewardsV6.js +0 -2
  21. package/lib/contracts/types/generated/GNSNftRewardsV6_3_1.d.ts +0 -613
  22. package/lib/contracts/types/generated/GNSNftRewardsV6_3_1.js +0 -2
  23. package/lib/contracts/types/generated/GNSPairInfosV6_1.d.ts +0 -911
  24. package/lib/contracts/types/generated/GNSPairInfosV6_1.js +0 -2
  25. package/lib/contracts/types/generated/GNSPairsStorageV6.d.ts +0 -660
  26. package/lib/contracts/types/generated/GNSPairsStorageV6.js +0 -2
  27. package/lib/contracts/types/generated/GNSTrading.d.ts +0 -758
  28. package/lib/contracts/types/generated/GNSTrading.js +0 -2
  29. package/lib/contracts/types/generated/GNSTradingCallbacks.d.ts +0 -875
  30. package/lib/contracts/types/generated/GNSTradingCallbacks.js +0 -2
  31. package/lib/contracts/types/generated/GNSTradingCallbacksV6_3_2.d.ts +0 -806
  32. package/lib/contracts/types/generated/GNSTradingCallbacksV6_3_2.js +0 -2
  33. package/lib/contracts/types/generated/GNSTradingCallbacksV6_4.d.ts +0 -821
  34. package/lib/contracts/types/generated/GNSTradingCallbacksV6_4.js +0 -2
  35. package/lib/contracts/types/generated/GNSTradingStorage.d.ts +0 -1387
  36. package/lib/contracts/types/generated/GNSTradingStorage.js +0 -2
  37. package/lib/contracts/types/generated/GTokenV6_3_2.d.ts +0 -1838
  38. package/lib/contracts/types/generated/GTokenV6_3_2.js +0 -2
  39. package/lib/contracts/types/generated/factories/GFarmTradingStorageV5__factory.d.ts +0 -83
  40. package/lib/contracts/types/generated/factories/GFarmTradingStorageV5__factory.js +0 -2691
  41. package/lib/contracts/types/generated/factories/GNSBorrowingFeesV6_3_2__factory.d.ts +0 -88
  42. package/lib/contracts/types/generated/factories/GNSBorrowingFeesV6_3_2__factory.js +0 -1654
  43. package/lib/contracts/types/generated/factories/GNSBorrowingFeesV6_4__factory.d.ts +0 -113
  44. package/lib/contracts/types/generated/factories/GNSBorrowingFeesV6_4__factory.js +0 -1742
  45. package/lib/contracts/types/generated/factories/GNSBorrowingFees__factory.d.ts +0 -124
  46. package/lib/contracts/types/generated/factories/GNSBorrowingFees__factory.js +0 -1784
  47. package/lib/contracts/types/generated/factories/GNSNftRewardsV6_3_1__factory.d.ts +0 -100
  48. package/lib/contracts/types/generated/factories/GNSNftRewardsV6_3_1__factory.js +0 -1116
  49. package/lib/contracts/types/generated/factories/GNSNftRewardsV6__factory.d.ts +0 -100
  50. package/lib/contracts/types/generated/factories/GNSNftRewardsV6__factory.js +0 -1003
  51. package/lib/contracts/types/generated/factories/GNSPairInfosV6_1__factory.d.ts +0 -98
  52. package/lib/contracts/types/generated/factories/GNSPairInfosV6_1__factory.js +0 -1485
  53. package/lib/contracts/types/generated/factories/GNSPairsStorageV6__factory.d.ts +0 -117
  54. package/lib/contracts/types/generated/factories/GNSPairsStorageV6__factory.js +0 -1265
  55. package/lib/contracts/types/generated/factories/GNSTradingCallbacksV6_3_2__factory.d.ts +0 -82
  56. package/lib/contracts/types/generated/factories/GNSTradingCallbacksV6_3_2__factory.js +0 -1273
  57. package/lib/contracts/types/generated/factories/GNSTradingCallbacksV6_4__factory.d.ts +0 -82
  58. package/lib/contracts/types/generated/factories/GNSTradingCallbacksV6_4__factory.js +0 -1326
  59. package/lib/contracts/types/generated/factories/GNSTradingCallbacks__factory.d.ts +0 -113
  60. package/lib/contracts/types/generated/factories/GNSTradingCallbacks__factory.js +0 -1428
  61. package/lib/contracts/types/generated/factories/GNSTradingStorage__factory.d.ts +0 -96
  62. package/lib/contracts/types/generated/factories/GNSTradingStorage__factory.js +0 -2241
  63. package/lib/contracts/types/generated/factories/GNSTrading__factory.d.ts +0 -95
  64. package/lib/contracts/types/generated/factories/GNSTrading__factory.js +0 -1071
  65. package/lib/contracts/types/generated/factories/GTokenV6_3_2__factory.d.ts +0 -110
  66. package/lib/contracts/types/generated/factories/GTokenV6_3_2__factory.js +0 -2682
  67. package/lib/markets/oi/fetcher.d.ts +0 -58
  68. package/lib/markets/oi/fetcher.js +0 -181
  69. package/lib/markets/oi/validation.d.ts +0 -80
  70. package/lib/markets/oi/validation.js +0 -172
  71. package/lib/pricing/depthBands/converter.d.ts +0 -65
  72. package/lib/pricing/depthBands/converter.js +0 -155
  73. package/lib/pricing/depthBands/decoder.d.ts +0 -32
  74. package/lib/pricing/depthBands/decoder.js +0 -109
  75. package/lib/pricing/depthBands/encoder.d.ts +0 -19
  76. package/lib/pricing/depthBands/encoder.js +0 -105
  77. package/lib/pricing/depthBands/index.d.ts +0 -8
  78. package/lib/pricing/depthBands/index.js +0 -26
  79. package/lib/pricing/depthBands/types.d.ts +0 -49
  80. package/lib/pricing/depthBands/types.js +0 -10
  81. package/lib/pricing/depthBands/validator.d.ts +0 -22
  82. package/lib/pricing/depthBands/validator.js +0 -113
  83. package/lib/trade/effectiveLeverage/builder.d.ts +0 -23
  84. package/lib/trade/effectiveLeverage/builder.js +0 -30
  85. package/lib/trade/fees/holdingFees/index.d.ts +0 -46
  86. package/lib/trade/fees/holdingFees/index.js +0 -105
  87. package/lib/trade/fees/holdingFees/types.d.ts +0 -23
  88. package/lib/trade/fees/holdingFees/types.js +0 -5
  89. package/lib/trade/fees/trading/holdingFees.d.ts +0 -28
  90. package/lib/trade/fees/trading/holdingFees.js +0 -66
  91. package/lib/trade/fees/trading/holdingFeesStructured.d.ts +0 -28
  92. package/lib/trade/fees/trading/holdingFeesStructured.js +0 -66
package/lib/constants.js CHANGED
@@ -519,10 +519,11 @@ exports.delistedPairIxs = new Set([
519
519
  111, 113, 114, 116, 118, 120, 122, 123, 125, 127, 130, 147, 152, 160, 163,
520
520
  170, 179, 182, 183, 186, 198, 208, 209, 221, 224, 225, 227, 229, 230, 231,
521
521
  234, 238, 239, 241, 247, 250, 253, 254, 255, 258, 261, 268, 270, 272, 273,
522
- 275, 276, 278, 279, 280, 281, 284, 285, 290, 291, 292, 294, 296, 303, 305,
523
- 306, 311, 312, 322, 323, 330, 333, 335, 336, 337, 342, 343, 344, 346, 347,
524
- 349, 350, 351, 352, 353, 354, 355, 357, 362, 365, 366, 372, 379, 380, 387,
525
- 395, 396, 400, 401, 408, 423, 427, 428, 430, 435, 436, 437, 438, 441,
522
+ 275, 276, 278, 279, 280, 281, 284, 285, 290, 291, 292, 294, 296, 298, 303,
523
+ 305, 306, 311, 312, 322, 323, 330, 333, 335, 336, 337, 341, 342, 343, 344,
524
+ 346, 347, 349, 350, 351, 352, 353, 354, 355, 357, 362, 365, 366, 372, 379,
525
+ 380, 387, 395, 396, 400, 401, 408, 423, 427, 428, 430, 435, 436, 437, 438,
526
+ 441,
526
527
  ]);
527
528
  exports.delistedGroupsIxs = new Set([]);
528
529
  exports.DEFAULT_PROTECTION_CLOSE_FACTOR = 1;
@@ -3,5 +3,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.isCommoditiesOpen = void 0;
4
4
  // @ts-ignore-file
5
5
  const schedules_1 = require("./schedules");
6
- const isCommoditiesOpen = (dateToCheck) => (0, schedules_1.isOpenAt)('commodities', dateToCheck);
6
+ const isCommoditiesOpen = (dateToCheck) => (0, schedules_1.isOpenAt)("commodities", dateToCheck);
7
7
  exports.isCommoditiesOpen = isCommoditiesOpen;
@@ -2,7 +2,9 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.isForexLowLiquidity = exports.isForexOpen = void 0;
4
4
  const schedules_1 = require("./schedules");
5
- const isForexOpen = (dateToCheck) => (0, schedules_1.isOpenAt)('forex', dateToCheck);
5
+ const isForexOpen = (dateToCheck) => (0, schedules_1.isOpenAt)("forex", dateToCheck);
6
6
  exports.isForexOpen = isForexOpen;
7
- const isForexLowLiquidity = (timestampToCheck, pair) => (0, schedules_1.isLowLiquidityAt)('forex', new Date(timestampToCheck), pair?.groupIndex !== undefined ? { pairGroupIndex: +pair.groupIndex } : undefined);
7
+ const isForexLowLiquidity = (timestampToCheck, pair) => (0, schedules_1.isLowLiquidityAt)("forex", new Date(timestampToCheck), pair?.groupIndex !== undefined
8
+ ? { pairGroupIndex: +pair.groupIndex }
9
+ : undefined);
8
10
  exports.isForexLowLiquidity = isForexLowLiquidity;
@@ -2,5 +2,5 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.isIndicesOpen = void 0;
4
4
  const schedules_1 = require("./schedules");
5
- const isIndicesOpen = (dateToCheck) => (0, schedules_1.isOpenAt)('indices', dateToCheck);
5
+ const isIndicesOpen = (dateToCheck) => (0, schedules_1.isOpenAt)("indices", dateToCheck);
6
6
  exports.isIndicesOpen = isIndicesOpen;
@@ -1,4 +1,4 @@
1
- import { Schedule } from './types';
1
+ import { Schedule } from "./types";
2
2
  export declare const buildForexWeeklySchedule: (currentDate?: Date, opts?: {
3
3
  pairGroupIndex?: number;
4
4
  }) => Schedule;
@@ -4,7 +4,7 @@ exports.buildCommoditiesWeeklySchedule = exports.buildIndicesWeeklySchedule = ex
4
4
  const luxon_1 = require("luxon");
5
5
  const types_1 = require("./types");
6
6
  const holidays_1 = require("./holidays");
7
- const ET = luxon_1.IANAZone.create('America/New_York');
7
+ const ET = luxon_1.IANAZone.create("America/New_York");
8
8
  const emptyWeekly = () => ({
9
9
  monday: [],
10
10
  tuesday: [],
@@ -25,37 +25,75 @@ const buildForexWeeklySchedule = (currentDate = new Date(), opts) => {
25
25
  const openHour = isInDST ? 16 : 17; // Monday open
26
26
  const closeHour = isInDST ? 16 : 17; // Friday close
27
27
  // Open windows (ET): Sun 16/17:00 -> 24:00, Mon-Thu 0-24, Fri 0 -> 16/17:00
28
- add(open, types_1.WeekDay.Sunday, { start: { hour: openHour, minute: 0 }, end: { hour: 24, minute: 0 } });
29
- add(open, types_1.WeekDay.Monday, { start: { hour: 0, minute: 0 }, end: { hour: 24, minute: 0 } });
30
- add(open, types_1.WeekDay.Tuesday, { start: { hour: 0, minute: 0 }, end: { hour: 24, minute: 0 } });
31
- add(open, types_1.WeekDay.Wednesday, { start: { hour: 0, minute: 0 }, end: { hour: 24, minute: 0 } });
32
- add(open, types_1.WeekDay.Thursday, { start: { hour: 0, minute: 0 }, end: { hour: 24, minute: 0 } });
33
- add(open, types_1.WeekDay.Friday, { start: { hour: 0, minute: 0 }, end: { hour: closeHour, minute: 0 } });
28
+ add(open, types_1.WeekDay.Sunday, {
29
+ start: { hour: openHour, minute: 0 },
30
+ end: { hour: 24, minute: 0 },
31
+ });
32
+ add(open, types_1.WeekDay.Monday, {
33
+ start: { hour: 0, minute: 0 },
34
+ end: { hour: 24, minute: 0 },
35
+ });
36
+ add(open, types_1.WeekDay.Tuesday, {
37
+ start: { hour: 0, minute: 0 },
38
+ end: { hour: 24, minute: 0 },
39
+ });
40
+ add(open, types_1.WeekDay.Wednesday, {
41
+ start: { hour: 0, minute: 0 },
42
+ end: { hour: 24, minute: 0 },
43
+ });
44
+ add(open, types_1.WeekDay.Thursday, {
45
+ start: { hour: 0, minute: 0 },
46
+ end: { hour: 24, minute: 0 },
47
+ });
48
+ add(open, types_1.WeekDay.Friday, {
49
+ start: { hour: 0, minute: 0 },
50
+ end: { hour: closeHour, minute: 0 },
51
+ });
34
52
  // Low-liquidity windows (ET)
35
53
  const extendedGroups = [8, 9];
36
- const useExtended = opts?.pairGroupIndex !== undefined && extendedGroups.includes(+opts.pairGroupIndex);
37
- const llStartHour = isInDST ? (useExtended ? 14 : 15) : (useExtended ? 15 : 16);
54
+ const useExtended = opts?.pairGroupIndex !== undefined &&
55
+ extendedGroups.includes(+opts.pairGroupIndex);
56
+ const llStartHour = isInDST ? (useExtended ? 14 : 15) : useExtended ? 15 : 16;
38
57
  const llStartMinute = 45;
39
- const llEndHour = isInDST ? (useExtended ? 21 : 19) : (useExtended ? 22 : 20);
58
+ const llEndHour = isInDST ? (useExtended ? 21 : 19) : useExtended ? 22 : 20;
40
59
  const llEndMinute = 0;
41
- for (const d of [types_1.WeekDay.Sunday, types_1.WeekDay.Monday, types_1.WeekDay.Tuesday, types_1.WeekDay.Wednesday, types_1.WeekDay.Thursday, types_1.WeekDay.Friday]) {
42
- add(lowLiq, d, { start: { hour: llStartHour, minute: llStartMinute }, end: { hour: llEndHour, minute: llEndMinute } });
60
+ for (const d of [
61
+ types_1.WeekDay.Sunday,
62
+ types_1.WeekDay.Monday,
63
+ types_1.WeekDay.Tuesday,
64
+ types_1.WeekDay.Wednesday,
65
+ types_1.WeekDay.Thursday,
66
+ types_1.WeekDay.Friday,
67
+ ]) {
68
+ add(lowLiq, d, {
69
+ start: { hour: llStartHour, minute: llStartMinute },
70
+ end: { hour: llEndHour, minute: llEndMinute },
71
+ });
43
72
  }
44
- const holidays = (0, holidays_1.getHolidaysInCurrentWeek)('forex', currentDate);
73
+ const holidays = (0, holidays_1.getHolidaysInCurrentWeek)("forex", currentDate);
45
74
  const summary = isInDST
46
- ? 'Sunday 4:00 pm - Friday 4:00 pm ET (Closed weekends & holidays)'
47
- : 'Sunday 5:00 pm - Friday 5:00 pm ET (Closed weekends & holidays)';
75
+ ? "Sunday 4:00 pm - Friday 4:00 pm ET (Closed weekends & holidays)"
76
+ : "Sunday 5:00 pm - Friday 5:00 pm ET (Closed weekends & holidays)";
48
77
  return { open, lowLiq, holidays, summary };
49
78
  };
50
79
  exports.buildForexWeeklySchedule = buildForexWeeklySchedule;
51
80
  const buildStocksWeeklySchedule = (currentDate = new Date()) => {
52
81
  const open = emptyWeekly();
53
82
  const lowLiq = emptyWeekly();
54
- for (const d of [types_1.WeekDay.Monday, types_1.WeekDay.Tuesday, types_1.WeekDay.Wednesday, types_1.WeekDay.Thursday, types_1.WeekDay.Friday]) {
55
- add(open, d, { start: { hour: 9, minute: 30 }, end: { hour: 16, minute: 0 } });
83
+ for (const d of [
84
+ types_1.WeekDay.Monday,
85
+ types_1.WeekDay.Tuesday,
86
+ types_1.WeekDay.Wednesday,
87
+ types_1.WeekDay.Thursday,
88
+ types_1.WeekDay.Friday,
89
+ ]) {
90
+ add(open, d, {
91
+ start: { hour: 9, minute: 35 },
92
+ end: { hour: 16, minute: 0 },
93
+ });
56
94
  }
57
- const holidays = (0, holidays_1.getHolidaysInCurrentWeek)('stocks', currentDate);
58
- const summary = 'Monday - Friday: 9:30 am - 4:00 pm ET (Closed weekends & holidays)';
95
+ const holidays = (0, holidays_1.getHolidaysInCurrentWeek)("stocks", currentDate);
96
+ const summary = "Monday - Friday: 9:35 am - 4:00 pm ET (Closed weekends & holidays)";
59
97
  return { open, lowLiq, holidays, summary };
60
98
  };
61
99
  exports.buildStocksWeeklySchedule = buildStocksWeeklySchedule;
@@ -64,18 +102,35 @@ exports.buildIndicesWeeklySchedule = buildIndicesWeeklySchedule;
64
102
  const buildCommoditiesWeeklySchedule = (currentDate = new Date()) => {
65
103
  const open = emptyWeekly();
66
104
  const lowLiq = emptyWeekly();
67
- // Sunday: 18:00 -> 24:00
68
- add(open, types_1.WeekDay.Sunday, { start: { hour: 18, minute: 0 }, end: { hour: 24, minute: 0 } });
69
- // Mon-Thu: 0:00 -> 17:00 and 18:00 -> 24:00 (break represented by the gap)
70
- for (const d of [types_1.WeekDay.Monday, types_1.WeekDay.Tuesday, types_1.WeekDay.Wednesday, types_1.WeekDay.Thursday]) {
71
- add(open, d, { start: { hour: 0, minute: 0 }, end: { hour: 17, minute: 0 } });
72
- add(open, d, { start: { hour: 18, minute: 0 }, end: { hour: 24, minute: 0 } });
105
+ // Sunday: 18:10 -> 24:00
106
+ add(open, types_1.WeekDay.Sunday, {
107
+ start: { hour: 18, minute: 10 },
108
+ end: { hour: 24, minute: 0 },
109
+ });
110
+ // Mon-Thu: 0:00 -> 17:00 and 18:10 -> 24:00 (break represented by the gap)
111
+ for (const d of [
112
+ types_1.WeekDay.Monday,
113
+ types_1.WeekDay.Tuesday,
114
+ types_1.WeekDay.Wednesday,
115
+ types_1.WeekDay.Thursday,
116
+ ]) {
117
+ add(open, d, {
118
+ start: { hour: 0, minute: 0 },
119
+ end: { hour: 17, minute: 0 },
120
+ });
121
+ add(open, d, {
122
+ start: { hour: 18, minute: 10 },
123
+ end: { hour: 24, minute: 0 },
124
+ });
73
125
  }
74
126
  // Friday: 0:00 -> 17:00
75
- add(open, types_1.WeekDay.Friday, { start: { hour: 0, minute: 0 }, end: { hour: 17, minute: 0 } });
127
+ add(open, types_1.WeekDay.Friday, {
128
+ start: { hour: 0, minute: 0 },
129
+ end: { hour: 17, minute: 0 },
130
+ });
76
131
  // Saturday: closed (no windows)
77
- const holidays = (0, holidays_1.getHolidaysInCurrentWeek)('commodities', currentDate);
78
- const summary = `Sunday 6:00 pm - Friday 5:00 pm ET (Daily break: 5:00 pm - 6:00 pm ET)`;
132
+ const holidays = (0, holidays_1.getHolidaysInCurrentWeek)("commodities", currentDate);
133
+ const summary = `Sunday 6:10 pm - Friday 5:00 pm ET (Daily break: 5:00 pm - 6:10 pm ET)`;
79
134
  return { open, lowLiq, holidays, summary };
80
135
  };
81
136
  exports.buildCommoditiesWeeklySchedule = buildCommoditiesWeeklySchedule;
@@ -23,7 +23,7 @@ const isOpenAt = (market, date, opts) => {
23
23
  if (holiday) {
24
24
  return inInAnyWindow(mm, holiday.openWindows);
25
25
  }
26
- return inInAnyWindow(mm, (schedule.open)[dayKey]);
26
+ return inInAnyWindow(mm, schedule.open[dayKey]);
27
27
  };
28
28
  exports.isOpenAt = isOpenAt;
29
29
  const isLowLiquidityAt = (market, date, opts) => {
@@ -31,6 +31,6 @@ const isLowLiquidityAt = (market, date, opts) => {
31
31
  const schedule = (0, index_1.getWeeklySchedule)(market, date, opts);
32
32
  const dayKey = weekdayKey(dt.weekday);
33
33
  const mm = dt.hour * 60 + dt.minute;
34
- return inInAnyWindow(mm, (schedule.lowLiq)[dayKey]);
34
+ return inInAnyWindow(mm, schedule.lowLiq[dayKey]);
35
35
  };
36
36
  exports.isLowLiquidityAt = isLowLiquidityAt;
@@ -4,7 +4,18 @@ exports.getHolidaysInCurrentWeek = exports.getHolidays = void 0;
4
4
  const luxon_1 = require("luxon");
5
5
  const ET = luxon_1.IANAZone.create("America/New_York");
6
6
  const full = (year, month, day, name) => ({ year, month, day, name, openWindows: [] });
7
- const partial = (year, month, day, name, startH, startM, endH, endM) => ({ year, month, day, name, openWindows: [{ start: { hour: startH, minute: startM }, end: { hour: endH, minute: endM } }] });
7
+ const partial = (year, month, day, name, startH, startM, endH, endM) => ({
8
+ year,
9
+ month,
10
+ day,
11
+ name,
12
+ openWindows: [
13
+ {
14
+ start: { hour: startH, minute: startM },
15
+ end: { hour: endH, minute: endM },
16
+ },
17
+ ],
18
+ });
8
19
  // Shared holidays
9
20
  const HOLIDAYS = [
10
21
  // 2025
@@ -19,17 +30,18 @@ const HOLIDAYS = [
19
30
  // 2026
20
31
  full(2026, 1, 1, "New Year's Day"),
21
32
  full(2026, 1, 19, "Martin Luther King Jr. Day"),
22
- full(2026, 2, 16, "Presidents' Day"),
23
33
  full(2026, 4, 3, "Good Friday"),
24
34
  ];
25
35
  // Market-specific holiday overrides
26
36
  const HOLIDAYS_OVERRIDES = {
27
37
  stocks: [
28
38
  partial(2025, 12, 24, "Christmas Eve", 9, 30, 13, 0),
39
+ full(2026, 2, 16, "Presidents' Day"),
29
40
  ],
30
41
  indices: [
31
42
  partial(2025, 12, 24, "Christmas Eve", 9, 30, 12, 15),
32
43
  partial(2025, 12, 31, "New Year's Eve", 0, 0, 16, 0),
44
+ full(2026, 2, 16, "Presidents' Day"),
33
45
  ],
34
46
  commodities: [
35
47
  // MLK Jr. Day: Open until 1 PM ET, closed from 1-6 PM ET, then reopens at 6 PM ET
@@ -40,11 +52,22 @@ const HOLIDAYS_OVERRIDES = {
40
52
  name: "Martin Luther King Jr. Day",
41
53
  openWindows: [
42
54
  { start: { hour: 0, minute: 0 }, end: { hour: 13, minute: 0 } },
43
- { start: { hour: 18, minute: 0 }, end: { hour: 24, minute: 0 } }
44
- ]
55
+ { start: { hour: 18, minute: 0 }, end: { hour: 24, minute: 0 } },
56
+ ],
45
57
  },
46
58
  partial(2025, 12, 24, "Christmas Eve", 0, 0, 12, 45),
47
59
  partial(2025, 12, 31, "New Year's Eve", 0, 0, 16, 0),
60
+ // Presidents' Day: Open until 2:30 ET, closed from 2:30-6 PM ET, then reopens at 6 PM ET
61
+ {
62
+ year: 2026,
63
+ month: 2,
64
+ day: 16,
65
+ name: "Presidents' Day",
66
+ openWindows: [
67
+ { start: { hour: 0, minute: 0 }, end: { hour: 14, minute: 30 } },
68
+ { start: { hour: 18, minute: 0 }, end: { hour: 24, minute: 0 } },
69
+ ],
70
+ },
48
71
  ],
49
72
  forex: [
50
73
  partial(2025, 12, 24, "Christmas Eve", 0, 0, 12, 45),
@@ -58,7 +81,7 @@ const getHolidaysForYear = (market, year) => {
58
81
  return [...filteredHolidays, ...holidayOverrides].sort((a, b) => a.month === b.month ? a.day - b.day : a.month - b.month);
59
82
  };
60
83
  const getHolidays = (market, startDate, days) => {
61
- const start = luxon_1.DateTime.fromJSDate(startDate).setZone(ET).startOf('day');
84
+ const start = luxon_1.DateTime.fromJSDate(startDate).setZone(ET).startOf("day");
62
85
  const end = start.plus({ days });
63
86
  const years = [];
64
87
  for (let year = start.year; year <= end.year; year++) {
@@ -71,7 +94,9 @@ const getHolidays = (market, startDate, days) => {
71
94
  };
72
95
  exports.getHolidays = getHolidays;
73
96
  const getHolidaysInCurrentWeek = (market, currentDate) => {
74
- const weekStart = luxon_1.DateTime.fromJSDate(currentDate).setZone(ET).startOf("week");
97
+ const weekStart = luxon_1.DateTime.fromJSDate(currentDate)
98
+ .setZone(ET)
99
+ .startOf("week");
75
100
  return (0, exports.getHolidays)(market, weekStart.toJSDate(), 7);
76
101
  };
77
102
  exports.getHolidaysInCurrentWeek = getHolidaysInCurrentWeek;
@@ -7,7 +7,7 @@ exports.getUSMarketsNow = exports.isStocksOpen = void 0;
7
7
  const luxon_1 = require("luxon");
8
8
  const schedules_1 = require("./schedules");
9
9
  const STOCKS_MARKETS_TIME_ZONE_IANA = luxon_1.IANAZone.create("America/New_York");
10
- const isStocksOpen = (dateToCheck) => (0, schedules_1.isOpenAt)('stocks', dateToCheck);
10
+ const isStocksOpen = (dateToCheck) => (0, schedules_1.isOpenAt)("stocks", dateToCheck);
11
11
  exports.isStocksOpen = isStocksOpen;
12
12
  const getUSMarketsNow = () => {
13
13
  return luxon_1.DateTime.now().setZone(STOCKS_MARKETS_TIME_ZONE_IANA);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gainsnetwork/sdk",
3
- "version": "1.8.6",
3
+ "version": "1.8.8-rc1",
4
4
  "description": "Gains Network SDK",
5
5
  "main": "./lib/index.js",
6
6
  "files": [