lynx-client 0.0.1-beta.8 → 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 (328) 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 +2 -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 +1 -0
  65. package/dist/esm/lib/constants/contractEnums.d.ts.map +1 -1
  66. package/dist/esm/lib/constants/contractEnums.js +2 -0
  67. package/dist/esm/lib/contractsIntegration/IntentsVerifierLensService/IIntentsVerifierLensService.d.ts +20 -0
  68. package/dist/esm/lib/contractsIntegration/IntentsVerifierLensService/IIntentsVerifierLensService.d.ts.map +1 -0
  69. package/dist/esm/lib/contractsIntegration/IntentsVerifierLensService/IIntentsVerifierLensService.js +15 -0
  70. package/dist/esm/lib/contractsIntegration/IntentsVerifierLensService/IntentsVerifierLensService.d.ts +11 -0
  71. package/dist/esm/lib/contractsIntegration/IntentsVerifierLensService/IntentsVerifierLensService.d.ts.map +1 -0
  72. package/dist/esm/lib/contractsIntegration/IntentsVerifierLensService/IntentsVerifierLensService.js +42 -0
  73. package/dist/esm/lib/contractsIntegration/IntentsVerifierLensService/index.d.ts +3 -0
  74. package/dist/esm/lib/contractsIntegration/IntentsVerifierLensService/index.d.ts.map +1 -0
  75. package/dist/esm/lib/contractsIntegration/IntentsVerifierLensService/index.js +18 -0
  76. package/dist/esm/lib/contractsIntegration/LexLensService/ILexLensService.d.ts +85 -0
  77. package/dist/esm/lib/contractsIntegration/LexLensService/ILexLensService.d.ts.map +1 -0
  78. package/dist/esm/lib/contractsIntegration/LexLensService/ILexLensService.js +137 -0
  79. package/dist/esm/lib/contractsIntegration/LexLensService/LexLensService.d.ts +34 -0
  80. package/dist/esm/lib/contractsIntegration/LexLensService/LexLensService.d.ts.map +1 -0
  81. package/dist/esm/lib/contractsIntegration/LexLensService/LexLensService.js +250 -0
  82. package/dist/esm/lib/contractsIntegration/LexLensService/index.d.ts +3 -0
  83. package/dist/esm/lib/contractsIntegration/LexLensService/index.d.ts.map +1 -0
  84. package/dist/esm/lib/contractsIntegration/LexLensService/index.js +18 -0
  85. package/dist/esm/lib/contractsIntegration/OrderBookService/IOrderBookService.d.ts +40 -0
  86. package/dist/esm/lib/contractsIntegration/OrderBookService/IOrderBookService.d.ts.map +1 -0
  87. package/dist/esm/lib/contractsIntegration/OrderBookService/IOrderBookService.js +2 -0
  88. package/dist/esm/lib/contractsIntegration/OrderBookService/OrderBookService.d.ts +12 -0
  89. package/dist/esm/lib/contractsIntegration/OrderBookService/OrderBookService.d.ts.map +1 -0
  90. package/dist/esm/lib/contractsIntegration/OrderBookService/OrderBookService.js +92 -0
  91. package/dist/esm/lib/contractsIntegration/TradersPortalService/ITradersPortalService.d.ts +61 -0
  92. package/dist/esm/lib/contractsIntegration/TradersPortalService/ITradersPortalService.d.ts.map +1 -0
  93. package/dist/esm/lib/contractsIntegration/TradersPortalService/ITradersPortalService.js +2 -0
  94. package/dist/esm/lib/contractsIntegration/TradersPortalService/TradersPortalServiceService.d.ts +14 -0
  95. package/dist/esm/lib/contractsIntegration/TradersPortalService/TradersPortalServiceService.d.ts.map +1 -0
  96. package/dist/esm/lib/contractsIntegration/TradersPortalService/TradersPortalServiceService.js +157 -0
  97. package/dist/esm/lib/contractsIntegration/TradersPortalService/TradersPortalUtils.d.ts +32 -0
  98. package/dist/esm/lib/contractsIntegration/TradersPortalService/TradersPortalUtils.d.ts.map +1 -0
  99. package/dist/esm/lib/contractsIntegration/TradersPortalService/TradersPortalUtils.js +64 -0
  100. package/dist/esm/lib/contractsIntegration/TradersPortalService/index.d.ts +4 -0
  101. package/dist/esm/lib/contractsIntegration/TradersPortalService/index.d.ts.map +1 -0
  102. package/dist/esm/lib/contractsIntegration/TradersPortalService/index.js +19 -0
  103. package/dist/esm/lib/contractsIntegration/TradingFloorLensService/ITradingFloorLensService.d.ts +76 -0
  104. package/dist/esm/lib/contractsIntegration/TradingFloorLensService/ITradingFloorLensService.d.ts.map +1 -0
  105. package/dist/esm/lib/contractsIntegration/TradingFloorLensService/ITradingFloorLensService.js +61 -0
  106. package/dist/esm/lib/contractsIntegration/TradingFloorLensService/TradingFloorLensService.d.ts +16 -0
  107. package/dist/esm/lib/contractsIntegration/TradingFloorLensService/TradingFloorLensService.d.ts.map +1 -0
  108. package/dist/esm/lib/contractsIntegration/TradingFloorLensService/TradingFloorLensService.js +147 -0
  109. package/dist/esm/lib/contractsIntegration/TradingFloorLensService/index.d.ts +3 -0
  110. package/dist/esm/lib/contractsIntegration/TradingFloorLensService/index.d.ts.map +1 -0
  111. package/dist/esm/lib/contractsIntegration/TradingFloorLensService/index.js +18 -0
  112. package/dist/esm/lib/contractsIntegration/TradingFloorService/ITradingFloorService.d.ts +83 -0
  113. package/dist/esm/lib/contractsIntegration/TradingFloorService/ITradingFloorService.d.ts.map +1 -0
  114. package/dist/esm/lib/contractsIntegration/TradingFloorService/ITradingFloorService.js +2 -0
  115. package/dist/esm/lib/contractsIntegration/TradingFloorService/TradingFloorService.d.ts +80 -0
  116. package/dist/esm/lib/contractsIntegration/TradingFloorService/TradingFloorService.d.ts.map +1 -0
  117. package/dist/esm/lib/contractsIntegration/TradingFloorService/TradingFloorService.js +158 -0
  118. package/dist/esm/lib/contractsIntegration/TriggersAndPortalLensService/ITriggersAndPortalLensService.d.ts +33 -0
  119. package/dist/esm/lib/contractsIntegration/TriggersAndPortalLensService/ITriggersAndPortalLensService.d.ts.map +1 -0
  120. package/dist/esm/lib/contractsIntegration/TriggersAndPortalLensService/ITriggersAndPortalLensService.js +30 -0
  121. package/dist/esm/lib/contractsIntegration/TriggersAndPortalLensService/TriggersAndPortalLensService.d.ts +11 -0
  122. package/dist/esm/lib/contractsIntegration/TriggersAndPortalLensService/TriggersAndPortalLensService.d.ts.map +1 -0
  123. package/dist/esm/lib/contractsIntegration/TriggersAndPortalLensService/TriggersAndPortalLensService.js +58 -0
  124. package/dist/esm/lib/contractsIntegration/TriggersAndPortalLensService/index.d.ts +3 -0
  125. package/dist/esm/lib/contractsIntegration/TriggersAndPortalLensService/index.d.ts.map +1 -0
  126. package/dist/esm/lib/contractsIntegration/TriggersAndPortalLensService/index.js +18 -0
  127. package/dist/esm/lib/contractsIntegration/TriggersService/ITriggersService.d.ts +73 -0
  128. package/dist/esm/lib/contractsIntegration/TriggersService/ITriggersService.d.ts.map +1 -0
  129. package/dist/esm/lib/contractsIntegration/TriggersService/ITriggersService.js +2 -0
  130. package/dist/esm/lib/contractsIntegration/TriggersService/TriggersService.d.ts +18 -0
  131. package/dist/esm/lib/contractsIntegration/TriggersService/TriggersService.d.ts.map +1 -0
  132. package/dist/esm/lib/contractsIntegration/TriggersService/TriggersService.js +188 -0
  133. package/dist/esm/lib/contractsIntegration/deployedContractsConnector.d.ts +44 -5
  134. package/dist/esm/lib/contractsIntegration/deployedContractsConnector.d.ts.map +1 -1
  135. package/dist/esm/lib/contractsIntegration/deployedContractsConnector.js +119 -8
  136. package/dist/esm/lib/devex/getChainAddresses.d.ts +20 -0
  137. package/dist/esm/lib/devex/getChainAddresses.d.ts.map +1 -0
  138. package/dist/esm/lib/devex/getChainAddresses.js +65 -0
  139. package/dist/esm/lib/devex/getSupportedEngineChains.d.ts +37 -0
  140. package/dist/esm/lib/devex/getSupportedEngineChains.d.ts.map +1 -0
  141. package/dist/esm/lib/devex/getSupportedEngineChains.js +45 -0
  142. package/dist/esm/lib/devex/index.d.ts +5 -0
  143. package/dist/esm/lib/devex/index.d.ts.map +1 -0
  144. package/dist/esm/lib/devex/index.js +9 -0
  145. package/dist/esm/lib/devex/types.d.ts +20 -0
  146. package/dist/esm/lib/devex/types.d.ts.map +1 -0
  147. package/dist/esm/lib/devex/types.js +2 -0
  148. package/dist/esm/lib/lynxSystem/hashes.d.ts +6 -0
  149. package/dist/esm/lib/lynxSystem/hashes.d.ts.map +1 -1
  150. package/dist/esm/lib/lynxSystem/hashes.js +9 -0
  151. package/dist/esm/lib/lynxSystem/lynxScalesUtils.d.ts +2 -0
  152. package/dist/esm/lib/lynxSystem/lynxScalesUtils.d.ts.map +1 -1
  153. package/dist/esm/lib/lynxSystem/lynxScalesUtils.js +8 -0
  154. package/dist/esm/lib/lynxSystem/registry/registryReading.d.ts +9 -0
  155. package/dist/esm/lib/lynxSystem/registry/registryReading.d.ts.map +1 -0
  156. package/dist/esm/lib/lynxSystem/registry/registryReading.js +38 -0
  157. package/dist/esm/lib/priceFeeds/pyth/pythFeedConstants.d.ts.map +1 -1
  158. package/dist/esm/lib/priceFeeds/pyth/pythFeedConstants.js +1 -2
  159. package/dist/esm/lib/typechain/common.d.ts.map +1 -1
  160. package/dist/esm/lib/typechain/contracts/Lynx/OrderBook/OrderBookProxy.d.ts +151 -0
  161. package/dist/esm/lib/typechain/contracts/Lynx/OrderBook/OrderBookProxy.d.ts.map +1 -0
  162. package/dist/esm/lib/typechain/contracts/Lynx/OrderBook/OrderBookProxy.js +2 -0
  163. package/dist/esm/lib/typechain/contracts/Lynx/OrderBook/OrderBookV1.d.ts +268 -0
  164. package/dist/esm/lib/typechain/contracts/Lynx/OrderBook/OrderBookV1.d.ts.map +1 -0
  165. package/dist/esm/lib/typechain/contracts/Lynx/OrderBook/OrderBookV1.js +2 -0
  166. package/dist/esm/lib/typechain/contracts/Lynx/Registry/RegistryProxy.d.ts +143 -0
  167. package/dist/esm/lib/typechain/contracts/Lynx/Registry/RegistryProxy.d.ts.map +1 -0
  168. package/dist/esm/lib/typechain/contracts/Lynx/Registry/RegistryProxy.js +2 -0
  169. package/dist/esm/lib/typechain/contracts/Lynx/Registry/RegistryV1.d.ts +603 -0
  170. package/dist/esm/lib/typechain/contracts/Lynx/Registry/RegistryV1.d.ts.map +1 -0
  171. package/dist/esm/lib/typechain/contracts/Lynx/Registry/RegistryV1.js +2 -0
  172. package/dist/esm/lib/typechain/contracts/Lynx/TradersPortal/TradersPortalV1.d.ts +571 -0
  173. package/dist/esm/lib/typechain/contracts/Lynx/TradersPortal/TradersPortalV1.d.ts.map +1 -0
  174. package/dist/esm/lib/typechain/contracts/Lynx/TradersPortal/TradersPortalV1.js +2 -0
  175. package/dist/esm/lib/typechain/contracts/Lynx/TradingFloor/TradingFloorProxy.d.ts +151 -0
  176. package/dist/esm/lib/typechain/contracts/Lynx/TradingFloor/TradingFloorProxy.d.ts.map +1 -0
  177. package/dist/esm/lib/typechain/contracts/Lynx/TradingFloor/TradingFloorProxy.js +2 -0
  178. package/dist/esm/lib/typechain/contracts/Lynx/TradingFloor/TradingFloorV1.d.ts +1160 -0
  179. package/dist/esm/lib/typechain/contracts/Lynx/TradingFloor/TradingFloorV1.d.ts.map +1 -0
  180. package/dist/esm/lib/typechain/contracts/Lynx/TradingFloor/TradingFloorV1.js +2 -0
  181. package/dist/esm/lib/typechain/contracts/Lynx/Triggers/TriggersV1.d.ts +977 -0
  182. package/dist/esm/lib/typechain/contracts/Lynx/Triggers/TriggersV1.d.ts.map +1 -0
  183. package/dist/esm/lib/typechain/contracts/Lynx/Triggers/TriggersV1.js +2 -0
  184. package/dist/esm/lib/typechain/contracts/Peripheral/Lens/TradingFloorLens.d.ts +1 -3
  185. package/dist/esm/lib/typechain/contracts/Peripheral/Lens/TradingFloorLens.d.ts.map +1 -1
  186. package/dist/esm/lib/typechain/factories/contracts/Lynx/OrderBook/OrderBookProxy__factory.d.ts +193 -0
  187. package/dist/esm/lib/typechain/factories/contracts/Lynx/OrderBook/OrderBookProxy__factory.d.ts.map +1 -0
  188. package/dist/esm/lib/typechain/factories/contracts/Lynx/OrderBook/OrderBookProxy__factory.js +258 -0
  189. package/dist/esm/lib/typechain/factories/contracts/Lynx/OrderBook/OrderBookV1__factory.d.ts +407 -0
  190. package/dist/esm/lib/typechain/factories/contracts/Lynx/OrderBook/OrderBookV1__factory.d.ts.map +1 -0
  191. package/dist/esm/lib/typechain/factories/contracts/Lynx/OrderBook/OrderBookV1__factory.js +539 -0
  192. package/dist/esm/lib/typechain/factories/contracts/Lynx/Registry/RegistryProxy__factory.d.ts +169 -0
  193. package/dist/esm/lib/typechain/factories/contracts/Lynx/Registry/RegistryProxy__factory.d.ts.map +1 -0
  194. package/dist/esm/lib/typechain/factories/contracts/Lynx/Registry/RegistryProxy__factory.js +226 -0
  195. package/dist/esm/lib/typechain/factories/contracts/Lynx/Registry/RegistryV1__factory.d.ts +841 -0
  196. package/dist/esm/lib/typechain/factories/contracts/Lynx/Registry/RegistryV1__factory.d.ts.map +1 -0
  197. package/dist/esm/lib/typechain/factories/contracts/Lynx/Registry/RegistryV1__factory.js +1108 -0
  198. package/dist/esm/lib/typechain/factories/contracts/Lynx/TradersPortal/TradersPortalV1__factory.d.ts +745 -0
  199. package/dist/esm/lib/typechain/factories/contracts/Lynx/TradersPortal/TradersPortalV1__factory.d.ts.map +1 -0
  200. package/dist/esm/lib/typechain/factories/contracts/Lynx/TradersPortal/TradersPortalV1__factory.js +966 -0
  201. package/dist/esm/lib/typechain/factories/contracts/Lynx/TradingFloor/TradingFloorProxy__factory.d.ts +193 -0
  202. package/dist/esm/lib/typechain/factories/contracts/Lynx/TradingFloor/TradingFloorProxy__factory.d.ts.map +1 -0
  203. package/dist/esm/lib/typechain/factories/contracts/Lynx/TradingFloor/TradingFloorProxy__factory.js +258 -0
  204. package/dist/esm/lib/typechain/factories/contracts/Lynx/TradingFloor/TradingFloorV1__factory.d.ts +1374 -0
  205. package/dist/esm/lib/typechain/factories/contracts/Lynx/TradingFloor/TradingFloorV1__factory.d.ts.map +1 -0
  206. package/dist/esm/lib/typechain/factories/contracts/Lynx/TradingFloor/TradingFloorV1__factory.js +1774 -0
  207. package/dist/esm/lib/typechain/factories/contracts/Lynx/Triggers/TriggersV1__factory.d.ts +1135 -0
  208. package/dist/esm/lib/typechain/factories/contracts/Lynx/Triggers/TriggersV1__factory.d.ts.map +1 -0
  209. package/dist/esm/lib/typechain/factories/contracts/Lynx/Triggers/TriggersV1__factory.js +1459 -0
  210. package/dist/esm/lib/typechain/factories/contracts/Peripheral/Lens/LexLens__factory.d.ts +1 -1
  211. package/dist/esm/lib/typechain/factories/contracts/Peripheral/Lens/LexLens__factory.js +1 -1
  212. package/dist/esm/lib/typechain/factories/contracts/Peripheral/Lens/TradingFloorLens__factory.d.ts +1 -1
  213. package/dist/esm/lib/typechain/factories/contracts/Peripheral/Lens/TradingFloorLens__factory.js +1 -1
  214. package/dist/esm/lib/typechain/factories/contracts/Peripheral/Lens/TriggersAndPortalLens__factory.d.ts +1 -1
  215. package/dist/esm/lib/typechain/factories/contracts/Peripheral/Lens/TriggersAndPortalLens__factory.js +1 -1
  216. package/dist/esm/lib/utils/ethersTypes.d.ts +2 -2
  217. package/dist/esm/lib/utils/ethersTypes.d.ts.map +1 -1
  218. package/dist/esm/lib/utils/ethersTypes.js +29 -6
  219. package/dist/types/index.d.ts +7 -0
  220. package/dist/types/index.d.ts.map +1 -1
  221. package/dist/types/lib/chains/chainMappings.d.ts +13 -0
  222. package/dist/types/lib/chains/chainMappings.d.ts.map +1 -0
  223. package/dist/types/lib/chains/chainTypes.d.ts +3 -0
  224. package/dist/types/lib/chains/chainTypes.d.ts.map +1 -1
  225. package/dist/types/lib/constants/contractEnums.d.ts +1 -0
  226. package/dist/types/lib/constants/contractEnums.d.ts.map +1 -1
  227. package/dist/types/lib/contractsIntegration/IntentsVerifierLensService/IIntentsVerifierLensService.d.ts +20 -0
  228. package/dist/types/lib/contractsIntegration/IntentsVerifierLensService/IIntentsVerifierLensService.d.ts.map +1 -0
  229. package/dist/types/lib/contractsIntegration/IntentsVerifierLensService/IntentsVerifierLensService.d.ts +11 -0
  230. package/dist/types/lib/contractsIntegration/IntentsVerifierLensService/IntentsVerifierLensService.d.ts.map +1 -0
  231. package/dist/types/lib/contractsIntegration/IntentsVerifierLensService/index.d.ts +3 -0
  232. package/dist/types/lib/contractsIntegration/IntentsVerifierLensService/index.d.ts.map +1 -0
  233. package/dist/types/lib/contractsIntegration/LexLensService/ILexLensService.d.ts +85 -0
  234. package/dist/types/lib/contractsIntegration/LexLensService/ILexLensService.d.ts.map +1 -0
  235. package/dist/types/lib/contractsIntegration/LexLensService/LexLensService.d.ts +34 -0
  236. package/dist/types/lib/contractsIntegration/LexLensService/LexLensService.d.ts.map +1 -0
  237. package/dist/types/lib/contractsIntegration/LexLensService/index.d.ts +3 -0
  238. package/dist/types/lib/contractsIntegration/LexLensService/index.d.ts.map +1 -0
  239. package/dist/types/lib/contractsIntegration/OrderBookService/IOrderBookService.d.ts +40 -0
  240. package/dist/types/lib/contractsIntegration/OrderBookService/IOrderBookService.d.ts.map +1 -0
  241. package/dist/types/lib/contractsIntegration/OrderBookService/OrderBookService.d.ts +12 -0
  242. package/dist/types/lib/contractsIntegration/OrderBookService/OrderBookService.d.ts.map +1 -0
  243. package/dist/types/lib/contractsIntegration/TradersPortalService/ITradersPortalService.d.ts +61 -0
  244. package/dist/types/lib/contractsIntegration/TradersPortalService/ITradersPortalService.d.ts.map +1 -0
  245. package/dist/types/lib/contractsIntegration/TradersPortalService/TradersPortalServiceService.d.ts +14 -0
  246. package/dist/types/lib/contractsIntegration/TradersPortalService/TradersPortalServiceService.d.ts.map +1 -0
  247. package/dist/types/lib/contractsIntegration/TradersPortalService/TradersPortalUtils.d.ts +32 -0
  248. package/dist/types/lib/contractsIntegration/TradersPortalService/TradersPortalUtils.d.ts.map +1 -0
  249. package/dist/types/lib/contractsIntegration/TradersPortalService/index.d.ts +4 -0
  250. package/dist/types/lib/contractsIntegration/TradersPortalService/index.d.ts.map +1 -0
  251. package/dist/types/lib/contractsIntegration/TradingFloorLensService/ITradingFloorLensService.d.ts +76 -0
  252. package/dist/types/lib/contractsIntegration/TradingFloorLensService/ITradingFloorLensService.d.ts.map +1 -0
  253. package/dist/types/lib/contractsIntegration/TradingFloorLensService/TradingFloorLensService.d.ts +16 -0
  254. package/dist/types/lib/contractsIntegration/TradingFloorLensService/TradingFloorLensService.d.ts.map +1 -0
  255. package/dist/types/lib/contractsIntegration/TradingFloorLensService/index.d.ts +3 -0
  256. package/dist/types/lib/contractsIntegration/TradingFloorLensService/index.d.ts.map +1 -0
  257. package/dist/types/lib/contractsIntegration/TradingFloorService/ITradingFloorService.d.ts +83 -0
  258. package/dist/types/lib/contractsIntegration/TradingFloorService/ITradingFloorService.d.ts.map +1 -0
  259. package/dist/types/lib/contractsIntegration/TradingFloorService/TradingFloorService.d.ts +80 -0
  260. package/dist/types/lib/contractsIntegration/TradingFloorService/TradingFloorService.d.ts.map +1 -0
  261. package/dist/types/lib/contractsIntegration/TriggersAndPortalLensService/ITriggersAndPortalLensService.d.ts +33 -0
  262. package/dist/types/lib/contractsIntegration/TriggersAndPortalLensService/ITriggersAndPortalLensService.d.ts.map +1 -0
  263. package/dist/types/lib/contractsIntegration/TriggersAndPortalLensService/TriggersAndPortalLensService.d.ts +11 -0
  264. package/dist/types/lib/contractsIntegration/TriggersAndPortalLensService/TriggersAndPortalLensService.d.ts.map +1 -0
  265. package/dist/types/lib/contractsIntegration/TriggersAndPortalLensService/index.d.ts +3 -0
  266. package/dist/types/lib/contractsIntegration/TriggersAndPortalLensService/index.d.ts.map +1 -0
  267. package/dist/types/lib/contractsIntegration/TriggersService/ITriggersService.d.ts +73 -0
  268. package/dist/types/lib/contractsIntegration/TriggersService/ITriggersService.d.ts.map +1 -0
  269. package/dist/types/lib/contractsIntegration/TriggersService/TriggersService.d.ts +18 -0
  270. package/dist/types/lib/contractsIntegration/TriggersService/TriggersService.d.ts.map +1 -0
  271. package/dist/types/lib/contractsIntegration/deployedContractsConnector.d.ts +44 -5
  272. package/dist/types/lib/contractsIntegration/deployedContractsConnector.d.ts.map +1 -1
  273. package/dist/types/lib/devex/getChainAddresses.d.ts +20 -0
  274. package/dist/types/lib/devex/getChainAddresses.d.ts.map +1 -0
  275. package/dist/types/lib/devex/getSupportedEngineChains.d.ts +37 -0
  276. package/dist/types/lib/devex/getSupportedEngineChains.d.ts.map +1 -0
  277. package/dist/types/lib/devex/index.d.ts +5 -0
  278. package/dist/types/lib/devex/index.d.ts.map +1 -0
  279. package/dist/types/lib/devex/types.d.ts +20 -0
  280. package/dist/types/lib/devex/types.d.ts.map +1 -0
  281. package/dist/types/lib/lynxSystem/hashes.d.ts +6 -0
  282. package/dist/types/lib/lynxSystem/hashes.d.ts.map +1 -1
  283. package/dist/types/lib/lynxSystem/lynxScalesUtils.d.ts +2 -0
  284. package/dist/types/lib/lynxSystem/lynxScalesUtils.d.ts.map +1 -1
  285. package/dist/types/lib/lynxSystem/registry/registryReading.d.ts +9 -0
  286. package/dist/types/lib/lynxSystem/registry/registryReading.d.ts.map +1 -0
  287. package/dist/types/lib/priceFeeds/pyth/pythFeedConstants.d.ts.map +1 -1
  288. package/dist/types/lib/typechain/common.d.ts.map +1 -1
  289. package/dist/types/lib/typechain/contracts/Lynx/OrderBook/OrderBookProxy.d.ts +151 -0
  290. package/dist/types/lib/typechain/contracts/Lynx/OrderBook/OrderBookProxy.d.ts.map +1 -0
  291. package/dist/types/lib/typechain/contracts/Lynx/OrderBook/OrderBookV1.d.ts +268 -0
  292. package/dist/types/lib/typechain/contracts/Lynx/OrderBook/OrderBookV1.d.ts.map +1 -0
  293. package/dist/types/lib/typechain/contracts/Lynx/Registry/RegistryProxy.d.ts +143 -0
  294. package/dist/types/lib/typechain/contracts/Lynx/Registry/RegistryProxy.d.ts.map +1 -0
  295. package/dist/types/lib/typechain/contracts/Lynx/Registry/RegistryV1.d.ts +603 -0
  296. package/dist/types/lib/typechain/contracts/Lynx/Registry/RegistryV1.d.ts.map +1 -0
  297. package/dist/types/lib/typechain/contracts/Lynx/TradersPortal/TradersPortalV1.d.ts +571 -0
  298. package/dist/types/lib/typechain/contracts/Lynx/TradersPortal/TradersPortalV1.d.ts.map +1 -0
  299. package/dist/types/lib/typechain/contracts/Lynx/TradingFloor/TradingFloorProxy.d.ts +151 -0
  300. package/dist/types/lib/typechain/contracts/Lynx/TradingFloor/TradingFloorProxy.d.ts.map +1 -0
  301. package/dist/types/lib/typechain/contracts/Lynx/TradingFloor/TradingFloorV1.d.ts +1160 -0
  302. package/dist/types/lib/typechain/contracts/Lynx/TradingFloor/TradingFloorV1.d.ts.map +1 -0
  303. package/dist/types/lib/typechain/contracts/Lynx/Triggers/TriggersV1.d.ts +977 -0
  304. package/dist/types/lib/typechain/contracts/Lynx/Triggers/TriggersV1.d.ts.map +1 -0
  305. package/dist/types/lib/typechain/contracts/Peripheral/Lens/TradingFloorLens.d.ts +1 -3
  306. package/dist/types/lib/typechain/contracts/Peripheral/Lens/TradingFloorLens.d.ts.map +1 -1
  307. package/dist/types/lib/typechain/factories/contracts/Lynx/OrderBook/OrderBookProxy__factory.d.ts +193 -0
  308. package/dist/types/lib/typechain/factories/contracts/Lynx/OrderBook/OrderBookProxy__factory.d.ts.map +1 -0
  309. package/dist/types/lib/typechain/factories/contracts/Lynx/OrderBook/OrderBookV1__factory.d.ts +407 -0
  310. package/dist/types/lib/typechain/factories/contracts/Lynx/OrderBook/OrderBookV1__factory.d.ts.map +1 -0
  311. package/dist/types/lib/typechain/factories/contracts/Lynx/Registry/RegistryProxy__factory.d.ts +169 -0
  312. package/dist/types/lib/typechain/factories/contracts/Lynx/Registry/RegistryProxy__factory.d.ts.map +1 -0
  313. package/dist/types/lib/typechain/factories/contracts/Lynx/Registry/RegistryV1__factory.d.ts +841 -0
  314. package/dist/types/lib/typechain/factories/contracts/Lynx/Registry/RegistryV1__factory.d.ts.map +1 -0
  315. package/dist/types/lib/typechain/factories/contracts/Lynx/TradersPortal/TradersPortalV1__factory.d.ts +745 -0
  316. package/dist/types/lib/typechain/factories/contracts/Lynx/TradersPortal/TradersPortalV1__factory.d.ts.map +1 -0
  317. package/dist/types/lib/typechain/factories/contracts/Lynx/TradingFloor/TradingFloorProxy__factory.d.ts +193 -0
  318. package/dist/types/lib/typechain/factories/contracts/Lynx/TradingFloor/TradingFloorProxy__factory.d.ts.map +1 -0
  319. package/dist/types/lib/typechain/factories/contracts/Lynx/TradingFloor/TradingFloorV1__factory.d.ts +1374 -0
  320. package/dist/types/lib/typechain/factories/contracts/Lynx/TradingFloor/TradingFloorV1__factory.d.ts.map +1 -0
  321. package/dist/types/lib/typechain/factories/contracts/Lynx/Triggers/TriggersV1__factory.d.ts +1135 -0
  322. package/dist/types/lib/typechain/factories/contracts/Lynx/Triggers/TriggersV1__factory.d.ts.map +1 -0
  323. package/dist/types/lib/typechain/factories/contracts/Peripheral/Lens/LexLens__factory.d.ts +1 -1
  324. package/dist/types/lib/typechain/factories/contracts/Peripheral/Lens/TradingFloorLens__factory.d.ts +1 -1
  325. package/dist/types/lib/typechain/factories/contracts/Peripheral/Lens/TriggersAndPortalLens__factory.d.ts +1 -1
  326. package/dist/types/lib/utils/ethersTypes.d.ts +2 -2
  327. package/dist/types/lib/utils/ethersTypes.d.ts.map +1 -1
  328. package/package.json +7 -7
