@gainsnetwork/sdk 0.1.10-rc1 → 0.1.11-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.
@@ -1,2 +1,3 @@
1
+ import { Pair } from "src/trade";
1
2
  export declare const isForexOpen: (dateToCheck: Date) => boolean;
2
- export declare const isForexLowLiquidity: (timestampToCheck: number, pairId?: number) => boolean;
3
+ export declare const isForexLowLiquidity: (timestampToCheck: number, pair?: Pair) => boolean;
@@ -27,13 +27,15 @@ const isForexOpen = (dateToCheck) => {
27
27
  return !isClosed;
28
28
  };
29
29
  exports.isForexOpen = isForexOpen;
30
- const isForexLowLiquidity = (timestampToCheck, pairId) => {
30
+ const chfMinorPairIds = [28, 116, 120, 123, 125, 127];
31
+ const isForexLowLiquidity = (timestampToCheck, pair) => {
31
32
  const now = luxon_1.DateTime.fromMillis(timestampToCheck).setZone(FOREX_MARKETS_TIME_ZONE_IANA);
32
33
  const hour = now.hour;
33
34
  const minute = now.minute;
34
35
  const isInDST = now.isInDST;
35
- // NZD/CHF: increase low liquidity window by additional 30 mins
36
- if (pairId === 123) {
36
+ // CHF minor pairs: increase low liquidity window by additional 30 mins
37
+ const pairIndex = pair === null || pair === void 0 ? void 0 : pair.pairIndex;
38
+ if (pairIndex && chfMinorPairIds.includes(+pairIndex)) {
37
39
  return ((isInDST && ((hour == 15 && minute >= 15) || (hour >= 16 && hour < 19))) ||
38
40
  (!isInDST && ((hour == 16 && minute >= 15) || (hour >= 17 && hour < 20))));
39
41
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gainsnetwork/sdk",
3
- "version": "0.1.10-rc1",
3
+ "version": "0.1.11-rc1",
4
4
  "description": "Gains Network SDK",
5
5
  "main": "./lib/index.js",
6
6
  "files": [