@gainsnetwork/sdk 0.2.41-rc2 → 0.2.43-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 (46) hide show
  1. package/lib/constants.d.ts +3 -0
  2. package/lib/constants.js +4 -1
  3. package/lib/contracts/addresses.json +37 -0
  4. package/lib/contracts/index.d.ts +2 -1
  5. package/lib/contracts/index.js +30 -3
  6. package/lib/contracts/types/generated/GNSMultiCollatDiamond.d.ts +136 -1
  7. package/lib/contracts/types/generated/factories/GNSMultiCollatDiamond__factory.js +186 -1
  8. package/lib/contracts/types/index.d.ts +9 -1
  9. package/lib/contracts/types/index.js +10 -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/GNSNftRewardsV6.d.ts +0 -533
  16. package/lib/contracts/types/generated/GNSNftRewardsV6.js +0 -2
  17. package/lib/contracts/types/generated/GNSNftRewardsV6_3_1.d.ts +0 -613
  18. package/lib/contracts/types/generated/GNSNftRewardsV6_3_1.js +0 -2
  19. package/lib/contracts/types/generated/GNSTrading.d.ts +0 -758
  20. package/lib/contracts/types/generated/GNSTrading.js +0 -2
  21. package/lib/contracts/types/generated/GNSTradingCallbacks.d.ts +0 -875
  22. package/lib/contracts/types/generated/GNSTradingCallbacks.js +0 -2
  23. package/lib/contracts/types/generated/GNSTradingStorage.d.ts +0 -1387
  24. package/lib/contracts/types/generated/GNSTradingStorage.js +0 -2
  25. package/lib/contracts/types/generated/GTokenV6_3_2.d.ts +0 -1838
  26. package/lib/contracts/types/generated/GTokenV6_3_2.js +0 -2
  27. package/lib/contracts/types/generated/factories/GFarmTradingStorageV5__factory.d.ts +0 -83
  28. package/lib/contracts/types/generated/factories/GFarmTradingStorageV5__factory.js +0 -2691
  29. package/lib/contracts/types/generated/factories/GNSBorrowingFees__factory.d.ts +0 -124
  30. package/lib/contracts/types/generated/factories/GNSBorrowingFees__factory.js +0 -1784
  31. package/lib/contracts/types/generated/factories/GNSNftRewardsV6_3_1__factory.d.ts +0 -100
  32. package/lib/contracts/types/generated/factories/GNSNftRewardsV6_3_1__factory.js +0 -1116
  33. package/lib/contracts/types/generated/factories/GNSNftRewardsV6__factory.d.ts +0 -100
  34. package/lib/contracts/types/generated/factories/GNSNftRewardsV6__factory.js +0 -1003
  35. package/lib/contracts/types/generated/factories/GNSTradingCallbacks__factory.d.ts +0 -113
  36. package/lib/contracts/types/generated/factories/GNSTradingCallbacks__factory.js +0 -1428
  37. package/lib/contracts/types/generated/factories/GNSTradingStorage__factory.d.ts +0 -96
  38. package/lib/contracts/types/generated/factories/GNSTradingStorage__factory.js +0 -2241
  39. package/lib/contracts/types/generated/factories/GNSTrading__factory.d.ts +0 -95
  40. package/lib/contracts/types/generated/factories/GNSTrading__factory.js +0 -1071
  41. package/lib/contracts/types/generated/factories/GTokenV6_3_2__factory.d.ts +0 -110
  42. package/lib/contracts/types/generated/factories/GTokenV6_3_2__factory.js +0 -2682
  43. package/lib/contracts/utils/openLimitOrders.d.ts +0 -8
  44. package/lib/contracts/utils/openLimitOrders.js +0 -88
  45. package/lib/trade/openLimitOrder.d.ts +0 -2
  46. package/lib/trade/openLimitOrder.js +0 -23
@@ -62,6 +62,11 @@ const _abi = [
62
62
  name: "InsufficientBalance",
63
63
  type: "error",
64
64
  },