@@ -0,0 +1,147 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TradingFloorLensService = void 0;
4
+ const TradingFloorLens__factory_1 = require("../../typechain/factories/contracts/Peripheral/Lens/TradingFloorLens__factory");
5
+ const ethersTypes_1 = require("../../utils/ethersTypes");
6
+ const ITradingFloorLensService_1 = require("./ITradingFloorLensService");
7
+ // Helper function to convert position data to proper types
8
+ function convertPositionData(pos) {
9
+ const baseStruct = (0, ethersTypes_1.ethersStructResponseToObject)(pos, ITradingFloorLensService_1.EMPTY_COMPLETE_POSITION_DATA);
10
+ return {
11
+ ...baseStruct,
12
+ pairId: Number(baseStruct.pairId),
13
+ positionIndex: Number(baseStruct.positionIndex),
14
+ phase: Number(baseStruct.phase),
15
+ inPhaseSince: Number(baseStruct.inPhaseSince),
16
+ leverage: Number(baseStruct.leverage),
17
+ openPrice: Number(baseStruct.openPrice),
18
+ spreadReductionF: Number(baseStruct.spreadReductionF),
19
+ minPrice: Number(baseStruct.minPrice),
20
+ maxPrice: Number(baseStruct.maxPrice),
21
+ tpLastUpdated: Number(baseStruct.tpLastUpdated),
22
+ slLastUpdated: Number(baseStruct.slLastUpdated),
23
+ tp: Number(baseStruct.tp),
24
+ sl: Number(baseStruct.sl),
25
+ pendingUpdateOrderType: Number(baseStruct.pendingUpdateOrderType),
26
+ pendingUpdateOrderTimestamp: Number(baseStruct.pendingUpdateOrderTimestamp),
27
+ liquidationPrice: Number(baseStruct.liquidationPrice),
28
+ };
29
+ }
30
+ function convertLiquidationInfo(pos) {
31
+ const baseStruct = (0, ethersTypes_1.ethersStructResponseToObject)(pos, ITradingFloorLensService_1.EMPTY_POSITION_LIQUIDATION_INFO);
32
+ return {
33
+ ...baseStruct,
34
+ phase: Number(baseStruct.phase),
35
+ liquidationPrice: Number(baseStruct.liquidationPrice),
36
+ };
37
+ }
38
+ class TradingFloorLensService {
39
+ constructor(signerOrProvider, contractAddress) {
40
+ this.contract = TradingFloorLens__factory_1.TradingFloorLens__factory.connect(contractAddress, signerOrProvider);
41
+ }
42
+ async generatePositionHashId(settlementAsset, trader, pairId, index) {
43
+ return await this.contract.generatePositionHashId(settlementAsset, trader, BigInt(pairId), BigInt(index));
44
+ }
45
+ async getAllPositionsDataForAllTraders(params) {
46
+ const contractParams = {
47
+ tradingFloor: params.tradingFloor,
48
+ settlementAssetsStartIndex: BigInt(params.settlementAssetsStartIndex),
49
+ pairIdsStartIndex: BigInt(params.pairIdsStartIndex),
50
+ pairTraderStartIndex: BigInt(params.pairTraderStartIndex),
51
+ positionsLimit: BigInt(params.positionsLimit),
52
+ };
53
+ // @ts-ignore
54
+ const result = await this.contract.getAllPositionsDataForAllTraders.staticCall(contractParams);
55
+ const baseResult = (0, ethersTypes_1.ethersStructResponseToObject)(result, ITradingFloorLensService_1.EMPTY_POSITIONS_RESULT);
56
+ // Convert positions and filter out empty ones
57
+ const convertedPositions = result.positions
58
+ .filter((pos) => pos.collateral > 0n)
59
+ .map((pos) => convertPositionData(pos));
60
+ return {
61
+ ...baseResult,
62
+ positions: convertedPositions,
63
+ positionsCount: Number(baseResult.positionsCount),
64
+ settlementAssetsLastIndex: Number(baseResult.settlementAssetsLastIndex),
65
+ pairIdsLastIndex: Number(baseResult.pairIdsLastIndex),
66
+ pairTraderLastIndex: Number(baseResult.pairTraderLastIndex),
67
+ };
68
+ }
69
+ async getAllPositionsDataForAllTradersInDimension(tradingFloor, settlementAsset, arraySize) {
70
+ // @ts-ignore
71
+ const result = await this.contract.getAllPositionsDataForAllTradersInDimension.staticCall(tradingFloor, settlementAsset, BigInt(arraySize));
72
+ // Convert and filter out empty positions (collateral = 0)
73
+ return result
74
+ .filter((pos) => pos.collateral > 0n)
75
+ .map((pos) => convertPositionData(pos));
76
+ }
77
+ async getAllPositionsDataForTraderInDimension(tradingFloor, settlementAsset, trader) {
78
+ // @ts-ignore
79
+ const result = await this.contract.getAllPositionsDataForTraderInDimension.staticCall(tradingFloor, settlementAsset, trader);
80
+ // Convert and filter out empty positions (collateral = 0)
81
+ return result
82
+ .filter((pos) => pos.collateral > 0n)
83
+ .map((pos) => convertPositionData(pos));
84
+ }
85
+ async getAllPositionsLiquidationInfo(params, phases) {
86
+ const contractParams = {
87
+ tradingFloor: params.tradingFloor,
88
+ settlementAssetsStartIndex: BigInt(params.settlementAssetsStartIndex),
89
+ pairIdsStartIndex: BigInt(params.pairIdsStartIndex),
90
+ pairTraderStartIndex: BigInt(params.pairTraderStartIndex),
91
+ positionStartIndex: BigInt(params.positionStartIndex),
92
+ positionsLimit: BigInt(params.positionsLimit),
93
+ };
94
+ let result;
95
+ if (phases !== undefined) {
96
+ // @ts-ignore
97
+ result = await this.contract["getAllPositionsLiquidationInfo((address,uint256,uint256,uint256,uint16,uint256),uint8[])"].staticCall(contractParams, phases.map(p => BigInt(p)));
98
+ }
99
+ else {
100
+ // @ts-ignore
101
+ result = await this.contract["getAllPositionsLiquidationInfo((address,uint256,uint256,uint256,uint16,uint256))"].staticCall(contractParams);
102
+ }
103
+ const baseResult = (0, ethersTypes_1.ethersStructResponseToObject)(result, ITradingFloorLensService_1.EMPTY_LIQUIDATION_RESULT);
104
+ const convertedPositions = result.positionsLiquidationInfo.map((pos) => convertLiquidationInfo(pos));
105
+ return {
106
+ ...baseResult,
107
+ positionsLiquidationInfo: convertedPositions,
108
+ positionsCount: Number(baseResult.positionsCount),
109
+ settlementAssetsLastIndex: Number(baseResult.settlementAssetsLastIndex),
110
+ pairIdsLastIndex: Number(baseResult.pairIdsLastIndex),
111
+ pairTraderLastIndex: Number(baseResult.pairTraderLastIndex),
112
+ positionLastIndex: Number(baseResult.positionLastIndex),
113
+ };
114
+ }
115
+ async getCompletePositionData(tradingFloor, positionId) {
116
+ // @ts-ignore
117
+ const result = await this.contract.getCompletePositionData.staticCall(tradingFloor, positionId);
118
+ return convertPositionData(result);
119
+ }
120
+ async getPositionDataInPairsForTrader(tradingFloor, settlementAsset, trader, pairIds) {
121
+ // @ts-ignore
122
+ const result = await this.contract.getPositionDataInPairsForTrader.staticCall(tradingFloor, settlementAsset, trader, pairIds.map(id => BigInt(id)));
123
+ // Convert and filter out empty positions (collateral = 0)
124
+ return result
125
+ .filter((pos) => pos.collateral > 0n)
126
+ .map((pos) => convertPositionData(pos));
127
+ }
128
+ async getPositionsDataInPairForTrader(tradingFloor, settlementAsset, trader, pairId) {
129
+ // @ts-ignore
130
+ const result = await this.contract.getPositionsDataInPairForTrader.staticCall(tradingFloor, settlementAsset, trader, BigInt(pairId));
131
+ // Convert and filter out empty positions (collateral = 0)
132
+ return result
133
+ .filter((pos) => pos.collateral > 0n)
134
+ .map((pos) => convertPositionData(pos));
135
+ }
136
+ async getTradingFloorTradeParams(tradingFloor) {
137
+ const result = await this.contract.getTradingFloorTradeParams(tradingFloor);
138
+ // Result is a tuple/array-like object, extract the named properties
139
+ return {
140
+ tradingFloor: result.tradingFloor,
141
+ maxTradesPerPair: Number(result.maxTradesPerPair),
142
+ maxSlF: Number(result.maxSlF),
143
+ maxSanityProfitF: Number(result.maxSanityProfitF),
144
+ };
145
+ }
146
+ }
147
+ exports.TradingFloorLensService = TradingFloorLensService;
@@ -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("./ITradingFloorLensService"), exports);
18
+ __exportStar(require("./TradingFloorLensService"), exports);
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,158 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TradingFloorService = void 0;
4
+ const TradingFloorV1__factory_1 = require("../../typechain/factories/contracts/Lynx/TradingFloor/TradingFloorV1__factory");
5
+ class TradingFloorService {
6
+ constructor(address, signerOrProvider) {
7
+ this.signerOrProvider = signerOrProvider;
8
+ this.tradingFloorContract = TradingFloorV1__factory_1.TradingFloorV1__factory.connect(address, signerOrProvider);
9
+ }
10
+ // Read-only Functions - Position Information
11
+ async generatePositionHashId(settlementAsset, trader, pairId, index) {
12
+ return this.tradingFloorContract.generatePositionHashId(settlementAsset, trader, pairId, index);
13
+ }
14
+ async getPositionPortalInfo(positionId) {
15
+ const result = await this.tradingFloorContract.getPositionPortalInfo(positionId);
16
+ return {
17
+ phase: result[0],
18
+ timestamp: result[1],
19
+ trader: result[2],
20
+ };
21
+ }
22
+ async getPositionRegistrationParams(positionId) {
23
+ const result = await this.tradingFloorContract.getPositionRegistrationParams(positionId);
24
+ return {
25
+ collateral: result.collateral,
26
+ leverage: result.leverage,
27
+ long: result.long,
28
+ openPrice: result.openPrice,
29
+ tp: result.tp,
30
+ };
31
+ }
32
+ async getPositionTriggerInfo(positionId) {
33
+ const result = await this.tradingFloorContract.getPositionTriggerInfo(positionId);
34
+ return {
35
+ phase: result.positionPhase,
36
+ timestamp: result.timestamp,
37
+ pairId: result.pairId,
38
+ long: result.long,
39
+ spreadReductionF: result.spreadReductionF,
40
+ };
41
+ }
42
+ async positionIdentifiersById(positionId) {
43
+ const result = await this.tradingFloorContract.positionIdentifiersById(positionId);
44
+ return {
45
+ settlementAsset: result.settlementAsset,
46
+ pairId: result.pairId,
47
+ index: result.index,
48
+ trader: result.trader,
49
+ };
50
+ }
51
+ async positionLimitsInfoById(positionId) {
52
+ const result = await this.tradingFloorContract.positionLimitsInfoById(positionId);
53
+ return {
54
+ tpLastUpdated: result.tpLastUpdated,
55
+ slLastUpdated: result.slLastUpdated,
56
+ tp: result.tp,
57
+ sl: result.sl,
58
+ };
59
+ }
60
+ async positionsById(positionId) {
61
+ const result = await this.tradingFloorContract.positionsById(positionId);
62
+ return {
63
+ collateral: result.collateral,
64
+ phase: result.phase,
65
+ inPhaseSince: result.inPhaseSince,
66
+ leverage: result.leverage,
67
+ long: result.long,
68
+ openPrice: result.openPrice,
69
+ spreadReductionF: result.spreadReductionF,
70
+ };
71
+ }
72
+ async triggerPricesById(positionId) {
73
+ const result = await this.tradingFloorContract.triggerPricesById(positionId);
74
+ return {
75
+ minPrice: result.minPrice,
76
+ maxPrice: result.maxPrice,
77
+ tpByFraction: result.tpByFraction,
78
+ slByFraction: result.slByFraction,
79
+ };
80
+ }
81
+ async initialCollateralByPositionId(positionId) {
82
+ return this.tradingFloorContract.initialCollateralByPositionId(positionId);
83
+ }
84
+ // Read-only Functions - Settlement & Pool Information
85
+ async isSettlementAssetSupported(settlementAsset) {
86
+ return this.tradingFloorContract.isSettlementAssetSupported(settlementAsset);
87
+ }
88
+ async lexPoolForAsset(asset) {
89
+ return this.tradingFloorContract.lexPoolForAsset(asset);
90
+ }
91
+ async poolAccountantForAsset(asset) {
92
+ return this.tradingFloorContract.poolAccountantForAsset(asset);
93
+ }
94
+ // Read-only Functions - Trading Pair Information
95
+ async pairTraders(asset, pairId, index) {
96
+ return this.tradingFloorContract.pairTraders(asset, pairId, index);
97
+ }
98
+ async pairTradersArray(asset, pairIndex) {
99
+ return this.tradingFloorContract.pairTradersArray(asset, pairIndex);
100
+ }
101
+ async pairTradersInfo(asset, trader, pairId) {
102
+ const result = await this.tradingFloorContract.pairTradersInfo(asset, trader, pairId);
103
+ return {
104
+ positionsCounter: result.positionsCounter,
105
+ positionInArray: result.positionInArray,
106
+ };
107
+ }
108
+ async pausedPairs(pairId) {
109
+ return this.tradingFloorContract.pausedPairs(pairId);
110
+ }
111
+ // Read-only Functions - Trading Parameters
112
+ async maxSanityProfitF() {
113
+ return this.tradingFloorContract.maxSanityProfitF();
114
+ }
115
+ async maxSlF() {
116
+ return this.tradingFloorContract.maxSlF();
117
+ }
118
+ async maxTradesPerPair() {
119
+ return this.tradingFloorContract.maxTradesPerPair();
120
+ }
121
+ // Read-only Functions - Fee Information
122
+ async feesMap(asset, feeType) {
123
+ return this.tradingFloorContract.feesMap(asset, feeType);
124
+ }
125
+ // Read-only Functions - Admin & Implementation Info
126
+ async admin() {
127
+ return this.tradingFloorContract.admin();
128
+ }
129
+ async pendingAdmin() {
130
+ return this.tradingFloorContract.pendingAdmin();
131
+ }
132
+ async implementation() {
133
+ return this.tradingFloorContract.implementation();
134
+ }
135
+ async pendingImplementation() {
136
+ return this.tradingFloorContract.pendingImplementation();
137
+ }
138
+ async registry() {
139
+ return this.tradingFloorContract.registry();
140
+ }
141
+ // Constants
142
+ async ACCURACY_IMPROVEMENT_SCALE() {
143
+ return this.tradingFloorContract.ACCURACY_IMPROVEMENT_SCALE();
144
+ }
145
+ async FRACTION_SCALE() {
146
+ return this.tradingFloorContract.FRACTION_SCALE();
147
+ }
148
+ async LEVERAGE_SCALE() {
149
+ return this.tradingFloorContract.LEVERAGE_SCALE();
150
+ }
151
+ async MAX_FEE_FRACTION_FOR_CANCEL() {
152
+ return this.tradingFloorContract.MAX_FEE_FRACTION_FOR_CANCEL();
153
+ }
154
+ async PRECISION() {
155
+ return this.tradingFloorContract.PRECISION();
156
+ }
157
+ }
158
+ exports.TradingFloorService = TradingFloorService;
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EMPTY_COMPLETE_TRIGGER_CONFIGURATIONS = exports.EMPTY_COMPLETE_TRADERS_PORTAL_CONFIGURATIONS = exports.EMPTY_PAIR_CONFIGS_IN_TRIGGERS = void 0;
4
+ exports.EMPTY_PAIR_CONFIGS_IN_TRIGGERS = {
5
+ pairId: 0,
6
+ maxConfidenceFraction: 0,
7
+ spreadFraction: 0,
8
+ };
9
+ exports.EMPTY_COMPLETE_TRADERS_PORTAL_CONFIGURATIONS = {
10
+ limitOrdersTimelock: 0,
11
+ marketOrdersTimeout: 0,
12
+ isLimitingMarketClosePriceRange: false,
13
+ nativeFeeForPositionOpenRequest: 0n,
14
+ nativeFeeForMarketCloseRequest: 0n,
15
+ nativeFeeForSingleFieldUpdateRequest: 0n,
16
+ nativeFeeForDoubleFieldUpdateRequest: 0n,
17
+ minLiveTimeForMarketClose: 0,
18
+ };
19
+ exports.EMPTY_COMPLETE_TRIGGER_CONFIGURATIONS = {
20
+ minTriggerPeriodForMarketOrders: 0,
21
+ maxTriggerPeriodForMarketOrders: 0,
22
+ marketOrdersTimeout: 0,
23
+ marketOrderTightTimeRange: 0,
24
+ minTriggerPeriodForLimitOrders: 0,
25
+ triggerPriceFreshnessTimeRange: 0,
26
+ marketOrderCancelFeeFraction: 0,
27
+ openPositionCancellationFeeFraction: 0,
28
+ maxTriggersPerBlock: 0,
29
+ permissionedTriggerAccounts: [],
30
+ };
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TriggersAndPortalLensService = void 0;
4
+ const TriggersAndPortalLens__factory_1 = require("../../typechain/factories/contracts/Peripheral/Lens/TriggersAndPortalLens__factory");
5
+ const ethersTypes_1 = require("../../utils/ethersTypes");
6
+ const ITriggersAndPortalLensService_1 = require("./ITriggersAndPortalLensService");
7
+ class TriggersAndPortalLensService {
8
+ constructor(signerOrProvider, address) {
9
+ this.contract = TriggersAndPortalLens__factory_1.TriggersAndPortalLens__factory.connect(address, signerOrProvider);
10
+ }
11
+ async getPairConfigsInTriggers(triggers, pairId) {
12
+ const result = await this.contract.getPairConfigsInTriggers(triggers, BigInt(pairId));
13
+ const baseStruct = (0, ethersTypes_1.ethersStructResponseToObject)(result, ITriggersAndPortalLensService_1.EMPTY_PAIR_CONFIGS_IN_TRIGGERS);
14
+ return {
15
+ ...baseStruct,
16
+ pairId: Number(baseStruct.pairId),
17
+ maxConfidenceFraction: Number(baseStruct.maxConfidenceFraction),
18
+ spreadFraction: Number(baseStruct.spreadFraction),
19
+ };
20
+ }
21
+ async getPairsConfigsInTriggers(triggers, pairIds) {
22
+ const result = await this.contract.getPairsConfigsInTriggers(triggers, pairIds.map(id => BigInt(id)));
23
+ const baseArray = (0, ethersTypes_1.ethersStructResponseToArray)(result, ITriggersAndPortalLensService_1.EMPTY_PAIR_CONFIGS_IN_TRIGGERS);
24
+ return baseArray.map(item => ({
25
+ ...item,
26
+ pairId: Number(item.pairId),
27
+ maxConfidenceFraction: Number(item.maxConfidenceFraction),
28
+ spreadFraction: Number(item.spreadFraction),
29
+ }));
30
+ }
31
+ async getTradersPortalConfigurations(tradersPortal) {
32
+ const result = await this.contract.getTradersPortalConfigurations(tradersPortal);
33
+ const baseStruct = (0, ethersTypes_1.ethersStructResponseToObject)(result, ITriggersAndPortalLensService_1.EMPTY_COMPLETE_TRADERS_PORTAL_CONFIGURATIONS);
34
+ return {
35
+ ...baseStruct,
36
+ limitOrdersTimelock: Number(baseStruct.limitOrdersTimelock),
37
+ marketOrdersTimeout: Number(baseStruct.marketOrdersTimeout),
38
+ minLiveTimeForMarketClose: Number(baseStruct.minLiveTimeForMarketClose),
39
+ };
40
+ }
41
+ async getTriggersConfigurations(triggers) {
42
+ const result = await this.contract.getTriggersConfigurations(triggers);
43
+ const baseStruct = (0, ethersTypes_1.ethersStructResponseToObject)(result, ITriggersAndPortalLensService_1.EMPTY_COMPLETE_TRIGGER_CONFIGURATIONS);
44
+ return {
45
+ ...baseStruct,
46
+ minTriggerPeriodForMarketOrders: Number(baseStruct.minTriggerPeriodForMarketOrders),
47
+ maxTriggerPeriodForMarketOrders: Number(baseStruct.maxTriggerPeriodForMarketOrders),
48
+ marketOrdersTimeout: Number(baseStruct.marketOrdersTimeout),
49
+ marketOrderTightTimeRange: Number(baseStruct.marketOrderTightTimeRange),
50
+ minTriggerPeriodForLimitOrders: Number(baseStruct.minTriggerPeriodForLimitOrders),
51
+ triggerPriceFreshnessTimeRange: Number(baseStruct.triggerPriceFreshnessTimeRange),
52
+ marketOrderCancelFeeFraction: Number(baseStruct.marketOrderCancelFeeFraction),
53
+ openPositionCancellationFeeFraction: Number(baseStruct.openPositionCancellationFeeFraction),
54
+ maxTriggersPerBlock: Number(baseStruct.maxTriggersPerBlock),
55
+ };
56
+ }
57
+ }
58
+ exports.TriggersAndPortalLensService = TriggersAndPortalLensService;
@@ -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("./ITriggersAndPortalLensService"), exports);
18
+ __exportStar(require("./TriggersAndPortalLensService"), exports);
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,188 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TriggersService = void 0;
4
+ const TriggersV1__factory_1 = require("../../typechain/factories/contracts/Lynx/Triggers/TriggersV1__factory");
5
+ class OpenTriggers {
6
+ constructor(triggersContract) {
7
+ this.triggersContract = triggersContract;
8
+ }
9
+ async market(positionId, pricePayload, nativeFee) {
10
+ return this.triggersContract.trigger_openTrade_market(positionId, pricePayload, { value: nativeFee });
11
+ }
12
+ async limit(positionId, pricePayload, nativeFee) {
13
+ return this.triggersContract.trigger_openTrade_limit(positionId, pricePayload, { value: nativeFee });
14
+ }
15
+ }
16
+ class CloseTriggers {
17
+ constructor(triggersContract) {
18
+ this.triggersContract = triggersContract;
19
+ }
20
+ async market(positionId, pricePayload, nativeFee) {
21
+ return this.triggersContract.trigger_closeTrade_market(positionId, pricePayload, { value: nativeFee });
22
+ }
23
+ async takeProfit(positionId, pricePayload, nativeFee) {
24
+ return this.triggersContract.trigger_closeTrade_TP(positionId, pricePayload, { value: nativeFee });
25
+ }
26
+ async stopLoss(positionId, pricePayload, nativeFee) {
27
+ return this.triggersContract.trigger_closeTrade_SL(positionId, pricePayload, { value: nativeFee });
28
+ }
29
+ async liquidation(positionId, pricePayload, nativeFee) {
30
+ return this.triggersContract.trigger_closeTrade_LIQ(positionId, pricePayload, { value: nativeFee });
31
+ }
32
+ }
33
+ class UpdateTriggers {
34
+ constructor(triggersContract) {
35
+ this.triggersContract = triggersContract;
36
+ }
37
+ async takeProfit(positionId, pricePayload, nativeFee) {
38
+ return this.triggersContract.trigger_update_TP(positionId, pricePayload, { value: nativeFee });
39
+ }
40
+ async stopLoss(positionId, pricePayload, nativeFee) {
41
+ return this.triggersContract.trigger_update_SL(positionId, pricePayload, { value: nativeFee });
42
+ }
43
+ async takeProfitAndStopLoss(positionId, pricePayload, nativeFee) {
44
+ return this.triggersContract.trigger_update_TP_and_SL(positionId, pricePayload, { value: nativeFee });
45
+ }
46
+ }
47
+ class TimeoutTriggers {
48
+ constructor(triggersContract) {
49
+ this.triggersContract = triggersContract;
50
+ }
51
+ async marketOpen(positionId) {
52
+ return this.triggersContract.trigger_timeout_marketOpen(positionId);
53
+ }
54
+ async marketClose(positionId) {
55
+ return this.triggersContract.trigger_timeout_marketClose(positionId);
56
+ }
57
+ async updatePosition(positionId) {
58
+ return this.triggersContract.trigger_timeout_updatePosition(positionId);
59
+ }
60
+ }
61
+ class ContractInfo {
62
+ constructor(triggersContract) {
63
+ this.triggersContract = triggersContract;
64
+ }
65
+ async admin() {
66
+ return this.triggersContract.admin();
67
+ }
68
+ async pendingAdmin() {
69
+ return this.triggersContract.pendingAdmin();
70
+ }
71
+ async orderBook() {
72
+ return this.triggersContract.orderBook();
73
+ }
74
+ async tradingFloor() {
75
+ return this.triggersContract.tradingFloor();
76
+ }
77
+ async priceValidator() {
78
+ return this.triggersContract.priceValidator();
79
+ }
80
+ }
81
+ class Status {
82
+ constructor(triggersContract) {
83
+ this.triggersContract = triggersContract;
84
+ }
85
+ async isDone() {
86
+ return this.triggersContract.isDone();
87
+ }
88
+ async isPaused() {
89
+ return this.triggersContract.isPaused();
90
+ }
91
+ }
92
+ class Configuration {
93
+ constructor(triggersContract) {
94
+ this.triggersContract = triggersContract;
95
+ }
96
+ async marketOrderCancelFeeFraction() {
97
+ return this.triggersContract.marketOrderCancelFeeFraction();
98
+ }
99
+ async marketOrderTightTimeRange() {
100
+ return this.triggersContract.marketOrderTightTimeRange();
101
+ }
102
+ async marketOrdersTimeout() {
103
+ return this.triggersContract.marketOrdersTimeout();
104
+ }
105
+ async maxTriggerPeriodForMarketOrders() {
106
+ return this.triggersContract.maxTriggerPeriodForMarketOrders();
107
+ }
108
+ async minTriggerPeriodForLimitOrders() {
109
+ return this.triggersContract.minTriggerPeriodForLimitOrders();
110
+ }
111
+ async minTriggerPeriodForMarketOrders() {
112
+ return this.triggersContract.minTriggerPeriodForMarketOrders();
113
+ }
114
+ async openPositionCancellationFeeFraction() {
115
+ return this.triggersContract.openPositionCancellationFeeFraction();
116
+ }
117
+ async triggerPriceFreshnessTimeRange() {
118
+ return this.triggersContract.triggerPriceFreshnessTimeRange();
119
+ }
120
+ async maxTriggersPerBlock() {
121
+ return this.triggersContract.maxTriggersPerBlock();
122
+ }
123
+ async triggersPerBlock(blockNumber) {
124
+ return this.triggersContract.triggersPerBlock(blockNumber);
125
+ }
126
+ }
127
+ class PairConfiguration {
128
+ constructor(triggersContract) {
129
+ this.triggersContract = triggersContract;
130
+ }
131
+ async maxConfidenceFractionForPair(pairId) {
132
+ return this.triggersContract.maxConfidenceFractionForPair(pairId);
133
+ }
134
+ async spreadFractionForPair(pairId) {
135
+ return this.triggersContract.spreadFractionForPair(pairId);
136
+ }
137
+ }
138
+ class Permissions {
139
+ constructor(triggersContract) {
140
+ this.triggersContract = triggersContract;
141
+ }
142
+ async isAllowedToTrigger(account) {
143
+ return this.triggersContract.isAllowedToTrigger(account);
144
+ }
145
+ async getAllTriggerPermissionedAccounts() {
146
+ return this.triggersContract.getAllTriggerPermissionedAccounts();
147
+ }
148
+ }
149
+ class Constants {
150
+ constructor(triggersContract) {
151
+ this.triggersContract = triggersContract;
152
+ }
153
+ async ACCURACY_IMPROVEMENT_SCALE() {
154
+ return this.triggersContract.ACCURACY_IMPROVEMENT_SCALE();
155
+ }
156
+ async FRACTION_SCALE() {
157
+ return this.triggersContract.FRACTION_SCALE();
158
+ }
159
+ async LEVERAGE_SCALE() {
160
+ return this.triggersContract.LEVERAGE_SCALE();
161
+ }
162
+ async MAX_ALLOWED_CONFIDENCE_FRACTION() {
163
+ return this.triggersContract.MAX_ALLOWED_CONFIDENCE_FRACTION();
164
+ }
165
+ async MAX_ALLOWED_SPREAD_FRACTION() {
166
+ return this.triggersContract.MAX_ALLOWED_SPREAD_FRACTION();
167
+ }
168
+ async PRECISION() {
169
+ return this.triggersContract.PRECISION();
170
+ }
171
+ }
172
+ class TriggersService {
173
+ constructor(address, signerOrProvider) {
174
+ this.signerOrProvider = signerOrProvider;
175
+ this.triggersContract = TriggersV1__factory_1.TriggersV1__factory.connect(address, signerOrProvider);
176
+ this.openTriggers = new OpenTriggers(this.triggersContract);
177
+ this.closeTriggers = new CloseTriggers(this.triggersContract);
178
+ this.updateTriggers = new UpdateTriggers(this.triggersContract);
179
+ this.timeoutTriggers = new TimeoutTriggers(this.triggersContract);
180
+ this.contractInfo = new ContractInfo(this.triggersContract);
181
+ this.status = new Status(this.triggersContract);
182
+ this.configuration = new Configuration(this.triggersContract);
183
+ this.pairConfiguration = new PairConfiguration(this.triggersContract);
184
+ this.permissions = new Permissions(this.triggersContract);
185
+ this.constants = new Constants(this.triggersContract);
186
+ }
187
+ }
188
+ exports.TriggersService = TriggersService;