@gainsnetwork/sdk 1.1.0 → 1.1.1-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 (62) hide show
  1. package/lib/contracts/addresses.d.ts +1 -0
  2. package/lib/contracts/addresses.js +9 -1
  3. package/lib/contracts/addresses.json +29 -0
  4. package/lib/contracts/types/generated/GNSBorrowingFeesV6_3_2.d.ts +979 -0
  5. package/lib/contracts/types/generated/GNSBorrowingFeesV6_3_2.js +2 -0
  6. package/lib/contracts/types/generated/GNSBorrowingFeesV6_4.d.ts +1058 -0
  7. package/lib/contracts/types/generated/GNSBorrowingFeesV6_4.js +2 -0
  8. package/lib/contracts/types/generated/GNSPairInfosV6_1.d.ts +911 -0
  9. package/lib/contracts/types/generated/GNSPairInfosV6_1.js +2 -0
  10. package/lib/contracts/types/generated/GNSPairsStorageV6.d.ts +660 -0
  11. package/lib/contracts/types/generated/GNSPairsStorageV6.js +2 -0
  12. package/lib/contracts/types/generated/GNSTradingCallbacksV6_3_2.d.ts +806 -0
  13. package/lib/contracts/types/generated/GNSTradingCallbacksV6_3_2.js +2 -0
  14. package/lib/contracts/types/generated/GNSTradingCallbacksV6_4.d.ts +821 -0
  15. package/lib/contracts/types/generated/GNSTradingCallbacksV6_4.js +2 -0
  16. package/lib/contracts/types/generated/factories/GNSBorrowingFeesV6_3_2__factory.d.ts +88 -0
  17. package/lib/contracts/types/generated/factories/GNSBorrowingFeesV6_3_2__factory.js +1654 -0
  18. package/lib/contracts/types/generated/factories/GNSBorrowingFeesV6_4__factory.d.ts +113 -0
  19. package/lib/contracts/types/generated/factories/GNSBorrowingFeesV6_4__factory.js +1742 -0
  20. package/lib/contracts/types/generated/factories/GNSPairInfosV6_1__factory.d.ts +98 -0
  21. package/lib/contracts/types/generated/factories/GNSPairInfosV6_1__factory.js +1485 -0
  22. package/lib/contracts/types/generated/factories/GNSPairsStorageV6__factory.d.ts +117 -0
  23. package/lib/contracts/types/generated/factories/GNSPairsStorageV6__factory.js +1265 -0
  24. package/lib/contracts/types/generated/factories/GNSTradingCallbacksV6_3_2__factory.d.ts +82 -0
  25. package/lib/contracts/types/generated/factories/GNSTradingCallbacksV6_3_2__factory.js +1273 -0
  26. package/lib/contracts/types/generated/factories/GNSTradingCallbacksV6_4__factory.d.ts +82 -0
  27. package/lib/contracts/types/generated/factories/GNSTradingCallbacksV6_4__factory.js +1326 -0
  28. package/lib/markets/oi/fetcher.d.ts +58 -0
  29. package/lib/markets/oi/fetcher.js +181 -0
  30. package/lib/markets/oi/validation.d.ts +80 -0
  31. package/lib/markets/oi/validation.js +172 -0
  32. package/lib/markets/price/signedPrices.d.ts +36 -0
  33. package/lib/markets/price/signedPrices.js +181 -0
  34. package/lib/pricing/depthBands/converter.d.ts +65 -0
  35. package/lib/pricing/depthBands/converter.js +155 -0
  36. package/lib/pricing/depthBands/decoder.d.ts +32 -0
  37. package/lib/pricing/depthBands/decoder.js +109 -0
  38. package/lib/pricing/depthBands/encoder.d.ts +19 -0
  39. package/lib/pricing/depthBands/encoder.js +105 -0
  40. package/lib/pricing/depthBands/index.d.ts +8 -0
  41. package/lib/pricing/depthBands/index.js +26 -0
  42. package/lib/pricing/depthBands/types.d.ts +49 -0
  43. package/lib/pricing/depthBands/types.js +10 -0
  44. package/lib/pricing/depthBands/validator.d.ts +22 -0
  45. package/lib/pricing/depthBands/validator.js +113 -0
  46. package/lib/pricing/depthBands.d.ts +39 -0
  47. package/lib/pricing/depthBands.js +92 -0
  48. package/lib/pricing/index.d.ts +4 -0
  49. package/lib/pricing/index.js +20 -0
  50. package/lib/trade/effectiveLeverage/builder.d.ts +23 -0
  51. package/lib/trade/effectiveLeverage/builder.js +30 -0
  52. package/lib/trade/fees/holdingFees/index.d.ts +46 -0
  53. package/lib/trade/fees/holdingFees/index.js +105 -0
  54. package/lib/trade/fees/holdingFees/types.d.ts +23 -0
  55. package/lib/trade/fees/holdingFees/types.js +5 -0
  56. package/lib/trade/fees/trading/holdingFees.d.ts +28 -0
  57. package/lib/trade/fees/trading/holdingFees.js +66 -0
  58. package/lib/trade/fees/trading/holdingFeesStructured.d.ts +28 -0
  59. package/lib/trade/fees/trading/holdingFeesStructured.js +66 -0
  60. package/lib/trade/priceImpact/cumulVol/types.d.ts +11 -0
  61. package/lib/trade/priceImpact/cumulVol/types.js +2 -0
  62. package/package.json +1 -1
