@gainsnetwork/sdk 0.1.22-rc2 → 0.1.24-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.
- package/lib/constants.d.ts +2 -0
- package/lib/constants.js +3 -1
- package/lib/contracts/utils/pairs.js +2 -0
- package/lib/markets/forex.js +5 -6
- package/lib/trade/types.d.ts +3 -1
- package/lib/trade/types.js +2 -0
- package/package.json +1 -1
package/lib/constants.d.ts
CHANGED
|
@@ -220,6 +220,8 @@ export declare const pairs: {
|
|
|
220
220
|
"RONIN/USD": string;
|
|
221
221
|
"ENA/USD": string;
|
|
222
222
|
"W/USD": string;
|
|
223
|
+
"TNSR/USD": string;
|
|
224
|
+
"ZEUS/USD": string;
|
|
223
225
|
};
|
|
224
226
|
export declare const getAssetClassFromGroupIndex: (groupIndex: number) => string | undefined;
|
|
225
227
|
export declare const tickerChanges: {
|
package/lib/constants.js
CHANGED
|
@@ -228,6 +228,8 @@ exports.pairs = {
|
|
|
228
228
|
"RONIN/USD": CRYPTO,
|
|
229
229
|
"ENA/USD": CRYPTO,
|
|
230
230
|
"W/USD": CRYPTO,
|
|
231
|
+
"TNSR/USD": CRYPTO,
|
|
232
|
+
"ZEUS/USD": CRYPTO,
|
|
231
233
|
};
|
|
232
234
|
const getAssetClassFromGroupIndex = (groupIndex) => {
|
|
233
235
|
switch (groupIndex) {
|
|
@@ -261,6 +263,6 @@ exports.stockSplits = {
|
|
|
261
263
|
exports.delistedPairIxs = new Set([
|
|
262
264
|
6, 31, 36, 42, 45, 48, 51, 54, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69,
|
|
263
265
|
70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88,
|
|
264
|
-
89, 97, 99, 101, 106, 107, 108, 52, 131, 147, 160, 179, 182, 183, 190, 194,
|
|
266
|
+
89, 97, 99, 101, 106, 107, 108, 52, 131, 147, 160, 179, 182, 183, 190, 194, 221, 222,
|
|
265
267
|
]);
|
|
266
268
|
exports.delistedGroupsIxs = new Set([6, 7]);
|
|
@@ -323,4 +323,6 @@ const PAIR_INDEX_TO_DESCRIPTION = {
|
|
|
323
323
|
[types_1.PairIndex.RONINUSD]: "Ronin to US Dollar",
|
|
324
324
|
[types_1.PairIndex.ENAUSD]: "Ethena to US Dollar",
|
|
325
325
|
[types_1.PairIndex.WUSD]: "Wormhole to US Dollar",
|
|
326
|
+
[types_1.PairIndex.TNSRUSD]: "Tensor to US Dollar",
|
|
327
|
+
[types_1.PairIndex.ZEUSUSD]: "Zeus to US Dollar",
|
|
326
328
|
};
|
package/lib/markets/forex.js
CHANGED
|
@@ -27,18 +27,17 @@ const isForexOpen = (dateToCheck) => {
|
|
|
27
27
|
return !isClosed;
|
|
28
28
|
};
|
|
29
29
|
exports.isForexOpen = isForexOpen;
|
|
30
|
-
const
|
|
30
|
+
const extendedLowLiqGroupIds = [8, 9];
|
|
31
31
|
const isForexLowLiquidity = (timestampToCheck, pair) => {
|
|
32
32
|
const now = luxon_1.DateTime.fromMillis(timestampToCheck).setZone(FOREX_MARKETS_TIME_ZONE_IANA);
|
|
33
33
|
const hour = now.hour;
|
|
34
34
|
const minute = now.minute;
|
|
35
35
|
const isInDST = now.isInDST;
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
if (pairIndex && extendedLowLiqPairIds.includes(+pairIndex)) {
|
|
36
|
+
const groupIndex = pair === null || pair === void 0 ? void 0 : pair.groupIndex;
|
|
37
|
+
if (groupIndex && extendedLowLiqGroupIds.includes(+groupIndex)) {
|
|
39
38
|
return ((isInDST &&
|
|
40
|
-
((hour == 15 && minute >= 15) || (hour >= 16 && hour <
|
|
41
|
-
(!isInDST && ((hour == 16 && minute >= 15) || (hour >= 17 && hour <
|
|
39
|
+
((hour == 15 && minute >= 15) || (hour >= 16 && hour < 21))) ||
|
|
40
|
+
(!isInDST && ((hour == 16 && minute >= 15) || (hour >= 17 && hour < 22))));
|
|
42
41
|
}
|
|
43
42
|
return ((isInDST && ((hour == 15 && minute >= 45) || (hour >= 16 && hour < 19))) ||
|
|
44
43
|
(!isInDST && ((hour == 16 && minute >= 45) || (hour >= 17 && hour < 20))));
|
package/lib/trade/types.d.ts
CHANGED
package/lib/trade/types.js
CHANGED
|
@@ -235,4 +235,6 @@ var PairIndex;
|
|
|
235
235
|
PairIndex[PairIndex["RONINUSD"] = 218] = "RONINUSD";
|
|
236
236
|
PairIndex[PairIndex["ENAUSD"] = 219] = "ENAUSD";
|
|
237
237
|
PairIndex[PairIndex["WUSD"] = 220] = "WUSD";
|
|
238
|
+
PairIndex[PairIndex["TNSRUSD"] = 221] = "TNSRUSD";
|
|
239
|
+
PairIndex[PairIndex["ZEUSUSD"] = 222] = "ZEUSUSD";
|
|
238
240
|
})(PairIndex = exports.PairIndex || (exports.PairIndex = {}));
|