lynx-client 0.0.1-beta.4 → 0.0.1-beta.5

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 (193) hide show
  1. package/dist/cjs/index.js +46 -0
  2. package/dist/cjs/lib/addresses/lensAddresses.js +29 -0
  3. package/dist/cjs/lib/chains/chainConstants.js +20 -0
  4. package/dist/cjs/lib/chains/chainTypes.js +23 -0
  5. package/dist/cjs/lib/constants/contractEnums.js +138 -0
  6. package/dist/cjs/lib/constants/feeIds.js +27 -0
  7. package/dist/cjs/lib/constants/generalConstants.js +4 -0
  8. package/dist/cjs/lib/constants/groupIds.js +27 -0
  9. package/dist/cjs/lib/constants/pairIds.js +91 -0
  10. package/dist/cjs/lib/constants/scales.js +19 -0
  11. package/dist/cjs/lib/contractsIntegration/deployedContractsConnector.js +22 -0
  12. package/dist/cjs/lib/lynxSystem/chipsCalculationsUtils.js +12 -0
  13. package/dist/cjs/lib/lynxSystem/hashes.js +8 -0
  14. package/dist/cjs/lib/lynxSystem/leverageCalculationsUtils.js +25 -0
  15. package/dist/cjs/lib/lynxSystem/lynxScalesUtils.js +20 -0
  16. package/dist/cjs/lib/priceFeeds/pyth/pythFeedConstants.js +63 -0
  17. package/dist/cjs/lib/priceFeeds/pyth/pythFeedFunctions.js +11 -0
  18. package/dist/cjs/lib/typechain/common.js +2 -0
  19. package/dist/cjs/lib/typechain/contracts/Peripheral/Lens/IntentsVerifierLens.js +2 -0
  20. package/dist/cjs/lib/typechain/contracts/Peripheral/Lens/LexLens.js +2 -0
  21. package/dist/cjs/lib/typechain/contracts/Peripheral/Lens/TradingFloorLens.js +2 -0
  22. package/dist/cjs/lib/typechain/contracts/Peripheral/Lens/TriggersAndPortalLens.js +2 -0
  23. package/dist/cjs/lib/typechain/factories/contracts/Peripheral/Lens/IntentsVerifierLens__factory.js +201 -0
  24. package/dist/cjs/lib/typechain/factories/contracts/Peripheral/Lens/LexLens__factory.js +2269 -0
  25. package/dist/cjs/lib/typechain/factories/contracts/Peripheral/Lens/TradingFloorLens__factory.js +1339 -0
  26. package/dist/cjs/lib/typechain/factories/contracts/Peripheral/Lens/TriggersAndPortalLens__factory.js +253 -0
  27. package/dist/cjs/lib/utils/addresses.js +14 -0
  28. package/dist/cjs/lib/utils/bignumbers.js +35 -0
  29. package/dist/cjs/lib/utils/cloning.js +17 -0
  30. package/dist/cjs/lib/utils/enumTypes.js +2 -0
  31. package/dist/cjs/lib/utils/ethersTypes.js +51 -0
  32. package/dist/cjs/lib/utils/types.js +3 -0
  33. package/dist/esm/index.d.ts +31 -0
  34. package/dist/esm/index.d.ts.map +1 -0
  35. package/dist/esm/index.js +46 -0
  36. package/dist/esm/lib/addresses/lensAddresses.d.ts +27 -0
  37. package/dist/esm/lib/addresses/lensAddresses.d.ts.map +1 -0
  38. package/dist/esm/lib/addresses/lensAddresses.js +29 -0
  39. package/dist/esm/lib/chains/chainConstants.d.ts +18 -0
  40. package/dist/esm/lib/chains/chainConstants.d.ts.map +1 -0
  41. package/dist/esm/lib/chains/chainConstants.js +20 -0
  42. package/dist/esm/lib/chains/chainTypes.d.ts +10 -0
  43. package/dist/esm/lib/chains/chainTypes.d.ts.map +1 -0
  44. package/dist/esm/lib/chains/chainTypes.js +23 -0
  45. package/dist/esm/lib/constants/contractEnums.d.ts +148 -0
  46. package/dist/esm/lib/constants/contractEnums.d.ts.map +1 -0
  47. package/dist/esm/lib/constants/contractEnums.js +138 -0
  48. package/dist/esm/lib/constants/feeIds.d.ts +13 -0
  49. package/dist/esm/lib/constants/feeIds.d.ts.map +1 -0
  50. package/dist/esm/lib/constants/feeIds.js +27 -0
  51. package/dist/esm/lib/constants/generalConstants.d.ts +2 -0
  52. package/dist/esm/lib/constants/generalConstants.d.ts.map +1 -0
  53. package/dist/esm/lib/constants/generalConstants.js +4 -0
  54. package/dist/esm/lib/constants/groupIds.d.ts +15 -0
  55. package/dist/esm/lib/constants/groupIds.d.ts.map +1 -0
  56. package/dist/esm/lib/constants/groupIds.js +27 -0
  57. package/dist/esm/lib/constants/pairIds.d.ts +40 -0
  58. package/dist/esm/lib/constants/pairIds.d.ts.map +1 -0
  59. package/dist/esm/lib/constants/pairIds.js +91 -0
  60. package/dist/esm/lib/constants/scales.d.ts +15 -0
  61. package/dist/esm/lib/constants/scales.d.ts.map +1 -0
  62. package/dist/esm/lib/constants/scales.js +19 -0
  63. package/dist/esm/lib/contractsIntegration/deployedContractsConnector.d.ts +10 -0
  64. package/dist/esm/lib/contractsIntegration/deployedContractsConnector.d.ts.map +1 -0
  65. package/dist/esm/lib/contractsIntegration/deployedContractsConnector.js +22 -0
  66. package/dist/esm/lib/lynxSystem/chipsCalculationsUtils.d.ts +3 -0
  67. package/dist/esm/lib/lynxSystem/chipsCalculationsUtils.d.ts.map +1 -0
  68. package/dist/esm/lib/lynxSystem/chipsCalculationsUtils.js +12 -0
  69. package/dist/esm/lib/lynxSystem/hashes.d.ts +2 -0
  70. package/dist/esm/lib/lynxSystem/hashes.d.ts.map +1 -0
  71. package/dist/esm/lib/lynxSystem/hashes.js +8 -0
  72. package/dist/esm/lib/lynxSystem/leverageCalculationsUtils.d.ts +6 -0
  73. package/dist/esm/lib/lynxSystem/leverageCalculationsUtils.d.ts.map +1 -0
  74. package/dist/esm/lib/lynxSystem/leverageCalculationsUtils.js +25 -0
  75. package/dist/esm/lib/lynxSystem/lynxScalesUtils.d.ts +5 -0
  76. package/dist/esm/lib/lynxSystem/lynxScalesUtils.d.ts.map +1 -0
  77. package/dist/esm/lib/lynxSystem/lynxScalesUtils.js +20 -0
  78. package/dist/esm/lib/priceFeeds/pyth/pythFeedConstants.d.ts +5 -0
  79. package/dist/esm/lib/priceFeeds/pyth/pythFeedConstants.d.ts.map +1 -0
  80. package/dist/esm/lib/priceFeeds/pyth/pythFeedConstants.js +63 -0
  81. package/dist/esm/lib/priceFeeds/pyth/pythFeedFunctions.d.ts +7 -0
  82. package/dist/esm/lib/priceFeeds/pyth/pythFeedFunctions.d.ts.map +1 -0
  83. package/dist/esm/lib/priceFeeds/pyth/pythFeedFunctions.js +11 -0
  84. package/dist/esm/lib/typechain/common.d.ts +51 -0
  85. package/dist/esm/lib/typechain/common.d.ts.map +1 -0
  86. package/dist/esm/lib/typechain/common.js +2 -0
  87. package/dist/esm/lib/typechain/contracts/Peripheral/Lens/IntentsVerifierLens.d.ts +102 -0
  88. package/dist/esm/lib/typechain/contracts/Peripheral/Lens/IntentsVerifierLens.d.ts.map +1 -0
  89. package/dist/esm/lib/typechain/contracts/Peripheral/Lens/IntentsVerifierLens.js +2 -0
  90. package/dist/esm/lib/typechain/contracts/Peripheral/Lens/LexLens.d.ts +740 -0
  91. package/dist/esm/lib/typechain/contracts/Peripheral/Lens/LexLens.d.ts.map +1 -0
  92. package/dist/esm/lib/typechain/contracts/Peripheral/Lens/LexLens.js +2 -0
  93. package/dist/esm/lib/typechain/contracts/Peripheral/Lens/TradingFloorLens.d.ts +390 -0
  94. package/dist/esm/lib/typechain/contracts/Peripheral/Lens/TradingFloorLens.d.ts.map +1 -0
  95. package/dist/esm/lib/typechain/contracts/Peripheral/Lens/TradingFloorLens.js +2 -0
  96. package/dist/esm/lib/typechain/contracts/Peripheral/Lens/TriggersAndPortalLens.d.ts +152 -0
  97. package/dist/esm/lib/typechain/contracts/Peripheral/Lens/TriggersAndPortalLens.d.ts.map +1 -0
  98. package/dist/esm/lib/typechain/contracts/Peripheral/Lens/TriggersAndPortalLens.js +2 -0
  99. package/dist/esm/lib/typechain/factories/contracts/Peripheral/Lens/IntentsVerifierLens__factory.d.ts +146 -0
  100. package/dist/esm/lib/typechain/factories/contracts/Peripheral/Lens/IntentsVerifierLens__factory.d.ts.map +1 -0
  101. package/dist/esm/lib/typechain/factories/contracts/Peripheral/Lens/IntentsVerifierLens__factory.js +201 -0
  102. package/dist/esm/lib/typechain/factories/contracts/Peripheral/Lens/LexLens__factory.d.ts +1747 -0
  103. package/dist/esm/lib/typechain/factories/contracts/Peripheral/Lens/LexLens__factory.d.ts.map +1 -0
  104. package/dist/esm/lib/typechain/factories/contracts/Peripheral/Lens/LexLens__factory.js +2269 -0
  105. package/dist/esm/lib/typechain/factories/contracts/Peripheral/Lens/TradingFloorLens__factory.d.ts +1042 -0
  106. package/dist/esm/lib/typechain/factories/contracts/Peripheral/Lens/TradingFloorLens__factory.d.ts.map +1 -0
  107. package/dist/esm/lib/typechain/factories/contracts/Peripheral/Lens/TradingFloorLens__factory.js +1339 -0
  108. package/dist/esm/lib/typechain/factories/contracts/Peripheral/Lens/TriggersAndPortalLens__factory.d.ts +187 -0
  109. package/dist/esm/lib/typechain/factories/contracts/Peripheral/Lens/TriggersAndPortalLens__factory.d.ts.map +1 -0
  110. package/dist/esm/lib/typechain/factories/contracts/Peripheral/Lens/TriggersAndPortalLens__factory.js +253 -0
  111. package/dist/esm/lib/utils/addresses.d.ts +4 -0
  112. package/dist/esm/lib/utils/addresses.d.ts.map +1 -0
  113. package/dist/esm/lib/utils/addresses.js +14 -0
  114. package/dist/esm/lib/utils/bignumbers.d.ts +6 -0
  115. package/dist/esm/lib/utils/bignumbers.d.ts.map +1 -0
  116. package/dist/esm/lib/utils/bignumbers.js +35 -0
  117. package/dist/esm/lib/utils/cloning.d.ts +6 -0
  118. package/dist/esm/lib/utils/cloning.d.ts.map +1 -0
  119. package/dist/esm/lib/utils/cloning.js +17 -0
  120. package/dist/esm/lib/utils/enumTypes.d.ts +2 -0
  121. package/dist/esm/lib/utils/enumTypes.d.ts.map +1 -0
  122. package/dist/esm/lib/utils/enumTypes.js +2 -0
  123. package/dist/esm/lib/utils/ethersTypes.d.ts +14 -0
  124. package/dist/esm/lib/utils/ethersTypes.d.ts.map +1 -0
  125. package/dist/esm/lib/utils/ethersTypes.js +51 -0
  126. package/dist/esm/lib/utils/types.d.ts +7 -0
  127. package/dist/esm/lib/utils/types.d.ts.map +1 -0
  128. package/dist/esm/lib/utils/types.js +3 -0
  129. package/dist/types/index.d.ts +31 -0
  130. package/dist/types/index.d.ts.map +1 -0
  131. package/dist/types/lib/addresses/lensAddresses.d.ts +27 -0
  132. package/dist/types/lib/addresses/lensAddresses.d.ts.map +1 -0
  133. package/dist/types/lib/chains/chainConstants.d.ts +18 -0
  134. package/dist/types/lib/chains/chainConstants.d.ts.map +1 -0
  135. package/dist/types/lib/chains/chainTypes.d.ts +10 -0
  136. package/dist/types/lib/chains/chainTypes.d.ts.map +1 -0
  137. package/dist/types/lib/constants/contractEnums.d.ts +148 -0
  138. package/dist/types/lib/constants/contractEnums.d.ts.map +1 -0
  139. package/dist/types/lib/constants/feeIds.d.ts +13 -0
  140. package/dist/types/lib/constants/feeIds.d.ts.map +1 -0
  141. package/dist/types/lib/constants/generalConstants.d.ts +2 -0
  142. package/dist/types/lib/constants/generalConstants.d.ts.map +1 -0
  143. package/dist/types/lib/constants/groupIds.d.ts +15 -0
  144. package/dist/types/lib/constants/groupIds.d.ts.map +1 -0
  145. package/dist/types/lib/constants/pairIds.d.ts +40 -0
  146. package/dist/types/lib/constants/pairIds.d.ts.map +1 -0
  147. package/dist/types/lib/constants/scales.d.ts +15 -0
  148. package/dist/types/lib/constants/scales.d.ts.map +1 -0
  149. package/dist/types/lib/contractsIntegration/deployedContractsConnector.d.ts +10 -0
  150. package/dist/types/lib/contractsIntegration/deployedContractsConnector.d.ts.map +1 -0
  151. package/dist/types/lib/lynxSystem/chipsCalculationsUtils.d.ts +3 -0
  152. package/dist/types/lib/lynxSystem/chipsCalculationsUtils.d.ts.map +1 -0
  153. package/dist/types/lib/lynxSystem/hashes.d.ts +2 -0
  154. package/dist/types/lib/lynxSystem/hashes.d.ts.map +1 -0
  155. package/dist/types/lib/lynxSystem/leverageCalculationsUtils.d.ts +6 -0
  156. package/dist/types/lib/lynxSystem/leverageCalculationsUtils.d.ts.map +1 -0
  157. package/dist/types/lib/lynxSystem/lynxScalesUtils.d.ts +5 -0
  158. package/dist/types/lib/lynxSystem/lynxScalesUtils.d.ts.map +1 -0
  159. package/dist/types/lib/priceFeeds/pyth/pythFeedConstants.d.ts +5 -0
  160. package/dist/types/lib/priceFeeds/pyth/pythFeedConstants.d.ts.map +1 -0
  161. package/dist/types/lib/priceFeeds/pyth/pythFeedFunctions.d.ts +7 -0
  162. package/dist/types/lib/priceFeeds/pyth/pythFeedFunctions.d.ts.map +1 -0
  163. package/dist/types/lib/typechain/common.d.ts +51 -0
  164. package/dist/types/lib/typechain/common.d.ts.map +1 -0
  165. package/dist/types/lib/typechain/contracts/Peripheral/Lens/IntentsVerifierLens.d.ts +102 -0
  166. package/dist/types/lib/typechain/contracts/Peripheral/Lens/IntentsVerifierLens.d.ts.map +1 -0
  167. package/dist/types/lib/typechain/contracts/Peripheral/Lens/LexLens.d.ts +740 -0
  168. package/dist/types/lib/typechain/contracts/Peripheral/Lens/LexLens.d.ts.map +1 -0
  169. package/dist/types/lib/typechain/contracts/Peripheral/Lens/TradingFloorLens.d.ts +390 -0
  170. package/dist/types/lib/typechain/contracts/Peripheral/Lens/TradingFloorLens.d.ts.map +1 -0
  171. package/dist/types/lib/typechain/contracts/Peripheral/Lens/TriggersAndPortalLens.d.ts +152 -0
  172. package/dist/types/lib/typechain/contracts/Peripheral/Lens/TriggersAndPortalLens.d.ts.map +1 -0
  173. package/dist/types/lib/typechain/factories/contracts/Peripheral/Lens/IntentsVerifierLens__factory.d.ts +146 -0
  174. package/dist/types/lib/typechain/factories/contracts/Peripheral/Lens/IntentsVerifierLens__factory.d.ts.map +1 -0
  175. package/dist/types/lib/typechain/factories/contracts/Peripheral/Lens/LexLens__factory.d.ts +1747 -0
  176. package/dist/types/lib/typechain/factories/contracts/Peripheral/Lens/LexLens__factory.d.ts.map +1 -0
  177. package/dist/types/lib/typechain/factories/contracts/Peripheral/Lens/TradingFloorLens__factory.d.ts +1042 -0
  178. package/dist/types/lib/typechain/factories/contracts/Peripheral/Lens/TradingFloorLens__factory.d.ts.map +1 -0
  179. package/dist/types/lib/typechain/factories/contracts/Peripheral/Lens/TriggersAndPortalLens__factory.d.ts +187 -0
  180. package/dist/types/lib/typechain/factories/contracts/Peripheral/Lens/TriggersAndPortalLens__factory.d.ts.map +1 -0
  181. package/dist/types/lib/utils/addresses.d.ts +4 -0
  182. package/dist/types/lib/utils/addresses.d.ts.map +1 -0
  183. package/dist/types/lib/utils/bignumbers.d.ts +6 -0
  184. package/dist/types/lib/utils/bignumbers.d.ts.map +1 -0
  185. package/dist/types/lib/utils/cloning.d.ts +6 -0
  186. package/dist/types/lib/utils/cloning.d.ts.map +1 -0
  187. package/dist/types/lib/utils/enumTypes.d.ts +2 -0
  188. package/dist/types/lib/utils/enumTypes.d.ts.map +1 -0
  189. package/dist/types/lib/utils/ethersTypes.d.ts +14 -0
  190. package/dist/types/lib/utils/ethersTypes.d.ts.map +1 -0
  191. package/dist/types/lib/utils/types.d.ts +7 -0
  192. package/dist/types/lib/utils/types.d.ts.map +1 -0
  193. package/package.json +2 -1
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./lib/chains/chainConstants"), exports);
18
+ __exportStar(require("./lib/chains/chainTypes"), exports);
19
+ __exportStar(require("./lib/utils/addresses"), exports);
20
+ __exportStar(require("./lib/utils/bignumbers"), exports);
21
+ __exportStar(require("./lib/lynxSystem/chipsCalculationsUtils"), exports);
22
+ __exportStar(require("./lib/lynxSystem/leverageCalculationsUtils"), exports);
23
+ __exportStar(require("./lib/utils/cloning"), exports);
24
+ __exportStar(require("./lib/utils/enumTypes"), exports);
25
+ __exportStar(require("./lib/utils/ethersTypes"), exports);
26
+ __exportStar(require("./lib/lynxSystem/hashes"), exports);
27
+ __exportStar(require("./lib/lynxSystem/lynxScalesUtils"), exports);
28
+ __exportStar(require("./lib/utils/types"), exports);
29
+ __exportStar(require("./lib/constants/contractEnums"), exports);
30
+ __exportStar(require("./lib/constants/generalConstants"), exports);
31
+ __exportStar(require("./lib/constants/scales"), exports);
32
+ __exportStar(require("./lib/constants/pairIds"), exports);
33
+ __exportStar(require("./lib/constants/groupIds"), exports);
34
+ __exportStar(require("./lib/constants/feeIds"), exports);
35
+ __exportStar(require("./lib/priceFeeds/pyth/pythFeedConstants"), exports);
36
+ __exportStar(require("./lib/priceFeeds/pyth/pythFeedFunctions"), exports);
37
+ __exportStar(require("./lib/addresses/lensAddresses"), exports);
38
+ __exportStar(require("./lib/contractsIntegration/deployedContractsConnector"), exports);
39
+ __exportStar(require("./lib/typechain/contracts/Peripheral/Lens/IntentsVerifierLens"), exports);
40
+ __exportStar(require("./lib/typechain/contracts/Peripheral/Lens/TriggersAndPortalLens"), exports);
41
+ __exportStar(require("./lib/typechain/contracts/Peripheral/Lens/LexLens"), exports);
42
+ __exportStar(require("./lib/typechain/contracts/Peripheral/Lens/TradingFloorLens"), exports);
43
+ __exportStar(require("./lib/typechain/factories/contracts/Peripheral/Lens/IntentsVerifierLens__factory"), exports);
44
+ __exportStar(require("./lib/typechain/factories/contracts/Peripheral/Lens/TriggersAndPortalLens__factory"), exports);
45
+ __exportStar(require("./lib/typechain/factories/contracts/Peripheral/Lens/LexLens__factory"), exports);
46
+ __exportStar(require("./lib/typechain/factories/contracts/Peripheral/Lens/TradingFloorLens__factory"), exports);
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LensAddresses = void 0;
4
+ exports.LensAddresses = {
5
+ boba: {
6
+ lexLens: "0xCcFaDF4E72d5b2D382555E0eb72a1BF6F7f0EF7F",
7
+ tradingFloorLensLens: "0xed9D263917921cb5f0B9a59c5083beA4075F33e7",
8
+ intentsVerifierLens: "0x8F33670B7a076793D178D340AD70Cc097DD03739",
9
+ triggersAndPortalLens: "0xA03312361D07dfAe0C517a441C69BFA9E84e38bf",
10
+ },
11
+ sonic: {
12
+ lexLens: "0xBcb1D4ACbc844ba5FC0aA411b98aebD4A508B65F",
13
+ tradingFloorLensLens: "0xa5802951D972372f1385e9Ac83df738b3323d0A8",
14
+ intentsVerifierLens: "0xDBe9130AAe593Ec73a838ce286fa84c193bceFA1",
15
+ triggersAndPortalLens: "0xaA96df0a4F01212169c2347dc23D5AEb89924839",
16
+ },
17
+ fantom: {
18
+ lexLens: "0xB5A5041654391a720953D346367D3A3BE9c3d47B",
19
+ tradingFloorLensLens: "0x30377D42736Bf4b40A67C18e5dFC7f45496e8569",
20
+ intentsVerifierLens: "0xD9E77b2A3E9B1a21aC256802bB86Cba3e21627E7",
21
+ triggersAndPortalLens: "0x9544C73C97BD292a1F09ef671A5f8CcDf9Ff5429",
22
+ },
23
+ flare: {
24
+ lexLens: "0x812Ea46a0618f923ae473eb239a89A8169b34B85",
25
+ tradingFloorLensLens: "0x13d878F3C3f32400A727662af7dfAdBc8b389637",
26
+ intentsVerifierLens: "0x33576dFbA7Ed5E3F8F744132D6885cE106178161",
27
+ triggersAndPortalLens: "0x625D49B0258BB8277516C07494910d420FA31B06",
28
+ },
29
+ };
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CHAIN_ID_ZIRCUIT = exports.CHAIN_ID_LINEA = exports.CHAIN_ID_CELO = exports.CHAIN_ID_ARBITRUM = exports.CHAIN_ID_MODE = exports.CHAIN_ID_BASE = exports.CHAIN_ID_MANTLE = exports.CHAIN_ID_GOAT = exports.CHAIN_ID_BOBA = exports.CHAIN_ID_FUSE = exports.CHAIN_ID_FANTOM = exports.CHAIN_ID_SONIC = exports.CHAIN_ID_POLYGON = exports.CHAIN_ID_BSC = exports.CHAIN_ID_FLARE = exports.CHAIN_ID_OPTIMISM = exports.CHAIN_ID_ETHEREUM = void 0;
4
+ exports.CHAIN_ID_ETHEREUM = 1;
5
+ exports.CHAIN_ID_OPTIMISM = 10;
6
+ exports.CHAIN_ID_FLARE = 14;
7
+ exports.CHAIN_ID_BSC = 56;
8
+ exports.CHAIN_ID_POLYGON = 137;
9
+ exports.CHAIN_ID_SONIC = 146;
10
+ exports.CHAIN_ID_FANTOM = 250;
11
+ exports.CHAIN_ID_FUSE = 122;
12
+ exports.CHAIN_ID_BOBA = 288;
13
+ exports.CHAIN_ID_GOAT = 2345;
14
+ exports.CHAIN_ID_MANTLE = 5000;
15
+ exports.CHAIN_ID_BASE = 8453;
16
+ exports.CHAIN_ID_MODE = 34443;
17
+ exports.CHAIN_ID_ARBITRUM = 42161;
18
+ exports.CHAIN_ID_CELO = 42220;
19
+ exports.CHAIN_ID_LINEA = 59144;
20
+ exports.CHAIN_ID_ZIRCUIT = 48900;
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CHAIN_ID_TO_NAME = void 0;
4
+ const chainConstants_1 = require("./chainConstants");
5
+ exports.CHAIN_ID_TO_NAME = {
6
+ [chainConstants_1.CHAIN_ID_ETHEREUM]: "ethereum",
7
+ [chainConstants_1.CHAIN_ID_OPTIMISM]: "optimism",
8
+ [chainConstants_1.CHAIN_ID_BSC]: "bsc",
9
+ [chainConstants_1.CHAIN_ID_FANTOM]: "fantom",
10
+ [chainConstants_1.CHAIN_ID_POLYGON]: "polygon",
11
+ [chainConstants_1.CHAIN_ID_BOBA]: "boba",
12
+ [chainConstants_1.CHAIN_ID_MANTLE]: "mantle",
13
+ [chainConstants_1.CHAIN_ID_LINEA]: "linea",
14
+ [chainConstants_1.CHAIN_ID_FUSE]: "fuse",
15
+ [chainConstants_1.CHAIN_ID_ARBITRUM]: "arbitrum",
16
+ [chainConstants_1.CHAIN_ID_CELO]: "celo",
17
+ [chainConstants_1.CHAIN_ID_MODE]: "mode",
18
+ [chainConstants_1.CHAIN_ID_ZIRCUIT]: "zircuit",
19
+ [chainConstants_1.CHAIN_ID_BASE]: "base",
20
+ [chainConstants_1.CHAIN_ID_GOAT]: "goat",
21
+ [chainConstants_1.CHAIN_ID_SONIC]: "sonic",
22
+ [chainConstants_1.CHAIN_ID_FLARE]: "flare",
23
+ };
@@ -0,0 +1,138 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GeneralTokenDispenserPusherLevelEnums = exports.ChipsIntentsVerifierActionsEnums = exports.LiquidityIntentsVerifierActionsEnums = exports.TradeIntentsVerifierActionsEnums = exports.ChipSpenderRolesEnums = exports.ChipModeEnums = exports.TradersPortalActionEnums = exports.UpdatePositionFieldOrderTypeEnums = exports.LexPoolNumberEnums = exports.LexPoolAddressesEnums = exports.PoolAccountantNumberEnums = exports.PoolAccountantAddressesEnums = exports.AdminNumericParam = exports.PositionCloseTypeEnums = exports.PositionFieldEnums = exports.FeeTypeEnums = exports.LimitTriggerEnums = exports.CloseOrderTypeEnums = exports.OpenOrderTypeEnums = exports.PositionPhaseEnums = void 0;
4
+ // ****** Trading Floor ******
5
+ exports.PositionPhaseEnums = {
6
+ NONE: 0,
7
+ OPEN_MARKET: 1,
8
+ OPEN_LIMIT: 2,
9
+ OPENED: 3,
10
+ CLOSE_MARKET: 4,
11
+ CLOSED: 5,
12
+ };
13
+ exports.OpenOrderTypeEnums = {
14
+ NONE: 0,
15
+ MARKET: 1,
16
+ LIMIT: 2,
17
+ };
18
+ exports.CloseOrderTypeEnums = {
19
+ NONE: 0,
20
+ MARKET: 1,
21
+ };
22
+ exports.LimitTriggerEnums = {
23
+ NONE: 0,
24
+ TP: 1,
25
+ SL: 2,
26
+ LIQ: 3,
27
+ };
28
+ exports.FeeTypeEnums = {
29
+ NOTE: 0,
30
+ OPEN_FEE: 1,
31
+ CLOSE_FEE: 2,
32
+ TRIGGER_FEE: 3,
33
+ };
34
+ exports.PositionFieldEnums = {
35
+ NONE: 0n,
36
+ TP: 1n,
37
+ SL: 2n,
38
+ };
39
+ exports.PositionCloseTypeEnums = {
40
+ NONE: 0,
41
+ TP: 1,
42
+ SL: 2,
43
+ LIQ: 3,
44
+ MARKET: 4,
45
+ };
46
+ exports.AdminNumericParam = {
47
+ NONE: 0,
48
+ MAX_TRADES_PER_PAIR: 1,
49
+ MAX_SL_F: 2,
50
+ MAX_SANITY_PROFIT_F: 3,
51
+ };
52
+ // ****** Lex ******
53
+ exports.PoolAccountantAddressesEnums = {
54
+ none: 0,
55
+ irm: 1,
56
+ frm: 2,
57
+ incentivizer: 3,
58
+ };
59
+ exports.PoolAccountantNumberEnums = {
60
+ none: 1,
61
+ minOpenFee: 1,
62
+ lexPartF: 2,
63
+ maxGainF: 3,
64
+ liquidationThresholdF: 4,
65
+ liquidationFeeF: 5,
66
+ fundingRateMax: 6,
67
+ interestShareFactor: 7,
68
+ borrowRateMax: 8,
69
+ maxTotalBorrows: 9,
70
+ maxVirtualUtilization: 10,
71
+ };
72
+ exports.LexPoolAddressesEnums = {
73
+ none: 0,
74
+ poolAccountant: 1,
75
+ pnlRole: 2,
76
+ };
77
+ exports.LexPoolNumberEnums = {
78
+ none: 0,
79
+ maxExtraWithdrawalAmountF: 1,
80
+ epochsDelayDeposit: 2,
81
+ epochsDelayRedeem: 3,
82
+ epochDuration: 4,
83
+ minDepositAmount: 5,
84
+ };
85
+ // ****** Order Book ******
86
+ exports.UpdatePositionFieldOrderTypeEnums = {
87
+ NONE: 0,
88
+ UPDATE_TP: 1,
89
+ UPDATE_SL: 2,
90
+ UPDATE_TP_AND_SL: 3,
91
+ };
92
+ // ****** Traders Portal ******
93
+ exports.TradersPortalActionEnums = {
94
+ NONE: 0,
95
+ REQUEST_POSITION_OPEN: 1,
96
+ REQUEST_POSITION_MARKET_CLOSE: 2,
97
+ REQUEST_POSITION_SINGLE_FIELD_UPDATE: 3,
98
+ REQUEST_POSITION_DOUBLE_FIELD_UPDATE: 4,
99
+ };
100
+ // ****** Base Chip ******
101
+ exports.ChipModeEnums = {
102
+ NONE: 0,
103
+ LOCAL: 1,
104
+ REMOTE: 2,
105
+ HYBRID: 3,
106
+ };
107
+ exports.ChipSpenderRolesEnums = {
108
+ TradingFloor: "TradingFloor",
109
+ LexPool: "LexPool",
110
+ ChipsIntentsVerifier: "ChipsIntentsVerifier",
111
+ ChipsIntentsVerifierAdmin: "ChipsIntentsVerifierAdmin",
112
+ };
113
+ // ****** Trade Intents Verifier ******
114
+ exports.TradeIntentsVerifierActionsEnums = {
115
+ NONE: 0,
116
+ REQUEST_POSITION_OPEN: 1,
117
+ REQUEST_POSITION_MARKET_CLOSE: 2,
118
+ REQUEST_POSITION_SINGLE_FIELD_UPDATE: 3,
119
+ REQUEST_POSITION_DOUBLE_FIELD_UPDATE: 4,
120
+ DIRECT_UPDATE_PENDING_LIMIT_POSITION: 5,
121
+ DIRECT_CANCEL_PENDING_LIMIT_POSITION: 6,
122
+ };
123
+ // ****** Liquidity Intents Verifier ******
124
+ exports.LiquidityIntentsVerifierActionsEnums = {
125
+ NONE: 0,
126
+ REQUEST_EPOCH_DEPOSIT: 1,
127
+ REQUEST_EPOCH_REDEEM: 2,
128
+ };
129
+ // ****** Chips Intents Verifier ******
130
+ exports.ChipsIntentsVerifierActionsEnums = {
131
+ NONE: 0,
132
+ CHIP_OUT_LZ: 1,
133
+ };
134
+ // ****** General Token Dispenser ******
135
+ exports.GeneralTokenDispenserPusherLevelEnums = {
136
+ NONE: 0,
137
+ BASE: 1,
138
+ };
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FEE_CONFIGS_IDENTIFIERS = exports.FEE_CONFIGS_IDS = void 0;
4
+ exports.FEE_CONFIGS_IDS = {
5
+ basicCryptoPair: 1,
6
+ catCryptoPair: 2,
7
+ forexPair: 3,
8
+ catForexPair: 4,
9
+ };
10
+ exports.FEE_CONFIGS_IDENTIFIERS = {
11
+ CRYPTO_COMMON: {
12
+ name: "crypto",
13
+ id: exports.FEE_CONFIGS_IDS.basicCryptoPair,
14
+ },
15
+ CRYPTO_CAT: {
16
+ name: "crypto_cat",
17
+ id: exports.FEE_CONFIGS_IDS.catCryptoPair,
18
+ },
19
+ FOREX: {
20
+ name: "forex",
21
+ id: exports.FEE_CONFIGS_IDS.forexPair,
22
+ },
23
+ FOREX_CAT: {
24
+ name: "forex_cat",
25
+ id: exports.FEE_CONFIGS_IDS.catForexPair,
26
+ },
27
+ };
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SECONDS_IN_YEAR = void 0;
4
+ exports.SECONDS_IN_YEAR = 60 * 60 * 24 * 365;
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GROUP_CONFIGS_IDENTIFIERS = exports.GROUP_CONFIGS_IDS = void 0;
4
+ exports.GROUP_CONFIGS_IDS = {
5
+ basicCryptoGroup: 1,
6
+ catCryptoGroup: 2,
7
+ forexGroup: 3,
8
+ catForexGroup: 4,
9
+ };
10
+ exports.GROUP_CONFIGS_IDENTIFIERS = {
11
+ crypto: {
12
+ name: "crypto",
13
+ id: exports.GROUP_CONFIGS_IDS.basicCryptoGroup,
14
+ },
15
+ crypto_cat: {
16
+ name: "crypto_cat",
17
+ id: exports.GROUP_CONFIGS_IDS.catCryptoGroup,
18
+ },
19
+ forex: {
20
+ name: "forex",
21
+ id: exports.GROUP_CONFIGS_IDS.forexGroup,
22
+ },
23
+ forex_cat: {
24
+ name: "forex_cat",
25
+ id: exports.GROUP_CONFIGS_IDS.catForexGroup,
26
+ },
27
+ };
@@ -0,0 +1,91 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PAIRS_FROM_TO = exports.PAIR_CONFIGS_IDENTIFIERS = exports.PAIR_CONFIGS_IDS = void 0;
4
+ exports.getPairConfigsIdentifierFromPairId = getPairConfigsIdentifierFromPairId;
5
+ const groupIds_1 = require("./groupIds");
6
+ exports.PAIR_CONFIGS_IDS = {
7
+ // NONE: 0,
8
+ // CRYPTO
9
+ BTC_USD: 1,
10
+ ETH_USD: 2,
11
+ BNB_USD: 3,
12
+ FTM_USD: 4,
13
+ SOL_USD: 5,
14
+ // CRYPTO -- Specific cases
15
+ FLR_USD: 1001,
16
+ // CRYPTO -- new version of previous pair
17
+ S_USD: 2004,
18
+ // FOREX
19
+ EUR_USD: 8001,
20
+ GBP_USD: 8002,
21
+ AUD_USD: 8003,
22
+ NZD_USD: 8004,
23
+ // REVERSE FOREX
24
+ USD_JPY: 8101,
25
+ USD_CHF: 8102,
26
+ // STOCKS
27
+ // TSLA_USD: 9001,
28
+ // CAT MODE -- CRYPTO
29
+ BTC_USD_CAT: 10001,
30
+ ETH_USD_CAT: 10002,
31
+ // CAT MODE -- FOREX
32
+ EUR_USD_CAT: 18001,
33
+ GBP_USD_CAT: 18002,
34
+ AUD_USD_CAT: 18003,
35
+ NZD_USD_CAT: 18004,
36
+ // CAT MODE -- REVERSE FOREX
37
+ USD_JPY_CAT: 18101,
38
+ USD_CHF_CAT: 18102,
39
+ };
40
+ exports.PAIR_CONFIGS_IDENTIFIERS = {
41
+ // CRYPTO
42
+ BTC_USD: buildCryptoPairConfigsIdentifier(groupIds_1.GROUP_CONFIGS_IDS.basicCryptoGroup, exports.PAIR_CONFIGS_IDS.BTC_USD, "BTC", "USD"),
43
+ ETH_USD: buildCryptoPairConfigsIdentifier(groupIds_1.GROUP_CONFIGS_IDS.basicCryptoGroup, exports.PAIR_CONFIGS_IDS.ETH_USD, "ETH", "USD"),
44
+ BNB_USD: buildCryptoPairConfigsIdentifier(groupIds_1.GROUP_CONFIGS_IDS.basicCryptoGroup, exports.PAIR_CONFIGS_IDS.BNB_USD, "BNB", "USD"),
45
+ FTM_USD: buildCryptoPairConfigsIdentifier(groupIds_1.GROUP_CONFIGS_IDS.basicCryptoGroup, exports.PAIR_CONFIGS_IDS.FTM_USD, "FTM", "USD"),
46
+ SOL_USD: buildCryptoPairConfigsIdentifier(groupIds_1.GROUP_CONFIGS_IDS.basicCryptoGroup, exports.PAIR_CONFIGS_IDS.SOL_USD, "SOL", "USD"),
47
+ // CRYPTO -- Specific cases
48
+ FLR_USD: buildCryptoPairConfigsIdentifier(groupIds_1.GROUP_CONFIGS_IDS.basicCryptoGroup, exports.PAIR_CONFIGS_IDS.FLR_USD, "FLR", "USD"),
49
+ // CRYPTO -- new version of previous pair
50
+ S_USD: buildCryptoPairConfigsIdentifier(groupIds_1.GROUP_CONFIGS_IDS.basicCryptoGroup, exports.PAIR_CONFIGS_IDS.S_USD, "S", "USD"),
51
+ // FOREX
52
+ EUR_USD: buildCryptoPairConfigsIdentifier(groupIds_1.GROUP_CONFIGS_IDS.forexGroup, exports.PAIR_CONFIGS_IDS.EUR_USD, "EUR", "USD"),
53
+ GBP_USD: buildCryptoPairConfigsIdentifier(groupIds_1.GROUP_CONFIGS_IDS.forexGroup, exports.PAIR_CONFIGS_IDS.GBP_USD, "GBP", "USD"),
54
+ AUD_USD: buildCryptoPairConfigsIdentifier(groupIds_1.GROUP_CONFIGS_IDS.forexGroup, exports.PAIR_CONFIGS_IDS.AUD_USD, "AUD", "USD"),
55
+ NZD_USD: buildCryptoPairConfigsIdentifier(groupIds_1.GROUP_CONFIGS_IDS.forexGroup, exports.PAIR_CONFIGS_IDS.NZD_USD, "NZD", "USD"),
56
+ // Reverse Forex
57
+ USD_JPY: buildCryptoPairConfigsIdentifier(groupIds_1.GROUP_CONFIGS_IDS.forexGroup, exports.PAIR_CONFIGS_IDS.USD_JPY, "USD", "JPY"),
58
+ USD_CHF: buildCryptoPairConfigsIdentifier(groupIds_1.GROUP_CONFIGS_IDS.forexGroup, exports.PAIR_CONFIGS_IDS.USD_CHF, "USD", "CHF"),
59
+ // CRYPTO CAT MODE
60
+ BTC_USD_CAT: buildCryptoPairConfigsIdentifier(groupIds_1.GROUP_CONFIGS_IDS.catCryptoGroup, exports.PAIR_CONFIGS_IDS.BTC_USD_CAT, "BTC", "USD"),
61
+ ETH_USD_CAT: buildCryptoPairConfigsIdentifier(groupIds_1.GROUP_CONFIGS_IDS.catCryptoGroup, exports.PAIR_CONFIGS_IDS.ETH_USD_CAT, "ETH", "USD"),
62
+ // FOREX CAT MODE
63
+ // FOREX
64
+ EUR_USD_CAT: buildCryptoPairConfigsIdentifier(groupIds_1.GROUP_CONFIGS_IDS.catForexGroup, exports.PAIR_CONFIGS_IDS.EUR_USD_CAT, "EUR", "USD"),
65
+ GBP_USD_CAT: buildCryptoPairConfigsIdentifier(groupIds_1.GROUP_CONFIGS_IDS.catForexGroup, exports.PAIR_CONFIGS_IDS.GBP_USD_CAT, "GBP", "USD"),
66
+ AUD_USD_CAT: buildCryptoPairConfigsIdentifier(groupIds_1.GROUP_CONFIGS_IDS.catForexGroup, exports.PAIR_CONFIGS_IDS.AUD_USD_CAT, "AUD", "USD"),
67
+ NZD_USD_CAT: buildCryptoPairConfigsIdentifier(groupIds_1.GROUP_CONFIGS_IDS.catForexGroup, exports.PAIR_CONFIGS_IDS.NZD_USD_CAT, "NZD", "USD"),
68
+ // Reverse Cat Forex
69
+ USD_JPY_CAT: buildCryptoPairConfigsIdentifier(groupIds_1.GROUP_CONFIGS_IDS.catForexGroup, exports.PAIR_CONFIGS_IDS.USD_JPY_CAT, "USD", "JPY"),
70
+ USD_CHF_CAT: buildCryptoPairConfigsIdentifier(groupIds_1.GROUP_CONFIGS_IDS.catForexGroup, exports.PAIR_CONFIGS_IDS.USD_CHF_CAT, "USD", "CHF"),
71
+ };
72
+ const PAIR_ID_TO_NAME = Object.fromEntries(Object.entries(exports.PAIR_CONFIGS_IDENTIFIERS).map(([pairName, value]) => [
73
+ value.id,
74
+ pairName,
75
+ ]));
76
+ function buildCryptoPairConfigsIdentifier(groupId, id, from, to) {
77
+ return {
78
+ groupId,
79
+ id,
80
+ from,
81
+ to,
82
+ };
83
+ }
84
+ function getPairConfigsIdentifierFromPairId(pairId) {
85
+ const pairName = PAIR_ID_TO_NAME[pairId];
86
+ return exports.PAIR_CONFIGS_IDENTIFIERS[pairName];
87
+ }
88
+ exports.PAIRS_FROM_TO = Object.fromEntries(Object.entries(exports.PAIR_CONFIGS_IDENTIFIERS).map(([pairName, value]) => [
89
+ value.id,
90
+ { from: value.from, to: value.to },
91
+ ]));
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CONTRACT_VERSION_SCALE = exports.PROXY_VERSION_SCALE = exports.LEX_TOKEN_UNIT = exports.LEX_TOKEN_SCALE = exports.ACCURACY_IMPROVEMENT_UNIT = exports.ACCURACY_IMPROVEMENT_SCALE = exports.FRACTION_UNIT = exports.FRACTION_MULTIPLIER_SCALE = exports.LEVERAGE_UNIT = exports.LEVERAGE_MULTIPLIER_SCALE = exports.PRICES_SCALE = exports.PRECISION_UNIT = exports.PRECISION_SCALE = exports.CHIP_DECIMALS = void 0;
4
+ exports.CHIP_DECIMALS = 18;
5
+ exports.PRECISION_SCALE = 18n;
6
+ exports.PRECISION_UNIT = 10n ** exports.PRECISION_SCALE;
7
+ exports.PRICES_SCALE = 8;
8
+ // NOTE : multiplier, not power
9
+ exports.LEVERAGE_MULTIPLIER_SCALE = 100;
10
+ exports.LEVERAGE_UNIT = BigInt(exports.LEVERAGE_MULTIPLIER_SCALE);
11
+ // NOTE : multiplier, not power
12
+ exports.FRACTION_MULTIPLIER_SCALE = 100000n; // allows 5 decimal points
13
+ exports.FRACTION_UNIT = exports.FRACTION_MULTIPLIER_SCALE;
14
+ exports.ACCURACY_IMPROVEMENT_SCALE = 9n;
15
+ exports.ACCURACY_IMPROVEMENT_UNIT = 10n ** exports.ACCURACY_IMPROVEMENT_SCALE;
16
+ exports.LEX_TOKEN_SCALE = 18n;
17
+ exports.LEX_TOKEN_UNIT = 10n ** exports.LEX_TOKEN_SCALE;
18
+ exports.PROXY_VERSION_SCALE = 1000; // 1,000 = 1.00, 1,120 = 1.12
19
+ exports.CONTRACT_VERSION_SCALE = 1000; // 1,000 = 1.00, 1,120 = 1.12
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.connectToTradingFloorLens = connectToTradingFloorLens;
4
+ exports.connectToLeXLens = connectToLeXLens;
5
+ exports.connectToIntentsVerifierLens = connectToIntentsVerifierLens;
6
+ exports.connectToTriggersAndPortalLens = connectToTriggersAndPortalLens;
7
+ const TradingFloorLens__factory_1 = require("../typechain/factories/contracts/Peripheral/Lens/TradingFloorLens__factory");
8
+ const LexLens__factory_1 = require("../typechain/factories/contracts/Peripheral/Lens/LexLens__factory");
9
+ const IntentsVerifierLens__factory_1 = require("../typechain/factories/contracts/Peripheral/Lens/IntentsVerifierLens__factory");
10
+ const TriggersAndPortalLens__factory_1 = require("../typechain/factories/contracts/Peripheral/Lens/TriggersAndPortalLens__factory");
11
+ function connectToTradingFloorLens(provider, address) {
12
+ return TradingFloorLens__factory_1.TradingFloorLens__factory.connect(address, provider);
13
+ }
14
+ function connectToLeXLens(provider, address) {
15
+ return LexLens__factory_1.LexLens__factory.connect(address, provider);
16
+ }
17
+ function connectToIntentsVerifierLens(provider, address) {
18
+ return IntentsVerifierLens__factory_1.IntentsVerifierLens__factory.connect(address, provider);
19
+ }
20
+ function connectToTriggersAndPortalLens(provider, address) {
21
+ return TriggersAndPortalLens__factory_1.TriggersAndPortalLens__factory.connect(address, provider);
22
+ }
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.floatToChipsBn = floatToChipsBn;
4
+ exports.chipsBnToUnits = chipsBnToUnits;
5
+ const scales_1 = require("../constants/scales");
6
+ const bignumbers_1 = require("../utils/bignumbers");
7
+ function floatToChipsBn(value) {
8
+ return (0, bignumbers_1.floatToUnitsBn)(value, scales_1.CHIP_DECIMALS);
9
+ }
10
+ function chipsBnToUnits(chipAmount) {
11
+ return (0, bignumbers_1.unitsBnToFloat)(chipAmount, scales_1.CHIP_DECIMALS);
12
+ }
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.hashContractName = hashContractName;
4
+ const ethers_1 = require("ethers");
5
+ function hashContractName(contractName) {
6
+ const contractNameHash = ethers_1.ethers.solidityPackedKeccak256(["string"], [contractName]);
7
+ return contractNameHash;
8
+ }
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.scaledLeverageToUnits = scaledLeverageToUnits;
4
+ exports.floatUnitsToScaledLeverage = floatUnitsToScaledLeverage;
5
+ exports.calculateLeveragedPosition = calculateLeveragedPosition;
6
+ exports.calculateCollateralFromLeveragedPosition = calculateCollateralFromLeveragedPosition;
7
+ exports.calculateLeveragedPosition_leverageUnits = calculateLeveragedPosition_leverageUnits;
8
+ const scales_1 = require("../constants/scales");
9
+ function scaledLeverageToUnits(scaledLeverage) {
10
+ return scaledLeverage / scales_1.LEVERAGE_MULTIPLIER_SCALE;
11
+ }
12
+ function floatUnitsToScaledLeverage(leverageInUnits) {
13
+ return leverageInUnits * scales_1.LEVERAGE_MULTIPLIER_SCALE;
14
+ }
15
+ function calculateLeveragedPosition(collateral, leverage) {
16
+ return (collateral * BigInt(leverage)) / scales_1.LEVERAGE_UNIT;
17
+ }
18
+ function calculateCollateralFromLeveragedPosition(leveragedPosition, leverage) {
19
+ return (leveragedPosition * scales_1.LEVERAGE_UNIT) / leverage;
20
+ }
21
+ function calculateLeveragedPosition_leverageUnits(collateral, leverageInUnits) {
22
+ // TODO : Change after changing scale
23
+ const leverageBn = floatUnitsToScaledLeverage(leverageInUnits);
24
+ return calculateLeveragedPosition(collateral, leverageBn);
25
+ }
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.precisionBnToFloat = precisionBnToFloat;
4
+ exports.floatToPrecisionBn = floatToPrecisionBn;
5
+ exports.priceBnToFloat = priceBnToFloat;
6
+ exports.floatToPriceBn = floatToPriceBn;
7
+ const scales_1 = require("../constants/scales");
8
+ const bignumbers_1 = require("../utils/bignumbers");
9
+ function precisionBnToFloat(precisionBn) {
10
+ return (0, bignumbers_1.unitsBnToFloat)(precisionBn, Number(scales_1.PRECISION_SCALE));
11
+ }
12
+ function floatToPrecisionBn(value) {
13
+ return (0, bignumbers_1.floatToUnitsBn)(value, Number(scales_1.PRECISION_SCALE));
14
+ }
15
+ function priceBnToFloat(pricesBn) {
16
+ return (0, bignumbers_1.unitsBnToFloat)(pricesBn, scales_1.PRICES_SCALE);
17
+ }
18
+ function floatToPriceBn(priceUnits) {
19
+ return (0, bignumbers_1.floatToUnitsBn)(priceUnits, scales_1.PRICES_SCALE);
20
+ }
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PYTH_PAIRS_PRICE_FEED_IDS = exports.PYTH_PRICE_ENTRIES = exports.PYTH_PRICE_KEYS = void 0;
4
+ const pairIds_1 = require("../../constants/pairIds");
5
+ exports.PYTH_PRICE_KEYS = {
6
+ [pairIds_1.PAIR_CONFIGS_IDS.BTC_USD]: "Crypto.BTC/USD",
7
+ [pairIds_1.PAIR_CONFIGS_IDS.ETH_USD]: "Crypto.ETH/USD",
8
+ [pairIds_1.PAIR_CONFIGS_IDS.BNB_USD]: "Crypto.BNB/USD",
9
+ [pairIds_1.PAIR_CONFIGS_IDS.FTM_USD]: "Crypto.FTM/USD",
10
+ [pairIds_1.PAIR_CONFIGS_IDS.SOL_USD]: "Crypto.SOL/USD",
11
+ [pairIds_1.PAIR_CONFIGS_IDS.FLR_USD]: "Crypto.FLR/USD",
12
+ [pairIds_1.PAIR_CONFIGS_IDS.S_USD]: "Crypto.S/USD",
13
+ // Forex
14
+ [pairIds_1.PAIR_CONFIGS_IDS.EUR_USD]: "Fx.EUR/USD",
15
+ [pairIds_1.PAIR_CONFIGS_IDS.GBP_USD]: "Fx.GBP/USD",
16
+ [pairIds_1.PAIR_CONFIGS_IDS.AUD_USD]: "Fx.AUD/USD",
17
+ [pairIds_1.PAIR_CONFIGS_IDS.NZD_USD]: "Fx.NZD/USD",
18
+ // Reverse Forex
19
+ [pairIds_1.PAIR_CONFIGS_IDS.USD_JPY]: "Fx.USD/JPY",
20
+ [pairIds_1.PAIR_CONFIGS_IDS.USD_CHF]: "Fx.USD/CHF",
21
+ // CAT Mode
22
+ [pairIds_1.PAIR_CONFIGS_IDS.BTC_USD_CAT]: "Crypto.BTC/USD",
23
+ [pairIds_1.PAIR_CONFIGS_IDS.ETH_USD_CAT]: "Crypto.ETH/USD",
24
+ // CAT Mode Forex
25
+ [pairIds_1.PAIR_CONFIGS_IDS.EUR_USD_CAT]: "Fx.EUR/USD",
26
+ [pairIds_1.PAIR_CONFIGS_IDS.GBP_USD_CAT]: "Fx.GBP/USD",
27
+ [pairIds_1.PAIR_CONFIGS_IDS.AUD_USD_CAT]: "Fx.AUD/USD",
28
+ [pairIds_1.PAIR_CONFIGS_IDS.NZD_USD_CAT]: "Fx.NZD/USD",
29
+ [pairIds_1.PAIR_CONFIGS_IDS.USD_JPY_CAT]: "Fx.USD/JPY",
30
+ [pairIds_1.PAIR_CONFIGS_IDS.USD_CHF_CAT]: "Fx.USD/CHF",
31
+ };
32
+ exports.PYTH_PRICE_ENTRIES = Object.entries(exports.PYTH_PRICE_KEYS).map(([stringPariId, stringKey]) => [
33
+ parseFloat(stringPariId),
34
+ stringKey,
35
+ ]);
36
+ // You can find the ids of prices at https://pyth.network/developers/price-feed-ids
37
+ exports.PYTH_PAIRS_PRICE_FEED_IDS = {
38
+ [pairIds_1.PAIR_CONFIGS_IDS.BTC_USD]: "0xe62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43",
39
+ [pairIds_1.PAIR_CONFIGS_IDS.ETH_USD]: "0xff61491a931112ddf1bd8147cd1b641375f79f5825126d665480874634fd0ace",
40
+ [pairIds_1.PAIR_CONFIGS_IDS.BNB_USD]: "0x2f95862b045670cd22bee3114c39763a4a08beeb663b145d283c31d7d1101c4f",
41
+ // [PAIR_CONFIGS_IDS.FTM_USD]: "5c6c0d2386e3352356c3ab84434fafb5ea067ac2678a38a338c4a69ddc4bdb0c",
42
+ // NOTE : Using S instead of deprecated FTM
43
+ [pairIds_1.PAIR_CONFIGS_IDS.FTM_USD]: "0xf490b178d0c85683b7a0f2388b40af2e6f7c90cbe0f96b31f315f08d0e5a2d6d",
44
+ [pairIds_1.PAIR_CONFIGS_IDS.SOL_USD]: "0xef0d8b6fda2ceba41da15d4095d1da392a0d2f8ed0c6c7bc0f4cfac8c280b56d",
45
+ [pairIds_1.PAIR_CONFIGS_IDS.S_USD]: "0xf490b178d0c85683b7a0f2388b40af2e6f7c90cbe0f96b31f315f08d0e5a2d6d",
46
+ [pairIds_1.PAIR_CONFIGS_IDS.EUR_USD]: "0xa995d00bb36a63cef7fd2c287dc105fc8f3d93779f062f09551b0af3e81ec30b",
47
+ [pairIds_1.PAIR_CONFIGS_IDS.GBP_USD]: "0x84c2dde9633d93d1bcad84e7dc41c9d56578b7ec52fabedc1f335d673df0a7c1",
48
+ [pairIds_1.PAIR_CONFIGS_IDS.AUD_USD]: "0x67a6f93030420c1c9e3fe37c1ab6b77966af82f995944a9fefce357a22854a80",
49
+ [pairIds_1.PAIR_CONFIGS_IDS.NZD_USD]: "0x92eea8ba1b00078cdc2ef6f64f091f262e8c7d0576ee4677572f314ebfafa4c7",
50
+ [pairIds_1.PAIR_CONFIGS_IDS.USD_JPY]: "0xef2c98c804ba503c6a707e38be4dfbb16683775f195b091252bf24693042fd52",
51
+ [pairIds_1.PAIR_CONFIGS_IDS.USD_CHF]: "0x0b1e3297e69f162877b577b0d6a47a0d63b2392bc8499e6540da4187a63e28f8",
52
+ // NOTE : CAT pair will have the same price feed id as the non-CAT pair
53
+ [pairIds_1.PAIR_CONFIGS_IDS.BTC_USD_CAT]: "",
54
+ [pairIds_1.PAIR_CONFIGS_IDS.ETH_USD_CAT]: "",
55
+ [pairIds_1.PAIR_CONFIGS_IDS.EUR_USD_CAT]: "",
56
+ [pairIds_1.PAIR_CONFIGS_IDS.GBP_USD_CAT]: "",
57
+ [pairIds_1.PAIR_CONFIGS_IDS.AUD_USD_CAT]: "",
58
+ [pairIds_1.PAIR_CONFIGS_IDS.NZD_USD_CAT]: "",
59
+ [pairIds_1.PAIR_CONFIGS_IDS.USD_JPY_CAT]: "",
60
+ [pairIds_1.PAIR_CONFIGS_IDS.USD_CHF_CAT]: "",
61
+ // Pairs Unsupported by pyth
62
+ [pairIds_1.PAIR_CONFIGS_IDS.FLR_USD]: "",
63
+ };
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getPythFeedIdForPair = getPythFeedIdForPair;
4
+ const pythFeedConstants_1 = require("./pythFeedConstants");
5
+ /**
6
+ * Get the Pyth feed id for a pair
7
+ * @param pairId The pair id
8
+ */
9
+ function getPythFeedIdForPair(pairId) {
10
+ return pythFeedConstants_1.PYTH_PRICE_KEYS[pairId];
11
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });