@metamask-previews/perps-controller 16.1.0-preview-abca9bcea → 17.0.0-preview-0a30e47

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 (891) hide show
  1. package/CHANGELOG.md +35 -1
  2. package/README.md +17 -0
  3. package/dist/PerpsController-method-action-types.d.ts +1235 -0
  4. package/dist/PerpsController-method-action-types.d.ts.map +1 -0
  5. package/dist/PerpsController-method-action-types.js +6 -0
  6. package/dist/PerpsController-method-action-types.js.map +1 -0
  7. package/dist/PerpsController.d.ts +1313 -0
  8. package/dist/PerpsController.d.ts.map +1 -0
  9. package/dist/PerpsController.js +5331 -0
  10. package/dist/PerpsController.js.map +1 -0
  11. package/dist/aggregation/SubscriptionMultiplexer.d.ts +171 -0
  12. package/dist/aggregation/SubscriptionMultiplexer.d.ts.map +1 -0
  13. package/dist/aggregation/SubscriptionMultiplexer.js +451 -0
  14. package/dist/aggregation/SubscriptionMultiplexer.js.map +1 -0
  15. package/dist/aggregation/index.d.ts +6 -0
  16. package/dist/aggregation/index.d.ts.map +1 -0
  17. package/dist/aggregation/index.js +5 -0
  18. package/dist/aggregation/index.js.map +1 -0
  19. package/dist/constants/chartConfig.d.ts +228 -0
  20. package/dist/constants/chartConfig.d.ts.map +1 -0
  21. package/dist/constants/chartConfig.js +233 -0
  22. package/dist/constants/chartConfig.js.map +1 -0
  23. package/dist/constants/eventNames.d.ts +565 -0
  24. package/dist/constants/eventNames.d.ts.map +1 -0
  25. package/dist/constants/eventNames.js +657 -0
  26. package/dist/constants/eventNames.js.map +1 -0
  27. package/dist/constants/hyperLiquidConfig.d.ts +280 -0
  28. package/dist/constants/hyperLiquidConfig.d.ts.map +1 -0
  29. package/dist/constants/hyperLiquidConfig.js +596 -0
  30. package/dist/constants/hyperLiquidConfig.js.map +1 -0
  31. package/dist/constants/index.d.ts +12 -0
  32. package/dist/constants/index.d.ts.map +1 -0
  33. package/dist/constants/index.js +12 -0
  34. package/dist/constants/index.js.map +1 -0
  35. package/dist/constants/lighterConfig.d.ts +204 -0
  36. package/dist/constants/lighterConfig.d.ts.map +1 -0
  37. package/dist/constants/lighterConfig.js +317 -0
  38. package/dist/constants/lighterConfig.js.map +1 -0
  39. package/dist/constants/orderTypes.d.ts +19 -0
  40. package/dist/constants/orderTypes.d.ts.map +1 -0
  41. package/dist/constants/orderTypes.js +27 -0
  42. package/dist/constants/orderTypes.js.map +1 -0
  43. package/dist/constants/performanceMetrics.d.ts +46 -0
  44. package/dist/constants/performanceMetrics.d.ts.map +1 -0
  45. package/dist/constants/performanceMetrics.js +60 -0
  46. package/dist/constants/performanceMetrics.js.map +1 -0
  47. package/dist/constants/perpsConfig.d.ts +480 -0
  48. package/dist/constants/perpsConfig.d.ts.map +1 -0
  49. package/dist/constants/perpsConfig.js +555 -0
  50. package/dist/constants/perpsConfig.js.map +1 -0
  51. package/dist/constants/transactionsHistoryConfig.d.ts +35 -0
  52. package/dist/constants/transactionsHistoryConfig.d.ts.map +1 -0
  53. package/dist/constants/transactionsHistoryConfig.js +35 -0
  54. package/dist/constants/transactionsHistoryConfig.js.map +1 -0
  55. package/dist/index.d.ts +95 -0
  56. package/dist/index.d.ts.map +1 -0
  57. package/dist/index.js +80 -0
  58. package/dist/index.js.map +1 -0
  59. package/dist/perpsErrorCodes.d.ts +113 -0
  60. package/dist/perpsErrorCodes.d.ts.map +1 -0
  61. package/dist/perpsErrorCodes.js +133 -0
  62. package/dist/perpsErrorCodes.js.map +1 -0
  63. package/dist/providers/AggregatedPerpsProvider.d.ts +277 -0
  64. package/dist/providers/AggregatedPerpsProvider.d.ts.map +1 -0
  65. package/dist/providers/AggregatedPerpsProvider.js +827 -0
  66. package/dist/providers/AggregatedPerpsProvider.js.map +1 -0
  67. package/dist/providers/HyperLiquidProvider.d.ts +656 -0
  68. package/dist/providers/HyperLiquidProvider.d.ts.map +1 -0
  69. package/dist/providers/HyperLiquidProvider.js +11308 -0
  70. package/dist/providers/HyperLiquidProvider.js.map +1 -0
  71. package/dist/providers/LighterProvider.d.ts +179 -0
  72. package/dist/providers/LighterProvider.d.ts.map +1 -0
  73. package/dist/providers/LighterProvider.js +6599 -0
  74. package/dist/providers/LighterProvider.js.map +1 -0
  75. package/dist/routing/ProviderRouter.d.ts +112 -0
  76. package/dist/routing/ProviderRouter.d.ts.map +1 -0
  77. package/dist/routing/ProviderRouter.js +137 -0
  78. package/dist/routing/ProviderRouter.js.map +1 -0
  79. package/dist/routing/index.d.ts +6 -0
  80. package/dist/routing/index.d.ts.map +1 -0
  81. package/dist/routing/index.js +5 -0
  82. package/dist/routing/index.js.map +1 -0
  83. package/dist/selectors.d.ts +336 -0
  84. package/dist/selectors.d.ts.map +1 -0
  85. package/dist/selectors.js +249 -0
  86. package/dist/selectors.js.map +1 -0
  87. package/dist/services/AccountService.d.ts +56 -0
  88. package/dist/services/AccountService.d.ts.map +1 -0
  89. package/dist/services/AccountService.js +307 -0
  90. package/dist/services/AccountService.js.map +1 -0
  91. package/dist/services/AggregatedOrderBookConnection.d.ts +106 -0
  92. package/dist/services/AggregatedOrderBookConnection.d.ts.map +1 -0
  93. package/dist/services/AggregatedOrderBookConnection.js +388 -0
  94. package/dist/services/AggregatedOrderBookConnection.js.map +1 -0
  95. package/dist/services/DataLakeService.d.ts +51 -0
  96. package/dist/services/DataLakeService.d.ts.map +1 -0
  97. package/dist/services/DataLakeService.js +215 -0
  98. package/dist/services/DataLakeService.js.map +1 -0
  99. package/dist/services/DepositService.d.ts +39 -0
  100. package/dist/services/DepositService.d.ts.map +1 -0
  101. package/dist/services/DepositService.js +88 -0
  102. package/dist/services/DepositService.js.map +1 -0
  103. package/dist/services/DexDiscoveryCacheManager.d.ts +52 -0
  104. package/dist/services/DexDiscoveryCacheManager.d.ts.map +1 -0
  105. package/dist/services/DexDiscoveryCacheManager.js +130 -0
  106. package/dist/services/DexDiscoveryCacheManager.js.map +1 -0
  107. package/dist/services/EligibilityService.d.ts +28 -0
  108. package/dist/services/EligibilityService.d.ts.map +1 -0
  109. package/dist/services/EligibilityService.js +61 -0
  110. package/dist/services/EligibilityService.js.map +1 -0
  111. package/dist/services/FeatureFlagConfigurationService.d.ts +73 -0
  112. package/dist/services/FeatureFlagConfigurationService.d.ts.map +1 -0
  113. package/dist/services/FeatureFlagConfigurationService.js +266 -0
  114. package/dist/services/FeatureFlagConfigurationService.js.map +1 -0
  115. package/dist/services/HyperLiquidClientService.d.ts +252 -0
  116. package/dist/services/HyperLiquidClientService.d.ts.map +1 -0
  117. package/dist/services/HyperLiquidClientService.js +1152 -0
  118. package/dist/services/HyperLiquidClientService.js.map +1 -0
  119. package/dist/services/HyperLiquidSubscriptionService.d.ts +265 -0
  120. package/dist/services/HyperLiquidSubscriptionService.d.ts.map +1 -0
  121. package/dist/services/HyperLiquidSubscriptionService.js +3874 -0
  122. package/dist/services/HyperLiquidSubscriptionService.js.map +1 -0
  123. package/dist/services/HyperLiquidWalletService.d.ts +84 -0
  124. package/dist/services/HyperLiquidWalletService.d.ts.map +1 -0
  125. package/dist/services/HyperLiquidWalletService.js +168 -0
  126. package/dist/services/HyperLiquidWalletService.js.map +1 -0
  127. package/dist/services/LighterClientService.d.ts +200 -0
  128. package/dist/services/LighterClientService.d.ts.map +1 -0
  129. package/dist/services/LighterClientService.js +634 -0
  130. package/dist/services/LighterClientService.js.map +1 -0
  131. package/dist/services/LighterWalletService.d.ts +51 -0
  132. package/dist/services/LighterWalletService.d.ts.map +1 -0
  133. package/dist/services/LighterWalletService.js +92 -0
  134. package/dist/services/LighterWalletService.js.map +1 -0
  135. package/dist/services/MarketDataService.d.ts +350 -0
  136. package/dist/services/MarketDataService.d.ts.map +1 -0
  137. package/dist/services/MarketDataService.js +1165 -0
  138. package/dist/services/MarketDataService.js.map +1 -0
  139. package/dist/services/RewardsIntegrationService.d.ts +84 -0
  140. package/dist/services/RewardsIntegrationService.d.ts.map +1 -0
  141. package/dist/services/RewardsIntegrationService.js +380 -0
  142. package/dist/services/RewardsIntegrationService.js.map +1 -0
  143. package/dist/services/ServiceContext.d.ts +102 -0
  144. package/dist/services/ServiceContext.d.ts.map +1 -0
  145. package/dist/services/ServiceContext.js +2 -0
  146. package/dist/services/ServiceContext.js.map +1 -0
  147. package/dist/services/TerminalMarketService.d.ts +45 -0
  148. package/dist/services/TerminalMarketService.d.ts.map +1 -0
  149. package/dist/services/TerminalMarketService.js +640 -0
  150. package/dist/services/TerminalMarketService.js.map +1 -0
  151. package/dist/services/TradingReadinessCache.d.ts +204 -0
  152. package/dist/services/TradingReadinessCache.d.ts.map +1 -0
  153. package/dist/services/TradingReadinessCache.js +313 -0
  154. package/dist/services/TradingReadinessCache.js.map +1 -0
  155. package/dist/services/TradingService.d.ts +201 -0
  156. package/dist/services/TradingService.d.ts.map +1 -0
  157. package/dist/services/TradingService.js +1967 -0
  158. package/dist/services/TradingService.js.map +1 -0
  159. package/dist/types/config.d.ts +49 -0
  160. package/dist/types/config.d.ts.map +1 -0
  161. package/dist/types/config.js +2 -0
  162. package/dist/types/config.js.map +1 -0
  163. package/dist/types/hyperliquid-types.d.ts +67 -0
  164. package/dist/types/hyperliquid-types.d.ts.map +1 -0
  165. package/dist/types/hyperliquid-types.js +41 -0
  166. package/dist/types/hyperliquid-types.js.map +1 -0
  167. package/dist/types/index.d.ts +2192 -0
  168. package/dist/types/index.d.ts.map +1 -0
  169. package/dist/types/index.js +133 -0
  170. package/dist/types/index.js.map +1 -0
  171. package/dist/types/lighter-types.d.ts +772 -0
  172. package/dist/types/lighter-types.d.ts.map +1 -0
  173. package/dist/types/lighter-types.js +10 -0
  174. package/dist/types/lighter-types.js.map +1 -0
  175. package/dist/types/messenger.d.ts +30 -0
  176. package/dist/types/messenger.d.ts.map +1 -0
  177. package/dist/types/messenger.js +2 -0
  178. package/dist/types/messenger.js.map +1 -0
  179. package/dist/types/perps-types.d.ts +184 -0
  180. package/dist/types/perps-types.d.ts.map +1 -0
  181. package/dist/types/perps-types.js +2 -0
  182. package/dist/types/perps-types.js.map +1 -0
  183. package/dist/types/token.d.ts +25 -0
  184. package/dist/types/token.d.ts.map +1 -0
  185. package/dist/types/token.js +2 -0
  186. package/dist/types/token.js.map +1 -0
  187. package/dist/types/transactionTypes.d.ts +60 -0
  188. package/dist/types/transactionTypes.d.ts.map +1 -0
  189. package/dist/types/transactionTypes.js +24 -0
  190. package/dist/types/transactionTypes.js.map +1 -0
  191. package/dist/utils/accountUtils.d.ts +72 -0
  192. package/dist/utils/accountUtils.d.ts.map +1 -0
  193. package/dist/utils/accountUtils.js +223 -0
  194. package/dist/utils/accountUtils.js.map +1 -0
  195. package/dist/utils/capabilitySymbols.d.ts +15 -0
  196. package/dist/utils/capabilitySymbols.d.ts.map +1 -0
  197. package/dist/utils/capabilitySymbols.js +21 -0
  198. package/dist/utils/capabilitySymbols.js.map +1 -0
  199. package/dist/utils/coalescePerpsRestRequest.d.ts +32 -0
  200. package/dist/utils/coalescePerpsRestRequest.d.ts.map +1 -0
  201. package/dist/utils/coalescePerpsRestRequest.js +66 -0
  202. package/dist/utils/coalescePerpsRestRequest.js.map +1 -0
  203. package/dist/utils/errorUtils.d.ts +50 -0
  204. package/dist/utils/errorUtils.d.ts.map +1 -0
  205. package/dist/utils/errorUtils.js +96 -0
  206. package/dist/utils/errorUtils.js.map +1 -0
  207. package/dist/utils/hyperLiquidAbstraction.d.ts +11 -0
  208. package/dist/utils/hyperLiquidAbstraction.d.ts.map +1 -0
  209. package/dist/utils/hyperLiquidAbstraction.js +19 -0
  210. package/dist/utils/hyperLiquidAbstraction.js.map +1 -0
  211. package/dist/utils/hyperLiquidAdapter.d.ts +77 -0
  212. package/dist/utils/hyperLiquidAdapter.d.ts.map +1 -0
  213. package/dist/utils/hyperLiquidAdapter.js +495 -0
  214. package/dist/utils/hyperLiquidAdapter.js.map +1 -0
  215. package/dist/utils/hyperLiquidOrderBookProcessor.d.ts +55 -0
  216. package/dist/utils/hyperLiquidOrderBookProcessor.d.ts.map +1 -0
  217. package/dist/utils/hyperLiquidOrderBookProcessor.js +78 -0
  218. package/dist/utils/hyperLiquidOrderBookProcessor.js.map +1 -0
  219. package/dist/utils/hyperLiquidPositionPreview.d.ts +124 -0
  220. package/dist/utils/hyperLiquidPositionPreview.d.ts.map +1 -0
  221. package/dist/utils/hyperLiquidPositionPreview.js +347 -0
  222. package/dist/utils/hyperLiquidPositionPreview.js.map +1 -0
  223. package/dist/utils/hyperLiquidValidation.d.ts +192 -0
  224. package/dist/utils/hyperLiquidValidation.d.ts.map +1 -0
  225. package/dist/utils/hyperLiquidValidation.js +786 -0
  226. package/dist/utils/hyperLiquidValidation.js.map +1 -0
  227. package/dist/utils/idUtils.d.ts +6 -0
  228. package/dist/utils/idUtils.d.ts.map +1 -0
  229. package/dist/utils/idUtils.js +10 -0
  230. package/dist/utils/idUtils.js.map +1 -0
  231. package/dist/utils/index.d.ts +29 -0
  232. package/dist/utils/index.d.ts.map +1 -0
  233. package/dist/utils/index.js +34 -0
  234. package/dist/utils/index.js.map +1 -0
  235. package/dist/utils/lighterAdapter.d.ts +117 -0
  236. package/dist/utils/lighterAdapter.d.ts.map +1 -0
  237. package/dist/utils/lighterAdapter.js +562 -0
  238. package/dist/utils/lighterAdapter.js.map +1 -0
  239. package/dist/utils/marketDataTransform.d.ts +71 -0
  240. package/dist/utils/marketDataTransform.d.ts.map +1 -0
  241. package/dist/utils/marketDataTransform.js +243 -0
  242. package/dist/utils/marketDataTransform.js.map +1 -0
  243. package/dist/utils/marketSearch.d.ts +48 -0
  244. package/dist/utils/marketSearch.d.ts.map +1 -0
  245. package/dist/utils/marketSearch.js +106 -0
  246. package/dist/utils/marketSearch.js.map +1 -0
  247. package/dist/utils/marketUtils.d.ts +73 -0
  248. package/dist/utils/marketUtils.d.ts.map +1 -0
  249. package/dist/utils/marketUtils.js +248 -0
  250. package/dist/utils/marketUtils.js.map +1 -0
  251. package/dist/utils/orderCalculations.d.ts +306 -0
  252. package/dist/utils/orderCalculations.d.ts.map +1 -0
  253. package/dist/utils/orderCalculations.js +833 -0
  254. package/dist/utils/orderCalculations.js.map +1 -0
  255. package/dist/utils/orderTypes.d.ts +166 -0
  256. package/dist/utils/orderTypes.d.ts.map +1 -0
  257. package/dist/utils/orderTypes.js +287 -0
  258. package/dist/utils/orderTypes.js.map +1 -0
  259. package/dist/utils/perpsConnectionAttemptContext.d.ts +7 -0
  260. package/dist/utils/perpsConnectionAttemptContext.d.ts.map +1 -0
  261. package/dist/utils/perpsConnectionAttemptContext.js +15 -0
  262. package/dist/utils/perpsConnectionAttemptContext.js.map +1 -0
  263. package/dist/utils/perpsDiskPersistence.d.ts +112 -0
  264. package/dist/utils/perpsDiskPersistence.d.ts.map +1 -0
  265. package/dist/utils/perpsDiskPersistence.js +251 -0
  266. package/dist/utils/perpsDiskPersistence.js.map +1 -0
  267. package/dist/utils/perpsFormatters.d.ts +204 -0
  268. package/dist/utils/perpsFormatters.d.ts.map +1 -0
  269. package/dist/utils/perpsFormatters.js +500 -0
  270. package/dist/utils/perpsFormatters.js.map +1 -0
  271. package/dist/utils/rewardsUtils.d.ts +33 -0
  272. package/dist/utils/rewardsUtils.d.ts.map +1 -0
  273. package/dist/utils/rewardsUtils.js +92 -0
  274. package/dist/utils/rewardsUtils.js.map +1 -0
  275. package/dist/utils/significantFigures.d.ts +25 -0
  276. package/dist/utils/significantFigures.d.ts.map +1 -0
  277. package/dist/utils/significantFigures.js +82 -0
  278. package/dist/utils/significantFigures.js.map +1 -0
  279. package/dist/utils/sortMarkets.d.ts +25 -0
  280. package/dist/utils/sortMarkets.d.ts.map +1 -0
  281. package/dist/utils/sortMarkets.js +88 -0
  282. package/dist/utils/sortMarkets.js.map +1 -0
  283. package/dist/utils/standaloneInfoClient.d.ts +37 -0
  284. package/dist/utils/standaloneInfoClient.d.ts.map +1 -0
  285. package/dist/utils/standaloneInfoClient.js +64 -0
  286. package/dist/utils/standaloneInfoClient.js.map +1 -0
  287. package/dist/utils/stringParseUtils.d.ts +11 -0
  288. package/dist/utils/stringParseUtils.d.ts.map +1 -0
  289. package/dist/utils/stringParseUtils.js +28 -0
  290. package/dist/utils/stringParseUtils.js.map +1 -0
  291. package/dist/utils/transferData.d.ts +9 -0
  292. package/dist/utils/transferData.d.ts.map +1 -0
  293. package/dist/utils/transferData.js +29 -0
  294. package/dist/utils/transferData.js.map +1 -0
  295. package/dist/utils/wait.d.ts +2 -0
  296. package/dist/utils/wait.d.ts.map +1 -0
  297. package/dist/utils/wait.js +2 -0
  298. package/dist/utils/wait.js.map +1 -0
  299. package/package.json +33 -61
  300. package/dist/PerpsController-method-action-types.cjs +0 -7
  301. package/dist/PerpsController-method-action-types.cjs.map +0 -1
  302. package/dist/PerpsController-method-action-types.d.cts +0 -1235
  303. package/dist/PerpsController-method-action-types.d.cts.map +0 -1
  304. package/dist/PerpsController-method-action-types.d.mts +0 -1235
  305. package/dist/PerpsController-method-action-types.d.mts.map +0 -1
  306. package/dist/PerpsController-method-action-types.mjs +0 -6
  307. package/dist/PerpsController-method-action-types.mjs.map +0 -1
  308. package/dist/PerpsController.cjs +0 -5154
  309. package/dist/PerpsController.cjs.map +0 -1
  310. package/dist/PerpsController.d.cts +0 -1313
  311. package/dist/PerpsController.d.cts.map +0 -1
  312. package/dist/PerpsController.d.mts +0 -1313
  313. package/dist/PerpsController.d.mts.map +0 -1
  314. package/dist/PerpsController.mjs +0 -5142
  315. package/dist/PerpsController.mjs.map +0 -1
  316. package/dist/aggregation/SubscriptionMultiplexer.cjs +0 -441
  317. package/dist/aggregation/SubscriptionMultiplexer.cjs.map +0 -1
  318. package/dist/aggregation/SubscriptionMultiplexer.d.cts +0 -171
  319. package/dist/aggregation/SubscriptionMultiplexer.d.cts.map +0 -1
  320. package/dist/aggregation/SubscriptionMultiplexer.d.mts +0 -171
  321. package/dist/aggregation/SubscriptionMultiplexer.d.mts.map +0 -1
  322. package/dist/aggregation/SubscriptionMultiplexer.mjs +0 -437
  323. package/dist/aggregation/SubscriptionMultiplexer.mjs.map +0 -1
  324. package/dist/aggregation/index.cjs +0 -9
  325. package/dist/aggregation/index.cjs.map +0 -1
  326. package/dist/aggregation/index.d.cts +0 -6
  327. package/dist/aggregation/index.d.cts.map +0 -1
  328. package/dist/aggregation/index.d.mts +0 -6
  329. package/dist/aggregation/index.d.mts.map +0 -1
  330. package/dist/aggregation/index.mjs +0 -5
  331. package/dist/aggregation/index.mjs.map +0 -1
  332. package/dist/constants/chartConfig.cjs +0 -239
  333. package/dist/constants/chartConfig.cjs.map +0 -1
  334. package/dist/constants/chartConfig.d.cts +0 -228
  335. package/dist/constants/chartConfig.d.cts.map +0 -1
  336. package/dist/constants/chartConfig.d.mts +0 -228
  337. package/dist/constants/chartConfig.d.mts.map +0 -1
  338. package/dist/constants/chartConfig.mjs +0 -233
  339. package/dist/constants/chartConfig.mjs.map +0 -1
  340. package/dist/constants/eventNames.cjs +0 -660
  341. package/dist/constants/eventNames.cjs.map +0 -1
  342. package/dist/constants/eventNames.d.cts +0 -565
  343. package/dist/constants/eventNames.d.cts.map +0 -1
  344. package/dist/constants/eventNames.d.mts +0 -565
  345. package/dist/constants/eventNames.d.mts.map +0 -1
  346. package/dist/constants/eventNames.mjs +0 -657
  347. package/dist/constants/eventNames.mjs.map +0 -1
  348. package/dist/constants/hyperLiquidConfig.cjs +0 -607
  349. package/dist/constants/hyperLiquidConfig.cjs.map +0 -1
  350. package/dist/constants/hyperLiquidConfig.d.cts +0 -280
  351. package/dist/constants/hyperLiquidConfig.d.cts.map +0 -1
  352. package/dist/constants/hyperLiquidConfig.d.mts +0 -280
  353. package/dist/constants/hyperLiquidConfig.d.mts.map +0 -1
  354. package/dist/constants/hyperLiquidConfig.mjs +0 -596
  355. package/dist/constants/hyperLiquidConfig.mjs.map +0 -1
  356. package/dist/constants/index.cjs +0 -28
  357. package/dist/constants/index.cjs.map +0 -1
  358. package/dist/constants/index.d.cts +0 -12
  359. package/dist/constants/index.d.cts.map +0 -1
  360. package/dist/constants/index.d.mts +0 -12
  361. package/dist/constants/index.d.mts.map +0 -1
  362. package/dist/constants/index.mjs +0 -12
  363. package/dist/constants/index.mjs.map +0 -1
  364. package/dist/constants/lighterConfig.cjs +0 -328
  365. package/dist/constants/lighterConfig.cjs.map +0 -1
  366. package/dist/constants/lighterConfig.d.cts +0 -204
  367. package/dist/constants/lighterConfig.d.cts.map +0 -1
  368. package/dist/constants/lighterConfig.d.mts +0 -204
  369. package/dist/constants/lighterConfig.d.mts.map +0 -1
  370. package/dist/constants/lighterConfig.mjs +0 -317
  371. package/dist/constants/lighterConfig.mjs.map +0 -1
  372. package/dist/constants/orderTypes.cjs +0 -31
  373. package/dist/constants/orderTypes.cjs.map +0 -1
  374. package/dist/constants/orderTypes.d.cts +0 -19
  375. package/dist/constants/orderTypes.d.cts.map +0 -1
  376. package/dist/constants/orderTypes.d.mts +0 -19
  377. package/dist/constants/orderTypes.d.mts.map +0 -1
  378. package/dist/constants/orderTypes.mjs +0 -27
  379. package/dist/constants/orderTypes.mjs.map +0 -1
  380. package/dist/constants/performanceMetrics.cjs +0 -63
  381. package/dist/constants/performanceMetrics.cjs.map +0 -1
  382. package/dist/constants/performanceMetrics.d.cts +0 -46
  383. package/dist/constants/performanceMetrics.d.cts.map +0 -1
  384. package/dist/constants/performanceMetrics.d.mts +0 -46
  385. package/dist/constants/performanceMetrics.d.mts.map +0 -1
  386. package/dist/constants/performanceMetrics.mjs +0 -60
  387. package/dist/constants/performanceMetrics.mjs.map +0 -1
  388. package/dist/constants/perpsConfig.cjs +0 -560
  389. package/dist/constants/perpsConfig.cjs.map +0 -1
  390. package/dist/constants/perpsConfig.d.cts +0 -480
  391. package/dist/constants/perpsConfig.d.cts.map +0 -1
  392. package/dist/constants/perpsConfig.d.mts +0 -480
  393. package/dist/constants/perpsConfig.d.mts.map +0 -1
  394. package/dist/constants/perpsConfig.mjs +0 -555
  395. package/dist/constants/perpsConfig.mjs.map +0 -1
  396. package/dist/constants/transactionsHistoryConfig.cjs +0 -38
  397. package/dist/constants/transactionsHistoryConfig.cjs.map +0 -1
  398. package/dist/constants/transactionsHistoryConfig.d.cts +0 -35
  399. package/dist/constants/transactionsHistoryConfig.d.cts.map +0 -1
  400. package/dist/constants/transactionsHistoryConfig.d.mts +0 -35
  401. package/dist/constants/transactionsHistoryConfig.d.mts.map +0 -1
  402. package/dist/constants/transactionsHistoryConfig.mjs +0 -35
  403. package/dist/constants/transactionsHistoryConfig.mjs.map +0 -1
  404. package/dist/index.cjs +0 -334
  405. package/dist/index.cjs.map +0 -1
  406. package/dist/index.d.cts +0 -95
  407. package/dist/index.d.cts.map +0 -1
  408. package/dist/index.d.mts +0 -95
  409. package/dist/index.d.mts.map +0 -1
  410. package/dist/index.mjs +0 -80
  411. package/dist/index.mjs.map +0 -1
  412. package/dist/perpsErrorCodes.cjs +0 -128
  413. package/dist/perpsErrorCodes.cjs.map +0 -1
  414. package/dist/perpsErrorCodes.d.cts +0 -105
  415. package/dist/perpsErrorCodes.d.cts.map +0 -1
  416. package/dist/perpsErrorCodes.d.mts +0 -105
  417. package/dist/perpsErrorCodes.d.mts.map +0 -1
  418. package/dist/perpsErrorCodes.mjs +0 -125
  419. package/dist/perpsErrorCodes.mjs.map +0 -1
  420. package/dist/providers/AggregatedPerpsProvider.cjs +0 -810
  421. package/dist/providers/AggregatedPerpsProvider.cjs.map +0 -1
  422. package/dist/providers/AggregatedPerpsProvider.d.cts +0 -277
  423. package/dist/providers/AggregatedPerpsProvider.d.cts.map +0 -1
  424. package/dist/providers/AggregatedPerpsProvider.d.mts +0 -277
  425. package/dist/providers/AggregatedPerpsProvider.d.mts.map +0 -1
  426. package/dist/providers/AggregatedPerpsProvider.mjs +0 -805
  427. package/dist/providers/AggregatedPerpsProvider.mjs.map +0 -1
  428. package/dist/providers/HyperLiquidProvider.cjs +0 -10963
  429. package/dist/providers/HyperLiquidProvider.cjs.map +0 -1
  430. package/dist/providers/HyperLiquidProvider.d.cts +0 -656
  431. package/dist/providers/HyperLiquidProvider.d.cts.map +0 -1
  432. package/dist/providers/HyperLiquidProvider.d.mts +0 -656
  433. package/dist/providers/HyperLiquidProvider.d.mts.map +0 -1
  434. package/dist/providers/HyperLiquidProvider.mjs +0 -10959
  435. package/dist/providers/HyperLiquidProvider.mjs.map +0 -1
  436. package/dist/providers/LighterProvider.cjs +0 -6575
  437. package/dist/providers/LighterProvider.cjs.map +0 -1
  438. package/dist/providers/LighterProvider.d.cts +0 -179
  439. package/dist/providers/LighterProvider.d.cts.map +0 -1
  440. package/dist/providers/LighterProvider.d.mts +0 -179
  441. package/dist/providers/LighterProvider.d.mts.map +0 -1
  442. package/dist/providers/LighterProvider.mjs +0 -6571
  443. package/dist/providers/LighterProvider.mjs.map +0 -1
  444. package/dist/routing/ProviderRouter.cjs +0 -154
  445. package/dist/routing/ProviderRouter.cjs.map +0 -1
  446. package/dist/routing/ProviderRouter.d.cts +0 -112
  447. package/dist/routing/ProviderRouter.d.cts.map +0 -1
  448. package/dist/routing/ProviderRouter.d.mts +0 -112
  449. package/dist/routing/ProviderRouter.d.mts.map +0 -1
  450. package/dist/routing/ProviderRouter.mjs +0 -150
  451. package/dist/routing/ProviderRouter.mjs.map +0 -1
  452. package/dist/routing/index.cjs +0 -9
  453. package/dist/routing/index.cjs.map +0 -1
  454. package/dist/routing/index.d.cts +0 -6
  455. package/dist/routing/index.d.cts.map +0 -1
  456. package/dist/routing/index.d.mts +0 -6
  457. package/dist/routing/index.d.mts.map +0 -1
  458. package/dist/routing/index.mjs +0 -5
  459. package/dist/routing/index.mjs.map +0 -1
  460. package/dist/selectors.cjs +0 -264
  461. package/dist/selectors.cjs.map +0 -1
  462. package/dist/selectors.d.cts +0 -336
  463. package/dist/selectors.d.cts.map +0 -1
  464. package/dist/selectors.d.mts +0 -336
  465. package/dist/selectors.d.mts.map +0 -1
  466. package/dist/selectors.mjs +0 -249
  467. package/dist/selectors.mjs.map +0 -1
  468. package/dist/services/AccountService.cjs +0 -324
  469. package/dist/services/AccountService.cjs.map +0 -1
  470. package/dist/services/AccountService.d.cts +0 -56
  471. package/dist/services/AccountService.d.cts.map +0 -1
  472. package/dist/services/AccountService.d.mts +0 -56
  473. package/dist/services/AccountService.d.mts.map +0 -1
  474. package/dist/services/AccountService.mjs +0 -320
  475. package/dist/services/AccountService.mjs.map +0 -1
  476. package/dist/services/AggregatedOrderBookConnection.cjs +0 -405
  477. package/dist/services/AggregatedOrderBookConnection.cjs.map +0 -1
  478. package/dist/services/AggregatedOrderBookConnection.d.cts +0 -106
  479. package/dist/services/AggregatedOrderBookConnection.d.cts.map +0 -1
  480. package/dist/services/AggregatedOrderBookConnection.d.mts +0 -106
  481. package/dist/services/AggregatedOrderBookConnection.d.mts.map +0 -1
  482. package/dist/services/AggregatedOrderBookConnection.mjs +0 -400
  483. package/dist/services/AggregatedOrderBookConnection.mjs.map +0 -1
  484. package/dist/services/DataLakeService.cjs +0 -233
  485. package/dist/services/DataLakeService.cjs.map +0 -1
  486. package/dist/services/DataLakeService.d.cts +0 -51
  487. package/dist/services/DataLakeService.d.cts.map +0 -1
  488. package/dist/services/DataLakeService.d.mts +0 -51
  489. package/dist/services/DataLakeService.d.mts.map +0 -1
  490. package/dist/services/DataLakeService.mjs +0 -229
  491. package/dist/services/DataLakeService.mjs.map +0 -1
  492. package/dist/services/DepositService.cjs +0 -105
  493. package/dist/services/DepositService.cjs.map +0 -1
  494. package/dist/services/DepositService.d.cts +0 -39
  495. package/dist/services/DepositService.d.cts.map +0 -1
  496. package/dist/services/DepositService.d.mts +0 -39
  497. package/dist/services/DepositService.d.mts.map +0 -1
  498. package/dist/services/DepositService.mjs +0 -101
  499. package/dist/services/DepositService.mjs.map +0 -1
  500. package/dist/services/DexDiscoveryCacheManager.cjs +0 -147
  501. package/dist/services/DexDiscoveryCacheManager.cjs.map +0 -1
  502. package/dist/services/DexDiscoveryCacheManager.d.cts +0 -52
  503. package/dist/services/DexDiscoveryCacheManager.d.cts.map +0 -1
  504. package/dist/services/DexDiscoveryCacheManager.d.mts +0 -52
  505. package/dist/services/DexDiscoveryCacheManager.d.mts.map +0 -1
  506. package/dist/services/DexDiscoveryCacheManager.mjs +0 -143
  507. package/dist/services/DexDiscoveryCacheManager.mjs.map +0 -1
  508. package/dist/services/EligibilityService.cjs +0 -78
  509. package/dist/services/EligibilityService.cjs.map +0 -1
  510. package/dist/services/EligibilityService.d.cts +0 -28
  511. package/dist/services/EligibilityService.d.cts.map +0 -1
  512. package/dist/services/EligibilityService.d.mts +0 -28
  513. package/dist/services/EligibilityService.d.mts.map +0 -1
  514. package/dist/services/EligibilityService.mjs +0 -74
  515. package/dist/services/EligibilityService.mjs.map +0 -1
  516. package/dist/services/FeatureFlagConfigurationService.cjs +0 -257
  517. package/dist/services/FeatureFlagConfigurationService.cjs.map +0 -1
  518. package/dist/services/FeatureFlagConfigurationService.d.cts +0 -73
  519. package/dist/services/FeatureFlagConfigurationService.d.cts.map +0 -1
  520. package/dist/services/FeatureFlagConfigurationService.d.mts +0 -73
  521. package/dist/services/FeatureFlagConfigurationService.d.mts.map +0 -1
  522. package/dist/services/FeatureFlagConfigurationService.mjs +0 -253
  523. package/dist/services/FeatureFlagConfigurationService.mjs.map +0 -1
  524. package/dist/services/HyperLiquidClientService.cjs +0 -1114
  525. package/dist/services/HyperLiquidClientService.cjs.map +0 -1
  526. package/dist/services/HyperLiquidClientService.d.cts +0 -252
  527. package/dist/services/HyperLiquidClientService.d.cts.map +0 -1
  528. package/dist/services/HyperLiquidClientService.d.mts +0 -252
  529. package/dist/services/HyperLiquidClientService.d.mts.map +0 -1
  530. package/dist/services/HyperLiquidClientService.mjs +0 -1109
  531. package/dist/services/HyperLiquidClientService.mjs.map +0 -1
  532. package/dist/services/HyperLiquidSubscriptionService.cjs +0 -3594
  533. package/dist/services/HyperLiquidSubscriptionService.cjs.map +0 -1
  534. package/dist/services/HyperLiquidSubscriptionService.d.cts +0 -265
  535. package/dist/services/HyperLiquidSubscriptionService.d.cts.map +0 -1
  536. package/dist/services/HyperLiquidSubscriptionService.d.mts +0 -265
  537. package/dist/services/HyperLiquidSubscriptionService.d.mts.map +0 -1
  538. package/dist/services/HyperLiquidSubscriptionService.mjs +0 -3590
  539. package/dist/services/HyperLiquidSubscriptionService.mjs.map +0 -1
  540. package/dist/services/HyperLiquidWalletService.cjs +0 -186
  541. package/dist/services/HyperLiquidWalletService.cjs.map +0 -1
  542. package/dist/services/HyperLiquidWalletService.d.cts +0 -84
  543. package/dist/services/HyperLiquidWalletService.d.cts.map +0 -1
  544. package/dist/services/HyperLiquidWalletService.d.mts +0 -84
  545. package/dist/services/HyperLiquidWalletService.d.mts.map +0 -1
  546. package/dist/services/HyperLiquidWalletService.mjs +0 -182
  547. package/dist/services/HyperLiquidWalletService.mjs.map +0 -1
  548. package/dist/services/LighterClientService.cjs +0 -643
  549. package/dist/services/LighterClientService.cjs.map +0 -1
  550. package/dist/services/LighterClientService.d.cts +0 -200
  551. package/dist/services/LighterClientService.d.cts.map +0 -1
  552. package/dist/services/LighterClientService.d.mts +0 -200
  553. package/dist/services/LighterClientService.d.mts.map +0 -1
  554. package/dist/services/LighterClientService.mjs +0 -637
  555. package/dist/services/LighterClientService.mjs.map +0 -1
  556. package/dist/services/LighterWalletService.cjs +0 -109
  557. package/dist/services/LighterWalletService.cjs.map +0 -1
  558. package/dist/services/LighterWalletService.d.cts +0 -51
  559. package/dist/services/LighterWalletService.d.cts.map +0 -1
  560. package/dist/services/LighterWalletService.d.mts +0 -51
  561. package/dist/services/LighterWalletService.d.mts.map +0 -1
  562. package/dist/services/LighterWalletService.mjs +0 -105
  563. package/dist/services/LighterWalletService.mjs.map +0 -1
  564. package/dist/services/MarketDataService.cjs +0 -1171
  565. package/dist/services/MarketDataService.cjs.map +0 -1
  566. package/dist/services/MarketDataService.d.cts +0 -350
  567. package/dist/services/MarketDataService.d.cts.map +0 -1
  568. package/dist/services/MarketDataService.d.mts +0 -350
  569. package/dist/services/MarketDataService.d.mts.map +0 -1
  570. package/dist/services/MarketDataService.mjs +0 -1167
  571. package/dist/services/MarketDataService.mjs.map +0 -1
  572. package/dist/services/RewardsIntegrationService.cjs +0 -391
  573. package/dist/services/RewardsIntegrationService.cjs.map +0 -1
  574. package/dist/services/RewardsIntegrationService.d.cts +0 -84
  575. package/dist/services/RewardsIntegrationService.d.cts.map +0 -1
  576. package/dist/services/RewardsIntegrationService.d.mts +0 -84
  577. package/dist/services/RewardsIntegrationService.d.mts.map +0 -1
  578. package/dist/services/RewardsIntegrationService.mjs +0 -387
  579. package/dist/services/RewardsIntegrationService.mjs.map +0 -1
  580. package/dist/services/ServiceContext.cjs +0 -3
  581. package/dist/services/ServiceContext.cjs.map +0 -1
  582. package/dist/services/ServiceContext.d.cts +0 -102
  583. package/dist/services/ServiceContext.d.cts.map +0 -1
  584. package/dist/services/ServiceContext.d.mts +0 -102
  585. package/dist/services/ServiceContext.d.mts.map +0 -1
  586. package/dist/services/ServiceContext.mjs +0 -2
  587. package/dist/services/ServiceContext.mjs.map +0 -1
  588. package/dist/services/TerminalMarketService.cjs +0 -623
  589. package/dist/services/TerminalMarketService.cjs.map +0 -1
  590. package/dist/services/TerminalMarketService.d.cts +0 -45
  591. package/dist/services/TerminalMarketService.d.cts.map +0 -1
  592. package/dist/services/TerminalMarketService.d.mts +0 -45
  593. package/dist/services/TerminalMarketService.d.mts.map +0 -1
  594. package/dist/services/TerminalMarketService.mjs +0 -619
  595. package/dist/services/TerminalMarketService.mjs.map +0 -1
  596. package/dist/services/TradingReadinessCache.cjs +0 -329
  597. package/dist/services/TradingReadinessCache.cjs.map +0 -1
  598. package/dist/services/TradingReadinessCache.d.cts +0 -204
  599. package/dist/services/TradingReadinessCache.d.cts.map +0 -1
  600. package/dist/services/TradingReadinessCache.d.mts +0 -204
  601. package/dist/services/TradingReadinessCache.d.mts.map +0 -1
  602. package/dist/services/TradingReadinessCache.mjs +0 -326
  603. package/dist/services/TradingReadinessCache.mjs.map +0 -1
  604. package/dist/services/TradingService.cjs +0 -1895
  605. package/dist/services/TradingService.cjs.map +0 -1
  606. package/dist/services/TradingService.d.cts +0 -201
  607. package/dist/services/TradingService.d.cts.map +0 -1
  608. package/dist/services/TradingService.d.mts +0 -201
  609. package/dist/services/TradingService.d.mts.map +0 -1
  610. package/dist/services/TradingService.mjs +0 -1891
  611. package/dist/services/TradingService.mjs.map +0 -1
  612. package/dist/types/config.cjs +0 -3
  613. package/dist/types/config.cjs.map +0 -1
  614. package/dist/types/config.d.cts +0 -49
  615. package/dist/types/config.d.cts.map +0 -1
  616. package/dist/types/config.d.mts +0 -49
  617. package/dist/types/config.d.mts.map +0 -1
  618. package/dist/types/config.mjs +0 -2
  619. package/dist/types/config.mjs.map +0 -1
  620. package/dist/types/hyperliquid-types.cjs +0 -45
  621. package/dist/types/hyperliquid-types.cjs.map +0 -1
  622. package/dist/types/hyperliquid-types.d.cts +0 -67
  623. package/dist/types/hyperliquid-types.d.cts.map +0 -1
  624. package/dist/types/hyperliquid-types.d.mts +0 -67
  625. package/dist/types/hyperliquid-types.d.mts.map +0 -1
  626. package/dist/types/hyperliquid-types.mjs +0 -41
  627. package/dist/types/hyperliquid-types.mjs.map +0 -1
  628. package/dist/types/index.cjs +0 -151
  629. package/dist/types/index.cjs.map +0 -1
  630. package/dist/types/index.d.cts +0 -2183
  631. package/dist/types/index.d.cts.map +0 -1
  632. package/dist/types/index.d.mts +0 -2183
  633. package/dist/types/index.d.mts.map +0 -1
  634. package/dist/types/index.mjs +0 -133
  635. package/dist/types/index.mjs.map +0 -1
  636. package/dist/types/lighter-types.cjs +0 -11
  637. package/dist/types/lighter-types.cjs.map +0 -1
  638. package/dist/types/lighter-types.d.cts +0 -763
  639. package/dist/types/lighter-types.d.cts.map +0 -1
  640. package/dist/types/lighter-types.d.mts +0 -763
  641. package/dist/types/lighter-types.d.mts.map +0 -1
  642. package/dist/types/lighter-types.mjs +0 -10
  643. package/dist/types/lighter-types.mjs.map +0 -1
  644. package/dist/types/messenger.cjs +0 -3
  645. package/dist/types/messenger.cjs.map +0 -1
  646. package/dist/types/messenger.d.cts +0 -30
  647. package/dist/types/messenger.d.cts.map +0 -1
  648. package/dist/types/messenger.d.mts +0 -30
  649. package/dist/types/messenger.d.mts.map +0 -1
  650. package/dist/types/messenger.mjs +0 -2
  651. package/dist/types/messenger.mjs.map +0 -1
  652. package/dist/types/perps-types.cjs +0 -7
  653. package/dist/types/perps-types.cjs.map +0 -1
  654. package/dist/types/perps-types.d.cts +0 -184
  655. package/dist/types/perps-types.d.cts.map +0 -1
  656. package/dist/types/perps-types.d.mts +0 -184
  657. package/dist/types/perps-types.d.mts.map +0 -1
  658. package/dist/types/perps-types.mjs +0 -5
  659. package/dist/types/perps-types.mjs.map +0 -1
  660. package/dist/types/token.cjs +0 -3
  661. package/dist/types/token.cjs.map +0 -1
  662. package/dist/types/token.d.cts +0 -25
  663. package/dist/types/token.d.cts.map +0 -1
  664. package/dist/types/token.d.mts +0 -25
  665. package/dist/types/token.d.mts.map +0 -1
  666. package/dist/types/token.mjs +0 -2
  667. package/dist/types/token.mjs.map +0 -1
  668. package/dist/types/transactionTypes.cjs +0 -29
  669. package/dist/types/transactionTypes.cjs.map +0 -1
  670. package/dist/types/transactionTypes.d.cts +0 -60
  671. package/dist/types/transactionTypes.d.cts.map +0 -1
  672. package/dist/types/transactionTypes.d.mts +0 -60
  673. package/dist/types/transactionTypes.d.mts.map +0 -1
  674. package/dist/types/transactionTypes.mjs +0 -24
  675. package/dist/types/transactionTypes.mjs.map +0 -1
  676. package/dist/utils/accountUtils.cjs +0 -236
  677. package/dist/utils/accountUtils.cjs.map +0 -1
  678. package/dist/utils/accountUtils.d.cts +0 -72
  679. package/dist/utils/accountUtils.d.cts.map +0 -1
  680. package/dist/utils/accountUtils.d.mts +0 -72
  681. package/dist/utils/accountUtils.d.mts.map +0 -1
  682. package/dist/utils/accountUtils.mjs +0 -223
  683. package/dist/utils/accountUtils.mjs.map +0 -1
  684. package/dist/utils/capabilitySymbols.cjs +0 -25
  685. package/dist/utils/capabilitySymbols.cjs.map +0 -1
  686. package/dist/utils/capabilitySymbols.d.cts +0 -15
  687. package/dist/utils/capabilitySymbols.d.cts.map +0 -1
  688. package/dist/utils/capabilitySymbols.d.mts +0 -15
  689. package/dist/utils/capabilitySymbols.d.mts.map +0 -1
  690. package/dist/utils/capabilitySymbols.mjs +0 -21
  691. package/dist/utils/capabilitySymbols.mjs.map +0 -1
  692. package/dist/utils/coalescePerpsRestRequest.cjs +0 -71
  693. package/dist/utils/coalescePerpsRestRequest.cjs.map +0 -1
  694. package/dist/utils/coalescePerpsRestRequest.d.cts +0 -32
  695. package/dist/utils/coalescePerpsRestRequest.d.cts.map +0 -1
  696. package/dist/utils/coalescePerpsRestRequest.d.mts +0 -32
  697. package/dist/utils/coalescePerpsRestRequest.d.mts.map +0 -1
  698. package/dist/utils/coalescePerpsRestRequest.mjs +0 -66
  699. package/dist/utils/coalescePerpsRestRequest.mjs.map +0 -1
  700. package/dist/utils/errorUtils.cjs +0 -104
  701. package/dist/utils/errorUtils.cjs.map +0 -1
  702. package/dist/utils/errorUtils.d.cts +0 -50
  703. package/dist/utils/errorUtils.d.cts.map +0 -1
  704. package/dist/utils/errorUtils.d.mts +0 -50
  705. package/dist/utils/errorUtils.d.mts.map +0 -1
  706. package/dist/utils/errorUtils.mjs +0 -96
  707. package/dist/utils/errorUtils.mjs.map +0 -1
  708. package/dist/utils/hyperLiquidAbstraction.cjs +0 -23
  709. package/dist/utils/hyperLiquidAbstraction.cjs.map +0 -1
  710. package/dist/utils/hyperLiquidAbstraction.d.cts +0 -11
  711. package/dist/utils/hyperLiquidAbstraction.d.cts.map +0 -1
  712. package/dist/utils/hyperLiquidAbstraction.d.mts +0 -11
  713. package/dist/utils/hyperLiquidAbstraction.d.mts.map +0 -1
  714. package/dist/utils/hyperLiquidAbstraction.mjs +0 -19
  715. package/dist/utils/hyperLiquidAbstraction.mjs.map +0 -1
  716. package/dist/utils/hyperLiquidAdapter.cjs +0 -512
  717. package/dist/utils/hyperLiquidAdapter.cjs.map +0 -1
  718. package/dist/utils/hyperLiquidAdapter.d.cts +0 -77
  719. package/dist/utils/hyperLiquidAdapter.d.cts.map +0 -1
  720. package/dist/utils/hyperLiquidAdapter.d.mts +0 -77
  721. package/dist/utils/hyperLiquidAdapter.d.mts.map +0 -1
  722. package/dist/utils/hyperLiquidAdapter.mjs +0 -494
  723. package/dist/utils/hyperLiquidAdapter.mjs.map +0 -1
  724. package/dist/utils/hyperLiquidOrderBookProcessor.cjs +0 -83
  725. package/dist/utils/hyperLiquidOrderBookProcessor.cjs.map +0 -1
  726. package/dist/utils/hyperLiquidOrderBookProcessor.d.cts +0 -55
  727. package/dist/utils/hyperLiquidOrderBookProcessor.d.cts.map +0 -1
  728. package/dist/utils/hyperLiquidOrderBookProcessor.d.mts +0 -55
  729. package/dist/utils/hyperLiquidOrderBookProcessor.d.mts.map +0 -1
  730. package/dist/utils/hyperLiquidOrderBookProcessor.mjs +0 -78
  731. package/dist/utils/hyperLiquidOrderBookProcessor.mjs.map +0 -1
  732. package/dist/utils/hyperLiquidPositionPreview.cjs +0 -355
  733. package/dist/utils/hyperLiquidPositionPreview.cjs.map +0 -1
  734. package/dist/utils/hyperLiquidPositionPreview.d.cts +0 -124
  735. package/dist/utils/hyperLiquidPositionPreview.d.cts.map +0 -1
  736. package/dist/utils/hyperLiquidPositionPreview.d.mts +0 -124
  737. package/dist/utils/hyperLiquidPositionPreview.d.mts.map +0 -1
  738. package/dist/utils/hyperLiquidPositionPreview.mjs +0 -347
  739. package/dist/utils/hyperLiquidPositionPreview.mjs.map +0 -1
  740. package/dist/utils/hyperLiquidValidation.cjs +0 -799
  741. package/dist/utils/hyperLiquidValidation.cjs.map +0 -1
  742. package/dist/utils/hyperLiquidValidation.d.cts +0 -192
  743. package/dist/utils/hyperLiquidValidation.d.cts.map +0 -1
  744. package/dist/utils/hyperLiquidValidation.d.mts +0 -192
  745. package/dist/utils/hyperLiquidValidation.d.mts.map +0 -1
  746. package/dist/utils/hyperLiquidValidation.mjs +0 -786
  747. package/dist/utils/hyperLiquidValidation.mjs.map +0 -1
  748. package/dist/utils/idUtils.cjs +0 -18
  749. package/dist/utils/idUtils.cjs.map +0 -1
  750. package/dist/utils/idUtils.d.cts +0 -6
  751. package/dist/utils/idUtils.d.cts.map +0 -1
  752. package/dist/utils/idUtils.d.mts +0 -6
  753. package/dist/utils/idUtils.d.mts.map +0 -1
  754. package/dist/utils/idUtils.mjs +0 -10
  755. package/dist/utils/idUtils.mjs.map +0 -1
  756. package/dist/utils/index.cjs +0 -66
  757. package/dist/utils/index.cjs.map +0 -1
  758. package/dist/utils/index.d.cts +0 -29
  759. package/dist/utils/index.d.cts.map +0 -1
  760. package/dist/utils/index.d.mts +0 -29
  761. package/dist/utils/index.d.mts.map +0 -1
  762. package/dist/utils/index.mjs +0 -34
  763. package/dist/utils/index.mjs.map +0 -1
  764. package/dist/utils/lighterAdapter.cjs +0 -575
  765. package/dist/utils/lighterAdapter.cjs.map +0 -1
  766. package/dist/utils/lighterAdapter.d.cts +0 -117
  767. package/dist/utils/lighterAdapter.d.cts.map +0 -1
  768. package/dist/utils/lighterAdapter.d.mts +0 -117
  769. package/dist/utils/lighterAdapter.d.mts.map +0 -1
  770. package/dist/utils/lighterAdapter.mjs +0 -562
  771. package/dist/utils/lighterAdapter.mjs.map +0 -1
  772. package/dist/utils/marketDataTransform.cjs +0 -250
  773. package/dist/utils/marketDataTransform.cjs.map +0 -1
  774. package/dist/utils/marketDataTransform.d.cts +0 -71
  775. package/dist/utils/marketDataTransform.d.cts.map +0 -1
  776. package/dist/utils/marketDataTransform.d.mts +0 -71
  777. package/dist/utils/marketDataTransform.d.mts.map +0 -1
  778. package/dist/utils/marketDataTransform.mjs +0 -243
  779. package/dist/utils/marketDataTransform.mjs.map +0 -1
  780. package/dist/utils/marketSearch.cjs +0 -111
  781. package/dist/utils/marketSearch.cjs.map +0 -1
  782. package/dist/utils/marketSearch.d.cts +0 -48
  783. package/dist/utils/marketSearch.d.cts.map +0 -1
  784. package/dist/utils/marketSearch.d.mts +0 -48
  785. package/dist/utils/marketSearch.d.mts.map +0 -1
  786. package/dist/utils/marketSearch.mjs +0 -106
  787. package/dist/utils/marketSearch.mjs.map +0 -1
  788. package/dist/utils/marketUtils.cjs +0 -266
  789. package/dist/utils/marketUtils.cjs.map +0 -1
  790. package/dist/utils/marketUtils.d.cts +0 -73
  791. package/dist/utils/marketUtils.d.cts.map +0 -1
  792. package/dist/utils/marketUtils.d.mts +0 -73
  793. package/dist/utils/marketUtils.d.mts.map +0 -1
  794. package/dist/utils/marketUtils.mjs +0 -248
  795. package/dist/utils/marketUtils.mjs.map +0 -1
  796. package/dist/utils/orderCalculations.cjs +0 -849
  797. package/dist/utils/orderCalculations.cjs.map +0 -1
  798. package/dist/utils/orderCalculations.d.cts +0 -306
  799. package/dist/utils/orderCalculations.d.cts.map +0 -1
  800. package/dist/utils/orderCalculations.d.mts +0 -306
  801. package/dist/utils/orderCalculations.d.mts.map +0 -1
  802. package/dist/utils/orderCalculations.mjs +0 -833
  803. package/dist/utils/orderCalculations.mjs.map +0 -1
  804. package/dist/utils/orderTypes.cjs +0 -301
  805. package/dist/utils/orderTypes.cjs.map +0 -1
  806. package/dist/utils/orderTypes.d.cts +0 -166
  807. package/dist/utils/orderTypes.d.cts.map +0 -1
  808. package/dist/utils/orderTypes.d.mts +0 -166
  809. package/dist/utils/orderTypes.d.mts.map +0 -1
  810. package/dist/utils/orderTypes.mjs +0 -287
  811. package/dist/utils/orderTypes.mjs.map +0 -1
  812. package/dist/utils/perpsConnectionAttemptContext.cjs +0 -20
  813. package/dist/utils/perpsConnectionAttemptContext.cjs.map +0 -1
  814. package/dist/utils/perpsConnectionAttemptContext.d.cts +0 -7
  815. package/dist/utils/perpsConnectionAttemptContext.d.cts.map +0 -1
  816. package/dist/utils/perpsConnectionAttemptContext.d.mts +0 -7
  817. package/dist/utils/perpsConnectionAttemptContext.d.mts.map +0 -1
  818. package/dist/utils/perpsConnectionAttemptContext.mjs +0 -15
  819. package/dist/utils/perpsConnectionAttemptContext.mjs.map +0 -1
  820. package/dist/utils/perpsDiskPersistence.cjs +0 -259
  821. package/dist/utils/perpsDiskPersistence.cjs.map +0 -1
  822. package/dist/utils/perpsDiskPersistence.d.cts +0 -112
  823. package/dist/utils/perpsDiskPersistence.d.cts.map +0 -1
  824. package/dist/utils/perpsDiskPersistence.d.mts +0 -112
  825. package/dist/utils/perpsDiskPersistence.d.mts.map +0 -1
  826. package/dist/utils/perpsDiskPersistence.mjs +0 -251
  827. package/dist/utils/perpsDiskPersistence.mjs.map +0 -1
  828. package/dist/utils/perpsFormatters.cjs +0 -509
  829. package/dist/utils/perpsFormatters.cjs.map +0 -1
  830. package/dist/utils/perpsFormatters.d.cts +0 -204
  831. package/dist/utils/perpsFormatters.d.cts.map +0 -1
  832. package/dist/utils/perpsFormatters.d.mts +0 -204
  833. package/dist/utils/perpsFormatters.d.mts.map +0 -1
  834. package/dist/utils/perpsFormatters.mjs +0 -500
  835. package/dist/utils/perpsFormatters.mjs.map +0 -1
  836. package/dist/utils/rewardsUtils.cjs +0 -98
  837. package/dist/utils/rewardsUtils.cjs.map +0 -1
  838. package/dist/utils/rewardsUtils.d.cts +0 -33
  839. package/dist/utils/rewardsUtils.d.cts.map +0 -1
  840. package/dist/utils/rewardsUtils.d.mts +0 -33
  841. package/dist/utils/rewardsUtils.d.mts.map +0 -1
  842. package/dist/utils/rewardsUtils.mjs +0 -92
  843. package/dist/utils/rewardsUtils.mjs.map +0 -1
  844. package/dist/utils/significantFigures.cjs +0 -88
  845. package/dist/utils/significantFigures.cjs.map +0 -1
  846. package/dist/utils/significantFigures.d.cts +0 -25
  847. package/dist/utils/significantFigures.d.cts.map +0 -1
  848. package/dist/utils/significantFigures.d.mts +0 -25
  849. package/dist/utils/significantFigures.d.mts.map +0 -1
  850. package/dist/utils/significantFigures.mjs +0 -82
  851. package/dist/utils/significantFigures.mjs.map +0 -1
  852. package/dist/utils/sortMarkets.cjs +0 -93
  853. package/dist/utils/sortMarkets.cjs.map +0 -1
  854. package/dist/utils/sortMarkets.d.cts +0 -25
  855. package/dist/utils/sortMarkets.d.cts.map +0 -1
  856. package/dist/utils/sortMarkets.d.mts +0 -25
  857. package/dist/utils/sortMarkets.d.mts.map +0 -1
  858. package/dist/utils/sortMarkets.mjs +0 -88
  859. package/dist/utils/sortMarkets.mjs.map +0 -1
  860. package/dist/utils/standaloneInfoClient.cjs +0 -70
  861. package/dist/utils/standaloneInfoClient.cjs.map +0 -1
  862. package/dist/utils/standaloneInfoClient.d.cts +0 -37
  863. package/dist/utils/standaloneInfoClient.d.cts.map +0 -1
  864. package/dist/utils/standaloneInfoClient.d.mts +0 -37
  865. package/dist/utils/standaloneInfoClient.d.mts.map +0 -1
  866. package/dist/utils/standaloneInfoClient.mjs +0 -64
  867. package/dist/utils/standaloneInfoClient.mjs.map +0 -1
  868. package/dist/utils/stringParseUtils.cjs +0 -34
  869. package/dist/utils/stringParseUtils.cjs.map +0 -1
  870. package/dist/utils/stringParseUtils.d.cts +0 -11
  871. package/dist/utils/stringParseUtils.d.cts.map +0 -1
  872. package/dist/utils/stringParseUtils.d.mts +0 -11
  873. package/dist/utils/stringParseUtils.d.mts.map +0 -1
  874. package/dist/utils/stringParseUtils.mjs +0 -28
  875. package/dist/utils/stringParseUtils.mjs.map +0 -1
  876. package/dist/utils/transferData.cjs +0 -33
  877. package/dist/utils/transferData.cjs.map +0 -1
  878. package/dist/utils/transferData.d.cts +0 -9
  879. package/dist/utils/transferData.d.cts.map +0 -1
  880. package/dist/utils/transferData.d.mts +0 -9
  881. package/dist/utils/transferData.d.mts.map +0 -1
  882. package/dist/utils/transferData.mjs +0 -29
  883. package/dist/utils/transferData.mjs.map +0 -1
  884. package/dist/utils/wait.cjs +0 -6
  885. package/dist/utils/wait.cjs.map +0 -1
  886. package/dist/utils/wait.d.cts +0 -2
  887. package/dist/utils/wait.d.cts.map +0 -1
  888. package/dist/utils/wait.d.mts +0 -2
  889. package/dist/utils/wait.d.mts.map +0 -1
  890. package/dist/utils/wait.mjs +0 -2
  891. package/dist/utils/wait.mjs.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HyperLiquidClientService.js","sourceRoot":"","sources":["../../src/services/HyperLiquidClientService.ts"],"names":[],"mappings":"AACA,OAAO,EACL,cAAc,EACd,aAAa,EACb,UAAU,EACV,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EACL,YAAY,EACZ,oBAAoB,GACrB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AACjF,OAAO,EACL,kBAAkB,EAClB,eAAe,GAChB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE1D,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAM7D,OAAO,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAChF,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,EAAE,gCAAgC,EAAE,MAAM,2CAA2C,CAAC;AAE7F;;GAEG;AACH,MAAM,uBAAuB,GAAG,EAAE,CAAC;AA6BnC,kEAAkE;AAClE,+DAA+D;AAC/D,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAE7D;;;GAGG;AACH,MAAM,OAAO,wBAAwB;IACnC,eAAe,CAAkB;IAEjC,WAAW,CAAc,CAAC,gCAAgC;IAE1D,eAAe,CAAc,CAAC,4BAA4B;IAE1D,mBAAmB,CAEhB;IAEH,YAAY,CAAsB;IAElC,cAAc,CAAiB;IAE/B,aAAa,CAA2B;IAExC,UAAU,CAAU;IAEpB,gBAAgB,GACd,wBAAwB,CAAC,YAAY,CAAC;IAExC,6DAA6D;IAC7D,EAAE;IACF,qEAAqE;IACrE,uEAAuE;IACvE,2EAA2E;IAC3E,6EAA6E;IAC7E,8EAA8E;IAC9E,sEAAsE;IACtE,EAAE;IACF,uEAAuE;IACvE,gBAAgB,GAAG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B,CAAC,CAAC;QAC/C,CAAC;IACH,CAAC;CACF","sourcesContent":["import { Hex } from '@metamask/utils';\nimport {\n ExchangeClient,\n HttpTransport,\n InfoClient,\n SubscriptionClient,\n WebSocketTransport,\n} from '@nktkas/hyperliquid';\nimport type { HistoricalOrdersResponse } from '@nktkas/hyperliquid';\n\nimport {\n CandlePeriod,\n calculateCandleCount,\n} from '../constants/chartConfig.js';\nimport { HYPERLIQUID_TRANSPORT_CONFIG } from '../constants/hyperLiquidConfig.js';\nimport {\n PERFORMANCE_CONFIG,\n PERPS_CONSTANTS,\n} from '../constants/perpsConfig.js';\nimport { PERPS_ERROR_CODES } from '../perpsErrorCodes.js';\nimport type { HyperLiquidNetwork } from '../types/config.js';\nimport { WebSocketConnectionState } from '../types/index.js';\nimport type {\n SubscribeCandlesParams,\n PerpsPlatformDependencies,\n} from '../types/index.js';\nimport type { CandleData } from '../types/perps-types.js';\nimport { coalescePerpsRestRequest } from '../utils/coalescePerpsRestRequest.js';\nimport { ensureError, isAbortError } from '../utils/errorUtils.js';\nimport { getPerpsConnectionAttemptContext } from '../utils/perpsConnectionAttemptContext.js';\n\n/**\n * Maximum number of reconnection attempts before giving up.\n */\nconst maxReconnectionAttempts = 10;\n\n/**\n * Valid time intervals for historical candle data\n * Uses CandlePeriod enum for type safety\n */\nexport type ValidCandleInterval = CandlePeriod;\n\n/**\n * Wallet interface for HyperLiquid SDK operations.\n * Extracted for reuse across initialize(), toggleTestnet(), and ensureSubscriptionClient() methods.\n */\nexport type HyperLiquidWalletParams = {\n signTypedData: (params: {\n domain: {\n name: string;\n version: string;\n chainId: number;\n verifyingContract: Hex;\n };\n types: {\n [key: string]: { name: string; type: string }[];\n };\n primaryType: string;\n message: Record<string, unknown>;\n }) => Promise<Hex>;\n getChainId?: () => Promise<number>;\n};\n\n// WebSocketConnectionState is now imported from controllers/types\n// Re-export for backward compatibility with existing consumers\nexport { WebSocketConnectionState } from '../types/index.js';\n\n/**\n * Service for managing HyperLiquid SDK clients\n * Handles initialization, transport creation, and client lifecycle\n */\nexport class HyperLiquidClientService {\n #exchangeClient?: ExchangeClient;\n\n #infoClient?: InfoClient; // WebSocket transport (default)\n\n #infoClientHttp?: InfoClient; // HTTP transport (fallback)\n\n #subscriptionClient?: SubscriptionClient<{\n transport: WebSocketTransport;\n }>;\n\n #wsTransport?: WebSocketTransport;\n\n #httpTransport?: HttpTransport;\n\n #walletParams?: HyperLiquidWalletParams;\n\n #isTestnet: boolean;\n\n #connectionState: WebSocketConnectionState =\n WebSocketConnectionState.Disconnected;\n\n // Monotonic identifier for the current WebSocket connection.\n //\n // Incremented on every raw socket `close`, which covers SDK-internal\n // automatic reconnects as well as manual teardown — the SDK reconnects\n // underneath us without notifying callers, and `terminate` only fires once\n // retries are exhausted. Consumers stamp cached per-connection data with the\n // epoch that produced it and compare on read, so anything carried over from a\n // previous socket is rejected without any explicit invalidation step.\n //\n // Starts at 1 so a stamp of 0 (or an unstamped default) never matches.\n #connectionEpoch = 1;\n\n #disconnectionPromise: Promise<void> | null = null;\n\n // Callback for SDK terminate event (fired when all reconnection attempts exhausted)\n #onTerminateCallback: ((error: Error) => void) | null = null;\n\n #onReconnectCallback?: () => Promise<void>;\n\n // Reconnection attempt counter\n #reconnectionAttempt = 0;\n\n // Connection state change listeners for event-based notifications\n readonly #connectionStateListeners: Set<\n (state: WebSocketConnectionState, reconnectionAttempt: number) => void\n > = new Set();\n\n // Timeout reference for reconnection retry, tracked to enable cancellation on disconnect\n #reconnectionRetryTimeout: ReturnType<typeof setTimeout> | null = null;\n\n // Platform dependencies for logging\n readonly #deps: PerpsPlatformDependencies;\n\n constructor(\n deps: PerpsPlatformDependencies,\n options: { isTestnet?: boolean } = {},\n ) {\n this.#deps = deps;\n this.#isTestnet = options.isTestnet ?? false;\n }\n\n /**\n * Initialize all HyperLiquid SDK clients\n *\n * IMPORTANT: This method awaits transport.ready() to ensure the WebSocket is\n * in OPEN state before marking initialization complete. This prevents race\n * conditions where subscriptions are attempted before the WebSocket handshake\n * completes (which would cause \"subscribe error: undefined\" errors).\n *\n * @param wallet - The wallet parameters for signing typed data.\n */\n public async initialize(wallet: HyperLiquidWalletParams): Promise<void> {\n const network = this.#isTestnet ? 'testnet' : 'mainnet';\n const attemptContext = getPerpsConnectionAttemptContext();\n\n try {\n this.#updateConnectionState(WebSocketConnectionState.Connecting);\n this.#walletParams = wallet;\n this.#createTransports();\n\n // Ensure transports are created\n if (!this.#httpTransport || !this.#wsTransport) {\n throw new Error('Failed to create transports');\n }\n\n this.#createAllClients(wallet);\n\n // Wait for WebSocket to actually be ready before setting CONNECTED\n // This ensures we have a real connection, not just client objects\n await this.#wsTransport.ready();\n\n this.#updateConnectionState(WebSocketConnectionState.Connected);\n\n this.#deps.debugLogger.log('HyperLiquid SDK clients initialized', {\n testnet: this.#isTestnet,\n timestamp: new Date().toISOString(),\n connectionState: this.#connectionState,\n note: 'Using WebSocket for InfoClient (default), HTTP fallback available',\n });\n } catch (error) {\n // Cleanup on failure to prevent leaks and ensure isInitialized() returns false\n // Clear clients first, then transports\n this.#subscriptionClient = undefined;\n this.#infoClient = undefined;\n this.#infoClientHttp = undefined;\n this.#exchangeClient = undefined;\n\n // Close WebSocket transport to release resources and event listeners\n if (this.#wsTransport) {\n try {\n this.#wsTransport.close();\n } catch {\n // Ignore cleanup errors\n }\n this.#wsTransport = undefined;\n // The transport is gone: retire its epoch so a replacement starts fresh\n // and anything cached against the old connection stops matching.\n this.#retireConnectionEpoch();\n }\n this.#httpTransport = undefined;\n\n const errorInstance = ensureError(\n error,\n 'HyperLiquidClientService.initialize',\n );\n this.#updateConnectionState(WebSocketConnectionState.Disconnected);\n\n if (attemptContext?.suppressError) {\n this.#deps.debugLogger.log(\n 'HyperLiquid initialize failed during suppressed startup attempt',\n {\n error: errorInstance.message,\n network,\n source: attemptContext.source,\n },\n );\n } else {\n this.#deps.logger.error(errorInstance, {\n tags: {\n feature: PERPS_CONSTANTS.FeatureName,\n service: 'HyperLiquidClientService',\n network,\n },\n context: {\n name: 'sdk_initialization',\n data: {\n operation: 'initialize',\n isTestnet: this.#isTestnet,\n source: attemptContext?.source ?? 'unspecified',\n },\n },\n });\n }\n\n throw error;\n }\n }\n\n /**\n * Create HTTP and WebSocket transports\n * - HTTP for InfoClient and ExchangeClient (request/response operations)\n * - WebSocket for SubscriptionClient (real-time pub/sub)\n *\n * Both transports use SDK's built-in endpoint resolution via isTestnet flag\n *\n * @returns The created WebSocket transport instance.\n */\n #createTransports(): WebSocketTransport {\n // Prevent duplicate transport creation and listener accumulation\n // This guards against re-entry if initialize() is called multiple times\n // (e.g., after a failed initialization attempt that didn't properly clean up)\n if (this.#wsTransport && this.#httpTransport) {\n this.#deps.debugLogger.log(\n 'HyperLiquid: Transports already exist, skipping creation',\n );\n return this.#wsTransport;\n }\n\n this.#deps.debugLogger.log('HyperLiquid: Creating transports', {\n isTestnet: this.#isTestnet,\n timestamp: new Date().toISOString(),\n note: 'SDK will auto-select endpoints based on isTestnet flag',\n });\n\n // HTTP transport for request/response operations (InfoClient, ExchangeClient)\n // SDK automatically selects: mainnet (https://api.hyperliquid.xyz) or testnet (https://api.hyperliquid-testnet.xyz)\n this.#httpTransport = new HttpTransport({\n isTestnet: this.#isTestnet,\n timeout: HYPERLIQUID_TRANSPORT_CONFIG.timeout,\n });\n\n // WebSocket transport for real-time subscriptions (SubscriptionClient)\n // SDK automatically selects: mainnet (wss://api.hyperliquid.xyz/ws) or testnet (wss://api.hyperliquid-testnet.xyz/ws)\n this.#wsTransport = new WebSocketTransport({\n isTestnet: this.#isTestnet,\n ...HYPERLIQUID_TRANSPORT_CONFIG,\n reconnect: HYPERLIQUID_TRANSPORT_CONFIG.reconnect,\n });\n\n // Retire the connection epoch whenever the raw socket closes.\n //\n // This is the only signal that covers an SDK-internal automatic reconnect:\n // the SDK reopens the socket underneath us without notifying callers, and\n // `terminate` fires only once reconnection attempts are exhausted. rews\n // listeners survive reconnections, so attaching once here observes every\n // subsequent close. Data cached against the old epoch stops matching from\n // this moment, with no invalidation call to place correctly.\n //\n // The listener is bound to the transport it was attached to. A retired\n // transport can still emit `close` after it has been replaced — teardown is\n // asynchronous — and acting on that would retire the CURRENT connection's\n // epoch, discarding live positions for no reason. Replacing a transport\n // retires the outgoing epoch explicitly (see #retireConnectionEpoch), so\n // ignoring these late events loses nothing.\n const owningTransport = this.#wsTransport;\n this.#wsTransport.socket.addEventListener('close', () => {\n if (this.#wsTransport !== owningTransport) {\n this.#deps.debugLogger.log(\n 'HyperLiquid: ignoring close from a retired WebSocket transport',\n { connectionEpoch: this.#connectionEpoch },\n );\n return;\n }\n\n this.#connectionEpoch += 1;\n this.#deps.debugLogger.log(\n 'HyperLiquid: WebSocket closed, epoch retired',\n {\n connectionEpoch: this.#connectionEpoch,\n },\n );\n });\n\n // Listen for WebSocket termination (fired when SDK exhausts all reconnection attempts)\n this.#wsTransport.socket.addEventListener('terminate', (event: Event) => {\n const customEvent = event as CustomEvent;\n this.#deps.debugLogger.log('HyperLiquid: WebSocket terminated', {\n reason: customEvent.detail?.code,\n timestamp: new Date().toISOString(),\n });\n\n this.#updateConnectionState(WebSocketConnectionState.Disconnected);\n\n if (this.#onTerminateCallback) {\n const error =\n customEvent.detail instanceof Error\n ? customEvent.detail\n : new Error(\n `WebSocket terminated: ${customEvent.detail?.code ?? 'unknown'}`,\n );\n this.#onTerminateCallback(error);\n }\n });\n\n return this.#wsTransport;\n }\n\n /**\n * Create all SDK clients using the current transports.\n * Shared by initialize() and #handleConnectionDrop() to avoid drift.\n *\n * @param wallet - Optional wallet params. Uses stored #walletParams when omitted (reconnection path).\n */\n #createAllClients(wallet?: HyperLiquidWalletParams): void {\n if (!this.#wsTransport || !this.#httpTransport) {\n throw new Error('Transports must be created before clients');\n }\n\n this.#infoClient = new InfoClient({ transport: this.#wsTransport });\n this.#subscriptionClient = new SubscriptionClient({\n transport: this.#wsTransport,\n });\n this.#createHttpClients(wallet);\n }\n\n /**\n * Create the HTTP-backed SDK clients.\n *\n * @param wallet - Optional wallet params. Uses stored #walletParams when omitted.\n */\n #createHttpClients(wallet?: HyperLiquidWalletParams): void {\n const effectiveWallet = wallet ?? this.#walletParams;\n\n if (!this.#httpTransport) {\n throw new Error('HTTP transport must be created before clients');\n }\n\n this.#infoClientHttp = new InfoClient({ transport: this.#httpTransport });\n\n if (effectiveWallet) {\n this.#exchangeClient = new ExchangeClient({\n wallet: effectiveWallet as any, // eslint-disable-line @typescript-eslint/no-explicit-any -- Type widening for SDK compatibility\n transport: this.#httpTransport,\n });\n } else {\n this.#exchangeClient = undefined;\n }\n }\n\n /**\n * Toggle testnet mode and reinitialize clients\n *\n * @param wallet - The wallet parameters for signing typed data.\n * @returns The new network name after toggling.\n */\n public async toggleTestnet(\n wallet: HyperLiquidWalletParams,\n ): Promise<HyperLiquidNetwork> {\n this.#isTestnet = !this.#isTestnet;\n await this.initialize(wallet);\n return this.#isTestnet ? 'testnet' : 'mainnet';\n }\n\n /**\n * Check if clients are properly initialized\n *\n * @returns True if all SDK clients are initialized.\n */\n public isInitialized(): boolean {\n return Boolean(\n this.#exchangeClient &&\n this.#infoClient &&\n this.#infoClientHttp &&\n this.#subscriptionClient,\n );\n }\n\n /**\n * Ensure clients are initialized, throw if not\n */\n public ensureInitialized(): void {\n if (!this.isInitialized()) {\n throw new Error(PERPS_ERROR_CODES.CLIENT_NOT_INITIALIZED);\n }\n }\n\n /**\n * Recreate subscription client if needed (for reconnection scenarios)\n *\n * @param wallet - The wallet parameters for signing typed data.\n */\n public async ensureSubscriptionClient(\n wallet: HyperLiquidWalletParams,\n ): Promise<void> {\n if (!this.#subscriptionClient) {\n // A reconnect publishes its WebSocket clients only after transport.ready().\n // Do not start a competing initialize() while that attempt or its retry\n // backoff is active; callers will observe an unavailable subscription\n // client until the reconnect completes and restores tracked subscriptions.\n if (this.#isReconnecting || this.#reconnectionRetryTimeout) {\n return;\n }\n\n this.#deps.debugLogger.log(\n 'HyperLiquid: Recreating subscription client after disconnect',\n );\n\n if (\n this.#walletParams &&\n this.#connectionState === WebSocketConnectionState.Disconnected\n ) {\n await this.reconnect();\n } else {\n await this.initialize(wallet);\n }\n }\n }\n\n /**\n * Get the exchange client\n *\n * @returns The initialized ExchangeClient instance.\n */\n public getExchangeClient(): ExchangeClient {\n if (!this.#exchangeClient) {\n this.ensureInitialized();\n throw new Error(PERPS_ERROR_CODES.EXCHANGE_CLIENT_NOT_AVAILABLE);\n }\n return this.#exchangeClient;\n }\n\n /**\n * Get the info client\n *\n * @param options - The options for selecting the transport.\n * @param options.useHttp - Force HTTP transport instead of WebSocket (default: false).\n * @returns InfoClient instance with the selected transport.\n */\n public getInfoClient(options?: { useHttp?: boolean }): InfoClient {\n if (options?.useHttp) {\n if (!this.#infoClientHttp) {\n this.ensureInitialized();\n throw new Error(PERPS_ERROR_CODES.INFO_CLIENT_NOT_AVAILABLE);\n }\n return this.#infoClientHttp;\n }\n\n this.ensureInitialized();\n if (!this.#infoClient) {\n throw new Error(PERPS_ERROR_CODES.INFO_CLIENT_NOT_AVAILABLE);\n }\n return this.#infoClient;\n }\n\n /**\n * Get the subscription client\n *\n * @returns The SubscriptionClient instance, or undefined if not initialized.\n */\n public getSubscriptionClient():\n | SubscriptionClient<{ transport: WebSocketTransport }>\n | undefined {\n if (!this.#subscriptionClient) {\n this.#deps.debugLogger.log('SubscriptionClient not initialized');\n return undefined;\n }\n return this.#subscriptionClient;\n }\n\n /**\n * Ensures the WebSocket transport is in OPEN state and ready for subscriptions.\n * This MUST be called before any subscription operations to prevent race conditions.\n *\n * The SDK's `transport.ready()` method:\n * - Returns immediately if WebSocket is already in OPEN state\n * - Waits for the \"open\" event if WebSocket is in CONNECTING state\n * - Supports AbortSignal for timeout/cancellation\n *\n * @param options - The options for transport readiness check.\n * @param options.timeoutMs - Maximum time to wait for transport ready (default 5000ms).\n * @throws Error if transport not ready within timeout or subscription client unavailable.\n */\n public async ensureTransportReady(\n options: { timeoutMs?: number } = {},\n ): Promise<void> {\n const { timeoutMs = 5000 } = options;\n const subscriptionClient = this.getSubscriptionClient();\n if (!subscriptionClient) {\n throw new Error('Subscription client not initialized');\n }\n\n const controller = new AbortController();\n const timeoutId = setTimeout(\n () =>\n controller.abort(\n new Error(`WebSocket transport ready timeout after ${timeoutMs}ms`),\n ),\n timeoutMs,\n );\n\n try {\n await subscriptionClient.config_.transport.ready(controller.signal);\n } catch (error) {\n if (controller.signal.aborted) {\n throw new Error(\n `WebSocket transport ready timeout after ${timeoutMs}ms`,\n );\n }\n throw ensureError(error, 'HyperLiquidClientService.ensureTransportReady');\n } finally {\n clearTimeout(timeoutId);\n }\n }\n\n /**\n * Get current network state\n *\n * @returns The current HyperLiquid network (mainnet or testnet).\n */\n public getNetwork(): HyperLiquidNetwork {\n return this.#isTestnet ? 'testnet' : 'mainnet';\n }\n\n /**\n * Check if running on testnet\n *\n * @returns True if the service is in testnet mode.\n */\n public isTestnetMode(): boolean {\n return this.#isTestnet;\n }\n\n /**\n * Update testnet mode\n *\n * @param isTestnet - Whether to enable testnet mode.\n */\n public setTestnetMode(isTestnet: boolean): void {\n this.#isTestnet = isTestnet;\n }\n\n /**\n * Fetch historical candle data using the HyperLiquid SDK\n *\n * @param options - The candle fetch configuration.\n * @param options.symbol - The asset symbol (e.g., \"BTC\", \"ETH\").\n * @param options.interval - The candle interval (e.g., \"1m\", \"5m\", \"15m\", \"1h\", \"1d\").\n * @param options.limit - Number of candles to fetch (default: 100).\n * @param options.endTime - End timestamp in milliseconds (default: now).\n * @param options.signal - Optional AbortSignal to cancel the fetch.\n * @returns The historical candle data, or null if no data is available.\n */\n public async fetchHistoricalCandles(options: {\n symbol: string;\n interval: ValidCandleInterval;\n limit?: number;\n endTime?: number;\n signal?: AbortSignal;\n }): Promise<CandleData | null> {\n const { symbol, interval, limit = 100, endTime, signal } = options;\n\n if (signal?.aborted) {\n const abortError = new Error('Aborted');\n abortError.name = 'AbortError';\n throw abortError;\n }\n\n // Explicit endTime is a paging call — the caller owns that exact window\n // and expects a fresh page. Coalescing per-millisecond endTimes produces\n // keys that never dedupe and never evict (TTL-miss sweep only fires on\n // re-access with the same key), so route paging straight to the SDK and\n // only coalesce the live-snapshot path where all callers share 'now'.\n if (endTime !== undefined) {\n return this.#runCandleSnapshotFetch({\n symbol,\n interval,\n limit,\n endTime,\n signal,\n });\n }\n\n // Live snapshot: coalesce across rapid market switches (pass 1 → pass 2\n // of the 10-market stress loop) so callers share one snapshot per\n // (symbol, interval).\n // Signal is intentionally dropped inside the coalesced fetch — the HL\n // SDK charges weight for any request already sent, and dropping a\n // per-caller abort lets the next caller reuse the in-flight/cached\n // result instead of re-firing the REST. The WS stream keeps live\n // candles fresh, so reusing the first-caller snapshot for up to the\n // TTL is acceptable.\n const cacheKey = [\n 'candleSnapshot',\n this.#isTestnet ? 'testnet' : 'mainnet',\n symbol,\n interval,\n limit,\n ].join('|');\n\n return coalescePerpsRestRequest<CandleData | null>(\n cacheKey,\n () => this.#runCandleSnapshotFetch({ symbol, interval, limit }),\n { ttlMs: PERFORMANCE_CONFIG.PerpsCandleCoalesceTtlMs },\n );\n }\n\n async #runCandleSnapshotFetch(options: {\n symbol: string;\n interval: ValidCandleInterval;\n limit: number;\n endTime?: number;\n signal?: AbortSignal;\n }): Promise<CandleData | null> {\n const { symbol, interval, limit, endTime, signal } = options;\n try {\n const now = endTime ?? Date.now();\n const intervalMs = this.#getIntervalMilliseconds(interval);\n const startTime = now - limit * intervalMs;\n\n // Use HTTP transport for historical candle snapshots (request/response).\n // This avoids the WebSocket abort race condition that causes 429s\n // during rapid market switching on extension (#TAT-2954).\n const infoClient = this.getInfoClient({ useHttp: true });\n const request = {\n coin: symbol, // Map to HyperLiquid SDK's 'coin' parameter\n interval,\n startTime,\n endTime: now,\n };\n const data = signal\n ? await infoClient.candleSnapshot(request, signal)\n : await infoClient.candleSnapshot(request);\n\n if (Array.isArray(data) && data.length > 0) {\n const candles = data.map((candle) => ({\n time: candle.t, // open time\n open: candle.o.toString(),\n high: candle.h.toString(),\n low: candle.l.toString(),\n close: candle.c.toString(),\n volume: candle.v.toString(),\n }));\n\n return {\n symbol,\n interval,\n candles,\n };\n }\n\n return {\n symbol,\n interval,\n candles: [],\n };\n } catch (error) {\n const errorInstance = ensureError(\n error,\n 'HyperLiquidClientService.fetchHistoricalCandles',\n );\n\n if (isAbortError(error)) {\n throw error;\n }\n\n // Log to Sentry: prevents initial chart data load\n this.#deps.logger.error(errorInstance, {\n tags: {\n feature: PERPS_CONSTANTS.FeatureName,\n service: 'HyperLiquidClientService',\n network: this.#isTestnet ? 'testnet' : 'mainnet',\n },\n context: {\n name: 'historical_candles_api',\n data: {\n operation: 'fetchHistoricalCandles',\n symbol,\n interval,\n limit,\n hasEndTime: endTime !== undefined,\n },\n },\n });\n\n throw error;\n }\n }\n\n /**\n * Fetch the user's historical orders via the HyperLiquid SDK, coalesced\n * across concurrent callers and cached for {@link PERFORMANCE_CONFIG.PerpsRestCoalesceTtlMs}.\n *\n * Both getOrders (service layer) and the getUserFills enrichment sidecar\n * (fills→order-type resolution for TP/SL pills in activity) hit the same\n * `historicalOrders` info-post. Routing both through this wrapper means the\n * enrichment path rides the same cache as an explicit activity-page fetch,\n * so rapid market switching never fires redundant HL traffic.\n *\n * Pass `forceRefresh: true` to bypass the coalesce cache end-to-end\n * (hooks → controller → MarketDataService → provider → this method), which\n * is required for pull-to-refresh to fetch fresh data from the network.\n *\n * @param userAddress - The user's 0x address to query.\n * @param options - Optional cache-control options.\n * @param options.forceRefresh - When true, bypasses the coalesce cache.\n * @returns Array of historical orders, empty array on SDK null.\n */\n public async fetchHistoricalOrders(\n userAddress: Hex,\n options?: { forceRefresh?: boolean },\n ): Promise<HistoricalOrdersResponse> {\n this.ensureInitialized();\n\n const cacheKey = [\n 'historicalOrders',\n this.#isTestnet ? 'testnet' : 'mainnet',\n userAddress.toLowerCase(),\n ].join('|');\n\n return coalescePerpsRestRequest<HistoricalOrdersResponse>(\n cacheKey,\n () => this.#runHistoricalOrdersFetch(userAddress),\n { forceRefresh: options?.forceRefresh },\n );\n }\n\n async #runHistoricalOrdersFetch(\n userAddress: Hex,\n ): Promise<HistoricalOrdersResponse> {\n const infoClient = this.getInfoClient();\n const result = await infoClient.historicalOrders({ user: userAddress });\n return result ?? [];\n }\n\n /**\n * Subscribe to candle updates via WebSocket\n *\n * @param root0 - The subscription parameters.\n * @param root0.symbol - The asset symbol (e.g., \"BTC\", \"ETH\").\n * @param root0.interval - The candle interval (e.g., \"1m\", \"5m\", \"15m\").\n * @param root0.duration - Optional time duration for calculating initial fetch size.\n * @param root0.callback - Function called with updated candle data.\n * @param root0.onError - Optional function called if subscription initialization fails.\n * @returns Cleanup function to unsubscribe.\n */\n public subscribeToCandles({\n symbol,\n interval,\n duration,\n callback,\n onError,\n }: SubscribeCandlesParams): () => void {\n this.ensureInitialized();\n\n const subscriptionClient = this.getSubscriptionClient();\n if (!subscriptionClient) {\n throw new Error(PERPS_ERROR_CODES.SUBSCRIPTION_CLIENT_NOT_AVAILABLE);\n }\n\n let currentCandleData: CandleData | null = null;\n let wsUnsubscribe: (() => void) | null = null;\n let isUnsubscribed = false;\n let hasUnsubscribeStarted = false;\n // Store the subscription promise to enable cleanup even when pending\n // This fixes a race condition where component unmounts before subscription resolves\n type CandleSubscription = Awaited<\n ReturnType<typeof subscriptionClient.candle>\n >;\n let subscriptionPromise: Promise<CandleSubscription> | null = null;\n\n const unsubscribeFromCandles = (subscription: CandleSubscription): void => {\n if (hasUnsubscribeStarted) {\n return;\n }\n hasUnsubscribeStarted = true;\n\n const logUnsubscribeError = (error: unknown): void => {\n const errorInstance = ensureError(\n error,\n 'HyperLiquidClientService.subscribeToCandles',\n );\n\n if (errorInstance.message.startsWith('Already unsubscribed')) {\n return;\n }\n\n this.#deps.logger.error(errorInstance, {\n tags: {\n feature: PERPS_CONSTANTS.FeatureName,\n service: 'HyperLiquidClientService',\n network: this.#isTestnet ? 'testnet' : 'mainnet',\n },\n context: {\n name: 'websocket_unsubscription',\n data: {\n operation: 'subscribeToCandles',\n symbol,\n interval,\n phase: 'ws_unsubscription',\n },\n },\n });\n };\n\n try {\n Promise.resolve(subscription.unsubscribe()).catch(logUnsubscribeError);\n } catch (error) {\n logUnsubscribeError(error);\n }\n };\n\n // AbortController to cancel in-flight REST calls (candleSnapshot) on cleanup.\n // Prevents rate limit exhaustion when rapidly switching markets (#28141).\n const abortController = new AbortController();\n\n // Calculate initial fetch size dynamically based on duration and interval\n // Match main branch behavior: up to 500 candles initially\n const initialLimit = duration\n ? Math.min(calculateCandleCount(duration, interval), 500)\n : 100; // Default to 100 if no duration provided\n\n // 1. Fetch initial historical data, then subscribe to WebSocket updates\n // Using an async IIFE to avoid nested promises and callback-in-promise issues\n const initAndSubscribe = async (): Promise<void> => {\n try {\n const initialData = await this.fetchHistoricalCandles({\n symbol,\n interval,\n limit: initialLimit,\n signal: abortController.signal,\n });\n\n // Don't proceed if already unsubscribed\n if (isUnsubscribed) {\n return;\n }\n\n currentCandleData = initialData;\n if (currentCandleData) {\n callback(currentCandleData);\n }\n\n // 2. Subscribe to WebSocket for new candles\n // HyperLiquid SDK uses 'coin' terminology\n // Store the promise so cleanup can wait for it if needed\n subscriptionPromise = subscriptionClient.candle(\n { coin: symbol, interval }, // Map to HyperLiquid SDK's 'coin' parameter\n (candleEvent) => {\n // Don't process events if already unsubscribed\n if (isUnsubscribed) {\n return;\n }\n\n // Transform SDK CandleEvent to our Candle format\n const newCandle = {\n time: candleEvent.t,\n open: candleEvent.o.toString(),\n high: candleEvent.h.toString(),\n low: candleEvent.l.toString(),\n close: candleEvent.c.toString(),\n volume: candleEvent.v.toString(),\n };\n\n if (currentCandleData) {\n // Check if this is an update to the last candle or a new candle\n const { candles } = currentCandleData;\n const lastCandle = candles[candles.length - 1];\n\n if (lastCandle?.time === newCandle.time) {\n // Update existing candle (live candle update)\n // Create new array with updated last element to trigger React re-render\n currentCandleData = {\n ...currentCandleData,\n candles: [...candles.slice(0, -1), newCandle],\n };\n } else {\n // New candle (completed candle)\n // Create new array with added element to trigger React re-render\n currentCandleData = {\n ...currentCandleData,\n candles: [...candles, newCandle],\n };\n }\n } else {\n currentCandleData = {\n symbol,\n interval,\n candles: [newCandle],\n };\n }\n\n callback(currentCandleData);\n },\n );\n\n // Store cleanup function when subscription resolves\n try {\n const sub = await subscriptionPromise;\n wsUnsubscribe = (): void => unsubscribeFromCandles(sub);\n // If already unsubscribed while waiting, clean up immediately\n if (isUnsubscribed) {\n wsUnsubscribe();\n wsUnsubscribe = null;\n }\n } catch (error) {\n const errorInstance = ensureError(\n error,\n 'HyperLiquidClientService.subscribeToCandles',\n );\n\n // Log to Sentry: WebSocket subscription failure prevents live updates\n this.#deps.logger.error(errorInstance, {\n tags: {\n feature: PERPS_CONSTANTS.FeatureName,\n service: 'HyperLiquidClientService',\n network: this.#isTestnet ? 'testnet' : 'mainnet',\n },\n context: {\n name: 'websocket_subscription',\n data: {\n operation: 'subscribeToCandles',\n symbol,\n interval,\n phase: 'ws_subscription',\n },\n },\n });\n\n // Notify caller of error\n onError?.(errorInstance);\n }\n } catch (error) {\n // Skip logging and notification for intentional abort (user navigated away)\n if (abortController.signal.aborted) {\n return;\n }\n\n const errorInstance = ensureError(\n error,\n 'HyperLiquidClientService.subscribeToCandles',\n );\n\n // Log to Sentry: initial fetch failure blocks chart completely\n this.#deps.logger.error(errorInstance, {\n tags: {\n feature: PERPS_CONSTANTS.FeatureName,\n service: 'HyperLiquidClientService',\n network: this.#isTestnet ? 'testnet' : 'mainnet',\n },\n context: {\n name: 'initial_candles_fetch',\n data: {\n operation: 'subscribeToCandles',\n symbol,\n interval,\n phase: 'initial_fetch',\n initialLimit,\n },\n },\n });\n\n // Notify caller of error\n onError?.(errorInstance);\n }\n };\n\n // Fire-and-forget the async initialization\n initAndSubscribe().catch(() => {\n // Error already handled inside initAndSubscribe\n });\n\n // Return cleanup function\n return () => {\n isUnsubscribed = true;\n // Cancel any in-flight REST calls (candleSnapshot) to conserve rate limit budget (#28141)\n abortController.abort();\n if (wsUnsubscribe) {\n // Subscription already resolved - unsubscribe directly\n wsUnsubscribe();\n wsUnsubscribe = null;\n } else if (subscriptionPromise) {\n // Subscription promise still pending - wait for it and clean up\n // This prevents WebSocket subscription leaks when component unmounts\n // before the subscription promise resolves\n subscriptionPromise\n .then((sub) => unsubscribeFromCandles(sub))\n .catch(() => {\n // Ignore errors during cleanup - subscription may have failed\n });\n subscriptionPromise = null;\n }\n };\n }\n\n /**\n * Convert interval string to milliseconds\n *\n * @param interval - The candle period interval to convert.\n * @returns The interval duration in milliseconds.\n */\n #getIntervalMilliseconds(interval: CandlePeriod): number {\n const intervalMap: Record<CandlePeriod, number> = {\n [CandlePeriod.OneMinute]: 1 * 60 * 1000,\n [CandlePeriod.ThreeMinutes]: 3 * 60 * 1000,\n [CandlePeriod.FiveMinutes]: 5 * 60 * 1000,\n [CandlePeriod.FifteenMinutes]: 15 * 60 * 1000,\n [CandlePeriod.ThirtyMinutes]: 30 * 60 * 1000,\n [CandlePeriod.OneHour]: 60 * 60 * 1000,\n [CandlePeriod.TwoHours]: 2 * 60 * 60 * 1000,\n [CandlePeriod.FourHours]: 4 * 60 * 60 * 1000,\n [CandlePeriod.EightHours]: 8 * 60 * 60 * 1000,\n [CandlePeriod.TwelveHours]: 12 * 60 * 60 * 1000,\n [CandlePeriod.OneDay]: 24 * 60 * 60 * 1000,\n [CandlePeriod.ThreeDays]: 3 * 24 * 60 * 60 * 1000,\n [CandlePeriod.OneWeek]: 7 * 24 * 60 * 60 * 1000,\n [CandlePeriod.OneMonth]: 30 * 24 * 60 * 60 * 1000, // Approximate\n };\n\n return intervalMap[interval];\n }\n\n /**\n * Disconnect and cleanup all clients\n *\n * @returns A promise that resolves when disconnection is complete.\n */\n public async disconnect(): Promise<void> {\n // Await existing promise if already disconnecting\n if (this.#disconnectionPromise) {\n await this.#disconnectionPromise;\n return;\n }\n\n // If already disconnected, return immediately\n if (this.#connectionState === WebSocketConnectionState.Disconnected) {\n return;\n }\n\n // Create and store the disconnection promise\n this.#disconnectionPromise = this.#performDisconnection();\n\n try {\n await this.#disconnectionPromise;\n } finally {\n this.#disconnectionPromise = null;\n }\n }\n\n async #performDisconnection(): Promise<void> {\n try {\n this.#updateConnectionState(WebSocketConnectionState.Disconnecting);\n\n this.#deps.debugLogger.log('HyperLiquid: Disconnecting SDK clients', {\n isTestnet: this.#isTestnet,\n timestamp: new Date().toISOString(),\n connectionState: this.#connectionState,\n });\n\n // Clear callbacks\n this.#onReconnectCallback = undefined;\n this.#onTerminateCallback = null;\n\n // Cancel any pending reconnection retry timeout\n if (this.#reconnectionRetryTimeout) {\n clearTimeout(this.#reconnectionRetryTimeout);\n this.#reconnectionRetryTimeout = null;\n }\n\n // Clear connection state listeners to prevent stale callbacks\n this.#connectionStateListeners.clear();\n\n // Reset reconnection flag to allow future manual retries\n // This prevents a race condition where disconnecting during an active\n // reconnection attempt could leave the flag stuck, blocking subsequent retries\n this.#isReconnecting = false;\n\n // Close WebSocket transport only (HTTP is stateless)\n if (this.#wsTransport) {\n try {\n this.#wsTransport.close();\n this.#deps.debugLogger.log(\n 'HyperLiquid: Closed WebSocket transport',\n {\n timestamp: new Date().toISOString(),\n },\n );\n } catch (error) {\n this.#deps.logger.error(\n ensureError(error, 'HyperLiquidClientService.performDisconnection'),\n {\n tags: { feature: PERPS_CONSTANTS.FeatureName },\n context: {\n name: 'HyperLiquidClientService.performDisconnection',\n data: { action: 'close_transport' },\n },\n },\n );\n }\n }\n\n // Clear client references\n this.#subscriptionClient = undefined;\n this.#exchangeClient = undefined;\n this.#infoClient = undefined;\n this.#infoClientHttp = undefined;\n this.#wsTransport = undefined;\n // The transport is gone: retire its epoch so a replacement starts fresh\n // and anything cached against the old connection stops matching.\n this.#retireConnectionEpoch();\n this.#httpTransport = undefined;\n\n this.#updateConnectionState(WebSocketConnectionState.Disconnected);\n\n this.#deps.debugLogger.log(\n 'HyperLiquid: SDK clients fully disconnected',\n {\n timestamp: new Date().toISOString(),\n connectionState: this.#connectionState,\n },\n );\n } catch (error) {\n this.#updateConnectionState(WebSocketConnectionState.Disconnected);\n this.#deps.logger.error(\n ensureError(error, 'HyperLiquidClientService.performDisconnection'),\n {\n tags: { feature: PERPS_CONSTANTS.FeatureName },\n context: {\n name: 'HyperLiquidClientService.performDisconnection',\n data: { action: 'outer_catch' },\n },\n },\n );\n throw error;\n }\n }\n\n /**\n * Get current WebSocket connection state\n *\n * @returns The current WebSocket connection state.\n */\n public getConnectionState(): WebSocketConnectionState {\n return this.#connectionState;\n }\n\n /**\n * Get the identifier of the current WebSocket connection.\n *\n * The value changes whenever the raw socket closes — including an SDK-internal\n * automatic reconnect, which is otherwise invisible to callers. Stamp cached\n * per-connection data with the epoch that produced it and compare on read:\n * anything carried across a reconnect stops matching on its own, so there is\n * no invalidation hook that can be attached at the wrong lifecycle point.\n *\n * @returns The current connection epoch. Never 0, so an unstamped default\n * cannot be mistaken for a live connection.\n */\n public getConnectionEpoch(): number {\n return this.#connectionEpoch;\n }\n\n /**\n * Retire the current connection epoch.\n *\n * Called when the WebSocket transport is discarded, so a replacement starts on\n * a fresh epoch and everything cached against the old connection stops\n * matching. The socket's own `close` listener cannot be relied on here: it may\n * fire after the transport has already been replaced, at which point it is\n * ignored precisely so it cannot retire the new connection's epoch.\n *\n * Retiring twice for one connection is harmless — the epoch is an identity,\n * not a count — so callers do not need to know whether `close` already fired.\n */\n #retireConnectionEpoch(): void {\n this.#connectionEpoch += 1;\n this.#deps.debugLogger.log('HyperLiquid: connection epoch retired', {\n connectionEpoch: this.#connectionEpoch,\n });\n }\n\n /**\n * Check if WebSocket is fully disconnected\n *\n * @returns True if the WebSocket is in disconnected state.\n */\n public isDisconnected(): boolean {\n return this.#connectionState === WebSocketConnectionState.Disconnected;\n }\n\n /**\n * Set callback to be invoked when reconnection is needed\n * This allows the service to notify external components (like PerpsConnectionManager)\n * when a connection drop is detected\n *\n * @param callback - The async callback to invoke when reconnection is needed.\n */\n public setOnReconnectCallback(callback: () => Promise<void>): void {\n this.#onReconnectCallback = callback;\n }\n\n /**\n * Set callback for WebSocket termination events\n * Called when the SDK exhausts all reconnection attempts\n *\n * @param callback - The callback to invoke on termination, or null to clear.\n */\n public setOnTerminateCallback(\n callback: ((error: Error) => void) | null,\n ): void {\n this.#onTerminateCallback = callback;\n }\n\n /**\n * Subscribe to connection state changes.\n * The listener will be called immediately with the current state and whenever the state changes.\n *\n * @param listener - Callback function that receives the new connection state and reconnection attempt\n * @returns Unsubscribe function to remove the listener\n */\n public subscribeToConnectionState(\n listener: (\n state: WebSocketConnectionState,\n reconnectionAttempt: number,\n ) => void,\n ): () => void {\n this.#connectionStateListeners.add(listener);\n\n // Immediately notify with current state\n // Wrap in try-catch to match notifyConnectionStateListeners behavior\n // This ensures the unsubscribe function is always returned even if listener throws\n try {\n listener(this.#connectionState, this.#reconnectionAttempt);\n } catch {\n // Ignore errors in listeners to prevent breaking subscription mechanism\n // If listener throws, it will be removed when unsubscribe is called\n }\n\n // Return unsubscribe function\n return () => {\n this.#connectionStateListeners.delete(listener);\n };\n }\n\n /**\n * Update connection state and notify all listeners\n * Always notifies if state changes OR if we're in CONNECTING state (to update attempt count)\n *\n * @param newState - The new WebSocket connection state.\n */\n #updateConnectionState(newState: WebSocketConnectionState): void {\n const previousState = this.#connectionState;\n const stateChanged = previousState !== newState;\n const isReconnectionAttempt =\n newState === WebSocketConnectionState.Connecting &&\n this.#reconnectionAttempt > 0;\n\n this.#connectionState = newState;\n\n // Reset reconnection attempt counter when successfully connected\n if (newState === WebSocketConnectionState.Connected) {\n this.#reconnectionAttempt = 0;\n }\n\n // Notify if state changed OR if this is a reconnection attempt (to update attempt count)\n if (stateChanged || isReconnectionAttempt) {\n this.#notifyConnectionStateListeners();\n }\n }\n\n /**\n * Notify all connection state listeners of the current state\n */\n #notifyConnectionStateListeners(): void {\n this.#connectionStateListeners.forEach((listener) => {\n try {\n listener(this.#connectionState, this.#reconnectionAttempt);\n } catch {\n // Ignore errors in listeners to prevent breaking other listeners\n }\n });\n }\n\n // Flag to prevent concurrent reconnection attempts\n #isReconnecting = false;\n\n /**\n * Manually trigger a reconnection attempt.\n * This is exposed for UI retry buttons when user wants to force reconnection.\n * Resets the reconnection attempt counter to allow retrying after max attempts.\n */\n public async reconnect(): Promise<void> {\n this.#deps.debugLogger.log(\n '[HyperLiquidClientService] reconnect() called',\n {\n previousAttempt: this.#reconnectionAttempt,\n currentState: this.#connectionState,\n },\n );\n // Reset attempt counter when user manually triggers retry\n this.#reconnectionAttempt = 0;\n await this.#handleConnectionDrop();\n this.#deps.debugLogger.log(\n '[HyperLiquidClientService] reconnect() completed',\n {\n newState: this.#connectionState,\n },\n );\n }\n\n /**\n * Handle detected connection drop\n * Recreates WebSocket transport and notifies callback to restore subscriptions\n * Will give up after maxReconnectionAttempts and mark status as disconnected\n */\n async #handleConnectionDrop(): Promise<void> {\n // Prevent multiple simultaneous reconnection attempts\n if (this.#isReconnecting) {\n return;\n }\n\n this.#isReconnecting = true;\n\n // Increment reconnection attempt counter\n this.#reconnectionAttempt += 1;\n\n // Check if we've exceeded max retry attempts\n if (this.#reconnectionAttempt > maxReconnectionAttempts) {\n this.#isReconnecting = false;\n this.#updateConnectionState(WebSocketConnectionState.Disconnected);\n return;\n }\n\n try {\n this.#updateConnectionState(WebSocketConnectionState.Connecting);\n\n // Close existing WebSocket transport and clear references\n // so createTransports() will create fresh ones\n if (this.#wsTransport) {\n try {\n this.#wsTransport.close();\n } catch {\n // Ignore errors during close - transport may already be dead\n }\n }\n this.#wsTransport = undefined;\n // The transport is gone: retire its epoch so a replacement starts fresh\n // and anything cached against the old connection stops matching.\n this.#retireConnectionEpoch();\n this.#httpTransport = undefined;\n\n // WebSocket clients are unavailable throughout the reconnect. HTTP\n // clients remain usable while the new socket is staged and verified.\n this.#subscriptionClient = undefined;\n this.#infoClient = undefined;\n\n // Recreate transports (both WS and HTTP)\n const newWsTransport = this.#createTransports();\n\n const newInfoClient = new InfoClient({ transport: newWsTransport });\n const newSubscriptionClient = new SubscriptionClient({\n transport: newWsTransport,\n });\n this.#createHttpClients();\n\n await newWsTransport.ready();\n\n // Publish WebSocket clients only after the transport is usable. This\n // keeps isInitialized() false and blocks WS-backed access during a\n // failed or in-flight reconnect without disabling HTTP-backed trading.\n this.#infoClient = newInfoClient;\n this.#subscriptionClient = newSubscriptionClient;\n\n this.#deps.debugLogger.log(\n 'HyperLiquid: Transport ready, restoring subscriptions',\n { timestamp: new Date().toISOString() },\n );\n\n // NOW safe to restore subscriptions\n if (this.#onReconnectCallback) {\n await this.#onReconnectCallback();\n }\n\n // Cancel any pending retry timeout from previous failed attempts\n if (this.#reconnectionRetryTimeout) {\n clearTimeout(this.#reconnectionRetryTimeout);\n this.#reconnectionRetryTimeout = null;\n }\n\n this.#updateConnectionState(WebSocketConnectionState.Connected);\n this.#isReconnecting = false;\n } catch {\n // The staged WebSocket clients were never published. Keep the HTTP\n // clients alive so exchange writes and explicit HTTP info reads remain\n // available while the WebSocket retry loop continues.\n this.#subscriptionClient = undefined;\n this.#infoClient = undefined;\n\n if (this.#wsTransport) {\n try {\n this.#wsTransport.close();\n } catch {\n // Ignore cleanup errors - transport may already be dead\n }\n }\n this.#wsTransport = undefined;\n // The transport is gone: retire its epoch so a replacement starts fresh\n // and anything cached against the old connection stops matching.\n this.#retireConnectionEpoch();\n\n // Reset flag before scheduling retry so the next attempt can proceed\n this.#isReconnecting = false;\n\n // Check if we've exceeded max retry attempts\n if (this.#reconnectionAttempt >= maxReconnectionAttempts) {\n this.#updateConnectionState(WebSocketConnectionState.Disconnected);\n return;\n }\n\n // Reconnection failed - schedule a retry after a delay\n // Store timeout reference so it can be cancelled on intentional disconnect\n this.#reconnectionRetryTimeout = setTimeout(() => {\n this.#reconnectionRetryTimeout = null; // Clear reference after execution\n // Only retry if we haven't been intentionally disconnected\n // and no manual reconnect() is already in progress\n // Note: State may be CONNECTING or DISCONNECTED (if terminate event fired during reconnect)\n if (\n (this.#connectionState === WebSocketConnectionState.Connecting ||\n this.#connectionState === WebSocketConnectionState.Disconnected) &&\n !this.#disconnectionPromise &&\n !this.#isReconnecting\n ) {\n this.#handleConnectionDrop().catch(() => {\n // Error already handled inside #handleConnectionDrop\n });\n }\n }, PERPS_CONSTANTS.ReconnectionRetryDelayMs);\n }\n }\n}\n"]}
