@gainsnetwork/sdk 0.2.41-rc1 → 0.2.42-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 +6 -0
- package/lib/constants.js +7 -1
- package/lib/contracts/utils/borrowingFees.d.ts +1 -0
- package/lib/contracts/utils/borrowingFees.js +20 -1
- package/lib/contracts/utils/pairs.js +6 -0
- package/lib/trade/fees/borrowing/converter.js +2 -0
- package/lib/trade/fees/borrowing/types.d.ts +1 -0
- package/lib/trade/types.d.ts +7 -1
- package/lib/trade/types.js +6 -0
- package/package.json +1 -1
- package/lib/contracts/types/generated/GFarmTradingStorageV5.d.ts +0 -1911
- package/lib/contracts/types/generated/GFarmTradingStorageV5.js +0 -2
- package/lib/contracts/types/generated/GNSBorrowingFees.d.ts +0 -1067
- package/lib/contracts/types/generated/GNSBorrowingFees.js +0 -2
- package/lib/contracts/types/generated/GNSBorrowingFeesV6_3_2.d.ts +0 -979
- package/lib/contracts/types/generated/GNSBorrowingFeesV6_3_2.js +0 -2
- package/lib/contracts/types/generated/GNSBorrowingFeesV6_4.d.ts +0 -1058
- package/lib/contracts/types/generated/GNSBorrowingFeesV6_4.js +0 -2
- package/lib/contracts/types/generated/GNSNftRewardsV6.d.ts +0 -533
- package/lib/contracts/types/generated/GNSNftRewardsV6.js +0 -2
- package/lib/contracts/types/generated/GNSNftRewardsV6_3_1.d.ts +0 -613
- package/lib/contracts/types/generated/GNSNftRewardsV6_3_1.js +0 -2
- package/lib/contracts/types/generated/GNSPairInfosV6_1.d.ts +0 -911
- package/lib/contracts/types/generated/GNSPairInfosV6_1.js +0 -2
- package/lib/contracts/types/generated/GNSPairsStorageV6.d.ts +0 -660
- package/lib/contracts/types/generated/GNSPairsStorageV6.js +0 -2
- package/lib/contracts/types/generated/GNSTrading.d.ts +0 -758
- package/lib/contracts/types/generated/GNSTrading.js +0 -2
- package/lib/contracts/types/generated/GNSTradingCallbacks.d.ts +0 -875
- package/lib/contracts/types/generated/GNSTradingCallbacks.js +0 -2
- package/lib/contracts/types/generated/GNSTradingCallbacksV6_3_2.d.ts +0 -806
- package/lib/contracts/types/generated/GNSTradingCallbacksV6_3_2.js +0 -2
- package/lib/contracts/types/generated/GNSTradingCallbacksV6_4.d.ts +0 -821
- package/lib/contracts/types/generated/GNSTradingCallbacksV6_4.js +0 -2
- package/lib/contracts/types/generated/GNSTradingStorage.d.ts +0 -1387
- package/lib/contracts/types/generated/GNSTradingStorage.js +0 -2
- package/lib/contracts/types/generated/GTokenV6_3_2.d.ts +0 -1838
- package/lib/contracts/types/generated/GTokenV6_3_2.js +0 -2
- package/lib/contracts/types/generated/factories/GFarmTradingStorageV5__factory.d.ts +0 -83
- package/lib/contracts/types/generated/factories/GFarmTradingStorageV5__factory.js +0 -2691
- package/lib/contracts/types/generated/factories/GNSBorrowingFeesV6_3_2__factory.d.ts +0 -88
- package/lib/contracts/types/generated/factories/GNSBorrowingFeesV6_3_2__factory.js +0 -1654
- package/lib/contracts/types/generated/factories/GNSBorrowingFeesV6_4__factory.d.ts +0 -113
- package/lib/contracts/types/generated/factories/GNSBorrowingFeesV6_4__factory.js +0 -1742
- package/lib/contracts/types/generated/factories/GNSBorrowingFees__factory.d.ts +0 -124
- package/lib/contracts/types/generated/factories/GNSBorrowingFees__factory.js +0 -1784
- package/lib/contracts/types/generated/factories/GNSNftRewardsV6_3_1__factory.d.ts +0 -100
- package/lib/contracts/types/generated/factories/GNSNftRewardsV6_3_1__factory.js +0 -1116
- package/lib/contracts/types/generated/factories/GNSNftRewardsV6__factory.d.ts +0 -100
- package/lib/contracts/types/generated/factories/GNSNftRewardsV6__factory.js +0 -1003
- package/lib/contracts/types/generated/factories/GNSPairInfosV6_1__factory.d.ts +0 -98
- package/lib/contracts/types/generated/factories/GNSPairInfosV6_1__factory.js +0 -1485
- package/lib/contracts/types/generated/factories/GNSPairsStorageV6__factory.d.ts +0 -117
- package/lib/contracts/types/generated/factories/GNSPairsStorageV6__factory.js +0 -1265
- package/lib/contracts/types/generated/factories/GNSTradingCallbacksV6_3_2__factory.d.ts +0 -82
- package/lib/contracts/types/generated/factories/GNSTradingCallbacksV6_3_2__factory.js +0 -1273
- package/lib/contracts/types/generated/factories/GNSTradingCallbacksV6_4__factory.d.ts +0 -82
- package/lib/contracts/types/generated/factories/GNSTradingCallbacksV6_4__factory.js +0 -1326
- package/lib/contracts/types/generated/factories/GNSTradingCallbacks__factory.d.ts +0 -113
- package/lib/contracts/types/generated/factories/GNSTradingCallbacks__factory.js +0 -1428
- package/lib/contracts/types/generated/factories/GNSTradingStorage__factory.d.ts +0 -96
- package/lib/contracts/types/generated/factories/GNSTradingStorage__factory.js +0 -2241
- package/lib/contracts/types/generated/factories/GNSTrading__factory.d.ts +0 -95
- package/lib/contracts/types/generated/factories/GNSTrading__factory.js +0 -1071
- package/lib/contracts/types/generated/factories/GTokenV6_3_2__factory.d.ts +0 -110
- package/lib/contracts/types/generated/factories/GTokenV6_3_2__factory.js +0 -2682
- package/lib/contracts/utils/openLimitOrders.d.ts +0 -8
- package/lib/contracts/utils/openLimitOrders.js +0 -88
- package/lib/trade/openLimitOrder.d.ts +0 -2
- package/lib/trade/openLimitOrder.js +0 -23
package/lib/constants.d.ts
CHANGED
|
@@ -299,6 +299,12 @@ export declare const pairs: {
|
|
|
299
299
|
"HOT/USD": string;
|
|
300
300
|
"STORJ/USD": string;
|
|
301
301
|
"RAY/USD": string;
|
|
302
|
+
"PNUT/USD": string;
|
|
303
|
+
"ACT/USD": string;
|
|
304
|
+
"GRASS/USD": string;
|
|
305
|
+
"ZEN/USD": string;
|
|
306
|
+
"LUMIA/USD": string;
|
|
307
|
+
"ALPH/USD": string;
|
|
302
308
|
};
|
|
303
309
|
export declare const getAssetClassFromGroupIndex: (groupIndex: number) => string | undefined;
|
|
304
310
|
export declare const tickerChanges: {
|
package/lib/constants.js
CHANGED
|
@@ -307,6 +307,12 @@ exports.pairs = {
|
|
|
307
307
|
"HOT/USD": CRYPTO,
|
|
308
308
|
"STORJ/USD": CRYPTO,
|
|
309
309
|
"RAY/USD": CRYPTO,
|
|
310
|
+
"PNUT/USD": CRYPTO,
|
|
311
|
+
"ACT/USD": CRYPTO,
|
|
312
|
+
"GRASS/USD": CRYPTO,
|
|
313
|
+
"ZEN/USD": CRYPTO,
|
|
314
|
+
"LUMIA/USD": CRYPTO,
|
|
315
|
+
"ALPH/USD": CRYPTO,
|
|
310
316
|
};
|
|
311
317
|
const getAssetClassFromGroupIndex = (groupIndex) => {
|
|
312
318
|
switch (groupIndex) {
|
|
@@ -342,7 +348,7 @@ exports.delistedPairIxs = new Set([
|
|
|
342
348
|
6, 31, 36, 45, 48, 51, 54, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70,
|
|
343
349
|
71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
|
|
344
350
|
97, 99, 101, 106, 108, 52, 131, 147, 160, 179, 182, 183, 190, 229, 163, 15,
|
|
345
|
-
170, 239, 254, 230, 4, 275, 290, 296,
|
|
351
|
+
170, 239, 254, 230, 4, 275, 290, 296, 300, 301, 302, 303, 304, 305,
|
|
346
352
|
]);
|
|
347
353
|
exports.delistedGroupsIxs = new Set([6, 7]);
|
|
348
354
|
exports.DEFAULT_PROTECTION_CLOSE_FACTOR = 1;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { GNSMultiCollatDiamond } from "../types/generated";
|
|
2
2
|
import { BorrowingFee } from "../../trade";
|
|
3
|
+
export declare const getBorrowingGroupName: (groupIndex: number) => string;
|
|
3
4
|
export declare const fetchAllPairBorrowingFees: (contract: GNSMultiCollatDiamond, collateralIndex: number) => Promise<BorrowingFee.Pair[]>;
|
|
4
5
|
export declare const fetchGroupBorrowingFees: (contract: GNSMultiCollatDiamond, collateralIndex: number, groupIxs: number[]) => Promise<BorrowingFee.Group[]>;
|
|
5
6
|
export declare const fetchAllPairAndGroupBorrowingFees: (contract: GNSMultiCollatDiamond, collateralIndex: number) => Promise<{
|
|
@@ -9,8 +9,27 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.fetchAllPairAndGroupBorrowingFees = exports.fetchGroupBorrowingFees = exports.fetchAllPairBorrowingFees = void 0;
|
|
12
|
+
exports.fetchAllPairAndGroupBorrowingFees = exports.fetchGroupBorrowingFees = exports.fetchAllPairBorrowingFees = exports.getBorrowingGroupName = void 0;
|
|
13
13
|
const trade_1 = require("../../trade");
|
|
14
|
+
const getBorrowingGroupName = (groupIndex) => {
|
|
15
|
+
const groupNamesByIndex = [
|
|
16
|
+
"Crypto Core",
|
|
17
|
+
"Crypto Altcoins",
|
|
18
|
+
"Forex USD Majors",
|
|
19
|
+
"Forex USD-Quoted Majors",
|
|
20
|
+
"Forex EUR Majors",
|
|
21
|
+
"",
|
|
22
|
+
"",
|
|
23
|
+
"Commodities",
|
|
24
|
+
"Forex USD Minors",
|
|
25
|
+
"Forex Nordic",
|
|
26
|
+
"Forex GBP Majors",
|
|
27
|
+
"Forex AUD",
|
|
28
|
+
"Forex NZD",
|
|
29
|
+
];
|
|
30
|
+
return groupNamesByIndex[groupIndex - 1] || "Unknown";
|
|
31
|
+
};
|
|
32
|
+
exports.getBorrowingGroupName = getBorrowingGroupName;
|
|
14
33
|
const fetchAllPairBorrowingFees = (contract, collateralIndex) => __awaiter(void 0, void 0, void 0, function* () {
|
|
15
34
|
return (0, trade_1.convertPairBorrowingFees)(yield contract.getAllBorrowingPairs(collateralIndex));
|
|
16
35
|
});
|
|
@@ -405,4 +405,10 @@ const PAIR_INDEX_TO_DESCRIPTION = {
|
|
|
405
405
|
[types_1.PairIndex.HOTUSD]: "Holo to US Dollar",
|
|
406
406
|
[types_1.PairIndex.STORJUSD]: "Storj to US Dollar",
|
|
407
407
|
[types_1.PairIndex.RAYUSD]: "Raydium to US Dollar",
|
|
408
|
+
[types_1.PairIndex.PNUTUSD]: "Peanut the Squirrel to US Dollar",
|
|
409
|
+
[types_1.PairIndex.ACTUSD]: "The AI Prophecy to US Dollar",
|
|
410
|
+
[types_1.PairIndex.GRASSUSD]: "Grass to US Dollar",
|
|
411
|
+
[types_1.PairIndex.ZENUSD]: "Horizen to US Dollar",
|
|
412
|
+
[types_1.PairIndex.LUMIAUSD]: "Lumia to US Dollar",
|
|
413
|
+
[types_1.PairIndex.ALPHUSD]: "Alephium to US Dollar",
|
|
408
414
|
};
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.convertGroupBorrowingFees = exports.convertGroupBorrowingData = exports.convertGroupBorrowingFee = exports.convertPairBorrowingFees = exports.convertPairBorrowingFee = exports.convertPairGroupBorrowingFee = void 0;
|
|
4
|
+
const borrowingFees_1 = require("../../../contracts/utils/borrowingFees");
|
|
4
5
|
const convertPairGroupBorrowingFee = (pairGroup) => ({
|
|
5
6
|
groupIndex: pairGroup.groupIndex,
|
|
7
|
+
name: (0, borrowingFees_1.getBorrowingGroupName)(pairGroup.groupIndex),
|
|
6
8
|
initialAccFeeLong: parseFloat(pairGroup.initialAccFeeLong.toString()) / 1e10,
|
|
7
9
|
initialAccFeeShort: parseFloat(pairGroup.initialAccFeeShort.toString()) / 1e10,
|
|
8
10
|
prevGroupAccFeeLong: parseFloat(pairGroup.prevGroupAccFeeLong.toString()) / 1e10,
|
package/lib/trade/types.d.ts
CHANGED
package/lib/trade/types.js
CHANGED
|
@@ -329,4 +329,10 @@ var PairIndex;
|
|
|
329
329
|
PairIndex[PairIndex["HOTUSD"] = 297] = "HOTUSD";
|
|
330
330
|
PairIndex[PairIndex["STORJUSD"] = 298] = "STORJUSD";
|
|
331
331
|
PairIndex[PairIndex["RAYUSD"] = 299] = "RAYUSD";
|
|
332
|
+
PairIndex[PairIndex["PNUTUSD"] = 300] = "PNUTUSD";
|
|
333
|
+
PairIndex[PairIndex["ACTUSD"] = 301] = "ACTUSD";
|
|
334
|
+
PairIndex[PairIndex["GRASSUSD"] = 302] = "GRASSUSD";
|
|
335
|
+
PairIndex[PairIndex["ZENUSD"] = 303] = "ZENUSD";
|
|
336
|
+
PairIndex[PairIndex["LUMIAUSD"] = 304] = "LUMIAUSD";
|
|
337
|
+
PairIndex[PairIndex["ALPHUSD"] = 305] = "ALPHUSD";
|
|
332
338
|
})(PairIndex = exports.PairIndex || (exports.PairIndex = {}));
|