@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,786 @@
1
+ import { isValidHexAddress } from '@metamask/utils';
2
+ import { HYPERLIQUID_ASSET_CONFIGS, BASIS_POINTS_DIVISOR, getSupportedAssets, TRADING_DEFAULTS, } from '../constants/hyperLiquidConfig.js';
3
+ import { CHASE_ORDER_CONFIG, HYPERLIQUID_ORDER_LIMITS, HYPERLIQUID_TWAP_LIMITS, } from '../constants/perpsConfig.js';
4
+ import { PERPS_ERROR_CODES } from '../perpsErrorCodes.js';
5
+ import { getTriggerExecution, isLimitExecutionOrderType, isStrategyOrderType, isTriggerOrderType, SCALE_ORDER_COUNT, } from './orderTypes.js';
6
+ /**
7
+ * Validation utilities for HyperLiquid operations
8
+ */
9
+ /**
10
+ * Create standardized error response.
11
+ *
12
+ * @param error - The error that occurred
13
+ * @param defaultResponse - The default response object to use as template
14
+ * @returns The error response with success=false and error message
15
+ */
16
+ export function createErrorResult(error, defaultResponse) {
17
+ return {
18
+ ...defaultResponse,
19
+ success: false,
20
+ error: error instanceof Error ? error.message : PERPS_ERROR_CODES.UNKNOWN_ERROR,
21
+ };
22
+ }
23
+ /**
24
+ * Validate withdrawal parameters.
25
+ *
26
+ * @param params - Withdrawal parameters to validate
27
+ * @param params.assetId - The CAIP asset ID to withdraw
28
+ * @param params.amount - Amount to withdraw as string
29
+ * @param params.destination - Optional destination hex address
30
+ * @param debugLogger - Optional debug logger for detailed logging
31
+ * @returns Validation result with isValid flag and optional error message
32
+ */
33
+ export function validateWithdrawalParams(params, debugLogger) {
34
+ debugLogger?.log('validateWithdrawalParams: Starting validation', {
35
+ params,
36
+ hasAssetId: Boolean(params.assetId),
37
+ hasAmount: Boolean(params.amount),
38
+ hasDestination: Boolean(params.destination),
39
+ });
40
+ // Validate required parameters
41
+ if (!params.assetId) {
42
+ debugLogger?.log('validateWithdrawalParams: Missing assetId', {
43
+ error: PERPS_ERROR_CODES.WITHDRAW_ASSET_ID_REQUIRED,
44
+ params,
45
+ });
46
+ return {
47
+ isValid: false,
48
+ error: PERPS_ERROR_CODES.WITHDRAW_ASSET_ID_REQUIRED,
49
+ };
50
+ }
51
+ // Validate amount
52
+ if (!params.amount) {
53
+ debugLogger?.log('validateWithdrawalParams: Missing amount', {
54
+ error: PERPS_ERROR_CODES.WITHDRAW_AMOUNT_REQUIRED,
55
+ params,
56
+ });
57
+ return {
58
+ isValid: false,
59
+ error: PERPS_ERROR_CODES.WITHDRAW_AMOUNT_REQUIRED,
60
+ };
61
+ }
62
+ const amount = parseFloat(params.amount);
63
+ if (isNaN(amount) || amount <= 0) {
64
+ debugLogger?.log('validateWithdrawalParams: Invalid amount', {
65
+ error: PERPS_ERROR_CODES.WITHDRAW_AMOUNT_POSITIVE,
66
+ amount: params.amount,
67
+ parsedAmount: amount,
68
+ isNaN: isNaN(amount),
69
+ });
70
+ return {
71
+ isValid: false,
72
+ error: PERPS_ERROR_CODES.WITHDRAW_AMOUNT_POSITIVE,
73
+ };
74
+ }
75
+ // Validate destination address if provided
76
+ if (params.destination && !isValidHexAddress(params.destination)) {
77
+ debugLogger?.log('validateWithdrawalParams: Invalid destination address', {
78
+ error: PERPS_ERROR_CODES.WITHDRAW_INVALID_DESTINATION,
79
+ destination: params.destination,
80
+ isValidHex: isValidHexAddress(params.destination),
81
+ });
82
+ return {
83
+ isValid: false,
84
+ error: PERPS_ERROR_CODES.WITHDRAW_INVALID_DESTINATION,
85
+ };
86
+ }
87
+ debugLogger?.log('validateWithdrawalParams: All validations passed', {
88
+ assetId: params.assetId,
89
+ amount: params.amount,
90
+ destination: params.destination ?? 'will use user wallet',
91
+ });
92
+ return { isValid: true };
93
+ }
94
+ /**
95
+ * Validate deposit parameters.
96
+ *
97
+ * @param params - Deposit parameters to validate
98
+ * @param params.assetId - The CAIP asset ID to deposit
99
+ * @param params.amount - Amount to deposit as string
100
+ * @param params.isTestnet - Whether this is a testnet deposit
101
+ * @param debugLogger - Optional debug logger for detailed logging
102
+ * @returns Validation result with isValid flag and optional error message
103
+ */
104
+ export function validateDepositParams(params, debugLogger) {
105
+ debugLogger?.log('validateDepositParams: Starting validation', {
106
+ params,
107
+ hasAssetId: Boolean(params.assetId),
108
+ hasAmount: Boolean(params.amount),
109
+ isTestnet: params.isTestnet,
110
+ });
111
+ // Validate required parameters
112
+ if (!params.assetId) {
113
+ debugLogger?.log('validateDepositParams: Missing assetId', {
114
+ error: PERPS_ERROR_CODES.DEPOSIT_ASSET_ID_REQUIRED,
115
+ params,
116
+ });
117
+ return {
118
+ isValid: false,
119
+ error: PERPS_ERROR_CODES.DEPOSIT_ASSET_ID_REQUIRED,
120
+ };
121
+ }
122
+ // Validate amount
123
+ if (!params.amount) {
124
+ debugLogger?.log('validateDepositParams: Missing amount', {
125
+ error: PERPS_ERROR_CODES.DEPOSIT_AMOUNT_REQUIRED,
126
+ params,
127
+ });
128
+ return {
129
+ isValid: false,
130
+ error: PERPS_ERROR_CODES.DEPOSIT_AMOUNT_REQUIRED,
131
+ };
132
+ }
133
+ const amount = parseFloat(params.amount);
134
+ if (isNaN(amount) || amount <= 0) {
135
+ debugLogger?.log('validateDepositParams: Invalid amount', {
136
+ error: PERPS_ERROR_CODES.DEPOSIT_AMOUNT_POSITIVE,
137
+ amount: params.amount,
138
+ parsedAmount: amount,
139
+ isNaN: isNaN(amount),
140
+ });
141
+ return {
142
+ isValid: false,
143
+ error: PERPS_ERROR_CODES.DEPOSIT_AMOUNT_POSITIVE,
144
+ };
145
+ }
146
+ // Check minimum deposit amount
147
+ const minimumAmount = params.isTestnet
148
+ ? TRADING_DEFAULTS.amount.testnet
149
+ : TRADING_DEFAULTS.amount.mainnet;
150
+ debugLogger?.log('validateDepositParams: Checking minimum amount', {
151
+ amount,
152
+ minimumAmount,
153
+ isTestnet: params.isTestnet,
154
+ network: params.isTestnet ? 'testnet' : 'mainnet',
155
+ });
156
+ if (amount < minimumAmount) {
157
+ debugLogger?.log('validateDepositParams: Below minimum deposit', {
158
+ error: PERPS_ERROR_CODES.DEPOSIT_MINIMUM_AMOUNT,
159
+ amount,
160
+ minimumAmount,
161
+ difference: minimumAmount - amount,
162
+ });
163
+ return {
164
+ isValid: false,
165
+ error: PERPS_ERROR_CODES.DEPOSIT_MINIMUM_AMOUNT,
166
+ };
167
+ }
168
+ debugLogger?.log('validateDepositParams: All validations passed', {
169
+ assetId: params.assetId,
170
+ amount: params.amount,
171
+ parsedAmount: amount,
172
+ minimumAmount,
173
+ isTestnet: params.isTestnet,
174
+ });
175
+ return { isValid: true };
176
+ }
177
+ /**
178
+ * Validate asset support for withdrawals using AssetRoute arrays.
179
+ *
180
+ * @param assetId - The CAIP asset ID to validate
181
+ * @param supportedRoutes - Array of supported asset routes
182
+ * @param debugLogger - Optional debug logger for detailed logging
183
+ * @returns Validation result with isValid flag and optional error message
184
+ */
185
+ export function validateAssetSupport(assetId, supportedRoutes, debugLogger) {
186
+ debugLogger?.log('validateAssetSupport: Checking asset support', {
187
+ assetId,
188
+ supportedRoutesCount: supportedRoutes.length,
189
+ });
190
+ const supportedAssetIds = supportedRoutes.map((route) => route.assetId);
191
+ // Check if asset is supported
192
+ const isSupported = supportedAssetIds.includes(assetId);
193
+ if (!isSupported) {
194
+ // Also check case-insensitive match for contract addresses
195
+ const isSupportedCaseInsensitive = supportedAssetIds.some((supportedId) => supportedId.toLowerCase() === assetId.toLowerCase());
196
+ if (!isSupportedCaseInsensitive) {
197
+ debugLogger?.log('validateAssetSupport: Asset not supported', {
198
+ error: PERPS_ERROR_CODES.WITHDRAW_ASSET_NOT_SUPPORTED,
199
+ assetId,
200
+ supportedAssetIds,
201
+ checkedCaseInsensitive: true,
202
+ });
203
+ return {
204
+ isValid: false,
205
+ error: PERPS_ERROR_CODES.WITHDRAW_ASSET_NOT_SUPPORTED,
206
+ };
207
+ }
208
+ debugLogger?.log('⚠️ validateAssetSupport: Asset supported with case mismatch', {
209
+ providedAssetId: assetId,
210
+ matchedAssetId: supportedAssetIds.find((id) => id.toLowerCase() === assetId.toLowerCase()),
211
+ });
212
+ }
213
+ debugLogger?.log('validateAssetSupport: Asset is supported', {
214
+ assetId,
215
+ });
216
+ return { isValid: true };
217
+ }
218
+ /**
219
+ * Validate balance against withdrawal amount.
220
+ *
221
+ * @param withdrawAmount - The amount to withdraw
222
+ * @param withdrawableBalance - Max USD that can leave the venue right now
223
+ * @param debugLogger - Optional debug logger for detailed logging
224
+ * @returns Validation result with isValid flag and optional error message
225
+ */
226
+ export function validateBalance(withdrawAmount, withdrawableBalance, debugLogger) {
227
+ debugLogger?.log('validateBalance: Checking balance sufficiency', {
228
+ withdrawAmount,
229
+ withdrawableBalance,
230
+ difference: withdrawableBalance - withdrawAmount,
231
+ });
232
+ if (withdrawAmount > withdrawableBalance) {
233
+ const shortfall = withdrawAmount - withdrawableBalance;
234
+ debugLogger?.log('validateBalance: Insufficient balance', {
235
+ error: PERPS_ERROR_CODES.WITHDRAW_INSUFFICIENT_BALANCE,
236
+ withdrawAmount,
237
+ withdrawableBalance,
238
+ shortfall,
239
+ percentageOfAvailable: `${((withdrawAmount / withdrawableBalance) * 100).toFixed(2)}%`,
240
+ });
241
+ return {
242
+ isValid: false,
243
+ error: PERPS_ERROR_CODES.WITHDRAW_INSUFFICIENT_BALANCE,
244
+ };
245
+ }
246
+ const remainingBalance = withdrawableBalance - withdrawAmount;
247
+ debugLogger?.log('validateBalance: Balance is sufficient', {
248
+ withdrawAmount,
249
+ withdrawableBalance,
250
+ remainingBalance,
251
+ percentageUsed: `${((withdrawAmount / withdrawableBalance) * 100).toFixed(2)}%`,
252
+ });
253
+ return { isValid: true };
254
+ }
255
+ /**
256
+ * Apply filters to asset paths with comprehensive logging.
257
+ *
258
+ * @param assets - Array of CAIP asset IDs to filter
259
+ * @param params - Filter parameters including chainId, symbol, and assetId
260
+ * @param debugLogger - Optional debug logger for detailed logging
261
+ * @returns Filtered array of CAIP asset IDs
262
+ */
263
+ export function applyPathFilters(assets, params, debugLogger) {
264
+ if (!params) {
265
+ debugLogger?.log('HyperLiquid: applyPathFilters - no params, returning all assets', { assets });
266
+ return assets;
267
+ }
268
+ let filtered = assets;
269
+ debugLogger?.log('HyperLiquid: applyPathFilters - starting filter', {
270
+ initialAssets: assets,
271
+ filterParams: params,
272
+ });
273
+ if (params.chainId) {
274
+ const before = filtered;
275
+ filtered = filtered.filter((asset) => asset.startsWith(params.chainId));
276
+ debugLogger?.log('HyperLiquid: applyPathFilters - chainId filter', {
277
+ chainId: params.chainId,
278
+ before,
279
+ after: filtered,
280
+ });
281
+ }
282
+ // Note: `in` is the idiomatic TypeScript way to narrow a string to
283
+ // `keyof typeof` for indexed access; `hasProperty` types the indexed
284
+ // result as `unknown` and loses the `{ testnet, mainnet }` shape.
285
+ /* eslint-disable-next-line no-restricted-syntax */
286
+ if (params.symbol && params.symbol in HYPERLIQUID_ASSET_CONFIGS) {
287
+ const config = HYPERLIQUID_ASSET_CONFIGS[params.symbol];
288
+ const isTestnet = params.isTestnet ?? false;
289
+ const selectedAsset = isTestnet ? config.testnet : config.mainnet;
290
+ const before = filtered;
291
+ filtered = [selectedAsset];
292
+ debugLogger?.log('HyperLiquid: applyPathFilters - symbol filter', {
293
+ symbol: params.symbol,
294
+ isTestnet,
295
+ config,
296
+ selectedAsset,
297
+ before,
298
+ after: filtered,
299
+ });
300
+ }
301
+ if (params.assetId) {
302
+ const before = filtered;
303
+ // Use case-insensitive comparison for asset ID matching to handle address case differences
304
+ filtered = filtered.filter((asset) => asset.toLowerCase() === params.assetId?.toLowerCase());
305
+ debugLogger?.log('HyperLiquid: applyPathFilters - assetId filter', {
306
+ assetId: params.assetId,
307
+ before,
308
+ after: filtered,
309
+ exactMatch: before.includes(params.assetId),
310
+ caseInsensitiveMatch: before.some((asset) => asset.toLowerCase() === params.assetId?.toLowerCase()),
311
+ });
312
+ }
313
+ debugLogger?.log('HyperLiquid: applyPathFilters - final result', {
314
+ initialAssets: assets,
315
+ finalFiltered: filtered,
316
+ filterParams: params,
317
+ });
318
+ return filtered;
319
+ }
320
+ /**
321
+ * Get supported deposit/withdrawal paths with filtering.
322
+ *
323
+ * @param params - Filter parameters including isTestnet, chainId, symbol
324
+ * @param debugLogger - Optional debug logger for detailed logging
325
+ * @returns Array of supported CAIP asset IDs
326
+ */
327
+ export function getSupportedPaths(params, debugLogger) {
328
+ const isTestnet = params?.isTestnet ?? false;
329
+ const assets = getSupportedAssets(isTestnet);
330
+ const filteredAssets = applyPathFilters(assets, params, debugLogger);
331
+ debugLogger?.log('HyperLiquid: getSupportedPaths', {
332
+ isTestnet,
333
+ requestedParams: params,
334
+ allAssets: assets,
335
+ filteredAssets,
336
+ returnType: 'CaipAssetId[]',
337
+ example: filteredAssets[0],
338
+ });
339
+ return filteredAssets;
340
+ }
341
+ /**
342
+ * Get maximum order value based on leverage and order type.
343
+ * Based on HyperLiquid contract specifications.
344
+ *
345
+ * @param maxLeverage - The maximum leverage for the market
346
+ * @param orderType - The order type; every type follows the limit/market
347
+ * multiplier of its execution mode, so `stop_limit`, `scale` and `chase` are all
348
+ * treated as limit orders and `twap` as a market order
349
+ * @returns Maximum order value in USD
350
+ */
351
+ export function getMaxOrderValue(maxLeverage, orderType) {
352
+ let marketLimit;
353
+ if (maxLeverage >= 25) {
354
+ marketLimit = HYPERLIQUID_ORDER_LIMITS.MarketOrderLimits.HighLeverage;
355
+ }
356
+ else if (maxLeverage >= 20) {
357
+ marketLimit = HYPERLIQUID_ORDER_LIMITS.MarketOrderLimits.MediumHighLeverage;
358
+ }
359
+ else if (maxLeverage >= 10) {
360
+ marketLimit = HYPERLIQUID_ORDER_LIMITS.MarketOrderLimits.MediumLeverage;
361
+ }
362
+ else {
363
+ marketLimit = HYPERLIQUID_ORDER_LIMITS.MarketOrderLimits.LowLeverage;
364
+ }
365
+ // The higher cap follows how the order executes, not whose price it uses: a
366
+ // scale ladder and a chase rest limit orders on the book, so holding them to
367
+ // the tighter market-order cap would bound them by how they were requested
368
+ // rather than by what they do.
369
+ return getTriggerExecution(orderType) === 'limit'
370
+ ? marketLimit * HYPERLIQUID_ORDER_LIMITS.LimitOrderMultiplier
371
+ : marketLimit;
372
+ }
373
+ /**
374
+ * The `grouping` value each provider-agnostic linkage corresponds to, used to
375
+ * detect a caller supplying both spellings with different meanings.
376
+ */
377
+ const TPSL_LINKAGE_GROUPING = {
378
+ none: 'na',
379
+ order: 'normalTpsl',
380
+ position: 'positionTpsl',
381
+ };
382
+ /**
383
+ * Which strategy owns each strategy-only field.
384
+ *
385
+ * Anything a placement does not own is rejected rather than ignored: a `twap`
386
+ * carrying `scaleNumOrders` is a caller mistake, and dropping it silently would
387
+ * execute something other than what was asked for.
388
+ */
389
+ const STRATEGY_FIELD_OWNER = {
390
+ twapDuration: 'twap',
391
+ twapRandomize: 'twap',
392
+ scaleMinPrice: 'scale',
393
+ scaleMaxPrice: 'scale',
394
+ scaleNumOrders: 'scale',
395
+ scaleSkew: 'scale',
396
+ chaseIntervalMs: 'chase',
397
+ chaseMaxDurationMs: 'chase',
398
+ chaseMaxRepricings: 'chase',
399
+ chaseMaxDistanceBps: 'chase',
400
+ };
401
+ /**
402
+ * Validate the TWAP-specific parameters of a `twap` placement.
403
+ *
404
+ * @param params - Strategy fields supplied by the caller.
405
+ * @returns Validation result with isValid flag and optional error message.
406
+ */
407
+ function validateTwapParams(params) {
408
+ if (params.twapDuration === undefined) {
409
+ return {
410
+ isValid: false,
411
+ error: PERPS_ERROR_CODES.ORDER_TWAP_DURATION_REQUIRED,
412
+ };
413
+ }
414
+ // The venue validates `twap.m` as a safe integer within these bounds before
415
+ // the request is signed, so checking it here turns an opaque SDK failure into
416
+ // a typed rejection that costs no round trip.
417
+ if (!Number.isInteger(params.twapDuration) ||
418
+ params.twapDuration < HYPERLIQUID_TWAP_LIMITS.MinDurationMinutes ||
419
+ params.twapDuration > HYPERLIQUID_TWAP_LIMITS.MaxDurationMinutes) {
420
+ return {
421
+ isValid: false,
422
+ error: PERPS_ERROR_CODES.ORDER_TWAP_DURATION_INVALID,
423
+ };
424
+ }
425
+ return { isValid: true };
426
+ }
427
+ /**
428
+ * Validate the ladder parameters of a `scale` placement.
429
+ *
430
+ * @param params - Strategy fields supplied by the caller.
431
+ * @returns Validation result with isValid flag and optional error message.
432
+ */
433
+ function validateScaleParams(params) {
434
+ if (params.scaleMinPrice === undefined ||
435
+ params.scaleMaxPrice === undefined) {
436
+ return {
437
+ isValid: false,
438
+ error: PERPS_ERROR_CODES.ORDER_SCALE_RANGE_REQUIRED,
439
+ };
440
+ }
441
+ const minPrice = parseFloat(params.scaleMinPrice);
442
+ const maxPrice = parseFloat(params.scaleMaxPrice);
443
+ if (!Number.isFinite(minPrice) ||
444
+ !Number.isFinite(maxPrice) ||
445
+ minPrice <= 0 ||
446
+ maxPrice <= minPrice) {
447
+ return {
448
+ isValid: false,
449
+ error: PERPS_ERROR_CODES.ORDER_SCALE_RANGE_INVALID,
450
+ };
451
+ }
452
+ if (params.scaleNumOrders === undefined ||
453
+ !Number.isInteger(params.scaleNumOrders) ||
454
+ params.scaleNumOrders < SCALE_ORDER_COUNT.min ||
455
+ params.scaleNumOrders > SCALE_ORDER_COUNT.max) {
456
+ return {
457
+ isValid: false,
458
+ error: PERPS_ERROR_CODES.ORDER_SCALE_COUNT_INVALID,
459
+ };
460
+ }
461
+ // Omitted is an even ladder, so only a supplied skew is checked. The value is
462
+ // taken exactly as the caller wrote it: clients coerce their input to two
463
+ // decimals, and rounding it again here would place a ladder weighted
464
+ // differently from the one the form previewed.
465
+ if (params.scaleSkew !== undefined &&
466
+ (!Number.isFinite(params.scaleSkew) || params.scaleSkew <= 0)) {
467
+ return {
468
+ isValid: false,
469
+ error: PERPS_ERROR_CODES.ORDER_SCALE_RANGE_INVALID,
470
+ };
471
+ }
472
+ return { isValid: true };
473
+ }
474
+ /**
475
+ * Validate the polling parameters of a `chase` placement.
476
+ *
477
+ * @param params - Strategy fields supplied by the caller.
478
+ * @returns Validation result with isValid flag and optional error message.
479
+ */
480
+ function validateChaseParams(params) {
481
+ const interval = params.chaseIntervalMs ?? CHASE_ORDER_CONFIG.DefaultIntervalMs;
482
+ if (!Number.isFinite(interval) ||
483
+ interval < CHASE_ORDER_CONFIG.MinIntervalMs) {
484
+ return {
485
+ isValid: false,
486
+ error: PERPS_ERROR_CODES.ORDER_CHASE_INTERVAL_INVALID,
487
+ };
488
+ }
489
+ const maxDuration = params.chaseMaxDurationMs;
490
+ // A window shorter than one poll would place the order and immediately stop
491
+ // chasing it — a plain post-only limit order wearing a chase's name.
492
+ if (maxDuration !== undefined &&
493
+ (!Number.isFinite(maxDuration) || maxDuration < interval)) {
494
+ return {
495
+ isValid: false,
496
+ error: PERPS_ERROR_CODES.ORDER_CHASE_DURATION_INVALID,
497
+ };
498
+ }
499
+ const maxRepricings = params.chaseMaxRepricings;
500
+ if (maxRepricings !== undefined &&
501
+ (!Number.isInteger(maxRepricings) || maxRepricings < 1)) {
502
+ return {
503
+ isValid: false,
504
+ error: PERPS_ERROR_CODES.ORDER_CHASE_DURATION_INVALID,
505
+ };
506
+ }
507
+ if (params.chaseMaxDistanceBps !== undefined &&
508
+ (!Number.isFinite(params.chaseMaxDistanceBps) ||
509
+ params.chaseMaxDistanceBps <= 0 ||
510
+ params.chaseMaxDistanceBps >= BASIS_POINTS_DIVISOR)) {
511
+ return {
512
+ isValid: false,
513
+ error: PERPS_ERROR_CODES.ORDER_CHASE_MAX_DISTANCE_INVALID,
514
+ };
515
+ }
516
+ return { isValid: true };
517
+ }
518
+ /**
519
+ * Validate strategy placement parameters, and the absence of them.
520
+ *
521
+ * Runs before every other order rule so a strategy placement is rejected with a
522
+ * strategy-shaped reason rather than with the trigger/limit rule its shape
523
+ * happens to trip first.
524
+ *
525
+ * @param params - Order parameters to validate.
526
+ * @param params.orderType - The order placement type.
527
+ * @returns Validation result with isValid flag and optional error message.
528
+ */
529
+ function validateStrategyOrderParams(params) {
530
+ const { orderType } = params;
531
+ const strategy = orderType !== undefined && isStrategyOrderType(orderType)
532
+ ? orderType
533
+ : undefined;
534
+ // Every strategy-only field must belong to the placement carrying it. This
535
+ // also covers the non-strategy case, where no field has an owner to match.
536
+ const foreignField = Object.keys(STRATEGY_FIELD_OWNER).find((field) => params[field] !== undefined && STRATEGY_FIELD_OWNER[field] !== strategy);
537
+ if (foreignField) {
538
+ return {
539
+ isValid: false,
540
+ error: PERPS_ERROR_CODES.ORDER_STRATEGY_PARAMS_NOT_SUPPORTED,
541
+ };
542
+ }
543
+ if (!strategy) {
544
+ return { isValid: true };
545
+ }
546
+ // A strategy owns its own execution: it derives its own prices, rests its own
547
+ // orders, and decides its own time in force. Accepting these fields would
548
+ // mean quietly ignoring them.
549
+ //
550
+ // `clientOrderId` is refused for the same reason and cannot be honoured even
551
+ // in principle: the venue's TWAP action carries no client id, a scale ladder
552
+ // is many orders and a client id must be unique per order, and a chase
553
+ // replaces its order on every re-price. One id cannot name any of them.
554
+ if (params.price !== undefined ||
555
+ params.triggerPrice !== undefined ||
556
+ params.timeInForce !== undefined ||
557
+ params.clientOrderId !== undefined ||
558
+ params.takeProfitPrice !== undefined ||
559
+ params.stopLossPrice !== undefined ||
560
+ params.takeProfitSize !== undefined ||
561
+ params.stopLossSize !== undefined) {
562
+ return {
563
+ isValid: false,
564
+ error: PERPS_ERROR_CODES.ORDER_STRATEGY_FIELD_UNSUPPORTED,
565
+ };
566
+ }
567
+ if (strategy === 'twap') {
568
+ return validateTwapParams(params);
569
+ }
570
+ if (strategy === 'scale') {
571
+ return validateScaleParams(params);
572
+ }
573
+ return validateChaseParams(params);
574
+ }
575
+ /**
576
+ * Validate order parameters.
577
+ * Basic validation - checks required fields are present.
578
+ * Amount validation (size/USD) is handled by validateOrder.
579
+ *
580
+ * @param params - Order parameters to validate
581
+ * @param params.coin - The trading pair coin symbol
582
+ * @param params.size - The order size as string
583
+ * @param params.price - The order price as string
584
+ * @param params.orderType - The order placement type
585
+ * @param params.triggerPrice - Trigger price; required for trigger placement types and
586
+ * rejected for market/limit orders so a stray value can never be silently dropped
587
+ * @param params.takeProfitPrice - Attached take profit price
588
+ * @param params.stopLossPrice - Attached stop loss price
589
+ * @param params.takeProfitSize - Partial take profit size
590
+ * @param params.stopLossSize - Partial stop loss size
591
+ * @param params.tpslLinkage - How an attached TP/SL is linked
592
+ * @param params.grouping - Deprecated protocol-shaped spelling of `tpslLinkage`
593
+ * @param params.timeInForce - Time in force; only a plain limit order can carry one
594
+ * @param params.clientOrderId - Client-provided order ID; a strategy placement cannot carry one
595
+ * @param params.twapDuration - TWAP window in whole minutes
596
+ * @param params.twapRandomize - Whether to vary each TWAP suborder's size by up to ±20%
597
+ * @param params.scaleMinPrice - Lowest price in a scale ladder
598
+ * @param params.scaleMaxPrice - Highest price in a scale ladder
599
+ * @param params.scaleNumOrders - How many orders a scale ladder fans out into
600
+ * @param params.scaleSkew - How a scale ladder's size is weighted across its rungs
601
+ * @param params.chaseIntervalMs - How often a chase re-reads the touch
602
+ * @param params.chaseMaxDurationMs - How long a chase keeps re-pricing
603
+ * @param params.chaseMaxRepricings - Cap on a chase's cancel/replace cycles
604
+ * @returns Validation result with isValid flag and optional error message
605
+ */
606
+ export function validateOrderParams(params) {
607
+ if (!params.coin) {
608
+ return {
609
+ isValid: false,
610
+ error: PERPS_ERROR_CODES.ORDER_COIN_REQUIRED,
611
+ };
612
+ }
613
+ // Note: Size validation removed - validateOrder handles amount validation using USD as source of truth
614
+ // Strategy placements are decided first: their shape trips the limit-price and
615
+ // trigger rules below, and the strategy-shaped reason is the useful one.
616
+ const strategyValidation = validateStrategyOrderParams(params);
617
+ if (!strategyValidation.isValid) {
618
+ return strategyValidation;
619
+ }
620
+ const { orderType } = params;
621
+ const isTrigger = orderType !== undefined && isTriggerOrderType(orderType);
622
+ // Require price for orders that execute as limit orders (limit, stop_limit,
623
+ // take_profit_limit)
624
+ if (orderType !== undefined &&
625
+ isLimitExecutionOrderType(orderType) &&
626
+ !params.price) {
627
+ return {
628
+ isValid: false,
629
+ error: PERPS_ERROR_CODES.ORDER_LIMIT_PRICE_REQUIRED,
630
+ };
631
+ }
632
+ if (params.price && parseFloat(params.price) <= 0) {
633
+ return {
634
+ isValid: false,
635
+ error: PERPS_ERROR_CODES.ORDER_PRICE_POSITIVE,
636
+ };
637
+ }
638
+ if (isTrigger) {
639
+ if (!params.triggerPrice) {
640
+ return {
641
+ isValid: false,
642
+ error: PERPS_ERROR_CODES.ORDER_TRIGGER_PRICE_REQUIRED,
643
+ };
644
+ }
645
+ const triggerPrice = parseFloat(params.triggerPrice);
646
+ if (isNaN(triggerPrice) || triggerPrice <= 0) {
647
+ return {
648
+ isValid: false,
649
+ error: PERPS_ERROR_CODES.ORDER_TRIGGER_PRICE_POSITIVE,
650
+ };
651
+ }
652
+ // A trigger placement combined with attached TP/SL children is rejected
653
+ // rather than silently reshaped: the exchange semantics of a triggered
654
+ // parent owning triggered children are not part of this contract.
655
+ // Each field is checked explicitly: a falsy-but-present price (e.g. '') is
656
+ // still an attached TP/SL request and must be rejected, not skipped.
657
+ if (params.takeProfitPrice !== undefined ||
658
+ params.stopLossPrice !== undefined) {
659
+ return {
660
+ isValid: false,
661
+ error: PERPS_ERROR_CODES.ORDER_TRIGGER_TPSL_UNSUPPORTED,
662
+ };
663
+ }
664
+ // Consistent with the attached-TP/SL check above: a falsy-but-present value
665
+ // (e.g. '') is still a request to place a trigger, not an absent field.
666
+ }
667
+ else if (params.triggerPrice !== undefined) {
668
+ return {
669
+ isValid: false,
670
+ error: PERPS_ERROR_CODES.ORDER_TRIGGER_PRICE_NOT_SUPPORTED,
671
+ };
672
+ }
673
+ // `tpslLinkage` supersedes `grouping`, but two spellings that disagree are a
674
+ // caller mistake — resolving one silently would hide it.
675
+ if (params.tpslLinkage !== undefined && params.grouping !== undefined) {
676
+ const expectedGrouping = TPSL_LINKAGE_GROUPING[params.tpslLinkage];
677
+ if (expectedGrouping !== params.grouping) {
678
+ return {
679
+ isValid: false,
680
+ error: PERPS_ERROR_CODES.ORDER_TPSL_LINKAGE_CONFLICT,
681
+ };
682
+ }
683
+ }
684
+ const hasAttachedTpsl = params.takeProfitPrice !== undefined || params.stopLossPrice !== undefined;
685
+ // Every order in a `positionTpsl` batch has to be a trigger order, and no
686
+ // shape of order placement produces one. With an attached TP/SL the batch
687
+ // carries the ordinary parent order the TP/SL protects; without one it is
688
+ // that parent order alone. HyperLiquid rejects both, so the linkage is
689
+ // refused outright — it belongs to `updatePositionTPSL`, applied to the
690
+ // position once the parent has filled.
691
+ const requestsPositionLinkage = params.tpslLinkage === 'position' || params.grouping === 'positionTpsl';
692
+ if (requestsPositionLinkage) {
693
+ return {
694
+ isValid: false,
695
+ error: PERPS_ERROR_CODES.ORDER_TPSL_POSITION_LINKAGE_UNSUPPORTED,
696
+ };
697
+ }
698
+ // `na` grouping submits the attached TP/SL as standalone triggers, bound to
699
+ // neither the parent order nor the resulting position. An unfilled parent
700
+ // then leaves them behind as orphan reduce-only triggers that fire against
701
+ // whatever position happens to exist. An attached TP/SL needs a linkage that
702
+ // links it, so the combination is a caller mistake rather than a mode.
703
+ const requestsNoLinkage = params.tpslLinkage === 'none' || params.grouping === 'na';
704
+ if (requestsNoLinkage && hasAttachedTpsl) {
705
+ return {
706
+ isValid: false,
707
+ error: PERPS_ERROR_CODES.ORDER_TPSL_LINKAGE_REQUIRED,
708
+ };
709
+ }
710
+ // Only a plain limit order rests on the book long enough for a time in force to
711
+ // mean anything: a market order fills immediately and a trigger order's
712
+ // execution is decided when it fires. Rejected here, at step 1 of placement, so
713
+ // it cannot fire after leverage changes or a HIP-3 margin transfer.
714
+ if (params.timeInForce !== undefined && orderType !== 'limit') {
715
+ return {
716
+ isValid: false,
717
+ error: PERPS_ERROR_CODES.ORDER_TIME_IN_FORCE_NOT_SUPPORTED,
718
+ };
719
+ }
720
+ const partialTpslValidation = validatePartialTpslSizes(params);
721
+ if (!partialTpslValidation.isValid) {
722
+ return partialTpslValidation;
723
+ }
724
+ return { isValid: true };
725
+ }
726
+ /**
727
+ * Validate quantity-scoped (partial) TP/SL sizes against the parent order.
728
+ *
729
+ * @param params - Order parameters carrying the TP/SL prices and sizes
730
+ * @param params.size - Parent order size
731
+ * @param params.takeProfitPrice - Attached take profit price
732
+ * @param params.stopLossPrice - Attached stop loss price
733
+ * @param params.takeProfitSize - Partial take profit size
734
+ * @param params.stopLossSize - Partial stop loss size
735
+ * @returns Validation result with isValid flag and optional error message
736
+ */
737
+ function validatePartialTpslSizes(params) {
738
+ const orderSize = params.size ? Math.abs(parseFloat(params.size)) : undefined;
739
+ const entries = [
740
+ { size: params.takeProfitSize, price: params.takeProfitPrice },
741
+ { size: params.stopLossSize, price: params.stopLossPrice },
742
+ ];
743
+ for (const entry of entries) {
744
+ if (entry.size === undefined) {
745
+ continue;
746
+ }
747
+ // A size without its price would silently place nothing.
748
+ if (!entry.price) {
749
+ return {
750
+ isValid: false,
751
+ error: PERPS_ERROR_CODES.ORDER_TPSL_SIZE_INVALID,
752
+ };
753
+ }
754
+ const size = parseFloat(entry.size);
755
+ if (isNaN(size) || size <= 0) {
756
+ return {
757
+ isValid: false,
758
+ error: PERPS_ERROR_CODES.ORDER_TPSL_SIZE_INVALID,
759
+ };
760
+ }
761
+ if (orderSize !== undefined && !isNaN(orderSize) && size > orderSize) {
762
+ return {
763
+ isValid: false,
764
+ error: PERPS_ERROR_CODES.ORDER_TPSL_SIZE_INVALID,
765
+ };
766
+ }
767
+ }
768
+ return { isValid: true };
769
+ }
770
+ /**
771
+ * Validate coin exists in asset mapping.
772
+ *
773
+ * @param coin - The coin symbol to validate
774
+ * @param coinToAssetId - Map of coin symbols to asset IDs
775
+ * @returns Validation result with isValid flag and optional error message
776
+ */
777
+ export function validateCoinExists(coin, coinToAssetId) {
778
+ if (!coinToAssetId.has(coin)) {
779
+ return {
780
+ isValid: false,
781
+ error: PERPS_ERROR_CODES.ORDER_UNKNOWN_COIN,
782
+ };
783
+ }
784
+ return { isValid: true };
785
+ }
786
+ //# sourceMappingURL=hyperLiquidValidation.js.map