@@ -0,0 +1,265 @@
1
+ import type { TwapHistoryResponse, AssetCtxsWsEvent } from '@nktkas/hyperliquid';
2
+ import type { HyperLiquidAbstractionMode } from '../types/hyperliquid-types.js';
3
+ import type { Position, OrderFill, Order, TwapOrder, SubscribePricesParams, SubscribePositionsParams, SubscribeOrderFillsParams, SubscribeOrdersParams, SubscribeTwapOrdersParams, SubscribeAccountParams, SubscribeOICapsParams, SubscribeOrderBookParams, PerpsPlatformDependencies } from '../types/index.js';
4
+ import type { HyperLiquidClientService } from './HyperLiquidClientService.js';
5
+ import type { HyperLiquidWalletService } from './HyperLiquidWalletService.js';
6
+ /**
7
+ * Service for managing HyperLiquid WebSocket subscriptions
8
+ * Implements singleton subscription architecture with reference counting
9
+ */
10
+ export declare class HyperLiquidSubscriptionService {
11
+ #private;
12
+ constructor(clientService: HyperLiquidClientService, walletService: HyperLiquidWalletService, platformDependencies: PerpsPlatformDependencies, hip3Enabled?: boolean, enabledDexs?: string[], allowlistMarkets?: string[], blocklistMarkets?: string[], priceDeviationLimit?: number, discoverEnabledDexs?: () => Promise<string[]>);
13
+ /**
14
+ * Populate DEX meta cache with pre-fetched meta data
15
+ * Called by Provider after buildAssetMapping to share cached meta,
16
+ * avoiding redundant metaAndAssetCtxs/meta API calls during subscription setup
17
+ *
18
+ * @param dex - DEX key ('' for main DEX, 'xyz'/'flx'/etc for HIP-3)
19
+ * @param meta - Meta response containing universe data
20
+ * @param meta.universe - The array of asset universe entries from the meta response.
21
+ */
22
+ setDexMetaCache(dex: string, meta: {
23
+ universe: {
24
+ name: string;
25
+ szDecimals: number;
26
+ maxLeverage: number;
27
+ }[];
28
+ }): void;
29
+ /**
30
+ * Cache asset contexts for a specific DEX from API response
31
+ * This allows buildAssetMapping() to populate cache for getMarketDataWithPrices() to use
32
+ *
33
+ * @param dex - DEX name ('' for main perps)
34
+ * @param assetCtxs - Asset contexts from metaAndAssetCtxs response
35
+ */
36
+ setDexAssetCtxsCache(dex: string, assetCtxs: AssetCtxsWsEvent['ctxs']): void;
37
+ /**
38
+ * Get cached assetCtxs for a DEX
39
+ * Returns the cached asset contexts from WebSocket subscription if available
40
+ *
41
+ * @param dex - DEX key ('' for main DEX, 'xyz'/'flx'/etc for HIP-3)
42
+ * @returns Array of asset contexts or undefined if not cached
43
+ */
44
+ getDexAssetCtxsCache(dex: string): AssetCtxsWsEvent['ctxs'] | undefined;
45
+ /**
46
+ * Update feature flags for HIP-3 support
47
+ * Called when provider configuration changes at runtime
48
+ * Note: Market filtering is NOT applied in subscription service - only in Provider
49
+ *
50
+ * @param hip3Enabled - Whether HIP-3 multi-DEX support is enabled.
51
+ * @param enabledDexs - The array of enabled DEX identifiers.
52
+ * @param allowlistMarkets - The array of allowed market patterns.
53
+ * @param blocklistMarkets - The array of blocked market patterns.
54
+ * @param dexDiscoveryComplete - Whether the DEX list came from a valid discovery response.
55
+ */
56
+ updateFeatureFlags(hip3Enabled: boolean, enabledDexs: string[], allowlistMarkets: string[], blocklistMarkets: string[], dexDiscoveryComplete?: boolean): Promise<void>;
57
+ /**
58
+ * Return the cached HL abstraction mode for the given user address.
59
+ *
60
+ * @param userAddress - The EVM address to look up.
61
+ * @returns Cached abstraction mode, or null when unresolved.
62
+ */
63
+ getCachedAbstractionMode(userAddress: string): HyperLiquidAbstractionMode | null;
64
+ /**
65
+ * Record a user's resolved abstraction mode and immediately re-aggregate.
66
+ * Call after the provider has confirmed the on-chain mode (already-enabled
67
+ * or just-migrated) so the WS-driven aggregator picks up the correct fold
68
+ * decision on the next tick.
69
+ *
70
+ * @param userAddress - The EVM address whose mode is being recorded.
71
+ * @param mode - The current abstraction mode for this user.
72
+ */
73
+ setUserAbstractionMode(userAddress: string, mode: HyperLiquidAbstractionMode): void;
74
+ /**
75
+ * Subscribe to live price updates with singleton subscription architecture
76
+ * Uses allMids for fast price updates and predictedFundings for accurate funding rates
77
+ *
78
+ * @param params - The subscription parameters including symbols and callbacks.
79
+ * @returns A cleanup function to unsubscribe from price updates.
80
+ */
81
+ subscribeToPrices(params: SubscribePricesParams): Promise<() => void>;
82
+ /**
83
+ * Subscribe to live position updates with TP/SL data
84
+ *
85
+ * @param params - The subscription parameters including callback and account ID.
86
+ * @returns A cleanup function to unsubscribe from position updates.
87
+ */
88
+ subscribeToPositions(params: SubscribePositionsParams): () => void;
89
+ /**
90
+ * Subscribe to open interest cap updates
91
+ * OI caps are extracted from the shared webData3 subscription (zero additional overhead)
92
+ *
93
+ * @param params - The subscription parameters including callback and account ID.
94
+ * @returns A cleanup function to unsubscribe from OI cap updates.
95
+ */
96
+ subscribeToOICaps(params: SubscribeOICapsParams): () => void;
97
+ /**
98
+ * Check if OI caps cache has been initialized
99
+ * Useful for preventing UI flashing before first data arrives
100
+ *
101
+ * @returns True if the condition is met.
102
+ */
103
+ isOICapsCacheInitialized(): boolean;
104
+ /**
105
+ * Subscribe to live order fill updates
106
+ * Shares subscriptions per accountId to avoid duplicate WebSocket connections
107
+ *
108
+ * @param params - The subscription parameters including callback and account ID.
109
+ * @returns A cleanup function to unsubscribe from order fill updates.
110
+ */
111
+ subscribeToOrderFills(params: SubscribeOrderFillsParams): () => void;
112
+ /**
113
+ * Subscribe to venue-native TWAP lifecycle updates.
114
+ *
115
+ * HyperLiquid pushes the same `twapHistory` payload the REST read returns,
116
+ * so the caller supplies the adapter that turns raw history entries into
117
+ * `TwapOrder`s. That keeps the venue-shape knowledge in the provider and
118
+ * leaves this service owning transport, fan-out, and teardown only.
119
+ *
120
+ * Slice fills are not part of this channel — the venue streams schedule
121
+ * state, not individual fills — so adapted orders carry the fills the
122
+ * caller's adapter resolves for them.
123
+ *
124
+ * @param params - Subscription parameters including callback and account ID.
125
+ * @param params.callback - Receives adapted TWAP schedules, newest first.
126
+ * @param params.accountId - Optional CAIP account ID; defaults to selected.
127
+ * @param params.adapt - Maps a raw venue history payload to TWAP schedules.
128
+ * @returns A cleanup function to unsubscribe from TWAP updates.
129
+ */
130
+ subscribeToTwapOrders(params: SubscribeTwapOrdersParams & {
131
+ adapt: (history: TwapHistoryResponse) => TwapOrder[];
132
+ }): () => void;
133
+ /**
134
+ * Subscribe to live order updates
135
+ * Uses the shared per-DEX subscriptions to avoid duplicate connections
136
+ *
137
+ * @param params - The subscription parameters including callback and account ID.
138
+ * @returns A cleanup function to unsubscribe from order updates.
139
+ */
140
+ subscribeToOrders(params: SubscribeOrdersParams): () => void;
141
+ /**
142
+ * Subscribe to live account updates
143
+ * Uses the shared per-DEX subscriptions to avoid duplicate connections
144
+ *
145
+ * @param params - The subscription parameters including callback and account ID.
146
+ * @returns A cleanup function to unsubscribe from account updates.
147
+ */
148
+ subscribeToAccount(params: SubscribeAccountParams): () => void;
149
+ /**
150
+ * Check if orders cache has been initialized from WebSocket
151
+ *
152
+ * @returns true if WebSocket has sent at least one update, false otherwise
153
+ */
154
+ isOrdersCacheInitialized(): boolean;
155
+ /**
156
+ * Check if positions cache has been initialized from WebSocket
157
+ *
158
+ * @returns true if WebSocket has sent at least one update, false otherwise
159
+ */
160
+ isPositionsCacheInitialized(): boolean;
161
+ /**
162
+ * Get one complete position snapshot from current-connection DEX slices.
163
+ *
164
+ * Unlike the aggregate cache, this checks connection-epoch freshness for
165
+ * every configured position DEX. The check and copy are synchronous, so a reconnect
166
+ * cannot interleave between proving completeness and reading the slices.
167
+ *
168
+ * @returns A shallow-copied complete snapshot, or null until every configured
169
+ * DEX is current.
170
+ */
171
+ getFreshPositionsForAllDexs(): Position[] | null;
172
+ /**
173
+ * Get the live positions for one DEX, or null when that DEX has not published
174
+ * authoritative positions on the current connection.
175
+ *
176
+ * `null` means the absence of a symbol proves nothing about whether a
177
+ * position exists there.
178
+ *
179
+ * Prefer this over `getCachedPositions()` when a decision depends on whether a
180
+ * specific symbol is absent. The aggregate is only rebuilt once *every*
181
+ * expected DEX has published (`#aggregateAndNotifySubscribers`), so after a
182
+ * reconnect — which resets `#initializedDexs` without clearing these caches —
183
+ * the aggregate can sit frozen at its pre-reconnect contents while this map
184
+ * keeps receiving per-DEX updates. Deciding "covered" from this map and then
185
+ * reading the symbol from the aggregate would mix a fresh answer with stale
186
+ * data.
187
+ *
188
+ * Only a DEX that has published `clearinghouseState` on the CURRENT
189
+ * connection answers non-null. The underlying cache is not cleared on
190
+ * resubscribe, so a key surviving from before a reconnect would otherwise
191
+ * hand back pre-reconnect sizes as though they were live.
192
+ *
193
+ * @param dexName - DEX identifier, or '' for the main DEX.
194
+ * @returns That DEX's live positions, or null if it has not published on this
195
+ * connection.
196
+ */
197
+ getCachedPositionsForDex(dexName: string): Position[] | null;
198
+ /**
199
+ * Get cached positions from WebSocket subscription
200
+ *
201
+ * @returns Cached positions array, or null if not initialized
202
+ */
203
+ getCachedPositions(): Position[] | null;
204
+ /**
205
+ * Get cached orders from WebSocket subscription
206
+ *
207
+ * @returns Cached orders array, or null if not initialized
208
+ */
209
+ getCachedOrders(): Order[] | null;
210
+ /**
211
+ * Atomically get cached orders if initialized
212
+ * Prevents race condition between checking initialization and getting data
213
+ *
214
+ * @returns Cached orders array if initialized, null otherwise
215
+ */
216
+ getOrdersCacheIfInitialized(): Order[] | null;
217
+ /**
218
+ * Get cached price for a symbol from WebSocket allMids subscription
219
+ * OPTIMIZATION: Use this instead of REST infoClient.allMids() to avoid rate limiting
220
+ *
221
+ * @param symbol - Asset symbol (e.g., 'BTC', 'ETH', 'xyz:TSLA')
222
+ * @returns Price string, or undefined if not cached
223
+ */
224
+ getCachedPrice(symbol: string): string | undefined;
225
+ getLastAllMidsSnapshot(dex?: string): Record<string, string> | null;
226
+ /**
227
+ * Get cached fills from WebSocket userFills subscription
228
+ * OPTIMIZATION: Use this instead of REST userFills() to avoid rate limiting
229
+ *
230
+ * @returns Copy of cached fills array, or null if not cached
231
+ */
232
+ getCachedFills(): OrderFill[] | null;
233
+ /**
234
+ * Get cached fills only if the cache has been initialized from WebSocket
235
+ * OPTIMIZATION: Distinguishes between "not initialized" (null) and "initialized but empty" ([])
236
+ * - Returns null if cache hasn't received WebSocket snapshot yet (caller should use REST)
237
+ * - Returns empty array [] if cache is initialized but user has no fills (caller can skip REST)
238
+ * - Returns fills array if cache has data
239
+ *
240
+ * @returns Fills array or empty array if initialized, null if not yet initialized
241
+ */
242
+ getFillsCacheIfInitialized(): OrderFill[] | null;
243
+ /**
244
+ * Subscribe to full order book updates with multiple depth levels
245
+ * Creates a dedicated L2Book subscription for the requested symbol
246
+ * and processes data into OrderBookData format for UI consumption
247
+ *
248
+ * @param params - Subscription parameters
249
+ * @returns Cleanup function to unsubscribe
250
+ */
251
+ subscribeToOrderBook(params: SubscribeOrderBookParams): () => void;
252
+ /**
253
+ * Restore all active subscriptions after WebSocket reconnection
254
+ * Re-establishes WebSocket subscriptions for all active subscribers
255
+ *
256
+ * IMPORTANT: This method verifies transport readiness before attempting
257
+ * any subscriptions to prevent "subscribe error: undefined" errors.
258
+ */
259
+ restoreSubscriptions(): Promise<void>;
260
+ /**
261
+ * Clear all subscriptions and cached data (multi-DEX support)
262
+ */
263
+ clearAll(): void;
264
+ }
265
+ //# sourceMappingURL=HyperLiquidSubscriptionService.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HyperLiquidSubscriptionService.d.ts","sourceRoot":"","sources":["../../src/services/HyperLiquidSubscriptionService.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAMV,mBAAmB,EAKnB,gBAAgB,EAMjB,MAAM,qBAAqB,CAAC;AAQ7B,OAAO,KAAK,EAEV,0BAA0B,EAC3B,MAAM,+BAA+B,CAAC;AAGvC,OAAO,KAAK,EAEV,QAAQ,EACR,SAAS,EACT,KAAK,EAEL,SAAS,EACT,qBAAqB,EACrB,wBAAwB,EACxB,yBAAyB,EACzB,qBAAqB,EACrB,yBAAyB,EACzB,sBAAsB,EACtB,qBAAqB,EACrB,wBAAwB,EAGxB,yB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