@@ -1,3 +1,4 @@
1
1
  import { CollateralTypes, ContractAddresses } from "./types";
2
2
  export declare const getContractAddressesForChain: (chainId: number, collateral?: CollateralTypes) => ContractAddresses;
3
3
  export declare const getCollateralByAddressForChain: (chainId: number, address: string) => CollateralTypes;
4
+ export declare const getContractAddressesForTestnetRelease: () => ContractAddresses;
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.getCollateralByAddressForChain = exports.getContractAddressesForChain = void 0;
6
+ exports.getContractAddressesForTestnetRelease = exports.getCollateralByAddressForChain = exports.getContractAddressesForChain = void 0;
7
7
  const types_1 = require("./types");
8
8
  const addresses_json_1 = __importDefault(require("./addresses.json"));
9
9
  const getContractAddressesForChain = (chainId, collateral = types_1.CollateralTypes.DAI) => {
@@ -29,3 +29,11 @@ const getCollateralByAddressForChain = (chainId, address) => {
29
29
  throw new Error(`Unable to find collateral for address (${address}) and chain id (${chainId}). No known contracts match requested address.`);
30
30
  };
31
31
  exports.getCollateralByAddressForChain = getCollateralByAddressForChain;
32
+ const getContractAddressesForTestnetRelease = () => {
33
+ const _addresses = addresses_json_1.default;
34
+ if (!_addresses["421614-release"]) {
35
+ throw new Error(`Unknown chain id (${"421614-release"}). No known contracts have been deployed on this chain.`);
36
+ }
37
+ return Object.assign(Object.assign({}, _addresses["421614-release"]["global"]), _addresses["421614-release"][types_1.CollateralTypes.DAI]);
38
+ };
39
+ exports.getContractAddressesForTestnetRelease = getContractAddressesForTestnetRelease;
@@ -143,5 +143,34 @@
143
143
  "gTokenOpenPnlFeed": "0x0000000000000000000000000000000000000000",
144
144
  "gToken": "0x0000000000000000000000000000000000000000"
145
145
  }
146
+ },
147
+ "421614-release": {
148
+ "global": {
149
+ "gnsMultiCollatDiamond": "0xB4F1B18b5679B42F2956dCBff3D7823A61F347C9"
150
+ },
151
+ "DAI": {
152
+ "gTokenOpenPnlFeed": "0xFcF76e2620eB6C32786e32620187A0FbF2844d68",
153
+ "gToken": "0x47CA7Fa22086CD63DBa92Dce23a75aEA9227a9DC"
154
+ },
155
+ "ETH": {
156
+ "gTokenOpenPnlFeed": "0x0000000000000000000000000000000000000000",
157
+ "gToken": "0x0000000000000000000000000000000000000000"
158
+ },
159
+ "USDC": {
160
+ "gTokenOpenPnlFeed": "0x0000000000000000000000000000000000000000",
161
+ "gToken": "0x0000000000000000000000000000000000000000"
162
+ },
163
+ "APE": {
164
+ "gTokenOpenPnlFeed": "0x0000000000000000000000000000000000000000",
165
+ "gToken": "0x0000000000000000000000000000000000000000"
166
+ },
167
+ "GNS": {
168
+ "gTokenOpenPnlFeed": "0x0000000000000000000000000000000000000000",
169
+ "gToken": "0x0000000000000000000000000000000000000000"
170
+ },
171
+ "BTCUSD": {
172
+ "gTokenOpenPnlFeed": "0x0000000000000000000000000000000000000000",
173
+ "gToken": "0x0000000000000000000000000000000000000000"
174
+ }
146
175
  }
147
176
  }