@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.
Files changed (70) hide show
  1. package/lib/constants.d.ts +6 -0
  2. package/lib/constants.js +7 -1
  3. package/lib/contracts/utils/borrowingFees.d.ts +1 -0
  4. package/lib/contracts/utils/borrowingFees.js +20 -1
  5. package/lib/contracts/utils/pairs.js +6 -0
  6. package/lib/trade/fees/borrowing/converter.js +2 -0
  7. package/lib/trade/fees/borrowing/types.d.ts +1 -0
  8. package/lib/trade/types.d.ts +7 -1
  9. package/lib/trade/types.js +6 -0
  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/contracts/utils/openLimitOrders.d.ts +0 -8
  68. package/lib/contracts/utils/openLimitOrders.js +0 -88
  69. package/lib/trade/openLimitOrder.d.ts +0 -2
  70. package/lib/trade/openLimitOrder.js +0 -23
@@ -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,
@@ -8,6 +8,7 @@ export type BorrowingData = {
8
8
  };
9
9
  export type PairGroup = {
10
10
  groupIndex: number;
11
+ name?: string;
11
12
  block: number;
12
13
  initialAccFeeLong: number;
13
14
  initialAccFeeShort: number;
@@ -518,5 +518,11 @@ export declare enum PairIndex {
518
518
  DOGUSD = 296,
519
519
  HOTUSD = 297,
520
520
  STORJUSD = 298,
521
- RAYUSD = 299
521
+ RAYUSD = 299,
522
+ PNUTUSD = 300,
523
+ ACTUSD = 301,
524
+ GRASSUSD = 302,
525
+ ZENUSD = 303,
526
+ LUMIAUSD = 304,
527
+ ALPHUSD = 305
522
528
  }
@@ -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 = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gainsnetwork/sdk",
3
- "version": "0.2.41-rc1",
3
+ "version": "0.2.42-rc1",
4
4
  "description": "Gains Network SDK",
5
5
  "main": "./lib/index.js",
6
6
  "files": [