lynx-client 0.0.1-beta.9 → 0.0.2

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 (326) hide show
  1. package/README.md +392 -3
  2. package/dist/cjs/index.js +8 -0
  3. package/dist/cjs/lib/chains/chainMappings.js +17 -0
  4. package/dist/cjs/lib/constants/contractEnums.js +1 -0
  5. package/dist/cjs/lib/contractsIntegration/IntentsVerifierLensService/IIntentsVerifierLensService.js +15 -0
  6. package/dist/cjs/lib/contractsIntegration/IntentsVerifierLensService/IntentsVerifierLensService.js +42 -0
  7. package/dist/cjs/lib/contractsIntegration/IntentsVerifierLensService/index.js +18 -0
  8. package/dist/cjs/lib/contractsIntegration/LexLensService/ILexLensService.js +137 -0
  9. package/dist/cjs/lib/contractsIntegration/LexLensService/LexLensService.js +250 -0
  10. package/dist/cjs/lib/contractsIntegration/LexLensService/index.js +18 -0
  11. package/dist/cjs/lib/contractsIntegration/OrderBookService/IOrderBookService.js +2 -0
  12. package/dist/cjs/lib/contractsIntegration/OrderBookService/OrderBookService.js +92 -0
  13. package/dist/cjs/lib/contractsIntegration/TradersPortalService/ITradersPortalService.js +2 -0
  14. package/dist/cjs/lib/contractsIntegration/TradersPortalService/TradersPortalServiceService.js +157 -0
  15. package/dist/cjs/lib/contractsIntegration/TradersPortalService/TradersPortalUtils.js +64 -0
  16. package/dist/cjs/lib/contractsIntegration/TradersPortalService/index.js +19 -0
  17. package/dist/cjs/lib/contractsIntegration/TradingFloorLensService/ITradingFloorLensService.js +61 -0
  18. package/dist/cjs/lib/contractsIntegration/TradingFloorLensService/TradingFloorLensService.js +147 -0
  19. package/dist/cjs/lib/contractsIntegration/TradingFloorLensService/index.js +18 -0
  20. package/dist/cjs/lib/contractsIntegration/TradingFloorService/ITradingFloorService.js +2 -0
  21. package/dist/cjs/lib/contractsIntegration/TradingFloorService/TradingFloorService.js +158 -0
  22. package/dist/cjs/lib/contractsIntegration/TriggersAndPortalLensService/ITriggersAndPortalLensService.js +30 -0
  23. package/dist/cjs/lib/contractsIntegration/TriggersAndPortalLensService/TriggersAndPortalLensService.js +58 -0
  24. package/dist/cjs/lib/contractsIntegration/TriggersAndPortalLensService/index.js +18 -0
  25. package/dist/cjs/lib/contractsIntegration/TriggersService/ITriggersService.js +2 -0
  26. package/dist/cjs/lib/contractsIntegration/TriggersService/TriggersService.js +188 -0
  27. package/dist/cjs/lib/contractsIntegration/deployedContractsConnector.js +119 -8
  28. package/dist/cjs/lib/devex/getChainAddresses.js +65 -0
  29. package/dist/cjs/lib/devex/getSupportedEngineChains.js +45 -0
  30. package/dist/cjs/lib/devex/index.js +9 -0
  31. package/dist/cjs/lib/devex/types.js +2 -0
  32. package/dist/cjs/lib/lynxSystem/hashes.js +9 -0
  33. package/dist/cjs/lib/lynxSystem/lynxScalesUtils.js +8 -0
  34. package/dist/cjs/lib/lynxSystem/registry/registryReading.js +38 -0
  35. package/dist/cjs/lib/priceFeeds/pyth/pythFeedConstants.js +1 -2
  36. package/dist/cjs/lib/typechain/contracts/Lynx/OrderBook/OrderBookProxy.js +2 -0
  37. package/dist/cjs/lib/typechain/contracts/Lynx/OrderBook/OrderBookV1.js +2 -0
  38. package/dist/cjs/lib/typechain/contracts/Lynx/Registry/RegistryProxy.js +2 -0
  39. package/dist/cjs/lib/typechain/contracts/Lynx/Registry/RegistryV1.js +2 -0
  40. package/dist/cjs/lib/typechain/contracts/Lynx/TradersPortal/TradersPortalV1.js +2 -0
  41. package/dist/cjs/lib/typechain/contracts/Lynx/TradingFloor/TradingFloorProxy.js +2 -0
  42. package/dist/cjs/lib/typechain/contracts/Lynx/TradingFloor/TradingFloorV1.js +2 -0
  43. package/dist/cjs/lib/typechain/contracts/Lynx/Triggers/TriggersV1.js +2 -0
  44. package/dist/cjs/lib/typechain/factories/contracts/Lynx/OrderBook/OrderBookProxy__factory.js +258 -0
  45. package/dist/cjs/lib/typechain/factories/contracts/Lynx/OrderBook/OrderBookV1__factory.js +539 -0
  46. package/dist/cjs/lib/typechain/factories/contracts/Lynx/Registry/RegistryProxy__factory.js +226 -0
  47. package/dist/cjs/lib/typechain/factories/contracts/Lynx/Registry/RegistryV1__factory.js +1108 -0
  48. package/dist/cjs/lib/typechain/factories/contracts/Lynx/TradersPortal/TradersPortalV1__factory.js +966 -0
  49. package/dist/cjs/lib/typechain/factories/contracts/Lynx/TradingFloor/TradingFloorProxy__factory.js +258 -0
  50. package/dist/cjs/lib/typechain/factories/contracts/Lynx/TradingFloor/TradingFloorV1__factory.js +1774 -0
  51. package/dist/cjs/lib/typechain/factories/contracts/Lynx/Triggers/TriggersV1__factory.js +1459 -0
  52. package/dist/cjs/lib/typechain/factories/contracts/Peripheral/Lens/LexLens__factory.js +1 -1
  53. package/dist/cjs/lib/typechain/factories/contracts/Peripheral/Lens/TradingFloorLens__factory.js +1 -1
  54. package/dist/cjs/lib/typechain/factories/contracts/Peripheral/Lens/TriggersAndPortalLens__factory.js +1 -1
  55. package/dist/cjs/lib/utils/ethersTypes.js +29 -6
  56. package/dist/esm/index.d.ts +7 -0
  57. package/dist/esm/index.d.ts.map +1 -1
  58. package/dist/esm/index.js +8 -0
  59. package/dist/esm/lib/chains/chainMappings.d.ts +13 -0
  60. package/dist/esm/lib/chains/chainMappings.d.ts.map +1 -0
  61. package/dist/esm/lib/chains/chainMappings.js +17 -0
  62. package/dist/esm/lib/chains/chainTypes.d.ts +3 -0
  63. package/dist/esm/lib/chains/chainTypes.d.ts.map +1 -1
  64. package/dist/esm/lib/constants/contractEnums.d.ts.map +1 -1
  65. package/dist/esm/lib/constants/contractEnums.js +1 -0
  66. package/dist/esm/lib/contractsIntegration/IntentsVerifierLensService/IIntentsVerifierLensService.d.ts +20 -0
  67. package/dist/esm/lib/contractsIntegration/IntentsVerifierLensService/IIntentsVerifierLensService.d.ts.map +1 -0
  68. package/dist/esm/lib/contractsIntegration/IntentsVerifierLensService/IIntentsVerifierLensService.js +15 -0
  69. package/dist/esm/lib/contractsIntegration/IntentsVerifierLensService/IntentsVerifierLensService.d.ts +11 -0
  70. package/dist/esm/lib/contractsIntegration/IntentsVerifierLensService/IntentsVerifierLensService.d.ts.map +1 -0
  71. package/dist/esm/lib/contractsIntegration/IntentsVerifierLensService/IntentsVerifierLensService.js +42 -0
  72. package/dist/esm/lib/contractsIntegration/IntentsVerifierLensService/index.d.ts +3 -0
  73. package/dist/esm/lib/contractsIntegration/IntentsVerifierLensService/index.d.ts.map +1 -0
  74. package/dist/esm/lib/contractsIntegration/IntentsVerifierLensService/index.js +18 -0
  75. package/dist/esm/lib/contractsIntegration/LexLensService/ILexLensService.d.ts +85 -0
  76. package/dist/esm/lib/contractsIntegration/LexLensService/ILexLensService.d.ts.map +1 -0
  77. package/dist/esm/lib/contractsIntegration/LexLensService/ILexLensService.js +137 -0
  78. package/dist/esm/lib/contractsIntegration/LexLensService/LexLensService.d.ts +34 -0
  79. package/dist/esm/lib/contractsIntegration/LexLensService/LexLensService.d.ts.map +1 -0
  80. package/dist/esm/lib/contractsIntegration/LexLensService/LexLensService.js +250 -0
  81. package/dist/esm/lib/contractsIntegration/LexLensService/index.d.ts +3 -0
  82. package/dist/esm/lib/contractsIntegration/LexLensService/index.d.ts.map +1 -0
  83. package/dist/esm/lib/contractsIntegration/LexLensService/index.js +18 -0
  84. package/dist/esm/lib/contractsIntegration/OrderBookService/IOrderBookService.d.ts +40 -0
  85. package/dist/esm/lib/contractsIntegration/OrderBookService/IOrderBookService.d.ts.map +1 -0
  86. package/dist/esm/lib/contractsIntegration/OrderBookService/IOrderBookService.js +2 -0
  87. package/dist/esm/lib/contractsIntegration/OrderBookService/OrderBookService.d.ts +12 -0
  88. package/dist/esm/lib/contractsIntegration/OrderBookService/OrderBookService.d.ts.map +1 -0
  89. package/dist/esm/lib/contractsIntegration/OrderBookService/OrderBookService.js +92 -0
  90. package/dist/esm/lib/contractsIntegration/TradersPortalService/ITradersPortalService.d.ts +61 -0
  91. package/dist/esm/lib/contractsIntegration/TradersPortalService/ITradersPortalService.d.ts.map +1 -0
  92. package/dist/esm/lib/contractsIntegration/TradersPortalService/ITradersPortalService.js +2 -0
  93. package/dist/esm/lib/contractsIntegration/TradersPortalService/TradersPortalServiceService.d.ts +14 -0
  94. package/dist/esm/lib/contractsIntegration/TradersPortalService/TradersPortalServiceService.d.ts.map +1 -0
  95. package/dist/esm/lib/contractsIntegration/TradersPortalService/TradersPortalServiceService.js +157 -0
  96. package/dist/esm/lib/contractsIntegration/TradersPortalService/TradersPortalUtils.d.ts +32 -0
  97. package/dist/esm/lib/contractsIntegration/TradersPortalService/TradersPortalUtils.d.ts.map +1 -0
  98. package/dist/esm/lib/contractsIntegration/TradersPortalService/TradersPortalUtils.js +64 -0
  99. package/dist/esm/lib/contractsIntegration/TradersPortalService/index.d.ts +4 -0
  100. package/dist/esm/lib/contractsIntegration/TradersPortalService/index.d.ts.map +1 -0
  101. package/dist/esm/lib/contractsIntegration/TradersPortalService/index.js +19 -0
  102. package/dist/esm/lib/contractsIntegration/TradingFloorLensService/ITradingFloorLensService.d.ts +76 -0
  103. package/dist/esm/lib/contractsIntegration/TradingFloorLensService/ITradingFloorLensService.d.ts.map +1 -0
  104. package/dist/esm/lib/contractsIntegration/TradingFloorLensService/ITradingFloorLensService.js +61 -0
  105. package/dist/esm/lib/contractsIntegration/TradingFloorLensService/TradingFloorLensService.d.ts +16 -0
  106. package/dist/esm/lib/contractsIntegration/TradingFloorLensService/TradingFloorLensService.d.ts.map +1 -0
  107. package/dist/esm/lib/contractsIntegration/TradingFloorLensService/TradingFloorLensService.js +147 -0
  108. package/dist/esm/lib/contractsIntegration/TradingFloorLensService/index.d.ts +3 -0
  109. package/dist/esm/lib/contractsIntegration/TradingFloorLensService/index.d.ts.map +1 -0
  110. package/dist/esm/lib/contractsIntegration/TradingFloorLensService/index.js +18 -0
  111. package/dist/esm/lib/contractsIntegration/TradingFloorService/ITradingFloorService.d.ts +83 -0
  112. package/dist/esm/lib/contractsIntegration/TradingFloorService/ITradingFloorService.d.ts.map +1 -0
  113. package/dist/esm/lib/contractsIntegration/TradingFloorService/ITradingFloorService.js +2 -0
  114. package/dist/esm/lib/contractsIntegration/TradingFloorService/TradingFloorService.d.ts +80 -0
  115. package/dist/esm/lib/contractsIntegration/TradingFloorService/TradingFloorService.d.ts.map +1 -0
  116. package/dist/esm/lib/contractsIntegration/TradingFloorService/TradingFloorService.js +158 -0
  117. package/dist/esm/lib/contractsIntegration/TriggersAndPortalLensService/ITriggersAndPortalLensService.d.ts +33 -0
  118. package/dist/esm/lib/contractsIntegration/TriggersAndPortalLensService/ITriggersAndPortalLensService.d.ts.map +1 -0
  119. package/dist/esm/lib/contractsIntegration/TriggersAndPortalLensService/ITriggersAndPortalLensService.js +30 -0
  120. package/dist/esm/lib/contractsIntegration/TriggersAndPortalLensService/TriggersAndPortalLensService.d.ts +11 -0
  121. package/dist/esm/lib/contractsIntegration/TriggersAndPortalLensService/TriggersAndPortalLensService.d.ts.map +1 -0
  122. package/dist/esm/lib/contractsIntegration/TriggersAndPortalLensService/TriggersAndPortalLensService.js +58 -0
  123. package/dist/esm/lib/contractsIntegration/TriggersAndPortalLensService/index.d.ts +3 -0
  124. package/dist/esm/lib/contractsIntegration/TriggersAndPortalLensService/index.d.ts.map +1 -0
  125. package/dist/esm/lib/contractsIntegration/TriggersAndPortalLensService/index.js +18 -0
  126. package/dist/esm/lib/contractsIntegration/TriggersService/ITriggersService.d.ts +73 -0
  127. package/dist/esm/lib/contractsIntegration/TriggersService/ITriggersService.d.ts.map +1 -0
  128. package/dist/esm/lib/contractsIntegration/TriggersService/ITriggersService.js +2 -0
  129. package/dist/esm/lib/contractsIntegration/TriggersService/TriggersService.d.ts +18 -0
  130. package/dist/esm/lib/contractsIntegration/TriggersService/TriggersService.d.ts.map +1 -0
  131. package/dist/esm/lib/contractsIntegration/TriggersService/TriggersService.js +188 -0
  132. package/dist/esm/lib/contractsIntegration/deployedContractsConnector.d.ts +44 -5
  133. package/dist/esm/lib/contractsIntegration/deployedContractsConnector.d.ts.map +1 -1
  134. package/dist/esm/lib/contractsIntegration/deployedContractsConnector.js +119 -8
  135. package/dist/esm/lib/devex/getChainAddresses.d.ts +20 -0
  136. package/dist/esm/lib/devex/getChainAddresses.d.ts.map +1 -0
  137. package/dist/esm/lib/devex/getChainAddresses.js +65 -0
  138. package/dist/esm/lib/devex/getSupportedEngineChains.d.ts +37 -0
  139. package/dist/esm/lib/devex/getSupportedEngineChains.d.ts.map +1 -0
  140. package/dist/esm/lib/devex/getSupportedEngineChains.js +45 -0
  141. package/dist/esm/lib/devex/index.d.ts +5 -0
  142. package/dist/esm/lib/devex/index.d.ts.map +1 -0
  143. package/dist/esm/lib/devex/index.js +9 -0
  144. package/dist/esm/lib/devex/types.d.ts +20 -0
  145. package/dist/esm/lib/devex/types.d.ts.map +1 -0
  146. package/dist/esm/lib/devex/types.js +2 -0
  147. package/dist/esm/lib/lynxSystem/hashes.d.ts +6 -0
  148. package/dist/esm/lib/lynxSystem/hashes.d.ts.map +1 -1
  149. package/dist/esm/lib/lynxSystem/hashes.js +9 -0
  150. package/dist/esm/lib/lynxSystem/lynxScalesUtils.d.ts +2 -0
  151. package/dist/esm/lib/lynxSystem/lynxScalesUtils.d.ts.map +1 -1
  152. package/dist/esm/lib/lynxSystem/lynxScalesUtils.js +8 -0
  153. package/dist/esm/lib/lynxSystem/registry/registryReading.d.ts +9 -0
  154. package/dist/esm/lib/lynxSystem/registry/registryReading.d.ts.map +1 -0
  155. package/dist/esm/lib/lynxSystem/registry/registryReading.js +38 -0
  156. package/dist/esm/lib/priceFeeds/pyth/pythFeedConstants.d.ts.map +1 -1
  157. package/dist/esm/lib/priceFeeds/pyth/pythFeedConstants.js +1 -2
  158. package/dist/esm/lib/typechain/common.d.ts.map +1 -1
  159. package/dist/esm/lib/typechain/contracts/Lynx/OrderBook/OrderBookProxy.d.ts +151 -0
  160. package/dist/esm/lib/typechain/contracts/Lynx/OrderBook/OrderBookProxy.d.ts.map +1 -0
  161. package/dist/esm/lib/typechain/contracts/Lynx/OrderBook/OrderBookProxy.js +2 -0
  162. package/dist/esm/lib/typechain/contracts/Lynx/OrderBook/OrderBookV1.d.ts +268 -0
  163. package/dist/esm/lib/typechain/contracts/Lynx/OrderBook/OrderBookV1.d.ts.map +1 -0
  164. package/dist/esm/lib/typechain/contracts/Lynx/OrderBook/OrderBookV1.js +2 -0
  165. package/dist/esm/lib/typechain/contracts/Lynx/Registry/RegistryProxy.d.ts +143 -0
  166. package/dist/esm/lib/typechain/contracts/Lynx/Registry/RegistryProxy.d.ts.map +1 -0
  167. package/dist/esm/lib/typechain/contracts/Lynx/Registry/RegistryProxy.js +2 -0
  168. package/dist/esm/lib/typechain/contracts/Lynx/Registry/RegistryV1.d.ts +603 -0
  169. package/dist/esm/lib/typechain/contracts/Lynx/Registry/RegistryV1.d.ts.map +1 -0
  170. package/dist/esm/lib/typechain/contracts/Lynx/Registry/RegistryV1.js +2 -0
  171. package/dist/esm/lib/typechain/contracts/Lynx/TradersPortal/TradersPortalV1.d.ts +571 -0
  172. package/dist/esm/lib/typechain/contracts/Lynx/TradersPortal/TradersPortalV1.d.ts.map +1 -0
  173. package/dist/esm/lib/typechain/contracts/Lynx/TradersPortal/TradersPortalV1.js +2 -0
  174. package/dist/esm/lib/typechain/contracts/Lynx/TradingFloor/TradingFloorProxy.d.ts +151 -0
  175. package/dist/esm/lib/typechain/contracts/Lynx/TradingFloor/TradingFloorProxy.d.ts.map +1 -0
  176. package/dist/esm/lib/typechain/contracts/Lynx/TradingFloor/TradingFloorProxy.js +2 -0
  177. package/dist/esm/lib/typechain/contracts/Lynx/TradingFloor/TradingFloorV1.d.ts +1160 -0
  178. package/dist/esm/lib/typechain/contracts/Lynx/TradingFloor/TradingFloorV1.d.ts.map +1 -0
  179. package/dist/esm/lib/typechain/contracts/Lynx/TradingFloor/TradingFloorV1.js +2 -0
  180. package/dist/esm/lib/typechain/contracts/Lynx/Triggers/TriggersV1.d.ts +977 -0
  181. package/dist/esm/lib/typechain/contracts/Lynx/Triggers/TriggersV1.d.ts.map +1 -0
  182. package/dist/esm/lib/typechain/contracts/Lynx/Triggers/TriggersV1.js +2 -0
  183. package/dist/esm/lib/typechain/contracts/Peripheral/Lens/TradingFloorLens.d.ts +1 -3
  184. package/dist/esm/lib/typechain/contracts/Peripheral/Lens/TradingFloorLens.d.ts.map +1 -1
  185. package/dist/esm/lib/typechain/factories/contracts/Lynx/OrderBook/OrderBookProxy__factory.d.ts +193 -0
  186. package/dist/esm/lib/typechain/factories/contracts/Lynx/OrderBook/OrderBookProxy__factory.d.ts.map +1 -0
  187. package/dist/esm/lib/typechain/factories/contracts/Lynx/OrderBook/OrderBookProxy__factory.js +258 -0
  188. package/dist/esm/lib/typechain/factories/contracts/Lynx/OrderBook/OrderBookV1__factory.d.ts +407 -0
  189. package/dist/esm/lib/typechain/factories/contracts/Lynx/OrderBook/OrderBookV1__factory.d.ts.map +1 -0
  190. package/dist/esm/lib/typechain/factories/contracts/Lynx/OrderBook/OrderBookV1__factory.js +539 -0
  191. package/dist/esm/lib/typechain/factories/contracts/Lynx/Registry/RegistryProxy__factory.d.ts +169 -0
  192. package/dist/esm/lib/typechain/factories/contracts/Lynx/Registry/RegistryProxy__factory.d.ts.map +1 -0
  193. package/dist/esm/lib/typechain/factories/contracts/Lynx/Registry/RegistryProxy__factory.js +226 -0
  194. package/dist/esm/lib/typechain/factories/contracts/Lynx/Registry/RegistryV1__factory.d.ts +841 -0
  195. package/dist/esm/lib/typechain/factories/contracts/Lynx/Registry/RegistryV1__factory.d.ts.map +1 -0
  196. package/dist/esm/lib/typechain/factories/contracts/Lynx/Registry/RegistryV1__factory.js +1108 -0
  197. package/dist/esm/lib/typechain/factories/contracts/Lynx/TradersPortal/TradersPortalV1__factory.d.ts +745 -0
  198. package/dist/esm/lib/typechain/factories/contracts/Lynx/TradersPortal/TradersPortalV1__factory.d.ts.map +1 -0
  199. package/dist/esm/lib/typechain/factories/contracts/Lynx/TradersPortal/TradersPortalV1__factory.js +966 -0
  200. package/dist/esm/lib/typechain/factories/contracts/Lynx/TradingFloor/TradingFloorProxy__factory.d.ts +193 -0
  201. package/dist/esm/lib/typechain/factories/contracts/Lynx/TradingFloor/TradingFloorProxy__factory.d.ts.map +1 -0
  202. package/dist/esm/lib/typechain/factories/contracts/Lynx/TradingFloor/TradingFloorProxy__factory.js +258 -0
  203. package/dist/esm/lib/typechain/factories/contracts/Lynx/TradingFloor/TradingFloorV1__factory.d.ts +1374 -0
  204. package/dist/esm/lib/typechain/factories/contracts/Lynx/TradingFloor/TradingFloorV1__factory.d.ts.map +1 -0
  205. package/dist/esm/lib/typechain/factories/contracts/Lynx/TradingFloor/TradingFloorV1__factory.js +1774 -0
  206. package/dist/esm/lib/typechain/factories/contracts/Lynx/Triggers/TriggersV1__factory.d.ts +1135 -0
  207. package/dist/esm/lib/typechain/factories/contracts/Lynx/Triggers/TriggersV1__factory.d.ts.map +1 -0
  208. package/dist/esm/lib/typechain/factories/contracts/Lynx/Triggers/TriggersV1__factory.js +1459 -0
  209. package/dist/esm/lib/typechain/factories/contracts/Peripheral/Lens/LexLens__factory.d.ts +1 -1
  210. package/dist/esm/lib/typechain/factories/contracts/Peripheral/Lens/LexLens__factory.js +1 -1
  211. package/dist/esm/lib/typechain/factories/contracts/Peripheral/Lens/TradingFloorLens__factory.d.ts +1 -1
  212. package/dist/esm/lib/typechain/factories/contracts/Peripheral/Lens/TradingFloorLens__factory.js +1 -1
  213. package/dist/esm/lib/typechain/factories/contracts/Peripheral/Lens/TriggersAndPortalLens__factory.d.ts +1 -1
  214. package/dist/esm/lib/typechain/factories/contracts/Peripheral/Lens/TriggersAndPortalLens__factory.js +1 -1
  215. package/dist/esm/lib/utils/ethersTypes.d.ts +2 -2
  216. package/dist/esm/lib/utils/ethersTypes.d.ts.map +1 -1
  217. package/dist/esm/lib/utils/ethersTypes.js +29 -6
  218. package/dist/types/index.d.ts +7 -0
  219. package/dist/types/index.d.ts.map +1 -1
  220. package/dist/types/lib/chains/chainMappings.d.ts +13 -0
  221. package/dist/types/lib/chains/chainMappings.d.ts.map +1 -0
  222. package/dist/types/lib/chains/chainTypes.d.ts +3 -0
  223. package/dist/types/lib/chains/chainTypes.d.ts.map +1 -1
  224. package/dist/types/lib/constants/contractEnums.d.ts.map +1 -1
  225. package/dist/types/lib/contractsIntegration/IntentsVerifierLensService/IIntentsVerifierLensService.d.ts +20 -0
  226. package/dist/types/lib/contractsIntegration/IntentsVerifierLensService/IIntentsVerifierLensService.d.ts.map +1 -0
  227. package/dist/types/lib/contractsIntegration/IntentsVerifierLensService/IntentsVerifierLensService.d.ts +11 -0
  228. package/dist/types/lib/contractsIntegration/IntentsVerifierLensService/IntentsVerifierLensService.d.ts.map +1 -0
  229. package/dist/types/lib/contractsIntegration/IntentsVerifierLensService/index.d.ts +3 -0
  230. package/dist/types/lib/contractsIntegration/IntentsVerifierLensService/index.d.ts.map +1 -0
  231. package/dist/types/lib/contractsIntegration/LexLensService/ILexLensService.d.ts +85 -0
  232. package/dist/types/lib/contractsIntegration/LexLensService/ILexLensService.d.ts.map +1 -0
  233. package/dist/types/lib/contractsIntegration/LexLensService/LexLensService.d.ts +34 -0
  234. package/dist/types/lib/contractsIntegration/LexLensService/LexLensService.d.ts.map +1 -0
  235. package/dist/types/lib/contractsIntegration/LexLensService/index.d.ts +3 -0
  236. package/dist/types/lib/contractsIntegration/LexLensService/index.d.ts.map +1 -0
  237. package/dist/types/lib/contractsIntegration/OrderBookService/IOrderBookService.d.ts +40 -0
  238. package/dist/types/lib/contractsIntegration/OrderBookService/IOrderBookService.d.ts.map +1 -0
  239. package/dist/types/lib/contractsIntegration/OrderBookService/OrderBookService.d.ts +12 -0
  240. package/dist/types/lib/contractsIntegration/OrderBookService/OrderBookService.d.ts.map +1 -0
  241. package/dist/types/lib/contractsIntegration/TradersPortalService/ITradersPortalService.d.ts +61 -0
  242. package/dist/types/lib/contractsIntegration/TradersPortalService/ITradersPortalService.d.ts.map +1 -0
  243. package/dist/types/lib/contractsIntegration/TradersPortalService/TradersPortalServiceService.d.ts +14 -0
  244. package/dist/types/lib/contractsIntegration/TradersPortalService/TradersPortalServiceService.d.ts.map +1 -0
  245. package/dist/types/lib/contractsIntegration/TradersPortalService/TradersPortalUtils.d.ts +32 -0
  246. package/dist/types/lib/contractsIntegration/TradersPortalService/TradersPortalUtils.d.ts.map +1 -0
  247. package/dist/types/lib/contractsIntegration/TradersPortalService/index.d.ts +4 -0
  248. package/dist/types/lib/contractsIntegration/TradersPortalService/index.d.ts.map +1 -0
  249. package/dist/types/lib/contractsIntegration/TradingFloorLensService/ITradingFloorLensService.d.ts +76 -0
  250. package/dist/types/lib/contractsIntegration/TradingFloorLensService/ITradingFloorLensService.d.ts.map +1 -0
  251. package/dist/types/lib/contractsIntegration/TradingFloorLensService/TradingFloorLensService.d.ts +16 -0
  252. package/dist/types/lib/contractsIntegration/TradingFloorLensService/TradingFloorLensService.d.ts.map +1 -0
  253. package/dist/types/lib/contractsIntegration/TradingFloorLensService/index.d.ts +3 -0
  254. package/dist/types/lib/contractsIntegration/TradingFloorLensService/index.d.ts.map +1 -0
  255. package/dist/types/lib/contractsIntegration/TradingFloorService/ITradingFloorService.d.ts +83 -0
  256. package/dist/types/lib/contractsIntegration/TradingFloorService/ITradingFloorService.d.ts.map +1 -0
  257. package/dist/types/lib/contractsIntegration/TradingFloorService/TradingFloorService.d.ts +80 -0
  258. package/dist/types/lib/contractsIntegration/TradingFloorService/TradingFloorService.d.ts.map +1 -0
  259. package/dist/types/lib/contractsIntegration/TriggersAndPortalLensService/ITriggersAndPortalLensService.d.ts +33 -0
  260. package/dist/types/lib/contractsIntegration/TriggersAndPortalLensService/ITriggersAndPortalLensService.d.ts.map +1 -0
  261. package/dist/types/lib/contractsIntegration/TriggersAndPortalLensService/TriggersAndPortalLensService.d.ts +11 -0
  262. package/dist/types/lib/contractsIntegration/TriggersAndPortalLensService/TriggersAndPortalLensService.d.ts.map +1 -0
  263. package/dist/types/lib/contractsIntegration/TriggersAndPortalLensService/index.d.ts +3 -0
  264. package/dist/types/lib/contractsIntegration/TriggersAndPortalLensService/index.d.ts.map +1 -0
  265. package/dist/types/lib/contractsIntegration/TriggersService/ITriggersService.d.ts +73 -0
  266. package/dist/types/lib/contractsIntegration/TriggersService/ITriggersService.d.ts.map +1 -0
  267. package/dist/types/lib/contractsIntegration/TriggersService/TriggersService.d.ts +18 -0
  268. package/dist/types/lib/contractsIntegration/TriggersService/TriggersService.d.ts.map +1 -0
  269. package/dist/types/lib/contractsIntegration/deployedContractsConnector.d.ts +44 -5
  270. package/dist/types/lib/contractsIntegration/deployedContractsConnector.d.ts.map +1 -1
  271. package/dist/types/lib/devex/getChainAddresses.d.ts +20 -0
  272. package/dist/types/lib/devex/getChainAddresses.d.ts.map +1 -0
  273. package/dist/types/lib/devex/getSupportedEngineChains.d.ts +37 -0
  274. package/dist/types/lib/devex/getSupportedEngineChains.d.ts.map +1 -0
  275. package/dist/types/lib/devex/index.d.ts +5 -0
  276. package/dist/types/lib/devex/index.d.ts.map +1 -0
  277. package/dist/types/lib/devex/types.d.ts +20 -0
  278. package/dist/types/lib/devex/types.d.ts.map +1 -0
  279. package/dist/types/lib/lynxSystem/hashes.d.ts +6 -0
  280. package/dist/types/lib/lynxSystem/hashes.d.ts.map +1 -1
  281. package/dist/types/lib/lynxSystem/lynxScalesUtils.d.ts +2 -0
  282. package/dist/types/lib/lynxSystem/lynxScalesUtils.d.ts.map +1 -1
  283. package/dist/types/lib/lynxSystem/registry/registryReading.d.ts +9 -0
  284. package/dist/types/lib/lynxSystem/registry/registryReading.d.ts.map +1 -0
  285. package/dist/types/lib/priceFeeds/pyth/pythFeedConstants.d.ts.map +1 -1
  286. package/dist/types/lib/typechain/common.d.ts.map +1 -1
  287. package/dist/types/lib/typechain/contracts/Lynx/OrderBook/OrderBookProxy.d.ts +151 -0
  288. package/dist/types/lib/typechain/contracts/Lynx/OrderBook/OrderBookProxy.d.ts.map +1 -0
  289. package/dist/types/lib/typechain/contracts/Lynx/OrderBook/OrderBookV1.d.ts +268 -0
  290. package/dist/types/lib/typechain/contracts/Lynx/OrderBook/OrderBookV1.d.ts.map +1 -0
  291. package/dist/types/lib/typechain/contracts/Lynx/Registry/RegistryProxy.d.ts +143 -0
  292. package/dist/types/lib/typechain/contracts/Lynx/Registry/RegistryProxy.d.ts.map +1 -0
  293. package/dist/types/lib/typechain/contracts/Lynx/Registry/RegistryV1.d.ts +603 -0
  294. package/dist/types/lib/typechain/contracts/Lynx/Registry/RegistryV1.d.ts.map +1 -0
  295. package/dist/types/lib/typechain/contracts/Lynx/TradersPortal/TradersPortalV1.d.ts +571 -0
  296. package/dist/types/lib/typechain/contracts/Lynx/TradersPortal/TradersPortalV1.d.ts.map +1 -0
  297. package/dist/types/lib/typechain/contracts/Lynx/TradingFloor/TradingFloorProxy.d.ts +151 -0
  298. package/dist/types/lib/typechain/contracts/Lynx/TradingFloor/TradingFloorProxy.d.ts.map +1 -0
  299. package/dist/types/lib/typechain/contracts/Lynx/TradingFloor/TradingFloorV1.d.ts +1160 -0
  300. package/dist/types/lib/typechain/contracts/Lynx/TradingFloor/TradingFloorV1.d.ts.map +1 -0
  301. package/dist/types/lib/typechain/contracts/Lynx/Triggers/TriggersV1.d.ts +977 -0
  302. package/dist/types/lib/typechain/contracts/Lynx/Triggers/TriggersV1.d.ts.map +1 -0
  303. package/dist/types/lib/typechain/contracts/Peripheral/Lens/TradingFloorLens.d.ts +1 -3
  304. package/dist/types/lib/typechain/contracts/Peripheral/Lens/TradingFloorLens.d.ts.map +1 -1
  305. package/dist/types/lib/typechain/factories/contracts/Lynx/OrderBook/OrderBookProxy__factory.d.ts +193 -0
  306. package/dist/types/lib/typechain/factories/contracts/Lynx/OrderBook/OrderBookProxy__factory.d.ts.map +1 -0
  307. package/dist/types/lib/typechain/factories/contracts/Lynx/OrderBook/OrderBookV1__factory.d.ts +407 -0
  308. package/dist/types/lib/typechain/factories/contracts/Lynx/OrderBook/OrderBookV1__factory.d.ts.map +1 -0
  309. package/dist/types/lib/typechain/factories/contracts/Lynx/Registry/RegistryProxy__factory.d.ts +169 -0
  310. package/dist/types/lib/typechain/factories/contracts/Lynx/Registry/RegistryProxy__factory.d.ts.map +1 -0
  311. package/dist/types/lib/typechain/factories/contracts/Lynx/Registry/RegistryV1__factory.d.ts +841 -0
  312. package/dist/types/lib/typechain/factories/contracts/Lynx/Registry/RegistryV1__factory.d.ts.map +1 -0
  313. package/dist/types/lib/typechain/factories/contracts/Lynx/TradersPortal/TradersPortalV1__factory.d.ts +745 -0
  314. package/dist/types/lib/typechain/factories/contracts/Lynx/TradersPortal/TradersPortalV1__factory.d.ts.map +1 -0
  315. package/dist/types/lib/typechain/factories/contracts/Lynx/TradingFloor/TradingFloorProxy__factory.d.ts +193 -0
  316. package/dist/types/lib/typechain/factories/contracts/Lynx/TradingFloor/TradingFloorProxy__factory.d.ts.map +1 -0
  317. package/dist/types/lib/typechain/factories/contracts/Lynx/TradingFloor/TradingFloorV1__factory.d.ts +1374 -0
  318. package/dist/types/lib/typechain/factories/contracts/Lynx/TradingFloor/TradingFloorV1__factory.d.ts.map +1 -0
  319. package/dist/types/lib/typechain/factories/contracts/Lynx/Triggers/TriggersV1__factory.d.ts +1135 -0
  320. package/dist/types/lib/typechain/factories/contracts/Lynx/Triggers/TriggersV1__factory.d.ts.map +1 -0
  321. package/dist/types/lib/typechain/factories/contracts/Peripheral/Lens/LexLens__factory.d.ts +1 -1
  322. package/dist/types/lib/typechain/factories/contracts/Peripheral/Lens/TradingFloorLens__factory.d.ts +1 -1
  323. package/dist/types/lib/typechain/factories/contracts/Peripheral/Lens/TriggersAndPortalLens__factory.d.ts +1 -1
  324. package/dist/types/lib/utils/ethersTypes.d.ts +2 -2
  325. package/dist/types/lib/utils/ethersTypes.d.ts.map +1 -1
  326. package/package.json +7 -7