65
+ {
66
+ inputs: [],
67
+ name: "InvalidAddress",
68
+ type: "error",
69
+ },
65
70
  {
66
71
  inputs: [],
67
72
  name: "InvalidAddresses",
@@ -7907,6 +7912,11 @@ const _abi = [
7907
7912
  name: "PriceZero",
7908
7913
  type: "error",
7909
7914
  },
7915
+ {
7916
+ inputs: [],
7917
+ name: "ReentrancyGuardReentrantCall",
7918
+ type: "error",
7919
+ },
7910
7920
  {
7911
7921
  inputs: [],
7912
7922
  name: "WaitTimeout",
@@ -8610,6 +8620,11 @@ const _abi = [
8610
8620
  name: "existingPnlCollateral",
8611
8621
  type: "int256",
8612
8622
  },
8623
+ {
8624
+ internalType: "uint256",
8625
+ name: "oldPosSizePlusPnlCollateral",
8626
+ type: "uint256",
8627
+ },
8613
8628
  {
8614
8629
  internalType: "uint256",
8615
8630
  name: "newOpenPrice",
@@ -8644,7 +8659,7 @@ const _abi = [
8644
8659
  ],
8645
8660
  name: "PositionSizeIncreaseExecuted",
8646
8661
  type: "event",
8647
- signature: "0xf09a9c949c4bd4cbe75b424bea11c683c3ae55e7cdb8321c3ec37e01af72c8d5",
8662
+ signature: "0x4627b6cfd38b837edb1d42b0c6c92e6ba06fded47652e32ce388fcaf3d513477",
8648
8663
  },
8649
8664
  {
8650
8665
  anonymous: false,
@@ -8955,6 +8970,40 @@ const _abi = [
8955
8970
  type: "function",
8956
8971
  signature: "0x24058ad3",
8957
8972
  },
8973
+ {
8974
+ inputs: [
8975
+ {
8976
+ internalType: "uint32",
8977
+ name: "_index",
8978
+ type: "uint32",
8979
+ },
8980
+ {
8981
+ internalType: "uint120",
8982
+ name: "_collateralDelta",
8983
+ type: "uint120",
8984
+ },
8985
+ {
8986
+ internalType: "uint24",
8987
+ name: "_leverageDelta",
8988
+ type: "uint24",
8989
+ },
8990
+ {
8991
+ internalType: "uint64",
8992
+ name: "_expectedPrice",
8993
+ type: "uint64",
8994
+ },
8995
+ {
8996
+ internalType: "uint16",
8997
+ name: "_maxSlippageP",
8998
+ type: "uint16",
8999
+ },
9000
+ ],
9001
+ name: "increasePositionSizeNative",
9002
+ outputs: [],
9003
+ stateMutability: "payable",
9004
+ type: "function",
9005
+ signature: "0x731104ba",
9006
+ },
8958
9007
  {
8959
9008
  inputs: [
8960
9009
  {
@@ -9250,6 +9299,25 @@ const _abi = [
9250
9299
  type: "function",
9251
9300
  signature: "0x0bce9aaa",
9252
9301
  },
9302
+ {
9303
+ inputs: [
9304
+ {
9305
+ internalType: "uint32",
9306
+ name: "_index",
9307
+ type: "uint32",
9308
+ },
9309
+ {
9310
+ internalType: "uint24",
9311
+ name: "_newLeverage",
9312
+ type: "uint24",
9313
+ },
9314
+ ],
9315
+ name: "updateLeverageNative",
9316
+ outputs: [],
9317
+ stateMutability: "payable",
9318
+ type: "function",
9319
+ signature: "0x0065efc8",
9320
+ },
9253
9321
  {
9254
9322
  inputs: [
9255
9323
  {
@@ -14124,6 +14192,123 @@ const _abi = [
14124
14192
  type: "function",
14125
14193
  signature: "0xac9650d8",
14126
14194
  },
14195
+ {
14196
+ anonymous: false,
14197
+ inputs: [
14198
+ {
14199
+ indexed: false,
14200
+ internalType: "bool",
14201
+ name: "enabled",
14202
+ type: "bool",
14203
+ },
14204
+ ],
14205
+ name: "NativeTransferEnabledUpdated",
14206
+ type: "event",
14207
+ signature: "0x2cc920a9e8bbfc19b048a3db4be815c4211e93faa33e0b1e97def344aac8aaa3",
14208
+ },
14209
+ {
14210
+ anonymous: false,
14211
+ inputs: [
14212
+ {
14213
+ indexed: false,
14214
+ internalType: "uint16",
14215
+ name: "newLimit",
14216
+ type: "uint16",
14217
+ },
14218
+ ],
14219
+ name: "NativeTransferGasLimitUpdated",
14220
+ type: "event",
14221
+ signature: "0xfbfcf05095de3956a64c56736502dd8e0280a6050ab0de536ce23c8725b61408",
14222
+ },
14223
+ {
14224
+ inputs: [],
14225
+ name: "getNativeTransferEnabled",
14226
+ outputs: [
14227
+ {
14228
+ internalType: "bool",
14229
+ name: "",
14230
+ type: "bool",
14231
+ },
14232
+ ],
14233
+ stateMutability: "view",
14234
+ type: "function",
14235
+ signature: "0x3bfab75c",
14236
+ },
14237
+ {
14238
+ inputs: [],
14239
+ name: "getNativeTransferGasLimit",
14240
+ outputs: [
14241
+ {
14242
+ internalType: "uint16",
14243
+ name: "",
14244
+ type: "uint16",
14245
+ },
14246
+ ],
14247
+ stateMutability: "view",
14248
+ type: "function",
14249
+ signature: "0x7a5c9d1e",
14250
+ },
14251
+ {
14252
+ inputs: [],
14253
+ name: "getReentrancyLock",
14254
+ outputs: [
14255
+ {
14256
+ internalType: "uint256",
14257
+ name: "",
14258
+ type: "uint256",
14259
+ },
14260
+ ],
14261
+ stateMutability: "view",
14262
+ type: "function",
14263
+ signature: "0x40ee2847",
14264
+ },
14265
+ {
14266
+ inputs: [
14267
+ {
14268
+ internalType: "uint16",
14269
+ name: "_nativeTransferGasLimit",
14270
+ type: "uint16",
14271
+ },
14272
+ {
14273
+ internalType: "bool",
14274
+ name: "_nativeTransferEnabled",
14275
+ type: "bool",
14276
+ },
14277
+ ],
14278
+ name: "initializeChainConfig",
14279
+ outputs: [],
14280
+ stateMutability: "nonpayable",
14281
+ type: "function",
14282
+ signature: "0x885af326",
14283
+ },
14284
+ {
14285
+ inputs: [
14286
+ {
14287
+ internalType: "bool",
14288
+ name: "_nativeTransferEnabled",
14289
+ type: "bool",
14290
+ },
14291
+ ],
14292
+ name: "updateNativeTransferEnabled",
14293
+ outputs: [],
14294
+ stateMutability: "nonpayable",
14295
+ type: "function",
14296
+ signature: "0x7644f242",
14297
+ },
14298
+ {
14299
+ inputs: [
14300
+ {
14301
+ internalType: "uint16",
14302
+ name: "_nativeTransferGasLimit",
14303
+ type: "uint16",
14304
+ },
14305
+ ],
14306
+ name: "updateNativeTransferGasLimit",
14307
+ outputs: [],
14308
+ stateMutability: "nonpayable",
14309
+ type: "function",
14310
+ signature: "0xe085d2a7",
14311
+ },
14127
14312
  ];
14128
14313
  class GNSMultiCollatDiamond__factory {
14129
14314
  static createInterface() {
@@ -14,10 +14,18 @@ export declare enum CollateralTypes {
14
14
  DAI = "DAI",
15
15
  ETH = "ETH",
16
16
  ARB = "ARB",
17
- USDC = "USDC"
17
+ USDC = "USDC",
18
+ APE = "APE"
18
19
  }
19
20
  export declare enum ContractsVersion {
20
21
  BEFORE_V9_2 = 0,
21
22
  V9_2 = 1
22
23
  }
23
24
  export type ContractAddressList = Record<string, Partial<Record<CollateralTypes | "global", Partial<ContractAddresses>>>>;
25
+ export declare enum ChainId {
26
+ POLYGON = 137,
27
+ ARBITRUM = 42161,
28
+ ARBITRUM_SEPOLIA = 421614,
29
+ BASE = 8453,
30
+ APECHAIN = 33139
31
+ }
@@ -1,15 +1,24 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ContractsVersion = exports.CollateralTypes = void 0;
3
+ exports.ChainId = exports.ContractsVersion = exports.CollateralTypes = void 0;
4
4
  var CollateralTypes;
5
5
  (function (CollateralTypes) {
6
6
  CollateralTypes["DAI"] = "DAI";
7
7
  CollateralTypes["ETH"] = "ETH";
8
8
  CollateralTypes["ARB"] = "ARB";
9
9
  CollateralTypes["USDC"] = "USDC";
10
+ CollateralTypes["APE"] = "APE";
10
11
  })(CollateralTypes = exports.CollateralTypes || (exports.CollateralTypes = {}));
11
12
  var ContractsVersion;
12
13
  (function (ContractsVersion) {
13
14
  ContractsVersion[ContractsVersion["BEFORE_V9_2"] = 0] = "BEFORE_V9_2";
14
15
  ContractsVersion[ContractsVersion["V9_2"] = 1] = "V9_2";
15
16
  })(ContractsVersion = exports.ContractsVersion || (exports.ContractsVersion = {}));
17
+ var ChainId;
18
+ (function (ChainId) {
19
+ ChainId[ChainId["POLYGON"] = 137] = "POLYGON";
20
+ ChainId[ChainId["ARBITRUM"] = 42161] = "ARBITRUM";
21
+ ChainId[ChainId["ARBITRUM_SEPOLIA"] = 421614] = "ARBITRUM_SEPOLIA";
22
+ ChainId[ChainId["BASE"] = 8453] = "BASE";
23
+ ChainId[ChainId["APECHAIN"] = 33139] = "APECHAIN";
24
+ })(ChainId = exports.ChainId || (exports.ChainId = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gainsnetwork/sdk",
3
- "version": "0.2.41-rc2",
3
+ "version": "0.2.43-rc1",
4
4
  "description": "Gains Network SDK",
5
5
  "main": "./lib/index.js",
6
6
  "files": [