@@ -0,0 +1,250 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LexLensService = void 0;
4
+ const LexLens__factory_1 = require("../../typechain/factories/contracts/Peripheral/Lens/LexLens__factory");
5
+ const ethersTypes_1 = require("../../utils/ethersTypes");
6
+ const ILexLensService_1 = require("./ILexLensService");
7
+ class LexLensService {
8
+ constructor(signerOrProvider, contractAddress) {
9
+ this.contract = LexLens__factory_1.LexLens__factory.connect(contractAddress, signerOrProvider);
10
+ }
11
+ async getAllFeeConfigurationsInLex(lexPool) {
12
+ const result = await this.contract.getAllFeeConfigurationsInLex(lexPool);
13
+ // First convert array, then handle special number conversions
14
+ const baseArray = (0, ethersTypes_1.ethersStructResponseToArray)(result, ILexLensService_1.EMPTY_FEE_CONFIGS_LENS);
15
+ return baseArray.map(item => ({
16
+ ...item,
17
+ feeId: Number(item.feeId),
18
+ openFeeF: Number(item.openFeeF),
19
+ closeFeeF: Number(item.closeFeeF),
20
+ performanceFeeF: Number(item.performanceFeeF),
21
+ }));
22
+ }
23
+ async getAllGroupConfigurationsInLex(lexPool) {
24
+ const result = await this.contract.getAllGroupConfigurationsInLex(lexPool);
25
+ const baseArray = (0, ethersTypes_1.ethersStructResponseToArray)(result, ILexLensService_1.EMPTY_GROUP_CONFIGS_LENS);
26
+ return baseArray.map(item => ({
27
+ ...item,
28
+ groupId: Number(item.groupId),
29
+ maxBorrowF: Number(item.maxBorrowF),
30
+ }));
31
+ }
32
+ async getAllGroupStateInLex(lexPool) {
33
+ const result = await this.contract.getAllGroupStateInLex(lexPool);
34
+ const baseArray = (0, ethersTypes_1.ethersStructResponseToArray)(result, ILexLensService_1.EMPTY_LEX_GROUP_STATE_LENS);
35
+ return baseArray.map(item => ({
36
+ ...item,
37
+ groupId: Number(item.groupId),
38
+ }));
39
+ }
40
+ async getAllPairAndGroupAndFeeConfigurationsInLex(lexPool) {
41
+ return await this.contract.getAllPairAndGroupAndFeeConfigurationsInLex(lexPool);
42
+ }
43
+ async getAllPairConfigurationsInLex(lexPool) {
44
+ const result = await this.contract.getAllPairConfigurationsInLex(lexPool);
45
+ const baseArray = (0, ethersTypes_1.ethersStructResponseToArray)(result, ILexLensService_1.EMPTY_PAIR_CONFIGS_LENS);
46
+ return baseArray.map(item => ({
47
+ ...item,
48
+ pairId: Number(item.pairId),
49
+ groupId: Number(item.groupId),
50
+ feeId: Number(item.feeId),
51
+ }));
52
+ }
53
+ async getAllPairStateInLex(lexPool) {
54
+ const result = await this.contract.getAllPairStateInLex(lexPool);
55
+ const baseArray = (0, ethersTypes_1.ethersStructResponseToArray)(result, ILexLensService_1.EMPTY_LEX_PAIR_STATE_LENS);
56
+ return baseArray.map(item => ({
57
+ ...item,
58
+ pairId: Number(item.pairId),
59
+ }));
60
+ }
61
+ async getCompleteConfigsForLex(pool) {
62
+ const result = await this.contract.getCompleteConfigsForLex(pool);
63
+ const baseResult = (0, ethersTypes_1.ethersStructResponseToObject)(result, ILexLensService_1.EMPTY_COMPLETE_LEX_CONFIGS, {
64
+ groupsConfigs: ILexLensService_1.EMPTY_GROUP_CONFIGS_LENS,
65
+ pairsConfigs: ILexLensService_1.EMPTY_PAIR_CONFIGS_LENS,
66
+ feesConfigs: ILexLensService_1.EMPTY_FEE_CONFIGS_LENS,
67
+ }, {
68
+ lexPoolParams: ILexLensService_1.EMPTY_LEX_POOL_LENS_PARAMS,
69
+ lexPoolConfigurations: ILexLensService_1.EMPTY_LEX_POOL_LENS_CONFIGS,
70
+ poolAccountantConfigurations: ILexLensService_1.EMPTY_POOL_ACCOUNTANT_CONFIGURATIONS_LENS,
71
+ });
72
+ // Apply number conversions
73
+ return {
74
+ ...baseResult,
75
+ groupsConfigs: baseResult.groupsConfigs.map(item => ({
76
+ ...item,
77
+ groupId: Number(item.groupId),
78
+ maxBorrowF: Number(item.maxBorrowF),
79
+ })),
80
+ pairsConfigs: baseResult.pairsConfigs.map(item => ({
81
+ ...item,
82
+ pairId: Number(item.pairId),
83
+ groupId: Number(item.groupId),
84
+ feeId: Number(item.feeId),
85
+ })),
86
+ feesConfigs: baseResult.feesConfigs.map(item => ({
87
+ ...item,
88
+ feeId: Number(item.feeId),
89
+ openFeeF: Number(item.openFeeF),
90
+ closeFeeF: Number(item.closeFeeF),
91
+ performanceFeeF: Number(item.performanceFeeF),
92
+ })),
93
+ };
94
+ }
95
+ async getCompleteConfigsForLexes(pools) {
96
+ const results = await this.contract.getCompleteConfigsForLexes(pools);
97
+ return results.map(result => this.convertCompleteConfigsResult(result));
98
+ }
99
+ async getCompleteStateForLex(pool) {
100
+ const result = await this.contract.getCompleteStateForLex(pool);
101
+ const baseResult = (0, ethersTypes_1.ethersStructResponseToObject)(result, ILexLensService_1.EMPTY_COMPLETE_LEX_STATE, {
102
+ pairsStates: ILexLensService_1.EMPTY_LEX_PAIR_STATE_LENS,
103
+ groupsStates: ILexLensService_1.EMPTY_LEX_GROUP_STATE_LENS,
104
+ }, {
105
+ lexPoolState: ILexLensService_1.EMPTY_LEX_POOL_LENS_STATE,
106
+ poolAccountantState: ILexLensService_1.EMPTY_POOL_ACCOUNTANT_STATE_LENS,
107
+ });
108
+ // Apply number conversions
109
+ return {
110
+ ...baseResult,
111
+ pairsStates: baseResult.pairsStates.map(item => ({
112
+ ...item,
113
+ pairId: Number(item.pairId),
114
+ })),
115
+ groupsStates: baseResult.groupsStates.map(item => ({
116
+ ...item,
117
+ groupId: Number(item.groupId),
118
+ })),
119
+ };
120
+ }
121
+ async getCompleteStateForLexes(pools) {
122
+ const results = await this.contract.getCompleteStateForLexes(pools);
123
+ return results.map(result => {
124
+ const baseResult = (0, ethersTypes_1.ethersStructResponseToObject)(result, ILexLensService_1.EMPTY_COMPLETE_LEX_STATE, {
125
+ pairsStates: ILexLensService_1.EMPTY_LEX_PAIR_STATE_LENS,
126
+ groupsStates: ILexLensService_1.EMPTY_LEX_GROUP_STATE_LENS,
127
+ }, {
128
+ lexPoolState: ILexLensService_1.EMPTY_LEX_POOL_LENS_STATE,
129
+ poolAccountantState: ILexLensService_1.EMPTY_POOL_ACCOUNTANT_STATE_LENS,
130
+ });
131
+ // Apply number conversions
132
+ return {
133
+ ...baseResult,
134
+ pairsStates: baseResult.pairsStates.map(item => ({
135
+ ...item,
136
+ pairId: Number(item.pairId),
137
+ })),
138
+ groupsStates: baseResult.groupsStates.map(item => ({
139
+ ...item,
140
+ groupId: Number(item.groupId),
141
+ })),
142
+ };
143
+ });
144
+ }
145
+ async getLExPoolForPoolAccountant(accountant) {
146
+ return await this.contract.getLExPoolForPoolAccountant(accountant);
147
+ }
148
+ async getLexPairState(lexPool, pairId) {
149
+ const result = await this.contract.getLexPairState(lexPool, BigInt(pairId));
150
+ const baseObj = (0, ethersTypes_1.ethersStructResponseToObject)(result, ILexLensService_1.EMPTY_LEX_PAIR_STATE_LENS);
151
+ return {
152
+ ...baseObj,
153
+ pairId: Number(baseObj.pairId),
154
+ };
155
+ }
156
+ async getLexPoolConfigs(lexPool) {
157
+ const result = await this.contract.getLexPoolConfigs(lexPool);
158
+ return (0, ethersTypes_1.ethersStructResponseToObject)(result, ILexLensService_1.EMPTY_LEX_POOL_LENS_CONFIGS);
159
+ }
160
+ async getLexPoolParams(lexPool) {
161
+ const result = await this.contract.getLexPoolParams(lexPool);
162
+ return (0, ethersTypes_1.ethersStructResponseToObject)(result, ILexLensService_1.EMPTY_LEX_POOL_LENS_PARAMS);
163
+ }
164
+ async getLexPoolState(lexPool) {
165
+ const result = await this.contract.getLexPoolState(lexPool);
166
+ return (0, ethersTypes_1.ethersStructResponseToObject)(result, ILexLensService_1.EMPTY_LEX_POOL_LENS_STATE);
167
+ }
168
+ async getLexPoolSupplierState(lexPool, supplier) {
169
+ const result = await this.contract.getLexPoolSupplierState(lexPool, supplier);
170
+ return (0, ethersTypes_1.ethersStructResponseToObject)(result, ILexLensService_1.EMPTY_LEX_POOL_SUPPLIER_LENS_STATE, {
171
+ pendingEpochDeposits: ILexLensService_1.EMPTY_PENDING_EPOCH_DEPOSIT,
172
+ pendingEpochRedeems: ILexLensService_1.EMPTY_PENDING_EPOCH_REDEEM,
173
+ });
174
+ }
175
+ async getLexPoolsStateAll(lexPools) {
176
+ const results = await this.contract.getLexPoolsStateAll(lexPools);
177
+ return (0, ethersTypes_1.ethersStructResponseToArray)(results, ILexLensService_1.EMPTY_LEX_POOL_LENS_STATE);
178
+ }
179
+ async getPoolAccountantConfigurationsByPool(lexPool) {
180
+ const result = await this.contract.getPoolAccountantConfigurationsByPool(lexPool);
181
+ return (0, ethersTypes_1.ethersStructResponseToObject)(result, ILexLensService_1.EMPTY_POOL_ACCOUNTANT_CONFIGURATIONS_LENS);
182
+ }
183
+ async getPoolAccountantConfigurationsByPoolAll(lexPools) {
184
+ const results = await this.contract.getPoolAccountantConfigurationsByPoolAll(lexPools);
185
+ return (0, ethersTypes_1.ethersStructResponseToArray)(results, ILexLensService_1.EMPTY_POOL_ACCOUNTANT_CONFIGURATIONS_LENS);
186
+ }
187
+ async getPoolAccountantForLexPool(lexPool) {
188
+ return await this.contract.getPoolAccountantForLexPool(lexPool);
189
+ }
190
+ async getPoolAccountantStateByPool(lexPool) {
191
+ const result = await this.contract.getPoolAccountantStateByPool(lexPool);
192
+ return (0, ethersTypes_1.ethersStructResponseToObject)(result, ILexLensService_1.EMPTY_POOL_ACCOUNTANT_STATE_LENS);
193
+ }
194
+ async getPoolAccountantStateByPoolAll(lexPools) {
195
+ const results = await this.contract.getPoolAccountantStateByPoolAll(lexPools);
196
+ return (0, ethersTypes_1.ethersStructResponseToArray)(results, ILexLensService_1.EMPTY_POOL_ACCOUNTANT_STATE_LENS);
197
+ }
198
+ async getSupplierCurrentStateAll(lexPools, supplier) {
199
+ const results = await this.contract.getSupplierCurrentStateAll(lexPools, supplier);
200
+ return (0, ethersTypes_1.ethersStructResponseToArray)(results, ILexLensService_1.EMPTY_LEX_POOL_SUPPLIER_LENS_STATE, {
201
+ pendingEpochDeposits: ILexLensService_1.EMPTY_PENDING_EPOCH_DEPOSIT,
202
+ pendingEpochRedeems: ILexLensService_1.EMPTY_PENDING_EPOCH_REDEEM,
203
+ });
204
+ }
205
+ async tradesValuesMultiplePairs(accountant, pairsTrades) {
206
+ // @ts-ignore
207
+ const results = await this.contract.tradesValuesMultiplePairs.staticCall(accountant, pairsTrades);
208
+ return results.map(pairResults => (0, ethersTypes_1.ethersStructResponseToArray)(pairResults, ILexLensService_1.EMPTY_SINGLE_POSITION_OUTPUT));
209
+ }
210
+ async tradesValuesSinglePair(accountant, pairParams) {
211
+ // @ts-ignore
212
+ const results = await this.contract.tradesValuesSinglePair.staticCall(accountant, pairParams);
213
+ return (0, ethersTypes_1.ethersStructResponseToArray)(results, ILexLensService_1.EMPTY_SINGLE_POSITION_OUTPUT);
214
+ }
215
+ // Helper methods
216
+ convertCompleteConfigsResult(result) {
217
+ const baseResult = (0, ethersTypes_1.ethersStructResponseToObject)(result, ILexLensService_1.EMPTY_COMPLETE_LEX_CONFIGS, {
218
+ groupsConfigs: ILexLensService_1.EMPTY_GROUP_CONFIGS_LENS,
219
+ pairsConfigs: ILexLensService_1.EMPTY_PAIR_CONFIGS_LENS,
220
+ feesConfigs: ILexLensService_1.EMPTY_FEE_CONFIGS_LENS,
221
+ }, {
222
+ lexPoolParams: ILexLensService_1.EMPTY_LEX_POOL_LENS_PARAMS,
223
+ lexPoolConfigurations: ILexLensService_1.EMPTY_LEX_POOL_LENS_CONFIGS,
224
+ poolAccountantConfigurations: ILexLensService_1.EMPTY_POOL_ACCOUNTANT_CONFIGURATIONS_LENS,
225
+ });
226
+ // Apply number conversions
227
+ return {
228
+ ...baseResult,
229
+ groupsConfigs: baseResult.groupsConfigs.map(item => ({
230
+ ...item,
231
+ groupId: Number(item.groupId),
232
+ maxBorrowF: Number(item.maxBorrowF),
233
+ })),
234
+ pairsConfigs: baseResult.pairsConfigs.map(item => ({
235
+ ...item,
236
+ pairId: Number(item.pairId),
237
+ groupId: Number(item.groupId),
238
+ feeId: Number(item.feeId),
239
+ })),
240
+ feesConfigs: baseResult.feesConfigs.map(item => ({
241
+ ...item,
242
+ feeId: Number(item.feeId),
243
+ openFeeF: Number(item.openFeeF),
244
+ closeFeeF: Number(item.closeFeeF),
245
+ performanceFeeF: Number(item.performanceFeeF),
246
+ })),
247
+ };
248
+ }
249
+ }
250
+ exports.LexLensService = LexLensService;
@@ -0,0 +1,18 @@
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("./ILexLensService"), exports);
18
+ __exportStar(require("./LexLensService"), exports);
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,92 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OrderBookService = void 0;
4
+ const OrderBookV1__factory_1 = require("../../typechain/factories/contracts/Lynx/OrderBook/OrderBookV1__factory");
5
+ class OrderManagement {
6
+ constructor(orderBookContract) {
7
+ this.orderBookContract = orderBookContract;
8
+ }
9
+ async getAllPendingUpdateOrderIds() {
10
+ return this.orderBookContract.getAllPendingUpdateOrderIds();
11
+ }
12
+ async allPendingUpdateOrderIds(index) {
13
+ return this.orderBookContract.allPendingUpdateOrderIds(index);
14
+ }
15
+ async pendingUpdateTradeFieldOrdersById(positionId) {
16
+ return this.orderBookContract.pendingUpdateTradeFieldOrdersById(positionId);
17
+ }
18
+ async readAndDeleteUpdatePositionOrder(positionId) {
19
+ return this.orderBookContract.readAndDeleteUpdatePositionOrder(positionId);
20
+ }
21
+ async storeUpdatePositionDoubleFieldOrder(positionId, orderType, fieldValueA, fieldValueB) {
22
+ return this.orderBookContract.storeUpdatePositionDoubleFieldOrder(positionId, orderType, fieldValueA, fieldValueB);
23
+ }
24
+ async storeUpdatePositionSingleFieldOrder(positionId, orderType, fieldValue) {
25
+ return this.orderBookContract.storeUpdatePositionSingleFieldOrder(positionId, orderType, fieldValue);
26
+ }
27
+ async updateOrderIdPositionInList(positionId) {
28
+ return this.orderBookContract.updateOrderIdPositionInList(positionId);
29
+ }
30
+ }
31
+ class ContractInfo {
32
+ constructor(orderBookContract) {
33
+ this.orderBookContract = orderBookContract;
34
+ }
35
+ async registry() {
36
+ return this.orderBookContract.registry();
37
+ }
38
+ async tradingFloor() {
39
+ return this.orderBookContract.tradingFloor();
40
+ }
41
+ async admin() {
42
+ return this.orderBookContract.admin();
43
+ }
44
+ async pendingAdmin() {
45
+ return this.orderBookContract.pendingAdmin();
46
+ }
47
+ async implementation() {
48
+ return this.orderBookContract.implementation();
49
+ }
50
+ async pendingImplementation() {
51
+ return this.orderBookContract.pendingImplementation();
52
+ }
53
+ }
54
+ class Administration {
55
+ constructor(orderBookContract) {
56
+ this.orderBookContract = orderBookContract;
57
+ }
58
+ async setTradingFloor(tradingFloor) {
59
+ return this.orderBookContract.setTradingFloor(tradingFloor);
60
+ }
61
+ async _become(orderBookProxy) {
62
+ return this.orderBookContract._become(orderBookProxy);
63
+ }
64
+ }
65
+ class Constants {
66
+ constructor(orderBookContract) {
67
+ this.orderBookContract = orderBookContract;
68
+ }
69
+ async ACCURACY_IMPROVEMENT_SCALE() {
70
+ return this.orderBookContract.ACCURACY_IMPROVEMENT_SCALE();
71
+ }
72
+ async FRACTION_SCALE() {
73
+ return this.orderBookContract.FRACTION_SCALE();
74
+ }
75
+ async LEVERAGE_SCALE() {
76
+ return this.orderBookContract.LEVERAGE_SCALE();
77
+ }
78
+ async PRECISION() {
79
+ return this.orderBookContract.PRECISION();
80
+ }
81
+ }
82
+ class OrderBookService {
83
+ constructor(address, signerOrProvider) {
84
+ this.signerOrProvider = signerOrProvider;
85
+ this.orderBookContract = OrderBookV1__factory_1.OrderBookV1__factory.connect(address, signerOrProvider);
86
+ this.orderManagement = new OrderManagement(this.orderBookContract);
87
+ this.contractInfo = new ContractInfo(this.orderBookContract);
88
+ this.administration = new Administration(this.orderBookContract);
89
+ this.constants = new Constants(this.orderBookContract);
90
+ }
91
+ }
92
+ exports.OrderBookService = OrderBookService;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,157 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TradersPortalServiceService = void 0;
4
+ const contractEnums_1 = require("../../constants/contractEnums");
5
+ const TradersPortalV1__factory_1 = require("../../typechain/factories/contracts/Lynx/TradersPortal/TradersPortalV1__factory");
6
+ class TraderRequests {
7
+ constructor(tradingContract) {
8
+ this.tradingContract = tradingContract;
9
+ }
10
+ async openNewPosition(tradeRequestIdentifier, tradeRequestParams, orderType, referrerDomain, referrerCode, runCapTests, nativeFee, staticCall = false) {
11
+ if (staticCall) {
12
+ // @ts-ignore
13
+ return this.tradingContract.traderRequest_openNewPosition.staticCall(tradeRequestIdentifier, tradeRequestParams, orderType, referrerDomain, referrerCode, runCapTests, {
14
+ value: nativeFee,
15
+ });
16
+ }
17
+ else {
18
+ return this.tradingContract.traderRequest_openNewPosition(tradeRequestIdentifier, tradeRequestParams, orderType, referrerDomain, referrerCode, runCapTests, {
19
+ value: nativeFee,
20
+ });
21
+ }
22
+ }
23
+ async setExistingPositionToMarketClose(positionId, minPrice, maxPrice, nativeFee) {
24
+ return this.tradingContract.traderRequest_marketClosePosition(positionId, minPrice, maxPrice, {
25
+ value: nativeFee,
26
+ });
27
+ }
28
+ async updatePositionSingleField(positionId, orderType, fieldValue, nativeFee) {
29
+ return this.tradingContract.traderRequest_updatePositionSingleField(positionId, orderType, fieldValue, {
30
+ value: nativeFee,
31
+ });
32
+ }
33
+ async updatePositionDoubleFieldTpAndSl(positionId, tpValue, slValue, nativeFee) {
34
+ return this.tradingContract.traderRequest_updatePositionDoubleField(positionId, contractEnums_1.UpdatePositionFieldOrderTypeEnums.UPDATE_TP_AND_SL, tpValue, slValue, {
35
+ value: nativeFee,
36
+ });
37
+ }
38
+ }
39
+ class DirectActions {
40
+ constructor(tradingContract) {
41
+ this.tradingContract = tradingContract;
42
+ }
43
+ async timeoutOpenMarket(positionId) {
44
+ return this.tradingContract.directAction_timeout_openMarket(positionId);
45
+ }
46
+ async timeoutCloseMarket(positionId) {
47
+ return this.tradingContract.directAction_timeout_closeMarket(positionId);
48
+ }
49
+ async cancelPendingPositionLimit(positionId) {
50
+ return this.tradingContract.directAction_cancelPendingPosition_limit(positionId);
51
+ }
52
+ async cancelPendingUpdatePositionField(positionId) {
53
+ return this.tradingContract.directAction_timeout_updateTradeField(positionId);
54
+ }
55
+ async updatePendingPositionLimit(positionId, minPrice, maxPrice, tp, sl) {
56
+ return this.tradingContract.directAction_updatePendingPosition_limit(positionId, minPrice, maxPrice, tp, sl);
57
+ }
58
+ }
59
+ class ContractInfo {
60
+ constructor(tradingContract) {
61
+ this.tradingContract = tradingContract;
62
+ }
63
+ async getContractName() {
64
+ return this.tradingContract.getContractName();
65
+ }
66
+ async getContractVersion() {
67
+ return this.tradingContract.getContractVersion();
68
+ }
69
+ async getOrderBook() {
70
+ return this.tradingContract.getOrderBook();
71
+ }
72
+ async getTradeIntentsVerifier() {
73
+ return this.tradingContract.getTradeIntentsVerifier();
74
+ }
75
+ async registry() {
76
+ return this.tradingContract.registry();
77
+ }
78
+ async tradingFloor() {
79
+ return this.tradingContract.tradingFloor();
80
+ }
81
+ async admin() {
82
+ return this.tradingContract.admin();
83
+ }
84
+ async pendingAdmin() {
85
+ return this.tradingContract.pendingAdmin();
86
+ }
87
+ }
88
+ class Status {
89
+ constructor(tradingContract) {
90
+ this.tradingContract = tradingContract;
91
+ }
92
+ async isDone() {
93
+ return this.tradingContract.isDone();
94
+ }
95
+ async isLimitingMarketClosePriceRange() {
96
+ return this.tradingContract.isLimitingMarketClosePriceRange();
97
+ }
98
+ async isPaused() {
99
+ return this.tradingContract.isPaused();
100
+ }
101
+ }
102
+ class Settings {
103
+ constructor(tradingContract) {
104
+ this.tradingContract = tradingContract;
105
+ }
106
+ async limitOrdersTimelock() {
107
+ return this.tradingContract.limitOrdersTimelock();
108
+ }
109
+ async marketOrdersTimeout() {
110
+ return this.tradingContract.marketOrdersTimeout();
111
+ }
112
+ async minLiveTimeForMarketClose() {
113
+ return this.tradingContract.minLiveTimeForMarketClose();
114
+ }
115
+ async actionFees(actionType) {
116
+ return this.tradingContract.actionFees(actionType);
117
+ }
118
+ }
119
+ class Constants {
120
+ constructor(tradingContract) {
121
+ this.tradingContract = tradingContract;
122
+ }
123
+ async ACCURACY_IMPROVEMENT_SCALE() {
124
+ return this.tradingContract.ACCURACY_IMPROVEMENT_SCALE();
125
+ }
126
+ async CONTRACT_NAME() {
127
+ return this.tradingContract.CONTRACT_NAME();
128
+ }
129
+ async CONTRACT_VERSION() {
130
+ return this.tradingContract.CONTRACT_VERSION();
131
+ }
132
+ async FRACTION_SCALE() {
133
+ return this.tradingContract.FRACTION_SCALE();
134
+ }
135
+ async LEVERAGE_SCALE() {
136
+ return this.tradingContract.LEVERAGE_SCALE();
137
+ }
138
+ async NATIVE_UNDERLYING_ADDRESS() {
139
+ return this.tradingContract.NATIVE_UNDERLYING_ADDRESS();
140
+ }
141
+ async PRECISION() {
142
+ return this.tradingContract.PRECISION();
143
+ }
144
+ }
145
+ class TradersPortalServiceService {
146
+ constructor(address, signerOrProvider) {
147
+ this.signerOrProvider = signerOrProvider;
148
+ this.tradingContract = TradersPortalV1__factory_1.TradersPortalV1__factory.connect(address, signerOrProvider);
149
+ this.traderRequests = new TraderRequests(this.tradingContract);
150
+ this.directActions = new DirectActions(this.tradingContract);
151
+ this.contractInfo = new ContractInfo(this.tradingContract);
152
+ this.status = new Status(this.tradingContract);
153
+ this.settings = new Settings(this.tradingContract);
154
+ this.constants = new Constants(this.tradingContract);
155
+ }
156
+ }
157
+ exports.TradersPortalServiceService = TradersPortalServiceService;
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.buildPositionRequestIdentifier = buildPositionRequestIdentifier;
4
+ exports.buildPositionRequestParams = buildPositionRequestParams;
5
+ const leverageCalculationsUtils_1 = require("../../lynxSystem/leverageCalculationsUtils");
6
+ const chipsCalculationsUtils_1 = require("../../lynxSystem/chipsCalculationsUtils");
7
+ const lynxScalesUtils_1 = require("../../lynxSystem/lynxScalesUtils");
8
+ /**
9
+ * Builds a position request identifier struct from human-readable values
10
+ * @param params Human-readable position request identifier parameters
11
+ * @returns TPositionRequestIdentifierStruct ready for contract interaction
12
+ */
13
+ function buildPositionRequestIdentifier(params) {
14
+ return {
15
+ trader: params.trader,
16
+ pairId: BigInt(params.pairId),
17
+ settlementAsset: params.settlementAsset,
18
+ positionIndex: BigInt(params.positionIndex),
19
+ };
20
+ }
21
+ /**
22
+ * Builds a position request params struct from human-readable values
23
+ * @param params Human-readable position request parameters
24
+ * @returns TPositionRequestParamsStruct ready for contract interaction
25
+ * @throws Error if both price-based and fraction-based TP/SL are provided
26
+ */
27
+ function buildPositionRequestParams(params) {
28
+ // Validate that only one type of TP is provided
29
+ if (params.takeProfit && params.takeProfitByFraction) {
30
+ throw new Error("Cannot specify both takeProfit and takeProfitByFraction. Please use only one.");
31
+ }
32
+ // Validate that only one type of SL is provided
33
+ if (params.stopLoss && params.stopLossByFraction) {
34
+ throw new Error("Cannot specify both stopLoss and stopLossByFraction. Please use only one.");
35
+ }
36
+ // Convert collateral from human-readable to chips (18 decimals)
37
+ const collateralBn = (0, chipsCalculationsUtils_1.floatToChipsBn)(params.collateral);
38
+ // Convert leverage from human-readable (e.g., 65) to scaled (65 * 100 = 6500)
39
+ const leverageBn = BigInt((0, leverageCalculationsUtils_1.floatUnitsToScaledLeverage)(params.leverage));
40
+ // Convert prices from human-readable to scaled (8 decimals)
41
+ const minPriceBn = (0, lynxScalesUtils_1.floatToPriceBn)(params.minPrice);
42
+ const maxPriceBn = (0, lynxScalesUtils_1.floatToPriceBn)(params.maxPrice);
43
+ // Convert optional take profit and stop loss prices
44
+ const tpBn = params.takeProfit ? (0, lynxScalesUtils_1.floatToPriceBn)(params.takeProfit) : 0n;
45
+ const slBn = params.stopLoss ? (0, lynxScalesUtils_1.floatToPriceBn)(params.stopLoss) : 0n;
46
+ // Convert optional fractions (e.g., 0.05 for 5%) to scaled (5 decimals: 0.05 * 100000 = 5000)
47
+ const tpByFractionBn = params.takeProfitByFraction
48
+ ? (0, lynxScalesUtils_1.floatToFractionBn)(params.takeProfitByFraction)
49
+ : 0n;
50
+ const slByFractionBn = params.stopLossByFraction
51
+ ? (0, lynxScalesUtils_1.floatToFractionBn)(params.stopLossByFraction)
52
+ : 0n;
53
+ return {
54
+ long: params.isLong,
55
+ collateral: collateralBn,
56
+ leverage: leverageBn,
57
+ minPrice: minPriceBn,
58
+ maxPrice: maxPriceBn,
59
+ tp: tpBn,
60
+ sl: slBn,
61
+ tpByFraction: tpByFractionBn,
62
+ slByFraction: slByFractionBn,
63
+ };
64
+ }
@@ -0,0 +1,19 @@
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("./ITradersPortalService"), exports);
18
+ __exportStar(require("./TradersPortalServiceService"), exports);
19
+ __exportStar(require("./TradersPortalUtils"), exports);
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EMPTY_TRADE_PARAMS = exports.EMPTY_LIQUIDATION_RESULT = exports.EMPTY_POSITION_LIQUIDATION_INFO = exports.EMPTY_POSITIONS_RESULT = exports.EMPTY_COMPLETE_POSITION_DATA = void 0;
4
+ // Empty struct constants for ethersStructResponseToObject
5
+ exports.EMPTY_COMPLETE_POSITION_DATA = {
6
+ id: "",
7
+ settlementAsset: "",
8
+ trader: "",
9
+ pairId: 0,
10
+ positionIndex: 0,
11
+ collateral: 0n,
12
+ phase: 0,
13
+ inPhaseSince: 0,
14
+ leverage: 0,
15
+ long: false,
16
+ openPrice: 0,
17
+ spreadReductionF: 0,
18
+ minPrice: 0,
19
+ maxPrice: 0,
20
+ tpLastUpdated: 0,
21
+ slLastUpdated: 0,
22
+ tp: 0,
23
+ sl: 0,
24
+ pendingUpdateOrderType: 0,
25
+ pendingUpdateOrderTimestamp: 0,
26
+ pendingUpdateOrderFieldAValue: 0n,
27
+ pendingUpdateOrderFieldBValue: 0n,
28
+ funding: 0n,
29
+ borrowInterest: 0n,
30
+ liquidationPrice: 0,
31
+ };
32
+ exports.EMPTY_POSITIONS_RESULT = {
33
+ positions: [],
34
+ positionsCount: 0,
35
+ settlementAssetsLastIndex: 0,
36
+ pairIdsLastIndex: 0,
37
+ pairTraderLastIndex: 0,
38
+ done: false,
39
+ };
40
+ exports.EMPTY_POSITION_LIQUIDATION_INFO = {
41
+ id: "",
42
+ phase: 0,
43
+ funding: 0n,
44
+ borrowInterest: 0n,
45
+ liquidationPrice: 0,
46
+ };
47
+ exports.EMPTY_LIQUIDATION_RESULT = {
48
+ positionsLiquidationInfo: [],
49
+ positionsCount: 0,
50
+ settlementAssetsLastIndex: 0,
51
+ pairIdsLastIndex: 0,
52
+ pairTraderLastIndex: 0,
53
+ positionLastIndex: 0,
54
+ done: false,
55
+ };
56
+ exports.EMPTY_TRADE_PARAMS = {
57
+ tradingFloor: "",
58
+ maxTradesPerPair: 0,
59
+ maxSlF: 0,
60
+ maxSanityProfitF: 0,
61
+ };