@metamask-previews/perps-controller 13.1.0-preview-8c2a2eeb2 → 13.1.0-preview-4f4c98e

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 (716) hide show
  1. package/CHANGELOG.md +4 -1
  2. package/dist/{PerpsController-method-action-types.d.mts → PerpsController-method-action-types.d.ts} +2 -2
  3. package/dist/PerpsController-method-action-types.d.ts.map +1 -0
  4. package/dist/{PerpsController-method-action-types.mjs → PerpsController-method-action-types.js} +1 -1
  5. package/dist/PerpsController-method-action-types.js.map +1 -0
  6. package/dist/{PerpsController.d.mts → PerpsController.d.ts} +17 -17
  7. package/dist/PerpsController.d.ts.map +1 -0
  8. package/dist/{PerpsController.mjs → PerpsController.js} +33 -31
  9. package/dist/PerpsController.js.map +1 -0
  10. package/dist/aggregation/{SubscriptionMultiplexer.d.cts → SubscriptionMultiplexer.d.ts} +2 -2
  11. package/dist/aggregation/SubscriptionMultiplexer.d.ts.map +1 -0
  12. package/dist/aggregation/{SubscriptionMultiplexer.mjs → SubscriptionMultiplexer.js} +3 -3
  13. package/dist/aggregation/SubscriptionMultiplexer.js.map +1 -0
  14. package/dist/aggregation/index.d.ts +6 -0
  15. package/dist/aggregation/index.d.ts.map +1 -0
  16. package/dist/aggregation/index.js +5 -0
  17. package/dist/aggregation/index.js.map +1 -0
  18. package/dist/constants/{chartConfig.d.mts → chartConfig.d.ts} +34 -34
  19. package/dist/constants/chartConfig.d.ts.map +1 -0
  20. package/dist/constants/{chartConfig.mjs → chartConfig.js} +1 -1
  21. package/dist/constants/chartConfig.js.map +1 -0
  22. package/dist/constants/eventNames.d.ts +555 -0
  23. package/dist/constants/eventNames.d.ts.map +1 -0
  24. package/dist/constants/{eventNames.mjs → eventNames.js} +1 -1
  25. package/dist/constants/eventNames.js.map +1 -0
  26. package/dist/constants/{hyperLiquidConfig.d.cts → hyperLiquidConfig.d.ts} +12 -12
  27. package/dist/constants/hyperLiquidConfig.d.ts.map +1 -0
  28. package/dist/constants/{hyperLiquidConfig.mjs → hyperLiquidConfig.js} +4 -4
  29. package/dist/constants/hyperLiquidConfig.js.map +1 -0
  30. package/dist/constants/index.d.ts +12 -0
  31. package/dist/constants/index.d.ts.map +1 -0
  32. package/dist/constants/index.js +12 -0
  33. package/dist/constants/index.js.map +1 -0
  34. package/dist/constants/{myxConfig.d.mts → myxConfig.d.ts} +9 -8
  35. package/dist/constants/myxConfig.d.ts.map +1 -0
  36. package/dist/constants/{myxConfig.mjs → myxConfig.js} +2 -2
  37. package/dist/constants/myxConfig.js.map +1 -0
  38. package/dist/constants/{orderTypes.d.cts → orderTypes.d.ts} +7 -7
  39. package/dist/constants/orderTypes.d.ts.map +1 -0
  40. package/dist/constants/{orderTypes.mjs → orderTypes.js} +1 -1
  41. package/dist/constants/orderTypes.js.map +1 -0
  42. package/dist/constants/{performanceMetrics.d.cts → performanceMetrics.d.ts} +1 -1
  43. package/dist/constants/performanceMetrics.d.ts.map +1 -0
  44. package/dist/constants/{performanceMetrics.mjs → performanceMetrics.js} +1 -1
  45. package/dist/constants/performanceMetrics.js.map +1 -0
  46. package/dist/constants/{perpsConfig.d.mts → perpsConfig.d.ts} +56 -56
  47. package/dist/constants/perpsConfig.d.ts.map +1 -0
  48. package/dist/constants/{perpsConfig.mjs → perpsConfig.js} +1 -1
  49. package/dist/constants/perpsConfig.js.map +1 -0
  50. package/dist/constants/{transactionsHistoryConfig.d.cts → transactionsHistoryConfig.d.ts} +1 -1
  51. package/dist/constants/transactionsHistoryConfig.d.ts.map +1 -0
  52. package/dist/constants/{transactionsHistoryConfig.mjs → transactionsHistoryConfig.js} +1 -1
  53. package/dist/constants/transactionsHistoryConfig.js.map +1 -0
  54. package/dist/{index.d.mts → index.d.ts} +64 -64
  55. package/dist/index.d.ts.map +1 -0
  56. package/dist/{index.mjs → index.js} +41 -41
  57. package/dist/index.js.map +1 -0
  58. package/dist/perpsErrorCodes.d.ts +104 -0
  59. package/dist/perpsErrorCodes.d.ts.map +1 -0
  60. package/dist/{perpsErrorCodes.mjs → perpsErrorCodes.js} +1 -1
  61. package/dist/perpsErrorCodes.js.map +1 -0
  62. package/dist/providers/{AggregatedPerpsProvider.d.cts → AggregatedPerpsProvider.d.ts} +5 -5
  63. package/dist/providers/AggregatedPerpsProvider.d.ts.map +1 -0
  64. package/dist/providers/{AggregatedPerpsProvider.mjs → AggregatedPerpsProvider.js} +5 -5
  65. package/dist/providers/AggregatedPerpsProvider.js.map +1 -0
  66. package/dist/providers/{HyperLiquidProvider.d.mts → HyperLiquidProvider.d.ts} +7 -7
  67. package/dist/providers/HyperLiquidProvider.d.ts.map +1 -0
  68. package/dist/providers/{HyperLiquidProvider.mjs → HyperLiquidProvider.js} +48 -50
  69. package/dist/providers/HyperLiquidProvider.js.map +1 -0
  70. package/dist/routing/{ProviderRouter.d.mts → ProviderRouter.d.ts} +2 -2
  71. package/dist/routing/ProviderRouter.d.ts.map +1 -0
  72. package/dist/routing/{ProviderRouter.mjs → ProviderRouter.js} +1 -1
  73. package/dist/routing/ProviderRouter.js.map +1 -0
  74. package/dist/routing/index.d.ts +6 -0
  75. package/dist/routing/index.d.ts.map +1 -0
  76. package/dist/routing/index.js +5 -0
  77. package/dist/routing/index.js.map +1 -0
  78. package/dist/{selectors.d.mts → selectors.d.ts} +97 -97
  79. package/dist/selectors.d.ts.map +1 -0
  80. package/dist/{selectors.mjs → selectors.js} +4 -4
  81. package/dist/selectors.js.map +1 -0
  82. package/dist/services/{AccountService.d.cts → AccountService.d.ts} +4 -4
  83. package/dist/services/AccountService.d.ts.map +1 -0
  84. package/dist/services/{AccountService.mjs → AccountService.js} +9 -9
  85. package/dist/services/AccountService.js.map +1 -0
  86. package/dist/services/{AggregatedOrderBookConnection.d.cts → AggregatedOrderBookConnection.d.ts} +2 -2
  87. package/dist/services/AggregatedOrderBookConnection.d.ts.map +1 -0
  88. package/dist/services/{AggregatedOrderBookConnection.mjs → AggregatedOrderBookConnection.js} +3 -3
  89. package/dist/services/AggregatedOrderBookConnection.js.map +1 -0
  90. package/dist/services/{DataLakeService.d.cts → DataLakeService.d.ts} +4 -4
  91. package/dist/services/DataLakeService.d.ts.map +1 -0
  92. package/dist/services/{DataLakeService.mjs → DataLakeService.js} +7 -7
  93. package/dist/services/DataLakeService.js.map +1 -0
  94. package/dist/services/{DepositService.d.cts → DepositService.d.ts} +4 -4
  95. package/dist/services/DepositService.d.ts.map +1 -0
  96. package/dist/services/{DepositService.mjs → DepositService.js} +7 -7
  97. package/dist/services/DepositService.js.map +1 -0
  98. package/dist/services/{DexDiscoveryCacheManager.d.cts → DexDiscoveryCacheManager.d.ts} +2 -2
  99. package/dist/services/DexDiscoveryCacheManager.d.ts.map +1 -0
  100. package/dist/services/{DexDiscoveryCacheManager.mjs → DexDiscoveryCacheManager.js} +2 -2
  101. package/dist/services/DexDiscoveryCacheManager.js.map +1 -0
  102. package/dist/services/{EligibilityService.d.cts → EligibilityService.d.ts} +2 -2
  103. package/dist/services/EligibilityService.d.ts.map +1 -0
  104. package/dist/services/{EligibilityService.mjs → EligibilityService.js} +3 -3
  105. package/dist/services/EligibilityService.js.map +1 -0
  106. package/dist/services/{FeatureFlagConfigurationService.d.cts → FeatureFlagConfigurationService.d.ts} +3 -3
  107. package/dist/services/FeatureFlagConfigurationService.d.ts.map +1 -0
  108. package/dist/services/{FeatureFlagConfigurationService.mjs → FeatureFlagConfigurationService.js} +7 -7
  109. package/dist/services/FeatureFlagConfigurationService.js.map +1 -0
  110. package/dist/services/{HyperLiquidClientService.d.cts → HyperLiquidClientService.d.ts} +10 -10
  111. package/dist/services/HyperLiquidClientService.d.ts.map +1 -0
  112. package/dist/services/{HyperLiquidClientService.mjs → HyperLiquidClientService.js} +11 -11
  113. package/dist/services/HyperLiquidClientService.js.map +1 -0
  114. package/dist/services/{HyperLiquidSubscriptionService.d.cts → HyperLiquidSubscriptionService.d.ts} +6 -6
  115. package/dist/services/HyperLiquidSubscriptionService.d.ts.map +1 -0
  116. package/dist/services/{HyperLiquidSubscriptionService.mjs → HyperLiquidSubscriptionService.js} +12 -12
  117. package/dist/services/HyperLiquidSubscriptionService.js.map +1 -0
  118. package/dist/services/{HyperLiquidWalletService.d.cts → HyperLiquidWalletService.d.ts} +4 -4
  119. package/dist/services/HyperLiquidWalletService.d.ts.map +1 -0
  120. package/dist/services/{HyperLiquidWalletService.mjs → HyperLiquidWalletService.js} +5 -5
  121. package/dist/services/HyperLiquidWalletService.js.map +1 -0
  122. package/dist/services/{MarketDataService.d.cts → MarketDataService.d.ts} +5 -5
  123. package/dist/services/MarketDataService.d.ts.map +1 -0
  124. package/dist/services/{MarketDataService.mjs → MarketDataService.js} +9 -9
  125. package/dist/services/MarketDataService.js.map +1 -0
  126. package/dist/services/{RewardsIntegrationService.d.cts → RewardsIntegrationService.d.ts} +3 -3
  127. package/dist/services/RewardsIntegrationService.d.ts.map +1 -0
  128. package/dist/services/{RewardsIntegrationService.mjs → RewardsIntegrationService.js} +6 -6
  129. package/dist/services/RewardsIntegrationService.js.map +1 -0
  130. package/dist/services/{ServiceContext.d.cts → ServiceContext.d.ts} +3 -3
  131. package/dist/services/ServiceContext.d.ts.map +1 -0
  132. package/dist/services/ServiceContext.js +2 -0
  133. package/dist/services/ServiceContext.js.map +1 -0
  134. package/dist/services/{TerminalMarketService.d.cts → TerminalMarketService.d.ts} +2 -2
  135. package/dist/services/TerminalMarketService.d.ts.map +1 -0
  136. package/dist/services/{TerminalMarketService.mjs → TerminalMarketService.js} +9 -9
  137. package/dist/services/TerminalMarketService.js.map +1 -0
  138. package/dist/services/{TradingReadinessCache.d.mts → TradingReadinessCache.d.ts} +1 -1
  139. package/dist/services/TradingReadinessCache.d.ts.map +1 -0
  140. package/dist/services/{TradingReadinessCache.mjs → TradingReadinessCache.js} +1 -1
  141. package/dist/services/TradingReadinessCache.js.map +1 -0
  142. package/dist/services/{TradingService.d.cts → TradingService.d.ts} +4 -4
  143. package/dist/services/TradingService.d.ts.map +1 -0
  144. package/dist/services/{TradingService.mjs → TradingService.js} +10 -10
  145. package/dist/services/TradingService.js.map +1 -0
  146. package/dist/types/{config.d.cts → config.d.ts} +2 -2
  147. package/dist/types/config.d.ts.map +1 -0
  148. package/dist/types/config.js +2 -0
  149. package/dist/types/config.js.map +1 -0
  150. package/dist/types/{hyperliquid-types.d.cts → hyperliquid-types.d.ts} +6 -6
  151. package/dist/types/hyperliquid-types.d.ts.map +1 -0
  152. package/dist/types/{hyperliquid-types.mjs → hyperliquid-types.js} +1 -1
  153. package/dist/types/hyperliquid-types.js.map +1 -0
  154. package/dist/types/{index.d.cts → index.d.ts} +41 -41
  155. package/dist/types/index.d.ts.map +1 -0
  156. package/dist/types/{index.mjs → index.js} +3 -3
  157. package/dist/types/index.js.map +1 -0
  158. package/dist/types/{messenger.d.mts → messenger.d.ts} +11 -11
  159. package/dist/types/messenger.d.ts.map +1 -0
  160. package/dist/types/messenger.js +2 -0
  161. package/dist/types/messenger.js.map +1 -0
  162. package/dist/types/{myx-types.d.mts → myx-types.d.ts} +16 -16
  163. package/dist/types/myx-types.d.ts.map +1 -0
  164. package/dist/types/{myx-types.mjs → myx-types.js} +3 -3
  165. package/dist/types/myx-types.js.map +1 -0
  166. package/dist/types/{perps-types.d.cts → perps-types.d.ts} +4 -4
  167. package/dist/types/perps-types.d.ts.map +1 -0
  168. package/dist/types/perps-types.js +2 -0
  169. package/dist/types/perps-types.js.map +1 -0
  170. package/dist/types/{token.d.cts → token.d.ts} +2 -2
  171. package/dist/types/token.d.ts.map +1 -0
  172. package/dist/types/token.js +2 -0
  173. package/dist/types/token.js.map +1 -0
  174. package/dist/types/{transactionTypes.d.cts → transactionTypes.d.ts} +1 -1
  175. package/dist/types/transactionTypes.d.ts.map +1 -0
  176. package/dist/types/{transactionTypes.mjs → transactionTypes.js} +2 -2
  177. package/dist/types/transactionTypes.js.map +1 -0
  178. package/dist/utils/{accountUtils.d.cts → accountUtils.d.ts} +4 -4
  179. package/dist/utils/accountUtils.d.ts.map +1 -0
  180. package/dist/utils/{accountUtils.mjs → accountUtils.js} +2 -2
  181. package/dist/utils/accountUtils.js.map +1 -0
  182. package/dist/utils/{capabilitySymbols.d.mts → capabilitySymbols.d.ts} +1 -1
  183. package/dist/utils/capabilitySymbols.d.ts.map +1 -0
  184. package/dist/utils/{capabilitySymbols.mjs → capabilitySymbols.js} +1 -1
  185. package/dist/utils/capabilitySymbols.js.map +1 -0
  186. package/dist/utils/{coalescePerpsRestRequest.d.cts → coalescePerpsRestRequest.d.ts} +1 -1
  187. package/dist/utils/coalescePerpsRestRequest.d.ts.map +1 -0
  188. package/dist/utils/{coalescePerpsRestRequest.mjs → coalescePerpsRestRequest.js} +2 -2
  189. package/dist/utils/coalescePerpsRestRequest.js.map +1 -0
  190. package/dist/utils/{errorUtils.d.mts → errorUtils.d.ts} +1 -1
  191. package/dist/utils/errorUtils.d.ts.map +1 -0
  192. package/dist/utils/{errorUtils.mjs → errorUtils.js} +3 -3
  193. package/dist/utils/errorUtils.js.map +1 -0
  194. package/dist/utils/{hyperLiquidAbstraction.d.cts → hyperLiquidAbstraction.d.ts} +2 -2
  195. package/dist/utils/hyperLiquidAbstraction.d.ts.map +1 -0
  196. package/dist/utils/{hyperLiquidAbstraction.mjs → hyperLiquidAbstraction.js} +1 -1
  197. package/dist/utils/hyperLiquidAbstraction.js.map +1 -0
  198. package/dist/utils/{hyperLiquidAdapter.d.cts → hyperLiquidAdapter.d.ts} +4 -4
  199. package/dist/utils/hyperLiquidAdapter.d.ts.map +1 -0
  200. package/dist/utils/{hyperLiquidAdapter.mjs → hyperLiquidAdapter.js} +9 -9
  201. package/dist/utils/hyperLiquidAdapter.js.map +1 -0
  202. package/dist/utils/{hyperLiquidOrderBookProcessor.d.mts → hyperLiquidOrderBookProcessor.d.ts} +3 -3
  203. package/dist/utils/hyperLiquidOrderBookProcessor.d.ts.map +1 -0
  204. package/dist/utils/{hyperLiquidOrderBookProcessor.mjs → hyperLiquidOrderBookProcessor.js} +1 -1
  205. package/dist/utils/hyperLiquidOrderBookProcessor.js.map +1 -0
  206. package/dist/utils/{hyperLiquidValidation.d.cts → hyperLiquidValidation.d.ts} +4 -4
  207. package/dist/utils/hyperLiquidValidation.d.ts.map +1 -0
  208. package/dist/utils/{hyperLiquidValidation.mjs → hyperLiquidValidation.js} +6 -6
  209. package/dist/utils/hyperLiquidValidation.js.map +1 -0
  210. package/dist/utils/{idUtils.d.cts → idUtils.d.ts} +1 -1
  211. package/dist/utils/idUtils.d.ts.map +1 -0
  212. package/dist/utils/{idUtils.mjs → idUtils.js} +2 -2
  213. package/dist/utils/idUtils.js.map +1 -0
  214. package/dist/utils/index.d.ts +28 -0
  215. package/dist/utils/index.d.ts.map +1 -0
  216. package/dist/utils/{index.mjs → index.js} +21 -21
  217. package/dist/utils/index.js.map +1 -0
  218. package/dist/utils/{marketDataTransform.d.cts → marketDataTransform.d.ts} +3 -3
  219. package/dist/utils/marketDataTransform.d.ts.map +1 -0
  220. package/dist/utils/{marketDataTransform.mjs → marketDataTransform.js} +5 -5
  221. package/dist/utils/marketDataTransform.js.map +1 -0
  222. package/dist/utils/{marketSearch.d.cts → marketSearch.d.ts} +2 -2
  223. package/dist/utils/marketSearch.d.ts.map +1 -0
  224. package/dist/utils/{marketSearch.mjs → marketSearch.js} +1 -1
  225. package/dist/utils/marketSearch.js.map +1 -0
  226. package/dist/utils/{marketUtils.d.cts → marketUtils.d.ts} +3 -3
  227. package/dist/utils/marketUtils.d.ts.map +1 -0
  228. package/dist/utils/{marketUtils.mjs → marketUtils.js} +2 -2
  229. package/dist/utils/marketUtils.js.map +1 -0
  230. package/dist/utils/{myxAdapter.d.cts → myxAdapter.d.ts} +3 -3
  231. package/dist/utils/myxAdapter.d.ts.map +1 -0
  232. package/dist/utils/{myxAdapter.mjs → myxAdapter.js} +3 -3
  233. package/dist/utils/myxAdapter.js.map +1 -0
  234. package/dist/utils/{orderCalculations.d.cts → orderCalculations.d.ts} +4 -4
  235. package/dist/utils/orderCalculations.d.ts.map +1 -0
  236. package/dist/utils/{orderCalculations.mjs → orderCalculations.js} +6 -6
  237. package/dist/utils/orderCalculations.js.map +1 -0
  238. package/dist/utils/{orderTypes.d.mts → orderTypes.d.ts} +3 -3
  239. package/dist/utils/orderTypes.d.ts.map +1 -0
  240. package/dist/utils/{orderTypes.mjs → orderTypes.js} +1 -1
  241. package/dist/utils/orderTypes.js.map +1 -0
  242. package/dist/utils/{perpsConnectionAttemptContext.d.mts → perpsConnectionAttemptContext.d.ts} +1 -1
  243. package/dist/utils/perpsConnectionAttemptContext.d.ts.map +1 -0
  244. package/dist/utils/{perpsConnectionAttemptContext.mjs → perpsConnectionAttemptContext.js} +1 -1
  245. package/dist/utils/perpsConnectionAttemptContext.js.map +1 -0
  246. package/dist/utils/{perpsDiskPersistence.d.cts → perpsDiskPersistence.d.ts} +2 -2
  247. package/dist/utils/perpsDiskPersistence.d.ts.map +1 -0
  248. package/dist/utils/{perpsDiskPersistence.mjs → perpsDiskPersistence.js} +2 -2
  249. package/dist/utils/perpsDiskPersistence.js.map +1 -0
  250. package/dist/utils/{perpsFormatters.d.cts → perpsFormatters.d.ts} +1 -1
  251. package/dist/utils/perpsFormatters.d.ts.map +1 -0
  252. package/dist/utils/{perpsFormatters.mjs → perpsFormatters.js} +2 -2
  253. package/dist/utils/perpsFormatters.js.map +1 -0
  254. package/dist/utils/{rewardsUtils.d.cts → rewardsUtils.d.ts} +4 -4
  255. package/dist/utils/rewardsUtils.d.ts.map +1 -0
  256. package/dist/utils/{rewardsUtils.mjs → rewardsUtils.js} +4 -4
  257. package/dist/utils/rewardsUtils.js.map +1 -0
  258. package/dist/utils/{significantFigures.d.cts → significantFigures.d.ts} +1 -1
  259. package/dist/utils/significantFigures.d.ts.map +1 -0
  260. package/dist/utils/{significantFigures.mjs → significantFigures.js} +2 -2
  261. package/dist/utils/significantFigures.js.map +1 -0
  262. package/dist/utils/{sortMarkets.d.cts → sortMarkets.d.ts} +2 -2
  263. package/dist/utils/sortMarkets.d.ts.map +1 -0
  264. package/dist/utils/{sortMarkets.mjs → sortMarkets.js} +2 -2
  265. package/dist/utils/sortMarkets.js.map +1 -0
  266. package/dist/utils/{standaloneInfoClient.d.cts → standaloneInfoClient.d.ts} +3 -3
  267. package/dist/utils/standaloneInfoClient.d.ts.map +1 -0
  268. package/dist/utils/{standaloneInfoClient.mjs → standaloneInfoClient.js} +3 -3
  269. package/dist/utils/standaloneInfoClient.js.map +1 -0
  270. package/dist/utils/{stringParseUtils.d.cts → stringParseUtils.d.ts} +1 -1
  271. package/dist/utils/stringParseUtils.d.ts.map +1 -0
  272. package/dist/utils/{stringParseUtils.mjs → stringParseUtils.js} +1 -1
  273. package/dist/utils/stringParseUtils.js.map +1 -0
  274. package/dist/utils/{transferData.d.cts → transferData.d.ts} +1 -1
  275. package/dist/utils/transferData.d.ts.map +1 -0
  276. package/dist/utils/{transferData.mjs → transferData.js} +3 -3
  277. package/dist/utils/transferData.js.map +1 -0
  278. package/dist/utils/{wait.d.cts → wait.d.ts} +1 -1
  279. package/dist/utils/wait.d.ts.map +1 -0
  280. package/dist/utils/{wait.mjs → wait.js} +1 -1
  281. package/dist/utils/wait.js.map +1 -0
  282. package/package.json +20 -48
  283. package/dist/PerpsController-method-action-types.cjs +0 -7
  284. package/dist/PerpsController-method-action-types.cjs.map +0 -1
  285. package/dist/PerpsController-method-action-types.d.cts +0 -1163
  286. package/dist/PerpsController-method-action-types.d.cts.map +0 -1
  287. package/dist/PerpsController-method-action-types.d.mts.map +0 -1
  288. package/dist/PerpsController-method-action-types.mjs.map +0 -1
  289. package/dist/PerpsController.cjs +0 -5063
  290. package/dist/PerpsController.cjs.map +0 -1
  291. package/dist/PerpsController.d.cts +0 -1274
  292. package/dist/PerpsController.d.cts.map +0 -1
  293. package/dist/PerpsController.d.mts.map +0 -1
  294. package/dist/PerpsController.mjs.map +0 -1
  295. package/dist/aggregation/SubscriptionMultiplexer.cjs +0 -441
  296. package/dist/aggregation/SubscriptionMultiplexer.cjs.map +0 -1
  297. package/dist/aggregation/SubscriptionMultiplexer.d.cts.map +0 -1
  298. package/dist/aggregation/SubscriptionMultiplexer.d.mts +0 -171
  299. package/dist/aggregation/SubscriptionMultiplexer.d.mts.map +0 -1
  300. package/dist/aggregation/SubscriptionMultiplexer.mjs.map +0 -1
  301. package/dist/aggregation/index.cjs +0 -9
  302. package/dist/aggregation/index.cjs.map +0 -1
  303. package/dist/aggregation/index.d.cts +0 -6
  304. package/dist/aggregation/index.d.cts.map +0 -1
  305. package/dist/aggregation/index.d.mts +0 -6
  306. package/dist/aggregation/index.d.mts.map +0 -1
  307. package/dist/aggregation/index.mjs +0 -5
  308. package/dist/aggregation/index.mjs.map +0 -1
  309. package/dist/constants/chartConfig.cjs +0 -239
  310. package/dist/constants/chartConfig.cjs.map +0 -1
  311. package/dist/constants/chartConfig.d.cts +0 -228
  312. package/dist/constants/chartConfig.d.cts.map +0 -1
  313. package/dist/constants/chartConfig.d.mts.map +0 -1
  314. package/dist/constants/chartConfig.mjs.map +0 -1
  315. package/dist/constants/eventNames.cjs +0 -650
  316. package/dist/constants/eventNames.cjs.map +0 -1
  317. package/dist/constants/eventNames.d.cts +0 -555
  318. package/dist/constants/eventNames.d.cts.map +0 -1
  319. package/dist/constants/eventNames.d.mts +0 -555
  320. package/dist/constants/eventNames.d.mts.map +0 -1
  321. package/dist/constants/eventNames.mjs.map +0 -1
  322. package/dist/constants/hyperLiquidConfig.cjs +0 -607
  323. package/dist/constants/hyperLiquidConfig.cjs.map +0 -1
  324. package/dist/constants/hyperLiquidConfig.d.cts.map +0 -1
  325. package/dist/constants/hyperLiquidConfig.d.mts +0 -280
  326. package/dist/constants/hyperLiquidConfig.d.mts.map +0 -1
  327. package/dist/constants/hyperLiquidConfig.mjs.map +0 -1
  328. package/dist/constants/index.cjs +0 -28
  329. package/dist/constants/index.cjs.map +0 -1
  330. package/dist/constants/index.d.cts +0 -12
  331. package/dist/constants/index.d.cts.map +0 -1
  332. package/dist/constants/index.d.mts +0 -12
  333. package/dist/constants/index.d.mts.map +0 -1
  334. package/dist/constants/index.mjs +0 -12
  335. package/dist/constants/index.mjs.map +0 -1
  336. package/dist/constants/myxConfig.cjs +0 -253
  337. package/dist/constants/myxConfig.cjs.map +0 -1
  338. package/dist/constants/myxConfig.d.cts +0 -145
  339. package/dist/constants/myxConfig.d.cts.map +0 -1
  340. package/dist/constants/myxConfig.d.mts.map +0 -1
  341. package/dist/constants/myxConfig.mjs.map +0 -1
  342. package/dist/constants/orderTypes.cjs +0 -31
  343. package/dist/constants/orderTypes.cjs.map +0 -1
  344. package/dist/constants/orderTypes.d.cts.map +0 -1
  345. package/dist/constants/orderTypes.d.mts +0 -19
  346. package/dist/constants/orderTypes.d.mts.map +0 -1
  347. package/dist/constants/orderTypes.mjs.map +0 -1
  348. package/dist/constants/performanceMetrics.cjs +0 -63
  349. package/dist/constants/performanceMetrics.cjs.map +0 -1
  350. package/dist/constants/performanceMetrics.d.cts.map +0 -1
  351. package/dist/constants/performanceMetrics.d.mts +0 -46
  352. package/dist/constants/performanceMetrics.d.mts.map +0 -1
  353. package/dist/constants/performanceMetrics.mjs.map +0 -1
  354. package/dist/constants/perpsConfig.cjs +0 -553
  355. package/dist/constants/perpsConfig.cjs.map +0 -1
  356. package/dist/constants/perpsConfig.d.cts +0 -474
  357. package/dist/constants/perpsConfig.d.cts.map +0 -1
  358. package/dist/constants/perpsConfig.d.mts.map +0 -1
  359. package/dist/constants/perpsConfig.mjs.map +0 -1
  360. package/dist/constants/transactionsHistoryConfig.cjs +0 -38
  361. package/dist/constants/transactionsHistoryConfig.cjs.map +0 -1
  362. package/dist/constants/transactionsHistoryConfig.d.cts.map +0 -1
  363. package/dist/constants/transactionsHistoryConfig.d.mts +0 -35
  364. package/dist/constants/transactionsHistoryConfig.d.mts.map +0 -1
  365. package/dist/constants/transactionsHistoryConfig.mjs.map +0 -1
  366. package/dist/index.cjs +0 -344
  367. package/dist/index.cjs.map +0 -1
  368. package/dist/index.d.cts +0 -92
  369. package/dist/index.d.cts.map +0 -1
  370. package/dist/index.d.mts.map +0 -1
  371. package/dist/index.mjs.map +0 -1
  372. package/dist/perpsErrorCodes.cjs +0 -127
  373. package/dist/perpsErrorCodes.cjs.map +0 -1
  374. package/dist/perpsErrorCodes.d.cts +0 -104
  375. package/dist/perpsErrorCodes.d.cts.map +0 -1
  376. package/dist/perpsErrorCodes.d.mts +0 -104
  377. package/dist/perpsErrorCodes.d.mts.map +0 -1
  378. package/dist/perpsErrorCodes.mjs.map +0 -1
  379. package/dist/providers/AggregatedPerpsProvider.cjs +0 -689
  380. package/dist/providers/AggregatedPerpsProvider.cjs.map +0 -1
  381. package/dist/providers/AggregatedPerpsProvider.d.cts.map +0 -1
  382. package/dist/providers/AggregatedPerpsProvider.d.mts +0 -232
  383. package/dist/providers/AggregatedPerpsProvider.d.mts.map +0 -1
  384. package/dist/providers/AggregatedPerpsProvider.mjs.map +0 -1
  385. package/dist/providers/HyperLiquidProvider.cjs +0 -10416
  386. package/dist/providers/HyperLiquidProvider.cjs.map +0 -1
  387. package/dist/providers/HyperLiquidProvider.d.cts +0 -625
  388. package/dist/providers/HyperLiquidProvider.d.cts.map +0 -1
  389. package/dist/providers/HyperLiquidProvider.d.mts.map +0 -1
  390. package/dist/providers/HyperLiquidProvider.mjs.map +0 -1
  391. package/dist/routing/ProviderRouter.cjs +0 -154
  392. package/dist/routing/ProviderRouter.cjs.map +0 -1
  393. package/dist/routing/ProviderRouter.d.cts +0 -112
  394. package/dist/routing/ProviderRouter.d.cts.map +0 -1
  395. package/dist/routing/ProviderRouter.d.mts.map +0 -1
  396. package/dist/routing/ProviderRouter.mjs.map +0 -1
  397. package/dist/routing/index.cjs +0 -9
  398. package/dist/routing/index.cjs.map +0 -1
  399. package/dist/routing/index.d.cts +0 -6
  400. package/dist/routing/index.d.cts.map +0 -1
  401. package/dist/routing/index.d.mts +0 -6
  402. package/dist/routing/index.d.mts.map +0 -1
  403. package/dist/routing/index.mjs +0 -5
  404. package/dist/routing/index.mjs.map +0 -1
  405. package/dist/selectors.cjs +0 -264
  406. package/dist/selectors.cjs.map +0 -1
  407. package/dist/selectors.d.cts +0 -336
  408. package/dist/selectors.d.cts.map +0 -1
  409. package/dist/selectors.d.mts.map +0 -1
  410. package/dist/selectors.mjs.map +0 -1
  411. package/dist/services/AccountService.cjs +0 -324
  412. package/dist/services/AccountService.cjs.map +0 -1
  413. package/dist/services/AccountService.d.cts.map +0 -1
  414. package/dist/services/AccountService.d.mts +0 -56
  415. package/dist/services/AccountService.d.mts.map +0 -1
  416. package/dist/services/AccountService.mjs.map +0 -1
  417. package/dist/services/AggregatedOrderBookConnection.cjs +0 -405
  418. package/dist/services/AggregatedOrderBookConnection.cjs.map +0 -1
  419. package/dist/services/AggregatedOrderBookConnection.d.cts.map +0 -1
  420. package/dist/services/AggregatedOrderBookConnection.d.mts +0 -106
  421. package/dist/services/AggregatedOrderBookConnection.d.mts.map +0 -1
  422. package/dist/services/AggregatedOrderBookConnection.mjs.map +0 -1
  423. package/dist/services/DataLakeService.cjs +0 -233
  424. package/dist/services/DataLakeService.cjs.map +0 -1
  425. package/dist/services/DataLakeService.d.cts.map +0 -1
  426. package/dist/services/DataLakeService.d.mts +0 -51
  427. package/dist/services/DataLakeService.d.mts.map +0 -1
  428. package/dist/services/DataLakeService.mjs.map +0 -1
  429. package/dist/services/DepositService.cjs +0 -99
  430. package/dist/services/DepositService.cjs.map +0 -1
  431. package/dist/services/DepositService.d.cts.map +0 -1
  432. package/dist/services/DepositService.d.mts +0 -39
  433. package/dist/services/DepositService.d.mts.map +0 -1
  434. package/dist/services/DepositService.mjs.map +0 -1
  435. package/dist/services/DexDiscoveryCacheManager.cjs +0 -147
  436. package/dist/services/DexDiscoveryCacheManager.cjs.map +0 -1
  437. package/dist/services/DexDiscoveryCacheManager.d.cts.map +0 -1
  438. package/dist/services/DexDiscoveryCacheManager.d.mts +0 -52
  439. package/dist/services/DexDiscoveryCacheManager.d.mts.map +0 -1
  440. package/dist/services/DexDiscoveryCacheManager.mjs.map +0 -1
  441. package/dist/services/EligibilityService.cjs +0 -78
  442. package/dist/services/EligibilityService.cjs.map +0 -1
  443. package/dist/services/EligibilityService.d.cts.map +0 -1
  444. package/dist/services/EligibilityService.d.mts +0 -28
  445. package/dist/services/EligibilityService.d.mts.map +0 -1
  446. package/dist/services/EligibilityService.mjs.map +0 -1
  447. package/dist/services/FeatureFlagConfigurationService.cjs +0 -257
  448. package/dist/services/FeatureFlagConfigurationService.cjs.map +0 -1
  449. package/dist/services/FeatureFlagConfigurationService.d.cts.map +0 -1
  450. package/dist/services/FeatureFlagConfigurationService.d.mts +0 -73
  451. package/dist/services/FeatureFlagConfigurationService.d.mts.map +0 -1
  452. package/dist/services/FeatureFlagConfigurationService.mjs.map +0 -1
  453. package/dist/services/HyperLiquidClientService.cjs +0 -1045
  454. package/dist/services/HyperLiquidClientService.cjs.map +0 -1
  455. package/dist/services/HyperLiquidClientService.d.cts.map +0 -1
  456. package/dist/services/HyperLiquidClientService.d.mts +0 -239
  457. package/dist/services/HyperLiquidClientService.d.mts.map +0 -1
  458. package/dist/services/HyperLiquidClientService.mjs.map +0 -1
  459. package/dist/services/HyperLiquidSubscriptionService.cjs +0 -3196
  460. package/dist/services/HyperLiquidSubscriptionService.cjs.map +0 -1
  461. package/dist/services/HyperLiquidSubscriptionService.d.cts.map +0 -1
  462. package/dist/services/HyperLiquidSubscriptionService.d.mts +0 -227
  463. package/dist/services/HyperLiquidSubscriptionService.d.mts.map +0 -1
  464. package/dist/services/HyperLiquidSubscriptionService.mjs.map +0 -1
  465. package/dist/services/HyperLiquidWalletService.cjs +0 -186
  466. package/dist/services/HyperLiquidWalletService.cjs.map +0 -1
  467. package/dist/services/HyperLiquidWalletService.d.cts.map +0 -1
  468. package/dist/services/HyperLiquidWalletService.d.mts +0 -84
  469. package/dist/services/HyperLiquidWalletService.d.mts.map +0 -1
  470. package/dist/services/HyperLiquidWalletService.mjs.map +0 -1
  471. package/dist/services/MarketDataService.cjs +0 -1138
  472. package/dist/services/MarketDataService.cjs.map +0 -1
  473. package/dist/services/MarketDataService.d.cts.map +0 -1
  474. package/dist/services/MarketDataService.d.mts +0 -334
  475. package/dist/services/MarketDataService.d.mts.map +0 -1
  476. package/dist/services/MarketDataService.mjs.map +0 -1
  477. package/dist/services/RewardsIntegrationService.cjs +0 -391
  478. package/dist/services/RewardsIntegrationService.cjs.map +0 -1
  479. package/dist/services/RewardsIntegrationService.d.cts.map +0 -1
  480. package/dist/services/RewardsIntegrationService.d.mts +0 -84
  481. package/dist/services/RewardsIntegrationService.d.mts.map +0 -1
  482. package/dist/services/RewardsIntegrationService.mjs.map +0 -1
  483. package/dist/services/ServiceContext.cjs +0 -3
  484. package/dist/services/ServiceContext.cjs.map +0 -1
  485. package/dist/services/ServiceContext.d.cts.map +0 -1
  486. package/dist/services/ServiceContext.d.mts +0 -102
  487. package/dist/services/ServiceContext.d.mts.map +0 -1
  488. package/dist/services/ServiceContext.mjs +0 -2
  489. package/dist/services/ServiceContext.mjs.map +0 -1
  490. package/dist/services/TerminalMarketService.cjs +0 -623
  491. package/dist/services/TerminalMarketService.cjs.map +0 -1
  492. package/dist/services/TerminalMarketService.d.cts.map +0 -1
  493. package/dist/services/TerminalMarketService.d.mts +0 -45
  494. package/dist/services/TerminalMarketService.d.mts.map +0 -1
  495. package/dist/services/TerminalMarketService.mjs.map +0 -1
  496. package/dist/services/TradingReadinessCache.cjs +0 -329
  497. package/dist/services/TradingReadinessCache.cjs.map +0 -1
  498. package/dist/services/TradingReadinessCache.d.cts +0 -204
  499. package/dist/services/TradingReadinessCache.d.cts.map +0 -1
  500. package/dist/services/TradingReadinessCache.d.mts.map +0 -1
  501. package/dist/services/TradingReadinessCache.mjs.map +0 -1
  502. package/dist/services/TradingService.cjs +0 -1865
  503. package/dist/services/TradingService.cjs.map +0 -1
  504. package/dist/services/TradingService.d.cts.map +0 -1
  505. package/dist/services/TradingService.d.mts +0 -201
  506. package/dist/services/TradingService.d.mts.map +0 -1
  507. package/dist/services/TradingService.mjs.map +0 -1
  508. package/dist/types/config.cjs +0 -3
  509. package/dist/types/config.cjs.map +0 -1
  510. package/dist/types/config.d.cts.map +0 -1
  511. package/dist/types/config.d.mts +0 -49
  512. package/dist/types/config.d.mts.map +0 -1
  513. package/dist/types/config.mjs +0 -2
  514. package/dist/types/config.mjs.map +0 -1
  515. package/dist/types/hyperliquid-types.cjs +0 -45
  516. package/dist/types/hyperliquid-types.cjs.map +0 -1
  517. package/dist/types/hyperliquid-types.d.cts.map +0 -1
  518. package/dist/types/hyperliquid-types.d.mts +0 -67
  519. package/dist/types/hyperliquid-types.d.mts.map +0 -1
  520. package/dist/types/hyperliquid-types.mjs.map +0 -1
  521. package/dist/types/index.cjs +0 -151
  522. package/dist/types/index.cjs.map +0 -1
  523. package/dist/types/index.d.cts.map +0 -1
  524. package/dist/types/index.d.mts +0 -1951
  525. package/dist/types/index.d.mts.map +0 -1
  526. package/dist/types/index.mjs.map +0 -1
  527. package/dist/types/messenger.cjs +0 -3
  528. package/dist/types/messenger.cjs.map +0 -1
  529. package/dist/types/messenger.d.cts +0 -30
  530. package/dist/types/messenger.d.cts.map +0 -1
  531. package/dist/types/messenger.d.mts.map +0 -1
  532. package/dist/types/messenger.mjs +0 -2
  533. package/dist/types/messenger.mjs.map +0 -1
  534. package/dist/types/myx-types.cjs +0 -41
  535. package/dist/types/myx-types.cjs.map +0 -1
  536. package/dist/types/myx-types.d.cts +0 -94
  537. package/dist/types/myx-types.d.cts.map +0 -1
  538. package/dist/types/myx-types.d.mts.map +0 -1
  539. package/dist/types/myx-types.mjs.map +0 -1
  540. package/dist/types/perps-types.cjs +0 -7
  541. package/dist/types/perps-types.cjs.map +0 -1
  542. package/dist/types/perps-types.d.cts.map +0 -1
  543. package/dist/types/perps-types.d.mts +0 -184
  544. package/dist/types/perps-types.d.mts.map +0 -1
  545. package/dist/types/perps-types.mjs +0 -5
  546. package/dist/types/perps-types.mjs.map +0 -1
  547. package/dist/types/token.cjs +0 -3
  548. package/dist/types/token.cjs.map +0 -1
  549. package/dist/types/token.d.cts.map +0 -1
  550. package/dist/types/token.d.mts +0 -25
  551. package/dist/types/token.d.mts.map +0 -1
  552. package/dist/types/token.mjs +0 -2
  553. package/dist/types/token.mjs.map +0 -1
  554. package/dist/types/transactionTypes.cjs +0 -29
  555. package/dist/types/transactionTypes.cjs.map +0 -1
  556. package/dist/types/transactionTypes.d.cts.map +0 -1
  557. package/dist/types/transactionTypes.d.mts +0 -60
  558. package/dist/types/transactionTypes.d.mts.map +0 -1
  559. package/dist/types/transactionTypes.mjs.map +0 -1
  560. package/dist/utils/accountUtils.cjs +0 -236
  561. package/dist/utils/accountUtils.cjs.map +0 -1
  562. package/dist/utils/accountUtils.d.cts.map +0 -1
  563. package/dist/utils/accountUtils.d.mts +0 -72
  564. package/dist/utils/accountUtils.d.mts.map +0 -1
  565. package/dist/utils/accountUtils.mjs.map +0 -1
  566. package/dist/utils/capabilitySymbols.cjs +0 -25
  567. package/dist/utils/capabilitySymbols.cjs.map +0 -1
  568. package/dist/utils/capabilitySymbols.d.cts +0 -15
  569. package/dist/utils/capabilitySymbols.d.cts.map +0 -1
  570. package/dist/utils/capabilitySymbols.d.mts.map +0 -1
  571. package/dist/utils/capabilitySymbols.mjs.map +0 -1
  572. package/dist/utils/coalescePerpsRestRequest.cjs +0 -71
  573. package/dist/utils/coalescePerpsRestRequest.cjs.map +0 -1
  574. package/dist/utils/coalescePerpsRestRequest.d.cts.map +0 -1
  575. package/dist/utils/coalescePerpsRestRequest.d.mts +0 -32
  576. package/dist/utils/coalescePerpsRestRequest.d.mts.map +0 -1
  577. package/dist/utils/coalescePerpsRestRequest.mjs.map +0 -1
  578. package/dist/utils/errorUtils.cjs +0 -104
  579. package/dist/utils/errorUtils.cjs.map +0 -1
  580. package/dist/utils/errorUtils.d.cts +0 -50
  581. package/dist/utils/errorUtils.d.cts.map +0 -1
  582. package/dist/utils/errorUtils.d.mts.map +0 -1
  583. package/dist/utils/errorUtils.mjs.map +0 -1
  584. package/dist/utils/hyperLiquidAbstraction.cjs +0 -23
  585. package/dist/utils/hyperLiquidAbstraction.cjs.map +0 -1
  586. package/dist/utils/hyperLiquidAbstraction.d.cts.map +0 -1
  587. package/dist/utils/hyperLiquidAbstraction.d.mts +0 -11
  588. package/dist/utils/hyperLiquidAbstraction.d.mts.map +0 -1
  589. package/dist/utils/hyperLiquidAbstraction.mjs.map +0 -1
  590. package/dist/utils/hyperLiquidAdapter.cjs +0 -512
  591. package/dist/utils/hyperLiquidAdapter.cjs.map +0 -1
  592. package/dist/utils/hyperLiquidAdapter.d.cts.map +0 -1
  593. package/dist/utils/hyperLiquidAdapter.d.mts +0 -77
  594. package/dist/utils/hyperLiquidAdapter.d.mts.map +0 -1
  595. package/dist/utils/hyperLiquidAdapter.mjs.map +0 -1
  596. package/dist/utils/hyperLiquidOrderBookProcessor.cjs +0 -83
  597. package/dist/utils/hyperLiquidOrderBookProcessor.cjs.map +0 -1
  598. package/dist/utils/hyperLiquidOrderBookProcessor.d.cts +0 -55
  599. package/dist/utils/hyperLiquidOrderBookProcessor.d.cts.map +0 -1
  600. package/dist/utils/hyperLiquidOrderBookProcessor.d.mts.map +0 -1
  601. package/dist/utils/hyperLiquidOrderBookProcessor.mjs.map +0 -1
  602. package/dist/utils/hyperLiquidValidation.cjs +0 -799
  603. package/dist/utils/hyperLiquidValidation.cjs.map +0 -1
  604. package/dist/utils/hyperLiquidValidation.d.cts.map +0 -1
  605. package/dist/utils/hyperLiquidValidation.d.mts +0 -192
  606. package/dist/utils/hyperLiquidValidation.d.mts.map +0 -1
  607. package/dist/utils/hyperLiquidValidation.mjs.map +0 -1
  608. package/dist/utils/idUtils.cjs +0 -18
  609. package/dist/utils/idUtils.cjs.map +0 -1
  610. package/dist/utils/idUtils.d.cts.map +0 -1
  611. package/dist/utils/idUtils.d.mts +0 -6
  612. package/dist/utils/idUtils.d.mts.map +0 -1
  613. package/dist/utils/idUtils.mjs.map +0 -1
  614. package/dist/utils/index.cjs +0 -65
  615. package/dist/utils/index.cjs.map +0 -1
  616. package/dist/utils/index.d.cts +0 -28
  617. package/dist/utils/index.d.cts.map +0 -1
  618. package/dist/utils/index.d.mts +0 -28
  619. package/dist/utils/index.d.mts.map +0 -1
  620. package/dist/utils/index.mjs.map +0 -1
  621. package/dist/utils/marketDataTransform.cjs +0 -250
  622. package/dist/utils/marketDataTransform.cjs.map +0 -1
  623. package/dist/utils/marketDataTransform.d.cts.map +0 -1
  624. package/dist/utils/marketDataTransform.d.mts +0 -71
  625. package/dist/utils/marketDataTransform.d.mts.map +0 -1
  626. package/dist/utils/marketDataTransform.mjs.map +0 -1
  627. package/dist/utils/marketSearch.cjs +0 -111
  628. package/dist/utils/marketSearch.cjs.map +0 -1
  629. package/dist/utils/marketSearch.d.cts.map +0 -1
  630. package/dist/utils/marketSearch.d.mts +0 -48
  631. package/dist/utils/marketSearch.d.mts.map +0 -1
  632. package/dist/utils/marketSearch.mjs.map +0 -1
  633. package/dist/utils/marketUtils.cjs +0 -266
  634. package/dist/utils/marketUtils.cjs.map +0 -1
  635. package/dist/utils/marketUtils.d.cts.map +0 -1
  636. package/dist/utils/marketUtils.d.mts +0 -73
  637. package/dist/utils/marketUtils.d.mts.map +0 -1
  638. package/dist/utils/marketUtils.mjs.map +0 -1
  639. package/dist/utils/myxAdapter.cjs +0 -569
  640. package/dist/utils/myxAdapter.cjs.map +0 -1
  641. package/dist/utils/myxAdapter.d.cts.map +0 -1
  642. package/dist/utils/myxAdapter.d.mts +0 -168
  643. package/dist/utils/myxAdapter.d.mts.map +0 -1
  644. package/dist/utils/myxAdapter.mjs.map +0 -1
  645. package/dist/utils/orderCalculations.cjs +0 -823
  646. package/dist/utils/orderCalculations.cjs.map +0 -1
  647. package/dist/utils/orderCalculations.d.cts.map +0 -1
  648. package/dist/utils/orderCalculations.d.mts +0 -298
  649. package/dist/utils/orderCalculations.d.mts.map +0 -1
  650. package/dist/utils/orderCalculations.mjs.map +0 -1
  651. package/dist/utils/orderTypes.cjs +0 -301
  652. package/dist/utils/orderTypes.cjs.map +0 -1
  653. package/dist/utils/orderTypes.d.cts +0 -166
  654. package/dist/utils/orderTypes.d.cts.map +0 -1
  655. package/dist/utils/orderTypes.d.mts.map +0 -1
  656. package/dist/utils/orderTypes.mjs.map +0 -1
  657. package/dist/utils/perpsConnectionAttemptContext.cjs +0 -20
  658. package/dist/utils/perpsConnectionAttemptContext.cjs.map +0 -1
  659. package/dist/utils/perpsConnectionAttemptContext.d.cts +0 -7
  660. package/dist/utils/perpsConnectionAttemptContext.d.cts.map +0 -1
  661. package/dist/utils/perpsConnectionAttemptContext.d.mts.map +0 -1
  662. package/dist/utils/perpsConnectionAttemptContext.mjs.map +0 -1
  663. package/dist/utils/perpsDiskPersistence.cjs +0 -259
  664. package/dist/utils/perpsDiskPersistence.cjs.map +0 -1
  665. package/dist/utils/perpsDiskPersistence.d.cts.map +0 -1
  666. package/dist/utils/perpsDiskPersistence.d.mts +0 -112
  667. package/dist/utils/perpsDiskPersistence.d.mts.map +0 -1
  668. package/dist/utils/perpsDiskPersistence.mjs.map +0 -1
  669. package/dist/utils/perpsFormatters.cjs +0 -509
  670. package/dist/utils/perpsFormatters.cjs.map +0 -1
  671. package/dist/utils/perpsFormatters.d.cts.map +0 -1
  672. package/dist/utils/perpsFormatters.d.mts +0 -204
  673. package/dist/utils/perpsFormatters.d.mts.map +0 -1
  674. package/dist/utils/perpsFormatters.mjs.map +0 -1
  675. package/dist/utils/rewardsUtils.cjs +0 -98
  676. package/dist/utils/rewardsUtils.cjs.map +0 -1
  677. package/dist/utils/rewardsUtils.d.cts.map +0 -1
  678. package/dist/utils/rewardsUtils.d.mts +0 -33
  679. package/dist/utils/rewardsUtils.d.mts.map +0 -1
  680. package/dist/utils/rewardsUtils.mjs.map +0 -1
  681. package/dist/utils/significantFigures.cjs +0 -88
  682. package/dist/utils/significantFigures.cjs.map +0 -1
  683. package/dist/utils/significantFigures.d.cts.map +0 -1
  684. package/dist/utils/significantFigures.d.mts +0 -25
  685. package/dist/utils/significantFigures.d.mts.map +0 -1
  686. package/dist/utils/significantFigures.mjs.map +0 -1
  687. package/dist/utils/sortMarkets.cjs +0 -93
  688. package/dist/utils/sortMarkets.cjs.map +0 -1
  689. package/dist/utils/sortMarkets.d.cts.map +0 -1
  690. package/dist/utils/sortMarkets.d.mts +0 -25
  691. package/dist/utils/sortMarkets.d.mts.map +0 -1
  692. package/dist/utils/sortMarkets.mjs.map +0 -1
  693. package/dist/utils/standaloneInfoClient.cjs +0 -70
  694. package/dist/utils/standaloneInfoClient.cjs.map +0 -1
  695. package/dist/utils/standaloneInfoClient.d.cts.map +0 -1
  696. package/dist/utils/standaloneInfoClient.d.mts +0 -37
  697. package/dist/utils/standaloneInfoClient.d.mts.map +0 -1
  698. package/dist/utils/standaloneInfoClient.mjs.map +0 -1
  699. package/dist/utils/stringParseUtils.cjs +0 -34
  700. package/dist/utils/stringParseUtils.cjs.map +0 -1
  701. package/dist/utils/stringParseUtils.d.cts.map +0 -1
  702. package/dist/utils/stringParseUtils.d.mts +0 -11
  703. package/dist/utils/stringParseUtils.d.mts.map +0 -1
  704. package/dist/utils/stringParseUtils.mjs.map +0 -1
  705. package/dist/utils/transferData.cjs +0 -33
  706. package/dist/utils/transferData.cjs.map +0 -1
  707. package/dist/utils/transferData.d.cts.map +0 -1
  708. package/dist/utils/transferData.d.mts +0 -9
  709. package/dist/utils/transferData.d.mts.map +0 -1
  710. package/dist/utils/transferData.mjs.map +0 -1
  711. package/dist/utils/wait.cjs +0 -6
  712. package/dist/utils/wait.cjs.map +0 -1
  713. package/dist/utils/wait.d.cts.map +0 -1
  714. package/dist/utils/wait.d.mts +0 -2
  715. package/dist/utils/wait.d.mts.map +0 -1
  716. package/dist/utils/wait.mjs.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"hyperLiquidValidation.cjs","sourceRoot":"","sources":["../../src/utils/hyperLiquidValidation.ts"],"names":[],"mappings":";;;AAAA,2CAAoD;AAGpD,6EAK2C;A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;QACJ,CAAC;QAED,IAAI,SAAS,KAAK,SAAS,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,IAAI,GAAG,SAAS,EAAE,CAAC;YACrE,OAAO;gBACL,OAAO,EAAE,KAAK;gBACd,KAAK,EAAE,sCAAiB,CAAC,uBAAuB;aACjD,CAAC;QACJ,CAAC;IACH,CAAC;IAED,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AAC3B,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,kBAAkB,CAChC,IAAY,EACZ,aAAkC;IAElC,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;QAC7B,OAAO;YACL,OAAO,EAAE,KAAK;YACd,KAAK,EAAE,sCAAiB,CAAC,kBAAkB;SAC5C,CAAC;IACJ,CAAC;IAED,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AAC3B,CAAC;AAZD,gDAYC","sourcesContent":["import { isValidHexAddress } from '@metamask/utils';\nimport type { CaipAssetId, Hex } from '@metamask/utils';\n\nimport {\n HYPERLIQUID_ASSET_CONFIGS,\n BASIS_POINTS_DIVISOR,\n getSupportedAssets,\n TRADING_DEFAULTS,\n} from '../constants/hyperLiquidConfig.js';\nimport {\n CHASE_ORDER_CONFIG,\n HYPERLIQUID_ORDER_LIMITS,\n HYPERLIQUID_TWAP_LIMITS,\n} from '../constants/perpsConfig.js';\nimport { PERPS_ERROR_CODES } from '../perpsErrorCodes.js';\nimport type {\n GetSupportedPathsParams,\n PerpsDebugLogger,\n} from '../types/index.js';\nimport type { OrderType, TpslLinkage } from '../types/perps-types.js';\nimport {\n getTriggerExecution,\n isLimitExecutionOrderType,\n isStrategyOrderType,\n isTriggerOrderType,\n SCALE_ORDER_COUNT,\n} from './orderTypes.js';\n\n/**\n * Optional debug logger for validation functions.\n * When provided, enables detailed logging for debugging.\n * When omitted, validation runs silently.\n */\nexport type ValidationDebugLogger = PerpsDebugLogger | undefined;\n\n/**\n * Validation utilities for HyperLiquid operations\n */\n\n/**\n * Create standardized error response.\n *\n * @param error - The error that occurred\n * @param defaultResponse - The default response object to use as template\n * @returns The error response with success=false and error message\n */\nexport function createErrorResult<\n TValue extends { success: boolean; error?: string },\n>(error: unknown, defaultResponse: TValue): TValue {\n return {\n ...defaultResponse,\n success: false,\n error:\n error instanceof Error ? error.message : PERPS_ERROR_CODES.UNKNOWN_ERROR,\n };\n}\n\n/**\n * Validate withdrawal parameters.\n *\n * @param params - Withdrawal parameters to validate\n * @param params.assetId - The CAIP asset ID to withdraw\n * @param params.amount - Amount to withdraw as string\n * @param params.destination - Optional destination hex address\n * @param debugLogger - Optional debug logger for detailed logging\n * @returns Validation result with isValid flag and optional error message\n */\nexport function validateWithdrawalParams(\n params: {\n assetId?: CaipAssetId;\n amount?: string;\n destination?: Hex;\n },\n debugLogger?: ValidationDebugLogger,\n): { isValid: boolean; error?: string } {\n debugLogger?.log('validateWithdrawalParams: Starting validation', {\n params,\n hasAssetId: Boolean(params.assetId),\n hasAmount: Boolean(params.amount),\n hasDestination: Boolean(params.destination),\n });\n\n // Validate required parameters\n if (!params.assetId) {\n debugLogger?.log('validateWithdrawalParams: Missing assetId', {\n error: PERPS_ERROR_CODES.WITHDRAW_ASSET_ID_REQUIRED,\n params,\n });\n return {\n isValid: false,\n error: PERPS_ERROR_CODES.WITHDRAW_ASSET_ID_REQUIRED,\n };\n }\n\n // Validate amount\n if (!params.amount) {\n debugLogger?.log('validateWithdrawalParams: Missing amount', {\n error: PERPS_ERROR_CODES.WITHDRAW_AMOUNT_REQUIRED,\n params,\n });\n return {\n isValid: false,\n error: PERPS_ERROR_CODES.WITHDRAW_AMOUNT_REQUIRED,\n };\n }\n\n const amount = parseFloat(params.amount);\n if (isNaN(amount) || amount <= 0) {\n debugLogger?.log('validateWithdrawalParams: Invalid amount', {\n error: PERPS_ERROR_CODES.WITHDRAW_AMOUNT_POSITIVE,\n amount: params.amount,\n parsedAmount: amount,\n isNaN: isNaN(amount),\n });\n return {\n isValid: false,\n error: PERPS_ERROR_CODES.WITHDRAW_AMOUNT_POSITIVE,\n };\n }\n\n // Validate destination address if provided\n if (params.destination && !isValidHexAddress(params.destination)) {\n debugLogger?.log('validateWithdrawalParams: Invalid destination address', {\n error: PERPS_ERROR_CODES.WITHDRAW_INVALID_DESTINATION,\n destination: params.destination,\n isValidHex: isValidHexAddress(params.destination),\n });\n return {\n isValid: false,\n error: PERPS_ERROR_CODES.WITHDRAW_INVALID_DESTINATION,\n };\n }\n\n debugLogger?.log('validateWithdrawalParams: All validations passed', {\n assetId: params.assetId,\n amount: params.amount,\n destination: params.destination ?? 'will use user wallet',\n });\n\n return { isValid: true };\n}\n\n/**\n * Validate deposit parameters.\n *\n * @param params - Deposit parameters to validate\n * @param params.assetId - The CAIP asset ID to deposit\n * @param params.amount - Amount to deposit as string\n * @param params.isTestnet - Whether this is a testnet deposit\n * @param debugLogger - Optional debug logger for detailed logging\n * @returns Validation result with isValid flag and optional error message\n */\nexport function validateDepositParams(\n params: {\n assetId?: CaipAssetId;\n amount?: string;\n isTestnet?: boolean;\n },\n debugLogger?: ValidationDebugLogger,\n): { isValid: boolean; error?: string } {\n debugLogger?.log('validateDepositParams: Starting validation', {\n params,\n hasAssetId: Boolean(params.assetId),\n hasAmount: Boolean(params.amount),\n isTestnet: params.isTestnet,\n });\n\n // Validate required parameters\n if (!params.assetId) {\n debugLogger?.log('validateDepositParams: Missing assetId', {\n error: PERPS_ERROR_CODES.DEPOSIT_ASSET_ID_REQUIRED,\n params,\n });\n return {\n isValid: false,\n error: PERPS_ERROR_CODES.DEPOSIT_ASSET_ID_REQUIRED,\n };\n }\n\n // Validate amount\n if (!params.amount) {\n debugLogger?.log('validateDepositParams: Missing amount', {\n error: PERPS_ERROR_CODES.DEPOSIT_AMOUNT_REQUIRED,\n params,\n });\n return {\n isValid: false,\n error: PERPS_ERROR_CODES.DEPOSIT_AMOUNT_REQUIRED,\n };\n }\n\n const amount = parseFloat(params.amount);\n if (isNaN(amount) || amount <= 0) {\n debugLogger?.log('validateDepositParams: Invalid amount', {\n error: PERPS_ERROR_CODES.DEPOSIT_AMOUNT_POSITIVE,\n amount: params.amount,\n parsedAmount: amount,\n isNaN: isNaN(amount),\n });\n return {\n isValid: false,\n error: PERPS_ERROR_CODES.DEPOSIT_AMOUNT_POSITIVE,\n };\n }\n\n // Check minimum deposit amount\n const minimumAmount = params.isTestnet\n ? TRADING_DEFAULTS.amount.testnet\n : TRADING_DEFAULTS.amount.mainnet;\n\n debugLogger?.log('validateDepositParams: Checking minimum amount', {\n amount,\n minimumAmount,\n isTestnet: params.isTestnet,\n network: params.isTestnet ? 'testnet' : 'mainnet',\n });\n\n if (amount < minimumAmount) {\n debugLogger?.log('validateDepositParams: Below minimum deposit', {\n error: PERPS_ERROR_CODES.DEPOSIT_MINIMUM_AMOUNT,\n amount,\n minimumAmount,\n difference: minimumAmount - amount,\n });\n return {\n isValid: false,\n error: PERPS_ERROR_CODES.DEPOSIT_MINIMUM_AMOUNT,\n };\n }\n\n debugLogger?.log('validateDepositParams: All validations passed', {\n assetId: params.assetId,\n amount: params.amount,\n parsedAmount: amount,\n minimumAmount,\n isTestnet: params.isTestnet,\n });\n\n return { isValid: true };\n}\n\n/**\n * Validate asset support for withdrawals using AssetRoute arrays.\n *\n * @param assetId - The CAIP asset ID to validate\n * @param supportedRoutes - Array of supported asset routes\n * @param debugLogger - Optional debug logger for detailed logging\n * @returns Validation result with isValid flag and optional error message\n */\nexport function validateAssetSupport(\n assetId: CaipAssetId,\n supportedRoutes: { assetId: CaipAssetId }[],\n debugLogger?: ValidationDebugLogger,\n): { isValid: boolean; error?: string } {\n debugLogger?.log('validateAssetSupport: Checking asset support', {\n assetId,\n supportedRoutesCount: supportedRoutes.length,\n });\n\n const supportedAssetIds = supportedRoutes.map((route) => route.assetId);\n\n // Check if asset is supported\n const isSupported = supportedAssetIds.includes(assetId);\n\n if (!isSupported) {\n // Also check case-insensitive match for contract addresses\n const isSupportedCaseInsensitive = supportedAssetIds.some(\n (supportedId) => supportedId.toLowerCase() === assetId.toLowerCase(),\n );\n\n if (!isSupportedCaseInsensitive) {\n debugLogger?.log('validateAssetSupport: Asset not supported', {\n error: PERPS_ERROR_CODES.WITHDRAW_ASSET_NOT_SUPPORTED,\n assetId,\n supportedAssetIds,\n checkedCaseInsensitive: true,\n });\n\n return {\n isValid: false,\n error: PERPS_ERROR_CODES.WITHDRAW_ASSET_NOT_SUPPORTED,\n };\n }\n\n debugLogger?.log(\n '⚠️ validateAssetSupport: Asset supported with case mismatch',\n {\n providedAssetId: assetId,\n matchedAssetId: supportedAssetIds.find(\n (id) => id.toLowerCase() === assetId.toLowerCase(),\n ),\n },\n );\n }\n\n debugLogger?.log('validateAssetSupport: Asset is supported', {\n assetId,\n });\n\n return { isValid: true };\n}\n\n/**\n * Validate balance against withdrawal amount.\n *\n * @param withdrawAmount - The amount to withdraw\n * @param withdrawableBalance - Max USD that can leave the venue right now\n * @param debugLogger - Optional debug logger for detailed logging\n * @returns Validation result with isValid flag and optional error message\n */\nexport function validateBalance(\n withdrawAmount: number,\n withdrawableBalance: number,\n debugLogger?: ValidationDebugLogger,\n): { isValid: boolean; error?: string } {\n debugLogger?.log('validateBalance: Checking balance sufficiency', {\n withdrawAmount,\n withdrawableBalance,\n difference: withdrawableBalance - withdrawAmount,\n });\n\n if (withdrawAmount > withdrawableBalance) {\n const shortfall = withdrawAmount - withdrawableBalance;\n\n debugLogger?.log('validateBalance: Insufficient balance', {\n error: PERPS_ERROR_CODES.WITHDRAW_INSUFFICIENT_BALANCE,\n withdrawAmount,\n withdrawableBalance,\n shortfall,\n percentageOfAvailable: `${((withdrawAmount / withdrawableBalance) * 100).toFixed(2)}%`,\n });\n\n return {\n isValid: false,\n error: PERPS_ERROR_CODES.WITHDRAW_INSUFFICIENT_BALANCE,\n };\n }\n\n const remainingBalance = withdrawableBalance - withdrawAmount;\n debugLogger?.log('validateBalance: Balance is sufficient', {\n withdrawAmount,\n withdrawableBalance,\n remainingBalance,\n percentageUsed: `${((withdrawAmount / withdrawableBalance) * 100).toFixed(2)}%`,\n });\n\n return { isValid: true };\n}\n\n/**\n * Apply filters to asset paths with comprehensive logging.\n *\n * @param assets - Array of CAIP asset IDs to filter\n * @param params - Filter parameters including chainId, symbol, and assetId\n * @param debugLogger - Optional debug logger for detailed logging\n * @returns Filtered array of CAIP asset IDs\n */\nexport function applyPathFilters(\n assets: CaipAssetId[],\n params?: GetSupportedPathsParams,\n debugLogger?: ValidationDebugLogger,\n): CaipAssetId[] {\n if (!params) {\n debugLogger?.log(\n 'HyperLiquid: applyPathFilters - no params, returning all assets',\n { assets },\n );\n return assets;\n }\n\n let filtered = assets;\n\n debugLogger?.log('HyperLiquid: applyPathFilters - starting filter', {\n initialAssets: assets,\n filterParams: params,\n });\n\n if (params.chainId) {\n const before = filtered;\n filtered = filtered.filter((asset) =>\n asset.startsWith(params.chainId as string),\n );\n debugLogger?.log('HyperLiquid: applyPathFilters - chainId filter', {\n chainId: params.chainId,\n before,\n after: filtered,\n });\n }\n\n // Note: `in` is the idiomatic TypeScript way to narrow a string to\n // `keyof typeof` for indexed access; `hasProperty` types the indexed\n // result as `unknown` and loses the `{ testnet, mainnet }` shape.\n /* eslint-disable-next-line no-restricted-syntax */\n if (params.symbol && params.symbol in HYPERLIQUID_ASSET_CONFIGS) {\n const config =\n HYPERLIQUID_ASSET_CONFIGS[\n params.symbol as keyof typeof HYPERLIQUID_ASSET_CONFIGS\n ];\n const isTestnet = params.isTestnet ?? false;\n const selectedAsset = isTestnet ? config.testnet : config.mainnet;\n const before = filtered;\n filtered = [selectedAsset];\n debugLogger?.log('HyperLiquid: applyPathFilters - symbol filter', {\n symbol: params.symbol,\n isTestnet,\n config,\n selectedAsset,\n before,\n after: filtered,\n });\n }\n\n if (params.assetId) {\n const before = filtered;\n // Use case-insensitive comparison for asset ID matching to handle address case differences\n filtered = filtered.filter(\n (asset) => asset.toLowerCase() === params.assetId?.toLowerCase(),\n );\n debugLogger?.log('HyperLiquid: applyPathFilters - assetId filter', {\n assetId: params.assetId,\n before,\n after: filtered,\n exactMatch: before.includes(params.assetId),\n caseInsensitiveMatch: before.some(\n (asset) => asset.toLowerCase() === params.assetId?.toLowerCase(),\n ),\n });\n }\n\n debugLogger?.log('HyperLiquid: applyPathFilters - final result', {\n initialAssets: assets,\n finalFiltered: filtered,\n filterParams: params,\n });\n\n return filtered;\n}\n\n/**\n * Get supported deposit/withdrawal paths with filtering.\n *\n * @param params - Filter parameters including isTestnet, chainId, symbol\n * @param debugLogger - Optional debug logger for detailed logging\n * @returns Array of supported CAIP asset IDs\n */\nexport function getSupportedPaths(\n params?: GetSupportedPathsParams,\n debugLogger?: ValidationDebugLogger,\n): CaipAssetId[] {\n const isTestnet = params?.isTestnet ?? false;\n const assets = getSupportedAssets(isTestnet);\n const filteredAssets = applyPathFilters(assets, params, debugLogger);\n\n debugLogger?.log('HyperLiquid: getSupportedPaths', {\n isTestnet,\n requestedParams: params,\n allAssets: assets,\n filteredAssets,\n returnType: 'CaipAssetId[]',\n example: filteredAssets[0],\n });\n\n return filteredAssets;\n}\n\n/**\n * Get maximum order value based on leverage and order type.\n * Based on HyperLiquid contract specifications.\n *\n * @param maxLeverage - The maximum leverage for the market\n * @param orderType - The order type; every type follows the limit/market\n * multiplier of its execution mode, so `stop_limit`, `scale` and `chase` are all\n * treated as limit orders and `twap` as a market order\n * @returns Maximum order value in USD\n */\nexport function getMaxOrderValue(\n maxLeverage: number,\n orderType: OrderType,\n): number {\n let marketLimit: number;\n\n if (maxLeverage >= 25) {\n marketLimit = HYPERLIQUID_ORDER_LIMITS.MarketOrderLimits.HighLeverage;\n } else if (maxLeverage >= 20) {\n marketLimit = HYPERLIQUID_ORDER_LIMITS.MarketOrderLimits.MediumHighLeverage;\n } else if (maxLeverage >= 10) {\n marketLimit = HYPERLIQUID_ORDER_LIMITS.MarketOrderLimits.MediumLeverage;\n } else {\n marketLimit = HYPERLIQUID_ORDER_LIMITS.MarketOrderLimits.LowLeverage;\n }\n\n // The higher cap follows how the order executes, not whose price it uses: a\n // scale ladder and a chase rest limit orders on the book, so holding them to\n // the tighter market-order cap would bound them by how they were requested\n // rather than by what they do.\n return getTriggerExecution(orderType) === 'limit'\n ? marketLimit * HYPERLIQUID_ORDER_LIMITS.LimitOrderMultiplier\n : marketLimit;\n}\n\n/**\n * The `grouping` value each provider-agnostic linkage corresponds to, used to\n * detect a caller supplying both spellings with different meanings.\n */\nconst TPSL_LINKAGE_GROUPING: Record<\n TpslLinkage,\n 'na' | 'normalTpsl' | 'positionTpsl'\n> = {\n none: 'na',\n order: 'normalTpsl',\n position: 'positionTpsl',\n};\n\n/**\n * The strategy-placement fields of `OrderParams`, as validation sees them.\n *\n * Named so the provider can forward exactly this group to `validateOrderParams`\n * without the field list drifting between the two call sites.\n */\nexport type StrategyOrderValidationParams = {\n twapDuration?: number;\n twapRandomize?: boolean;\n scaleMinPrice?: string;\n scaleMaxPrice?: string;\n scaleNumOrders?: number;\n scaleSkew?: number;\n chaseIntervalMs?: number;\n chaseMaxDurationMs?: number;\n chaseMaxRepricings?: number;\n chaseMaxDistanceBps?: number;\n};\n\n/**\n * Which strategy owns each strategy-only field.\n *\n * Anything a placement does not own is rejected rather than ignored: a `twap`\n * carrying `scaleNumOrders` is a caller mistake, and dropping it silently would\n * execute something other than what was asked for.\n */\nconst STRATEGY_FIELD_OWNER: Record<\n keyof StrategyOrderValidationParams,\n 'twap' | 'scale' | 'chase'\n> = {\n twapDuration: 'twap',\n twapRandomize: 'twap',\n scaleMinPrice: 'scale',\n scaleMaxPrice: 'scale',\n scaleNumOrders: 'scale',\n scaleSkew: 'scale',\n chaseIntervalMs: 'chase',\n chaseMaxDurationMs: 'chase',\n chaseMaxRepricings: 'chase',\n chaseMaxDistanceBps: 'chase',\n};\n\n/**\n * Validate the TWAP-specific parameters of a `twap` placement.\n *\n * @param params - Strategy fields supplied by the caller.\n * @returns Validation result with isValid flag and optional error message.\n */\nfunction validateTwapParams(params: StrategyOrderValidationParams): {\n isValid: boolean;\n error?: string;\n} {\n if (params.twapDuration === undefined) {\n return {\n isValid: false,\n error: PERPS_ERROR_CODES.ORDER_TWAP_DURATION_REQUIRED,\n };\n }\n\n // The venue validates `twap.m` as a safe integer within these bounds before\n // the request is signed, so checking it here turns an opaque SDK failure into\n // a typed rejection that costs no round trip.\n if (\n !Number.isInteger(params.twapDuration) ||\n params.twapDuration < HYPERLIQUID_TWAP_LIMITS.MinDurationMinutes ||\n params.twapDuration > HYPERLIQUID_TWAP_LIMITS.MaxDurationMinutes\n ) {\n return {\n isValid: false,\n error: PERPS_ERROR_CODES.ORDER_TWAP_DURATION_INVALID,\n };\n }\n\n return { isValid: true };\n}\n\n/**\n * Validate the ladder parameters of a `scale` placement.\n *\n * @param params - Strategy fields supplied by the caller.\n * @returns Validation result with isValid flag and optional error message.\n */\nfunction validateScaleParams(params: StrategyOrderValidationParams): {\n isValid: boolean;\n error?: string;\n} {\n if (\n params.scaleMinPrice === undefined ||\n params.scaleMaxPrice === undefined\n ) {\n return {\n isValid: false,\n error: PERPS_ERROR_CODES.ORDER_SCALE_RANGE_REQUIRED,\n };\n }\n\n const minPrice = parseFloat(params.scaleMinPrice);\n const maxPrice = parseFloat(params.scaleMaxPrice);\n if (\n !Number.isFinite(minPrice) ||\n !Number.isFinite(maxPrice) ||\n minPrice <= 0 ||\n maxPrice <= minPrice\n ) {\n return {\n isValid: false,\n error: PERPS_ERROR_CODES.ORDER_SCALE_RANGE_INVALID,\n };\n }\n\n if (\n params.scaleNumOrders === undefined ||\n !Number.isInteger(params.scaleNumOrders) ||\n params.scaleNumOrders < SCALE_ORDER_COUNT.min ||\n params.scaleNumOrders > SCALE_ORDER_COUNT.max\n ) {\n return {\n isValid: false,\n error: PERPS_ERROR_CODES.ORDER_SCALE_COUNT_INVALID,\n };\n }\n\n // Omitted is an even ladder, so only a supplied skew is checked. The value is\n // taken exactly as the caller wrote it: clients coerce their input to two\n // decimals, and rounding it again here would place a ladder weighted\n // differently from the one the form previewed.\n if (\n params.scaleSkew !== undefined &&\n (!Number.isFinite(params.scaleSkew) || params.scaleSkew <= 0)\n ) {\n return {\n isValid: false,\n error: PERPS_ERROR_CODES.ORDER_SCALE_RANGE_INVALID,\n };\n }\n\n return { isValid: true };\n}\n\n/**\n * Validate the polling parameters of a `chase` placement.\n *\n * @param params - Strategy fields supplied by the caller.\n * @returns Validation result with isValid flag and optional error message.\n */\nfunction validateChaseParams(params: StrategyOrderValidationParams): {\n isValid: boolean;\n error?: string;\n} {\n const interval =\n params.chaseIntervalMs ?? CHASE_ORDER_CONFIG.DefaultIntervalMs;\n if (\n !Number.isFinite(interval) ||\n interval < CHASE_ORDER_CONFIG.MinIntervalMs\n ) {\n return {\n isValid: false,\n error: PERPS_ERROR_CODES.ORDER_CHASE_INTERVAL_INVALID,\n };\n }\n\n const maxDuration = params.chaseMaxDurationMs;\n // A window shorter than one poll would place the order and immediately stop\n // chasing it — a plain post-only limit order wearing a chase's name.\n if (\n maxDuration !== undefined &&\n (!Number.isFinite(maxDuration) || maxDuration < interval)\n ) {\n return {\n isValid: false,\n error: PERPS_ERROR_CODES.ORDER_CHASE_DURATION_INVALID,\n };\n }\n\n const maxRepricings = params.chaseMaxRepricings;\n if (\n maxRepricings !== undefined &&\n (!Number.isInteger(maxRepricings) || maxRepricings < 1)\n ) {\n return {\n isValid: false,\n error: PERPS_ERROR_CODES.ORDER_CHASE_DURATION_INVALID,\n };\n }\n\n if (\n params.chaseMaxDistanceBps !== undefined &&\n (!Number.isFinite(params.chaseMaxDistanceBps) ||\n params.chaseMaxDistanceBps <= 0 ||\n params.chaseMaxDistanceBps >= BASIS_POINTS_DIVISOR)\n ) {\n return {\n isValid: false,\n error: PERPS_ERROR_CODES.ORDER_CHASE_MAX_DISTANCE_INVALID,\n };\n }\n\n return { isValid: true };\n}\n\n/**\n * Validate strategy placement parameters, and the absence of them.\n *\n * Runs before every other order rule so a strategy placement is rejected with a\n * strategy-shaped reason rather than with the trigger/limit rule its shape\n * happens to trip first.\n *\n * @param params - Order parameters to validate.\n * @param params.orderType - The order placement type.\n * @returns Validation result with isValid flag and optional error message.\n */\nfunction validateStrategyOrderParams(\n params: StrategyOrderValidationParams & {\n orderType?: OrderType;\n price?: string;\n triggerPrice?: string;\n timeInForce?: 'GTC' | 'IOC' | 'ALO';\n clientOrderId?: string;\n takeProfitPrice?: string;\n stopLossPrice?: string;\n takeProfitSize?: string;\n stopLossSize?: string;\n },\n): { isValid: boolean; error?: string } {\n const { orderType } = params;\n const strategy =\n orderType !== undefined && isStrategyOrderType(orderType)\n ? orderType\n : undefined;\n\n // Every strategy-only field must belong to the placement carrying it. This\n // also covers the non-strategy case, where no field has an owner to match.\n const foreignField = (\n Object.keys(STRATEGY_FIELD_OWNER) as (keyof StrategyOrderValidationParams)[]\n ).find(\n (field) =>\n params[field] !== undefined && STRATEGY_FIELD_OWNER[field] !== strategy,\n );\n if (foreignField) {\n return {\n isValid: false,\n error: PERPS_ERROR_CODES.ORDER_STRATEGY_PARAMS_NOT_SUPPORTED,\n };\n }\n\n if (!strategy) {\n return { isValid: true };\n }\n\n // A strategy owns its own execution: it derives its own prices, rests its own\n // orders, and decides its own time in force. Accepting these fields would\n // mean quietly ignoring them.\n //\n // `clientOrderId` is refused for the same reason and cannot be honoured even\n // in principle: the venue's TWAP action carries no client id, a scale ladder\n // is many orders and a client id must be unique per order, and a chase\n // replaces its order on every re-price. One id cannot name any of them.\n if (\n params.price !== undefined ||\n params.triggerPrice !== undefined ||\n params.timeInForce !== undefined ||\n params.clientOrderId !== undefined ||\n params.takeProfitPrice !== undefined ||\n params.stopLossPrice !== undefined ||\n params.takeProfitSize !== undefined ||\n params.stopLossSize !== undefined\n ) {\n return {\n isValid: false,\n error: PERPS_ERROR_CODES.ORDER_STRATEGY_FIELD_UNSUPPORTED,\n };\n }\n\n if (strategy === 'twap') {\n return validateTwapParams(params);\n }\n if (strategy === 'scale') {\n return validateScaleParams(params);\n }\n return validateChaseParams(params);\n}\n\n/**\n * Validate order parameters.\n * Basic validation - checks required fields are present.\n * Amount validation (size/USD) is handled by validateOrder.\n *\n * @param params - Order parameters to validate\n * @param params.coin - The trading pair coin symbol\n * @param params.size - The order size as string\n * @param params.price - The order price as string\n * @param params.orderType - The order placement type\n * @param params.triggerPrice - Trigger price; required for trigger placement types and\n * rejected for market/limit orders so a stray value can never be silently dropped\n * @param params.takeProfitPrice - Attached take profit price\n * @param params.stopLossPrice - Attached stop loss price\n * @param params.takeProfitSize - Partial take profit size\n * @param params.stopLossSize - Partial stop loss size\n * @param params.tpslLinkage - How an attached TP/SL is linked\n * @param params.grouping - Deprecated protocol-shaped spelling of `tpslLinkage`\n * @param params.timeInForce - Time in force; only a plain limit order can carry one\n * @param params.clientOrderId - Client-provided order ID; a strategy placement cannot carry one\n * @param params.twapDuration - TWAP window in whole minutes\n * @param params.twapRandomize - Whether to vary each TWAP suborder's size by up to ±20%\n * @param params.scaleMinPrice - Lowest price in a scale ladder\n * @param params.scaleMaxPrice - Highest price in a scale ladder\n * @param params.scaleNumOrders - How many orders a scale ladder fans out into\n * @param params.scaleSkew - How a scale ladder's size is weighted across its rungs\n * @param params.chaseIntervalMs - How often a chase re-reads the touch\n * @param params.chaseMaxDurationMs - How long a chase keeps re-pricing\n * @param params.chaseMaxRepricings - Cap on a chase's cancel/replace cycles\n * @returns Validation result with isValid flag and optional error message\n */\nexport function validateOrderParams(\n params: StrategyOrderValidationParams & {\n coin?: string;\n size?: string;\n price?: string;\n orderType?: OrderType;\n triggerPrice?: string;\n takeProfitPrice?: string;\n stopLossPrice?: string;\n takeProfitSize?: string;\n stopLossSize?: string;\n tpslLinkage?: TpslLinkage;\n grouping?: 'na' | 'normalTpsl' | 'positionTpsl';\n timeInForce?: 'GTC' | 'IOC' | 'ALO';\n clientOrderId?: string;\n },\n): { isValid: boolean; error?: string } {\n if (!params.coin) {\n return {\n isValid: false,\n error: PERPS_ERROR_CODES.ORDER_COIN_REQUIRED,\n };\n }\n\n // Note: Size validation removed - validateOrder handles amount validation using USD as source of truth\n\n // Strategy placements are decided first: their shape trips the limit-price and\n // trigger rules below, and the strategy-shaped reason is the useful one.\n const strategyValidation = validateStrategyOrderParams(params);\n if (!strategyValidation.isValid) {\n return strategyValidation;\n }\n\n const { orderType } = params;\n const isTrigger = orderType !== undefined && isTriggerOrderType(orderType);\n\n // Require price for orders that execute as limit orders (limit, stop_limit,\n // take_profit_limit)\n if (\n orderType !== undefined &&\n isLimitExecutionOrderType(orderType) &&\n !params.price\n ) {\n return {\n isValid: false,\n error: PERPS_ERROR_CODES.ORDER_LIMIT_PRICE_REQUIRED,\n };\n }\n\n if (params.price && parseFloat(params.price) <= 0) {\n return {\n isValid: false,\n error: PERPS_ERROR_CODES.ORDER_PRICE_POSITIVE,\n };\n }\n\n if (isTrigger) {\n if (!params.triggerPrice) {\n return {\n isValid: false,\n error: PERPS_ERROR_CODES.ORDER_TRIGGER_PRICE_REQUIRED,\n };\n }\n\n const triggerPrice = parseFloat(params.triggerPrice);\n if (isNaN(triggerPrice) || triggerPrice <= 0) {\n return {\n isValid: false,\n error: PERPS_ERROR_CODES.ORDER_TRIGGER_PRICE_POSITIVE,\n };\n }\n\n // A trigger placement combined with attached TP/SL children is rejected\n // rather than silently reshaped: the exchange semantics of a triggered\n // parent owning triggered children are not part of this contract.\n // Each field is checked explicitly: a falsy-but-present price (e.g. '') is\n // still an attached TP/SL request and must be rejected, not skipped.\n if (\n params.takeProfitPrice !== undefined ||\n params.stopLossPrice !== undefined\n ) {\n return {\n isValid: false,\n error: PERPS_ERROR_CODES.ORDER_TRIGGER_TPSL_UNSUPPORTED,\n };\n }\n // Consistent with the attached-TP/SL check above: a falsy-but-present value\n // (e.g. '') is still a request to place a trigger, not an absent field.\n } else if (params.triggerPrice !== undefined) {\n return {\n isValid: false,\n error: PERPS_ERROR_CODES.ORDER_TRIGGER_PRICE_NOT_SUPPORTED,\n };\n }\n\n // `tpslLinkage` supersedes `grouping`, but two spellings that disagree are a\n // caller mistake — resolving one silently would hide it.\n if (params.tpslLinkage !== undefined && params.grouping !== undefined) {\n const expectedGrouping = TPSL_LINKAGE_GROUPING[params.tpslLinkage];\n if (expectedGrouping !== params.grouping) {\n return {\n isValid: false,\n error: PERPS_ERROR_CODES.ORDER_TPSL_LINKAGE_CONFLICT,\n };\n }\n }\n\n const hasAttachedTpsl =\n params.takeProfitPrice !== undefined || params.stopLossPrice !== undefined;\n\n // Every order in a `positionTpsl` batch has to be a trigger order, and no\n // shape of order placement produces one. With an attached TP/SL the batch\n // carries the ordinary parent order the TP/SL protects; without one it is\n // that parent order alone. HyperLiquid rejects both, so the linkage is\n // refused outright — it belongs to `updatePositionTPSL`, applied to the\n // position once the parent has filled.\n const requestsPositionLinkage =\n params.tpslLinkage === 'position' || params.grouping === 'positionTpsl';\n if (requestsPositionLinkage) {\n return {\n isValid: false,\n error: PERPS_ERROR_CODES.ORDER_TPSL_POSITION_LINKAGE_UNSUPPORTED,\n };\n }\n\n // `na` grouping submits the attached TP/SL as standalone triggers, bound to\n // neither the parent order nor the resulting position. An unfilled parent\n // then leaves them behind as orphan reduce-only triggers that fire against\n // whatever position happens to exist. An attached TP/SL needs a linkage that\n // links it, so the combination is a caller mistake rather than a mode.\n const requestsNoLinkage =\n params.tpslLinkage === 'none' || params.grouping === 'na';\n if (requestsNoLinkage && hasAttachedTpsl) {\n return {\n isValid: false,\n error: PERPS_ERROR_CODES.ORDER_TPSL_LINKAGE_REQUIRED,\n };\n }\n\n // Only a plain limit order rests on the book long enough for a time in force to\n // mean anything: a market order fills immediately and a trigger order's\n // execution is decided when it fires. Rejected here, at step 1 of placement, so\n // it cannot fire after leverage changes or a HIP-3 margin transfer.\n if (params.timeInForce !== undefined && orderType !== 'limit') {\n return {\n isValid: false,\n error: PERPS_ERROR_CODES.ORDER_TIME_IN_FORCE_NOT_SUPPORTED,\n };\n }\n\n const partialTpslValidation = validatePartialTpslSizes(params);\n if (!partialTpslValidation.isValid) {\n return partialTpslValidation;\n }\n\n return { isValid: true };\n}\n\n/**\n * Validate quantity-scoped (partial) TP/SL sizes against the parent order.\n *\n * @param params - Order parameters carrying the TP/SL prices and sizes\n * @param params.size - Parent order size\n * @param params.takeProfitPrice - Attached take profit price\n * @param params.stopLossPrice - Attached stop loss price\n * @param params.takeProfitSize - Partial take profit size\n * @param params.stopLossSize - Partial stop loss size\n * @returns Validation result with isValid flag and optional error message\n */\nfunction validatePartialTpslSizes(params: {\n size?: string;\n takeProfitPrice?: string;\n stopLossPrice?: string;\n takeProfitSize?: string;\n stopLossSize?: string;\n}): { isValid: boolean; error?: string } {\n const orderSize = params.size ? Math.abs(parseFloat(params.size)) : undefined;\n\n const entries: { size?: string; price?: string }[] = [\n { size: params.takeProfitSize, price: params.takeProfitPrice },\n { size: params.stopLossSize, price: params.stopLossPrice },\n ];\n\n for (const entry of entries) {\n if (entry.size === undefined) {\n continue;\n }\n\n // A size without its price would silently place nothing.\n if (!entry.price) {\n return {\n isValid: false,\n error: PERPS_ERROR_CODES.ORDER_TPSL_SIZE_INVALID,\n };\n }\n\n const size = parseFloat(entry.size);\n if (isNaN(size) || size <= 0) {\n return {\n isValid: false,\n error: PERPS_ERROR_CODES.ORDER_TPSL_SIZE_INVALID,\n };\n }\n\n if (orderSize !== undefined && !isNaN(orderSize) && size > orderSize) {\n return {\n isValid: false,\n error: PERPS_ERROR_CODES.ORDER_TPSL_SIZE_INVALID,\n };\n }\n }\n\n return { isValid: true };\n}\n\n/**\n * Validate coin exists in asset mapping.\n *\n * @param coin - The coin symbol to validate\n * @param coinToAssetId - Map of coin symbols to asset IDs\n * @returns Validation result with isValid flag and optional error message\n */\nexport function validateCoinExists(\n coin: string,\n coinToAssetId: Map<string, number>,\n): { isValid: boolean; error?: string } {\n if (!coinToAssetId.has(coin)) {\n return {\n isValid: false,\n error: PERPS_ERROR_CODES.ORDER_UNKNOWN_COIN,\n };\n }\n\n return { isValid: true };\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"hyperLiquidValid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jC,MAAM,EAAE,6BAA6B,GAAG;IACtC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,QAAQ,CAAC,EAAE,IAAI,GAAG,YAAY,GAAG,cAAc,CAAC;IAChD,WAAW,CAAC,EAAE,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;IACpC,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,GACA;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CA4ItC;AA2DD;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,MAAM,EACZ,aAAa,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GACjC;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAStC"}
@@ -1,192 +0,0 @@
1
- import type { CaipAssetId, Hex } from "@metamask/utils";
2
- import type { GetSupportedPathsParams, PerpsDebugLogger } from "../types/index.mjs";
3
- import type { OrderType, TpslLinkage } from "../types/perps-types.mjs";
4
- /**
5
- * Optional debug logger for validation functions.
6
- * When provided, enables detailed logging for debugging.
7
- * When omitted, validation runs silently.
8
- */
9
- export type ValidationDebugLogger = PerpsDebugLogger | undefined;
10
- /**
11
- * Validation utilities for HyperLiquid operations
12
- */
13
- /**
14
- * Create standardized error response.
15
- *
16
- * @param error - The error that occurred
17
- * @param defaultResponse - The default response object to use as template
18
- * @returns The error response with success=false and error message
19
- */
20
- export declare function createErrorResult<TValue extends {
21
- success: boolean;
22
- error?: string;
23
- }>(error: unknown, defaultResponse: TValue): TValue;
24
- /**
25
- * Validate withdrawal parameters.
26
- *
27
- * @param params - Withdrawal parameters to validate
28
- * @param params.assetId - The CAIP asset ID to withdraw
29
- * @param params.amount - Amount to withdraw as string
30
- * @param params.destination - Optional destination hex address
31
- * @param debugLogger - Optional debug logger for detailed logging
32
- * @returns Validation result with isValid flag and optional error message
33
- */
34
- export declare function validateWithdrawalParams(params: {
35
- assetId?: CaipAssetId;
36
- amount?: string;
37
- destination?: Hex;
38
- }, debugLogger?: ValidationDebugLogger): {
39
- isValid: boolean;
40
- error?: string;
41
- };
42
- /**
43
- * Validate deposit parameters.
44
- *
45
- * @param params - Deposit parameters to validate
46
- * @param params.assetId - The CAIP asset ID to deposit
47
- * @param params.amount - Amount to deposit as string
48
- * @param params.isTestnet - Whether this is a testnet deposit
49
- * @param debugLogger - Optional debug logger for detailed logging
50
- * @returns Validation result with isValid flag and optional error message
51
- */
52
- export declare function validateDepositParams(params: {
53
- assetId?: CaipAssetId;
54
- amount?: string;
55
- isTestnet?: boolean;
56
- }, debugLogger?: ValidationDebugLogger): {
57
- isValid: boolean;
58
- error?: string;
59
- };
60
- /**
61
- * Validate asset support for withdrawals using AssetRoute arrays.
62
- *
63
- * @param assetId - The CAIP asset ID to validate
64
- * @param supportedRoutes - Array of supported asset routes
65
- * @param debugLogger - Optional debug logger for detailed logging
66
- * @returns Validation result with isValid flag and optional error message
67
- */
68
- export declare function validateAssetSupport(assetId: CaipAssetId, supportedRoutes: {
69
- assetId: CaipAssetId;
70
- }[], debugLogger?: ValidationDebugLogger): {
71
- isValid: boolean;
72
- error?: string;
73
- };
74
- /**
75
- * Validate balance against withdrawal amount.
76
- *
77
- * @param withdrawAmount - The amount to withdraw
78
- * @param withdrawableBalance - Max USD that can leave the venue right now
79
- * @param debugLogger - Optional debug logger for detailed logging
80
- * @returns Validation result with isValid flag and optional error message
81
- */
82
- export declare function validateBalance(withdrawAmount: number, withdrawableBalance: number, debugLogger?: ValidationDebugLogger): {
83
- isValid: boolean;
84
- error?: string;
85
- };
86
- /**
87
- * Apply filters to asset paths with comprehensive logging.
88
- *
89
- * @param assets - Array of CAIP asset IDs to filter
90
- * @param params - Filter parameters including chainId, symbol, and assetId
91
- * @param debugLogger - Optional debug logger for detailed logging
92
- * @returns Filtered array of CAIP asset IDs
93
- */
94
- export declare function applyPathFilters(assets: CaipAssetId[], params?: GetSupportedPathsParams, debugLogger?: ValidationDebugLogger): CaipAssetId[];
95
- /**
96
- * Get supported deposit/withdrawal paths with filtering.
97
- *
98
- * @param params - Filter parameters including isTestnet, chainId, symbol
99
- * @param debugLogger - Optional debug logger for detailed logging
100
- * @returns Array of supported CAIP asset IDs
101
- */
102
- export declare function getSupportedPaths(params?: GetSupportedPathsParams, debugLogger?: ValidationDebugLogger): CaipAssetId[];
103
- /**
104
- * Get maximum order value based on leverage and order type.
105
- * Based on HyperLiquid contract specifications.
106
- *
107
- * @param maxLeverage - The maximum leverage for the market
108
- * @param orderType - The order type; every type follows the limit/market
109
- * multiplier of its execution mode, so `stop_limit`, `scale` and `chase` are all
110
- * treated as limit orders and `twap` as a market order
111
- * @returns Maximum order value in USD
112
- */
113
- export declare function getMaxOrderValue(maxLeverage: number, orderType: OrderType): number;
114
- /**
115
- * The strategy-placement fields of `OrderParams`, as validation sees them.
116
- *
117
- * Named so the provider can forward exactly this group to `validateOrderParams`
118
- * without the field list drifting between the two call sites.
119
- */
120
- export type StrategyOrderValidationParams = {
121
- twapDuration?: number;
122
- twapRandomize?: boolean;
123
- scaleMinPrice?: string;
124
- scaleMaxPrice?: string;
125
- scaleNumOrders?: number;
126
- scaleSkew?: number;
127
- chaseIntervalMs?: number;
128
- chaseMaxDurationMs?: number;
129
- chaseMaxRepricings?: number;
130
- chaseMaxDistanceBps?: number;
131
- };
132
- /**
133
- * Validate order parameters.
134
- * Basic validation - checks required fields are present.
135
- * Amount validation (size/USD) is handled by validateOrder.
136
- *
137
- * @param params - Order parameters to validate
138
- * @param params.coin - The trading pair coin symbol
139
- * @param params.size - The order size as string
140
- * @param params.price - The order price as string
141
- * @param params.orderType - The order placement type
142
- * @param params.triggerPrice - Trigger price; required for trigger placement types and
143
- * rejected for market/limit orders so a stray value can never be silently dropped
144
- * @param params.takeProfitPrice - Attached take profit price
145
- * @param params.stopLossPrice - Attached stop loss price
146
- * @param params.takeProfitSize - Partial take profit size
147
- * @param params.stopLossSize - Partial stop loss size
148
- * @param params.tpslLinkage - How an attached TP/SL is linked
149
- * @param params.grouping - Deprecated protocol-shaped spelling of `tpslLinkage`
150
- * @param params.timeInForce - Time in force; only a plain limit order can carry one
151
- * @param params.clientOrderId - Client-provided order ID; a strategy placement cannot carry one
152
- * @param params.twapDuration - TWAP window in whole minutes
153
- * @param params.twapRandomize - Whether to vary each TWAP suborder's size by up to ±20%
154
- * @param params.scaleMinPrice - Lowest price in a scale ladder
155
- * @param params.scaleMaxPrice - Highest price in a scale ladder
156
- * @param params.scaleNumOrders - How many orders a scale ladder fans out into
157
- * @param params.scaleSkew - How a scale ladder's size is weighted across its rungs
158
- * @param params.chaseIntervalMs - How often a chase re-reads the touch
159
- * @param params.chaseMaxDurationMs - How long a chase keeps re-pricing
160
- * @param params.chaseMaxRepricings - Cap on a chase's cancel/replace cycles
161
- * @returns Validation result with isValid flag and optional error message
162
- */
163
- export declare function validateOrderParams(params: StrategyOrderValidationParams & {
164
- coin?: string;
165
- size?: string;
166
- price?: string;
167
- orderType?: OrderType;
168
- triggerPrice?: string;
169
- takeProfitPrice?: string;
170
- stopLossPrice?: string;
171
- takeProfitSize?: string;
172
- stopLossSize?: string;
173
- tpslLinkage?: TpslLinkage;
174
- grouping?: 'na' | 'normalTpsl' | 'positionTpsl';
175
- timeInForce?: 'GTC' | 'IOC' | 'ALO';
176
- clientOrderId?: string;
177
- }): {
178
- isValid: boolean;
179
- error?: string;
180
- };
181
- /**
182
- * Validate coin exists in asset mapping.
183
- *
184
- * @param coin - The coin symbol to validate
185
- * @param coinToAssetId - Map of coin symbols to asset IDs
186
- * @returns Validation result with isValid flag and optional error message
187
- */
188
- export declare function validateCoinExists(coin: string, coinToAssetId: Map<string, number>): {
189
- isValid: boolean;
190
- error?: string;
191
- };
192
- //# sourceMappingURL=hyperLiquidValidation.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hyperLiquidValidation.d.mts","sourceRoot":"","sources":["../../src/utils/hyperLiquidValidation.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,GAAG,EAAE,wBAAwB;AAcxD,OAAO,KAAK,EACV,uBAAuB,EACvB,gBAAgB,EACjB,2BAA0B;AAC3B,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,iCAAgC;AAStE;;;;GAIG;AACH,MAAM,MAAM,qBAAqB,GAAG,gBAAgB,GAAG,SAAS,CAAC;AAEjE;;GAEG;AAEH;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,SAAS;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,EACnD,KAAK,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,GAAG,MAAM,CAOjD;AAED;;;;;;;;;GASG;AACH,wBAAgB,wBAAwB,CACtC,MAAM,EAAE;IACN,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,GAAG,CAAC;CACnB,EACD,WAAW,CAAC,EAAE,qBAAqB,GAClC;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAkEtC;AAED;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE;IACN,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE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C,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,EAAE,CAAC;YAC7B,OAAO;gBACL,OAAO,EAAE,KAAK;gBACd,KAAK,EAAE,iBAAiB,CAAC,uBAAuB;aACjD,CAAC;QACJ,CAAC;QAED,IAAI,SAAS,KAAK,SAAS,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,IAAI,GAAG,SAAS,EAAE,CAAC;YACrE,OAAO;gBACL,OAAO,EAAE,KAAK;gBACd,KAAK,EAAE,iBAAiB,CAAC,uBAAuB;aACjD,CAAC;QACJ,CAAC;IACH,CAAC;IAED,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AAC3B,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB,CAChC,IAAY,EACZ,aAAkC;IAElC,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;QAC7B,OAAO;YACL,OAAO,EAAE,KAAK;YACd,KAAK,EAAE,iBAAiB,CAAC,kBAAkB;SAC5C,CAAC;IACJ,CAAC;IAED,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AAC3B,CAAC","sourcesContent":["import { isValidHexAddress } from '@metamask/utils';\nimport type { CaipAssetId, Hex } from '@metamask/utils';\n\nimport {\n HYPERLIQUID_ASSET_CONFIGS,\n BASIS_POINTS_DIVISOR,\n getSupportedAssets,\n TRADING_DEFAULTS,\n} from '../constants/hyperLiquidConfig.js';\nimport {\n CHASE_ORDER_CONFIG,\n HYPERLIQUID_ORDER_LIMITS,\n HYPERLIQUID_TWAP_LIMITS,\n} from '../constants/perpsConfig.js';\nimport { PERPS_ERROR_CODES } from '../perpsErrorCodes.js';\nimport type {\n GetSupportedPathsParams,\n PerpsDebugLogger,\n} from '../types/index.js';\nimport type { OrderType, TpslLinkage } from '../types/perps-types.js';\nimport {\n getTriggerExecution,\n isLimitExecutionOrderType,\n isStrategyOrderType,\n isTriggerOrderType,\n SCALE_ORDER_COUNT,\n} from './orderTypes.js';\n\n/**\n * Optional debug logger for validation functions.\n * When provided, enables detailed logging for debugging.\n * When omitted, validation runs silently.\n */\nexport type ValidationDebugLogger = PerpsDebugLogger | undefined;\n\n/**\n * Validation utilities for HyperLiquid operations\n */\n\n/**\n * Create standardized error response.\n *\n * @param error - The error that occurred\n * @param defaultResponse - The default response object to use as template\n * @returns The error response with success=false and error message\n */\nexport function createErrorResult<\n TValue extends { success: boolean; error?: string },\n>(error: unknown, defaultResponse: TValue): TValue {\n return {\n ...defaultResponse,\n success: false,\n error:\n error instanceof Error ? error.message : PERPS_ERROR_CODES.UNKNOWN_ERROR,\n };\n}\n\n/**\n * Validate withdrawal parameters.\n *\n * @param params - Withdrawal parameters to validate\n * @param params.assetId - The CAIP asset ID to withdraw\n * @param params.amount - Amount to withdraw as string\n * @param params.destination - Optional destination hex address\n * @param debugLogger - Optional debug logger for detailed logging\n * @returns Validation result with isValid flag and optional error message\n */\nexport function validateWithdrawalParams(\n params: {\n assetId?: CaipAssetId;\n amount?: string;\n destination?: Hex;\n },\n debugLogger?: ValidationDebugLogger,\n): { isValid: boolean; error?: string } {\n debugLogger?.log('validateWithdrawalParams: Starting validation', {\n params,\n hasAssetId: Boolean(params.assetId),\n hasAmount: Boolean(params.amount),\n hasDestination: Boolean(params.destination),\n });\n\n // Validate required parameters\n if (!params.assetId) {\n debugLogger?.log('validateWithdrawalParams: Missing assetId', {\n error: PERPS_ERROR_CODES.WITHDRAW_ASSET_ID_REQUIRED,\n params,\n });\n return {\n isValid: false,\n error: PERPS_ERROR_CODES.WITHDRAW_ASSET_ID_REQUIRED,\n };\n }\n\n // Validate amount\n if (!params.amount) {\n debugLogger?.log('validateWithdrawalParams: Missing amount', {\n error: PERPS_ERROR_CODES.WITHDRAW_AMOUNT_REQUIRED,\n params,\n });\n return {\n isValid: false,\n error: PERPS_ERROR_CODES.WITHDRAW_AMOUNT_REQUIRED,\n };\n }\n\n const amount = parseFloat(params.amount);\n if (isNaN(amount) || amount <= 0) {\n debugLogger?.log('validateWithdrawalParams: Invalid amount', {\n error: PERPS_ERROR_CODES.WITHDRAW_AMOUNT_POSITIVE,\n amount: params.amount,\n parsedAmount: amount,\n isNaN: isNaN(amount),\n });\n return {\n isValid: false,\n error: PERPS_ERROR_CODES.WITHDRAW_AMOUNT_POSITIVE,\n };\n }\n\n // Validate destination address if provided\n if (params.destination && !isValidHexAddress(params.destination)) {\n debugLogger?.log('validateWithdrawalParams: Invalid destination address', {\n error: PERPS_ERROR_CODES.WITHDRAW_INVALID_DESTINATION,\n destination: params.destination,\n isValidHex: isValidHexAddress(params.destination),\n });\n return {\n isValid: false,\n error: PERPS_ERROR_CODES.WITHDRAW_INVALID_DESTINATION,\n };\n }\n\n debugLogger?.log('validateWithdrawalParams: All validations passed', {\n assetId: params.assetId,\n amount: params.amount,\n destination: params.destination ?? 'will use user wallet',\n });\n\n return { isValid: true };\n}\n\n/**\n * Validate deposit parameters.\n *\n * @param params - Deposit parameters to validate\n * @param params.assetId - The CAIP asset ID to deposit\n * @param params.amount - Amount to deposit as string\n * @param params.isTestnet - Whether this is a testnet deposit\n * @param debugLogger - Optional debug logger for detailed logging\n * @returns Validation result with isValid flag and optional error message\n */\nexport function validateDepositParams(\n params: {\n assetId?: CaipAssetId;\n amount?: string;\n isTestnet?: boolean;\n },\n debugLogger?: ValidationDebugLogger,\n): { isValid: boolean; error?: string } {\n debugLogger?.log('validateDepositParams: Starting validation', {\n params,\n hasAssetId: Boolean(params.assetId),\n hasAmount: Boolean(params.amount),\n isTestnet: params.isTestnet,\n });\n\n // Validate required parameters\n if (!params.assetId) {\n debugLogger?.log('validateDepositParams: Missing assetId', {\n error: PERPS_ERROR_CODES.DEPOSIT_ASSET_ID_REQUIRED,\n params,\n });\n return {\n isValid: false,\n error: PERPS_ERROR_CODES.DEPOSIT_ASSET_ID_REQUIRED,\n };\n }\n\n // Validate amount\n if (!params.amount) {\n debugLogger?.log('validateDepositParams: Missing amount', {\n error: PERPS_ERROR_CODES.DEPOSIT_AMOUNT_REQUIRED,\n params,\n });\n return {\n isValid: false,\n error: PERPS_ERROR_CODES.DEPOSIT_AMOUNT_REQUIRED,\n };\n }\n\n const amount = parseFloat(params.amount);\n if (isNaN(amount) || amount <= 0) {\n debugLogger?.log('validateDepositParams: Invalid amount', {\n error: PERPS_ERROR_CODES.DEPOSIT_AMOUNT_POSITIVE,\n amount: params.amount,\n parsedAmount: amount,\n isNaN: isNaN(amount),\n });\n return {\n isValid: false,\n error: PERPS_ERROR_CODES.DEPOSIT_AMOUNT_POSITIVE,\n };\n }\n\n // Check minimum deposit amount\n const minimumAmount = params.isTestnet\n ? TRADING_DEFAULTS.amount.testnet\n : TRADING_DEFAULTS.amount.mainnet;\n\n debugLogger?.log('validateDepositParams: Checking minimum amount', {\n amount,\n minimumAmount,\n isTestnet: params.isTestnet,\n network: params.isTestnet ? 'testnet' : 'mainnet',\n });\n\n if (amount < minimumAmount) {\n debugLogger?.log('validateDepositParams: Below minimum deposit', {\n error: PERPS_ERROR_CODES.DEPOSIT_MINIMUM_AMOUNT,\n amount,\n minimumAmount,\n difference: minimumAmount - amount,\n });\n return {\n isValid: false,\n error: PERPS_ERROR_CODES.DEPOSIT_MINIMUM_AMOUNT,\n };\n }\n\n debugLogger?.log('validateDepositParams: All validations passed', {\n assetId: params.assetId,\n amount: params.amount,\n parsedAmount: amount,\n minimumAmount,\n isTestnet: params.isTestnet,\n });\n\n return { isValid: true };\n}\n\n/**\n * Validate asset support for withdrawals using AssetRoute arrays.\n *\n * @param assetId - The CAIP asset ID to validate\n * @param supportedRoutes - Array of supported asset routes\n * @param debugLogger - Optional debug logger for detailed logging\n * @returns Validation result with isValid flag and optional error message\n */\nexport function validateAssetSupport(\n assetId: CaipAssetId,\n supportedRoutes: { assetId: CaipAssetId }[],\n debugLogger?: ValidationDebugLogger,\n): { isValid: boolean; error?: string } {\n debugLogger?.log('validateAssetSupport: Checking asset support', {\n assetId,\n supportedRoutesCount: supportedRoutes.length,\n });\n\n const supportedAssetIds = supportedRoutes.map((route) => route.assetId);\n\n // Check if asset is supported\n const isSupported = supportedAssetIds.includes(assetId);\n\n if (!isSupported) {\n // Also check case-insensitive match for contract addresses\n const isSupportedCaseInsensitive = supportedAssetIds.some(\n (supportedId) => supportedId.toLowerCase() === assetId.toLowerCase(),\n );\n\n if (!isSupportedCaseInsensitive) {\n debugLogger?.log('validateAssetSupport: Asset not supported', {\n error: PERPS_ERROR_CODES.WITHDRAW_ASSET_NOT_SUPPORTED,\n assetId,\n supportedAssetIds,\n checkedCaseInsensitive: true,\n });\n\n return {\n isValid: false,\n error: PERPS_ERROR_CODES.WITHDRAW_ASSET_NOT_SUPPORTED,\n };\n }\n\n debugLogger?.log(\n '⚠️ validateAssetSupport: Asset supported with case mismatch',\n {\n providedAssetId: assetId,\n matchedAssetId: supportedAssetIds.find(\n (id) => id.toLowerCase() === assetId.toLowerCase(),\n ),\n },\n );\n }\n\n debugLogger?.log('validateAssetSupport: Asset is supported', {\n assetId,\n });\n\n return { isValid: true };\n}\n\n/**\n * Validate balance against withdrawal amount.\n *\n * @param withdrawAmount - The amount to withdraw\n * @param withdrawableBalance - Max USD that can leave the venue right now\n * @param debugLogger - Optional debug logger for detailed logging\n * @returns Validation result with isValid flag and optional error message\n */\nexport function validateBalance(\n withdrawAmount: number,\n withdrawableBalance: number,\n debugLogger?: ValidationDebugLogger,\n): { isValid: boolean; error?: string } {\n debugLogger?.log('validateBalance: Checking balance sufficiency', {\n withdrawAmount,\n withdrawableBalance,\n difference: withdrawableBalance - withdrawAmount,\n });\n\n if (withdrawAmount > withdrawableBalance) {\n const shortfall = withdrawAmount - withdrawableBalance;\n\n debugLogger?.log('validateBalance: Insufficient balance', {\n error: PERPS_ERROR_CODES.WITHDRAW_INSUFFICIENT_BALANCE,\n withdrawAmount,\n withdrawableBalance,\n shortfall,\n percentageOfAvailable: `${((withdrawAmount / withdrawableBalance) * 100).toFixed(2)}%`,\n });\n\n return {\n isValid: false,\n error: PERPS_ERROR_CODES.WITHDRAW_INSUFFICIENT_BALANCE,\n };\n }\n\n const remainingBalance = withdrawableBalance - withdrawAmount;\n debugLogger?.log('validateBalance: Balance is sufficient', {\n withdrawAmount,\n withdrawableBalance,\n remainingBalance,\n percentageUsed: `${((withdrawAmount / withdrawableBalance) * 100).toFixed(2)}%`,\n });\n\n return { isValid: true };\n}\n\n/**\n * Apply filters to asset paths with comprehensive logging.\n *\n * @param assets - Array of CAIP asset IDs to filter\n * @param params - Filter parameters including chainId, symbol, and assetId\n * @param debugLogger - Optional debug logger for detailed logging\n * @returns Filtered array of CAIP asset IDs\n */\nexport function applyPathFilters(\n assets: CaipAssetId[],\n params?: GetSupportedPathsParams,\n debugLogger?: ValidationDebugLogger,\n): CaipAssetId[] {\n if (!params) {\n debugLogger?.log(\n 'HyperLiquid: applyPathFilters - no params, returning all assets',\n { assets },\n );\n return assets;\n }\n\n let filtered = assets;\n\n debugLogger?.log('HyperLiquid: applyPathFilters - starting filter', {\n initialAssets: assets,\n filterParams: params,\n });\n\n if (params.chainId) {\n const before = filtered;\n filtered = filtered.filter((asset) =>\n asset.startsWith(params.chainId as string),\n );\n debugLogger?.log('HyperLiquid: applyPathFilters - chainId filter', {\n chainId: params.chainId,\n before,\n after: filtered,\n });\n }\n\n // Note: `in` is the idiomatic TypeScript way to narrow a string to\n // `keyof typeof` for indexed access; `hasProperty` types the indexed\n // result as `unknown` and loses the `{ testnet, mainnet }` shape.\n /* eslint-disable-next-line no-restricted-syntax */\n if (params.symbol && params.symbol in HYPERLIQUID_ASSET_CONFIGS) {\n const config =\n HYPERLIQUID_ASSET_CONFIGS[\n params.symbol as keyof typeof HYPERLIQUID_ASSET_CONFIGS\n ];\n const isTestnet = params.isTestnet ?? false;\n const selectedAsset = isTestnet ? config.testnet : config.mainnet;\n const before = filtered;\n filtered = [selectedAsset];\n debugLogger?.log('HyperLiquid: applyPathFilters - symbol filter', {\n symbol: params.symbol,\n isTestnet,\n config,\n selectedAsset,\n before,\n after: filtered,\n });\n }\n\n if (params.assetId) {\n const before = filtered;\n // Use case-insensitive comparison for asset ID matching to handle address case differences\n filtered = filtered.filter(\n (asset) => asset.toLowerCase() === params.assetId?.toLowerCase(),\n );\n debugLogger?.log('HyperLiquid: applyPathFilters - assetId filter', {\n assetId: params.assetId,\n before,\n after: filtered,\n exactMatch: before.includes(params.assetId),\n caseInsensitiveMatch: before.some(\n (asset) => asset.toLowerCase() === params.assetId?.toLowerCase(),\n ),\n });\n }\n\n debugLogger?.log('HyperLiquid: applyPathFilters - final result', {\n initialAssets: assets,\n finalFiltered: filtered,\n filterParams: params,\n });\n\n return filtered;\n}\n\n/**\n * Get supported deposit/withdrawal paths with filtering.\n *\n * @param params - Filter parameters including isTestnet, chainId, symbol\n * @param debugLogger - Optional debug logger for detailed logging\n * @returns Array of supported CAIP asset IDs\n */\nexport function getSupportedPaths(\n params?: GetSupportedPathsParams,\n debugLogger?: ValidationDebugLogger,\n): CaipAssetId[] {\n const isTestnet = params?.isTestnet ?? false;\n const assets = getSupportedAssets(isTestnet);\n const filteredAssets = applyPathFilters(assets, params, debugLogger);\n\n debugLogger?.log('HyperLiquid: getSupportedPaths', {\n isTestnet,\n requestedParams: params,\n allAssets: assets,\n filteredAssets,\n returnType: 'CaipAssetId[]',\n example: filteredAssets[0],\n });\n\n return filteredAssets;\n}\n\n/**\n * Get maximum order value based on leverage and order type.\n * Based on HyperLiquid contract specifications.\n *\n * @param maxLeverage - The maximum leverage for the market\n * @param orderType - The order type; every type follows the limit/market\n * multiplier of its execution mode, so `stop_limit`, `scale` and `chase` are all\n * treated as limit orders and `twap` as a market order\n * @returns Maximum order value in USD\n */\nexport function getMaxOrderValue(\n maxLeverage: number,\n orderType: OrderType,\n): number {\n let marketLimit: number;\n\n if (maxLeverage >= 25) {\n marketLimit = HYPERLIQUID_ORDER_LIMITS.MarketOrderLimits.HighLeverage;\n } else if (maxLeverage >= 20) {\n marketLimit = HYPERLIQUID_ORDER_LIMITS.MarketOrderLimits.MediumHighLeverage;\n } else if (maxLeverage >= 10) {\n marketLimit = HYPERLIQUID_ORDER_LIMITS.MarketOrderLimits.MediumLeverage;\n } else {\n marketLimit = HYPERLIQUID_ORDER_LIMITS.MarketOrderLimits.LowLeverage;\n }\n\n // The higher cap follows how the order executes, not whose price it uses: a\n // scale ladder and a chase rest limit orders on the book, so holding them to\n // the tighter market-order cap would bound them by how they were requested\n // rather than by what they do.\n return getTriggerExecution(orderType) === 'limit'\n ? marketLimit * HYPERLIQUID_ORDER_LIMITS.LimitOrderMultiplier\n : marketLimit;\n}\n\n/**\n * The `grouping` value each provider-agnostic linkage corresponds to, used to\n * detect a caller supplying both spellings with different meanings.\n */\nconst TPSL_LINKAGE_GROUPING: Record<\n TpslLinkage,\n 'na' | 'normalTpsl' | 'positionTpsl'\n> = {\n none: 'na',\n order: 'normalTpsl',\n position: 'positionTpsl',\n};\n\n/**\n * The strategy-placement fields of `OrderParams`, as validation sees them.\n *\n * Named so the provider can forward exactly this group to `validateOrderParams`\n * without the field list drifting between the two call sites.\n */\nexport type StrategyOrderValidationParams = {\n twapDuration?: number;\n twapRandomize?: boolean;\n scaleMinPrice?: string;\n scaleMaxPrice?: string;\n scaleNumOrders?: number;\n scaleSkew?: number;\n chaseIntervalMs?: number;\n chaseMaxDurationMs?: number;\n chaseMaxRepricings?: number;\n chaseMaxDistanceBps?: number;\n};\n\n/**\n * Which strategy owns each strategy-only field.\n *\n * Anything a placement does not own is rejected rather than ignored: a `twap`\n * carrying `scaleNumOrders` is a caller mistake, and dropping it silently would\n * execute something other than what was asked for.\n */\nconst STRATEGY_FIELD_OWNER: Record<\n keyof StrategyOrderValidationParams,\n 'twap' | 'scale' | 'chase'\n> = {\n twapDuration: 'twap',\n twapRandomize: 'twap',\n scaleMinPrice: 'scale',\n scaleMaxPrice: 'scale',\n scaleNumOrders: 'scale',\n scaleSkew: 'scale',\n chaseIntervalMs: 'chase',\n chaseMaxDurationMs: 'chase',\n chaseMaxRepricings: 'chase',\n chaseMaxDistanceBps: 'chase',\n};\n\n/**\n * Validate the TWAP-specific parameters of a `twap` placement.\n *\n * @param params - Strategy fields supplied by the caller.\n * @returns Validation result with isValid flag and optional error message.\n */\nfunction validateTwapParams(params: StrategyOrderValidationParams): {\n isValid: boolean;\n error?: string;\n} {\n if (params.twapDuration === undefined) {\n return {\n isValid: false,\n error: PERPS_ERROR_CODES.ORDER_TWAP_DURATION_REQUIRED,\n };\n }\n\n // The venue validates `twap.m` as a safe integer within these bounds before\n // the request is signed, so checking it here turns an opaque SDK failure into\n // a typed rejection that costs no round trip.\n if (\n !Number.isInteger(params.twapDuration) ||\n params.twapDuration < HYPERLIQUID_TWAP_LIMITS.MinDurationMinutes ||\n params.twapDuration > HYPERLIQUID_TWAP_LIMITS.MaxDurationMinutes\n ) {\n return {\n isValid: false,\n error: PERPS_ERROR_CODES.ORDER_TWAP_DURATION_INVALID,\n };\n }\n\n return { isValid: true };\n}\n\n/**\n * Validate the ladder parameters of a `scale` placement.\n *\n * @param params - Strategy fields supplied by the caller.\n * @returns Validation result with isValid flag and optional error message.\n */\nfunction validateScaleParams(params: StrategyOrderValidationParams): {\n isValid: boolean;\n error?: string;\n} {\n if (\n params.scaleMinPrice === undefined ||\n params.scaleMaxPrice === undefined\n ) {\n return {\n isValid: false,\n error: PERPS_ERROR_CODES.ORDER_SCALE_RANGE_REQUIRED,\n };\n }\n\n const minPrice = parseFloat(params.scaleMinPrice);\n const maxPrice = parseFloat(params.scaleMaxPrice);\n if (\n !Number.isFinite(minPrice) ||\n !Number.isFinite(maxPrice) ||\n minPrice <= 0 ||\n maxPrice <= minPrice\n ) {\n return {\n isValid: false,\n error: PERPS_ERROR_CODES.ORDER_SCALE_RANGE_INVALID,\n };\n }\n\n if (\n params.scaleNumOrders === undefined ||\n !Number.isInteger(params.scaleNumOrders) ||\n params.scaleNumOrders < SCALE_ORDER_COUNT.min ||\n params.scaleNumOrders > SCALE_ORDER_COUNT.max\n ) {\n return {\n isValid: false,\n error: PERPS_ERROR_CODES.ORDER_SCALE_COUNT_INVALID,\n };\n }\n\n // Omitted is an even ladder, so only a supplied skew is checked. The value is\n // taken exactly as the caller wrote it: clients coerce their input to two\n // decimals, and rounding it again here would place a ladder weighted\n // differently from the one the form previewed.\n if (\n params.scaleSkew !== undefined &&\n (!Number.isFinite(params.scaleSkew) || params.scaleSkew <= 0)\n ) {\n return {\n isValid: false,\n error: PERPS_ERROR_CODES.ORDER_SCALE_RANGE_INVALID,\n };\n }\n\n return { isValid: true };\n}\n\n/**\n * Validate the polling parameters of a `chase` placement.\n *\n * @param params - Strategy fields supplied by the caller.\n * @returns Validation result with isValid flag and optional error message.\n */\nfunction validateChaseParams(params: StrategyOrderValidationParams): {\n isValid: boolean;\n error?: string;\n} {\n const interval =\n params.chaseIntervalMs ?? CHASE_ORDER_CONFIG.DefaultIntervalMs;\n if (\n !Number.isFinite(interval) ||\n interval < CHASE_ORDER_CONFIG.MinIntervalMs\n ) {\n return {\n isValid: false,\n error: PERPS_ERROR_CODES.ORDER_CHASE_INTERVAL_INVALID,\n };\n }\n\n const maxDuration = params.chaseMaxDurationMs;\n // A window shorter than one poll would place the order and immediately stop\n // chasing it — a plain post-only limit order wearing a chase's name.\n if (\n maxDuration !== undefined &&\n (!Number.isFinite(maxDuration) || maxDuration < interval)\n ) {\n return {\n isValid: false,\n error: PERPS_ERROR_CODES.ORDER_CHASE_DURATION_INVALID,\n };\n }\n\n const maxRepricings = params.chaseMaxRepricings;\n if (\n maxRepricings !== undefined &&\n (!Number.isInteger(maxRepricings) || maxRepricings < 1)\n ) {\n return {\n isValid: false,\n error: PERPS_ERROR_CODES.ORDER_CHASE_DURATION_INVALID,\n };\n }\n\n if (\n params.chaseMaxDistanceBps !== undefined &&\n (!Number.isFinite(params.chaseMaxDistanceBps) ||\n params.chaseMaxDistanceBps <= 0 ||\n params.chaseMaxDistanceBps >= BASIS_POINTS_DIVISOR)\n ) {\n return {\n isValid: false,\n error: PERPS_ERROR_CODES.ORDER_CHASE_MAX_DISTANCE_INVALID,\n };\n }\n\n return { isValid: true };\n}\n\n/**\n * Validate strategy placement parameters, and the absence of them.\n *\n * Runs before every other order rule so a strategy placement is rejected with a\n * strategy-shaped reason rather than with the trigger/limit rule its shape\n * happens to trip first.\n *\n * @param params - Order parameters to validate.\n * @param params.orderType - The order placement type.\n * @returns Validation result with isValid flag and optional error message.\n */\nfunction validateStrategyOrderParams(\n params: StrategyOrderValidationParams & {\n orderType?: OrderType;\n price?: string;\n triggerPrice?: string;\n timeInForce?: 'GTC' | 'IOC' | 'ALO';\n clientOrderId?: string;\n takeProfitPrice?: string;\n stopLossPrice?: string;\n takeProfitSize?: string;\n stopLossSize?: string;\n },\n): { isValid: boolean; error?: string } {\n const { orderType } = params;\n const strategy =\n orderType !== undefined && isStrategyOrderType(orderType)\n ? orderType\n : undefined;\n\n // Every strategy-only field must belong to the placement carrying it. This\n // also covers the non-strategy case, where no field has an owner to match.\n const foreignField = (\n Object.keys(STRATEGY_FIELD_OWNER) as (keyof StrategyOrderValidationParams)[]\n ).find(\n (field) =>\n params[field] !== undefined && STRATEGY_FIELD_OWNER[field] !== strategy,\n );\n if (foreignField) {\n return {\n isValid: false,\n error: PERPS_ERROR_CODES.ORDER_STRATEGY_PARAMS_NOT_SUPPORTED,\n };\n }\n\n if (!strategy) {\n return { isValid: true };\n }\n\n // A strategy owns its own execution: it derives its own prices, rests its own\n // orders, and decides its own time in force. Accepting these fields would\n // mean quietly ignoring them.\n //\n // `clientOrderId` is refused for the same reason and cannot be honoured even\n // in principle: the venue's TWAP action carries no client id, a scale ladder\n // is many orders and a client id must be unique per order, and a chase\n // replaces its order on every re-price. One id cannot name any of them.\n if (\n params.price !== undefined ||\n params.triggerPrice !== undefined ||\n params.timeInForce !== undefined ||\n params.clientOrderId !== undefined ||\n params.takeProfitPrice !== undefined ||\n params.stopLossPrice !== undefined ||\n params.takeProfitSize !== undefined ||\n params.stopLossSize !== undefined\n ) {\n return {\n isValid: false,\n error: PERPS_ERROR_CODES.ORDER_STRATEGY_FIELD_UNSUPPORTED,\n };\n }\n\n if (strategy === 'twap') {\n return validateTwapParams(params);\n }\n if (strategy === 'scale') {\n return validateScaleParams(params);\n }\n return validateChaseParams(params);\n}\n\n/**\n * Validate order parameters.\n * Basic validation - checks required fields are present.\n * Amount validation (size/USD) is handled by validateOrder.\n *\n * @param params - Order parameters to validate\n * @param params.coin - The trading pair coin symbol\n * @param params.size - The order size as string\n * @param params.price - The order price as string\n * @param params.orderType - The order placement type\n * @param params.triggerPrice - Trigger price; required for trigger placement types and\n * rejected for market/limit orders so a stray value can never be silently dropped\n * @param params.takeProfitPrice - Attached take profit price\n * @param params.stopLossPrice - Attached stop loss price\n * @param params.takeProfitSize - Partial take profit size\n * @param params.stopLossSize - Partial stop loss size\n * @param params.tpslLinkage - How an attached TP/SL is linked\n * @param params.grouping - Deprecated protocol-shaped spelling of `tpslLinkage`\n * @param params.timeInForce - Time in force; only a plain limit order can carry one\n * @param params.clientOrderId - Client-provided order ID; a strategy placement cannot carry one\n * @param params.twapDuration - TWAP window in whole minutes\n * @param params.twapRandomize - Whether to vary each TWAP suborder's size by up to ±20%\n * @param params.scaleMinPrice - Lowest price in a scale ladder\n * @param params.scaleMaxPrice - Highest price in a scale ladder\n * @param params.scaleNumOrders - How many orders a scale ladder fans out into\n * @param params.scaleSkew - How a scale ladder's size is weighted across its rungs\n * @param params.chaseIntervalMs - How often a chase re-reads the touch\n * @param params.chaseMaxDurationMs - How long a chase keeps re-pricing\n * @param params.chaseMaxRepricings - Cap on a chase's cancel/replace cycles\n * @returns Validation result with isValid flag and optional error message\n */\nexport function validateOrderParams(\n params: StrategyOrderValidationParams & {\n coin?: string;\n size?: string;\n price?: string;\n orderType?: OrderType;\n triggerPrice?: string;\n takeProfitPrice?: string;\n stopLossPrice?: string;\n takeProfitSize?: string;\n stopLossSize?: string;\n tpslLinkage?: TpslLinkage;\n grouping?: 'na' | 'normalTpsl' | 'positionTpsl';\n timeInForce?: 'GTC' | 'IOC' | 'ALO';\n clientOrderId?: string;\n },\n): { isValid: boolean; error?: string } {\n if (!params.coin) {\n return {\n isValid: false,\n error: PERPS_ERROR_CODES.ORDER_COIN_REQUIRED,\n };\n }\n\n // Note: Size validation removed - validateOrder handles amount validation using USD as source of truth\n\n // Strategy placements are decided first: their shape trips the limit-price and\n // trigger rules below, and the strategy-shaped reason is the useful one.\n const strategyValidation = validateStrategyOrderParams(params);\n if (!strategyValidation.isValid) {\n return strategyValidation;\n }\n\n const { orderType } = params;\n const isTrigger = orderType !== undefined && isTriggerOrderType(orderType);\n\n // Require price for orders that execute as limit orders (limit, stop_limit,\n // take_profit_limit)\n if (\n orderType !== undefined &&\n isLimitExecutionOrderType(orderType) &&\n !params.price\n ) {\n return {\n isValid: false,\n error: PERPS_ERROR_CODES.ORDER_LIMIT_PRICE_REQUIRED,\n };\n }\n\n if (params.price && parseFloat(params.price) <= 0) {\n return {\n isValid: false,\n error: PERPS_ERROR_CODES.ORDER_PRICE_POSITIVE,\n };\n }\n\n if (isTrigger) {\n if (!params.triggerPrice) {\n return {\n isValid: false,\n error: PERPS_ERROR_CODES.ORDER_TRIGGER_PRICE_REQUIRED,\n };\n }\n\n const triggerPrice = parseFloat(params.triggerPrice);\n if (isNaN(triggerPrice) || triggerPrice <= 0) {\n return {\n isValid: false,\n error: PERPS_ERROR_CODES.ORDER_TRIGGER_PRICE_POSITIVE,\n };\n }\n\n // A trigger placement combined with attached TP/SL children is rejected\n // rather than silently reshaped: the exchange semantics of a triggered\n // parent owning triggered children are not part of this contract.\n // Each field is checked explicitly: a falsy-but-present price (e.g. '') is\n // still an attached TP/SL request and must be rejected, not skipped.\n if (\n params.takeProfitPrice !== undefined ||\n params.stopLossPrice !== undefined\n ) {\n return {\n isValid: false,\n error: PERPS_ERROR_CODES.ORDER_TRIGGER_TPSL_UNSUPPORTED,\n };\n }\n // Consistent with the attached-TP/SL check above: a falsy-but-present value\n // (e.g. '') is still a request to place a trigger, not an absent field.\n } else if (params.triggerPrice !== undefined) {\n return {\n isValid: false,\n error: PERPS_ERROR_CODES.ORDER_TRIGGER_PRICE_NOT_SUPPORTED,\n };\n }\n\n // `tpslLinkage` supersedes `grouping`, but two spellings that disagree are a\n // caller mistake — resolving one silently would hide it.\n if (params.tpslLinkage !== undefined && params.grouping !== undefined) {\n const expectedGrouping = TPSL_LINKAGE_GROUPING[params.tpslLinkage];\n if (expectedGrouping !== params.grouping) {\n return {\n isValid: false,\n error: PERPS_ERROR_CODES.ORDER_TPSL_LINKAGE_CONFLICT,\n };\n }\n }\n\n const hasAttachedTpsl =\n params.takeProfitPrice !== undefined || params.stopLossPrice !== undefined;\n\n // Every order in a `positionTpsl` batch has to be a trigger order, and no\n // shape of order placement produces one. With an attached TP/SL the batch\n // carries the ordinary parent order the TP/SL protects; without one it is\n // that parent order alone. HyperLiquid rejects both, so the linkage is\n // refused outright — it belongs to `updatePositionTPSL`, applied to the\n // position once the parent has filled.\n const requestsPositionLinkage =\n params.tpslLinkage === 'position' || params.grouping === 'positionTpsl';\n if (requestsPositionLinkage) {\n return {\n isValid: false,\n error: PERPS_ERROR_CODES.ORDER_TPSL_POSITION_LINKAGE_UNSUPPORTED,\n };\n }\n\n // `na` grouping submits the attached TP/SL as standalone triggers, bound to\n // neither the parent order nor the resulting position. An unfilled parent\n // then leaves them behind as orphan reduce-only triggers that fire against\n // whatever position happens to exist. An attached TP/SL needs a linkage that\n // links it, so the combination is a caller mistake rather than a mode.\n const requestsNoLinkage =\n params.tpslLinkage === 'none' || params.grouping === 'na';\n if (requestsNoLinkage && hasAttachedTpsl) {\n return {\n isValid: false,\n error: PERPS_ERROR_CODES.ORDER_TPSL_LINKAGE_REQUIRED,\n };\n }\n\n // Only a plain limit order rests on the book long enough for a time in force to\n // mean anything: a market order fills immediately and a trigger order's\n // execution is decided when it fires. Rejected here, at step 1 of placement, so\n // it cannot fire after leverage changes or a HIP-3 margin transfer.\n if (params.timeInForce !== undefined && orderType !== 'limit') {\n return {\n isValid: false,\n error: PERPS_ERROR_CODES.ORDER_TIME_IN_FORCE_NOT_SUPPORTED,\n };\n }\n\n const partialTpslValidation = validatePartialTpslSizes(params);\n if (!partialTpslValidation.isValid) {\n return partialTpslValidation;\n }\n\n return { isValid: true };\n}\n\n/**\n * Validate quantity-scoped (partial) TP/SL sizes against the parent order.\n *\n * @param params - Order parameters carrying the TP/SL prices and sizes\n * @param params.size - Parent order size\n * @param params.takeProfitPrice - Attached take profit price\n * @param params.stopLossPrice - Attached stop loss price\n * @param params.takeProfitSize - Partial take profit size\n * @param params.stopLossSize - Partial stop loss size\n * @returns Validation result with isValid flag and optional error message\n */\nfunction validatePartialTpslSizes(params: {\n size?: string;\n takeProfitPrice?: string;\n stopLossPrice?: string;\n takeProfitSize?: string;\n stopLossSize?: string;\n}): { isValid: boolean; error?: string } {\n const orderSize = params.size ? Math.abs(parseFloat(params.size)) : undefined;\n\n const entries: { size?: string; price?: string }[] = [\n { size: params.takeProfitSize, price: params.takeProfitPrice },\n { size: params.stopLossSize, price: params.stopLossPrice },\n ];\n\n for (const entry of entries) {\n if (entry.size === undefined) {\n continue;\n }\n\n // A size without its price would silently place nothing.\n if (!entry.price) {\n return {\n isValid: false,\n error: PERPS_ERROR_CODES.ORDER_TPSL_SIZE_INVALID,\n };\n }\n\n const size = parseFloat(entry.size);\n if (isNaN(size) || size <= 0) {\n return {\n isValid: false,\n error: PERPS_ERROR_CODES.ORDER_TPSL_SIZE_INVALID,\n };\n }\n\n if (orderSize !== undefined && !isNaN(orderSize) && size > orderSize) {\n return {\n isValid: false,\n error: PERPS_ERROR_CODES.ORDER_TPSL_SIZE_INVALID,\n };\n }\n }\n\n return { isValid: true };\n}\n\n/**\n * Validate coin exists in asset mapping.\n *\n * @param coin - The coin symbol to validate\n * @param coinToAssetId - Map of coin symbols to asset IDs\n * @returns Validation result with isValid flag and optional error message\n */\nexport function validateCoinExists(\n coin: string,\n coinToAssetId: Map<string, number>,\n): { isValid: boolean; error?: string } {\n if (!coinToAssetId.has(coin)) {\n return {\n isValid: false,\n error: PERPS_ERROR_CODES.ORDER_UNKNOWN_COIN,\n };\n }\n\n return { isValid: true };\n}\n"]}
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.generateTransactionId = exports.generateOrderId = exports.generateWithdrawalId = exports.generateDepositId = exports.generatePerpsId = void 0;
4
- const uuid_1 = require("uuid");
5
- const generatePerpsId = (prefix) => {
6
- const id = (0, uuid_1.v4)();
7
- return prefix ? `${prefix}-${id}` : id;
8
- };
9
- exports.generatePerpsId = generatePerpsId;
10
- const generateDepositId = () => (0, exports.generatePerpsId)('deposit');
11
- exports.generateDepositId = generateDepositId;
12
- const generateWithdrawalId = () => (0, exports.generatePerpsId)('withdrawal');
13
- exports.generateWithdrawalId = generateWithdrawalId;
14
- const generateOrderId = () => (0, exports.generatePerpsId)('order');
15
- exports.generateOrderId = generateOrderId;
16
- const generateTransactionId = () => (0, exports.generatePerpsId)('transaction');
17
- exports.generateTransactionId = generateTransactionId;
18
- //# sourceMappingURL=idUtils.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"idUtils.cjs","sourceRoot":"","sources":["../../src/utils/idUtils.ts"],"names":[],"mappings":";;;AAAA,+BAAoC;AAE7B,MAAM,eAAe,GAAG,CAAC,MAAe,EAAU,EAAE;IACzD,MAAM,EAAE,GAAG,IAAA,SAAM,GAAE,CAAC;IACpB,OAAO,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;AACzC,CAAC,CAAC;AAHW,QAAA,eAAe,mBAG1B;AAEK,MAAM,iBAAiB,GAAG,GAAW,EAAE,CAAC,IAAA,uBAAe,EAAC,SAAS,CAAC,CAAC;AAA7D,QAAA,iBAAiB,qBAA4C;AACnE,MAAM,oBAAoB,GAAG,GAAW,EAAE,CAAC,IAAA,uBAAe,EAAC,YAAY,CAAC,CAAC;AAAnE,QAAA,oBAAoB,wBAA+C;AACzE,MAAM,eAAe,GAAG,GAAW,EAAE,CAAC,IAAA,uBAAe,EAAC,OAAO,CAAC,CAAC;AAAzD,QAAA,eAAe,mBAA0C;AAC/D,MAAM,qBAAqB,GAAG,GAAW,EAAE,CAChD,IAAA,uBAAe,EAAC,aAAa,CAAC,CAAC;AADpB,QAAA,qBAAqB,yBACD","sourcesContent":["import { v4 as uuidv4 } from 'uuid';\n\nexport const generatePerpsId = (prefix?: string): string => {\n const id = uuidv4();\n return prefix ? `${prefix}-${id}` : id;\n};\n\nexport const generateDepositId = (): string => generatePerpsId('deposit');\nexport const generateWithdrawalId = (): string => generatePerpsId('withdrawal');\nexport const generateOrderId = (): string => generatePerpsId('order');\nexport const generateTransactionId = (): string =>\n generatePerpsId('transaction');\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"idUtils.d.cts","sourceRoot":"","sources":["../../src/utils/idUtils.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,eAAe,YAAa,MAAM,KAAG,MAGjD,CAAC;AAEF,eAAO,MAAM,iBAAiB,QAAO,MAAoC,CAAC;AAC1E,eAAO,MAAM,oBAAoB,QAAO,MAAuC,CAAC;AAChF,eAAO,MAAM,eAAe,QAAO,MAAkC,CAAC;AACtE,eAAO,MAAM,qBAAqB,QAAO,MACT,CAAC"}
@@ -1,6 +0,0 @@
1
- export declare const generatePerpsId: (prefix?: string) => string;
2
- export declare const generateDepositId: () => string;
3
- export declare const generateWithdrawalId: () => string;
4
- export declare const generateOrderId: () => string;
5
- export declare const generateTransactionId: () => string;
6
- //# sourceMappingURL=idUtils.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"idUtils.d.mts","sourceRoot":"","sources":["../../src/utils/idUtils.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,eAAe,YAAa,MAAM,KAAG,MAGjD,CAAC;AAEF,eAAO,MAAM,iBAAiB,QAAO,MAAoC,CAAC;AAC1E,eAAO,MAAM,oBAAoB,QAAO,MAAuC,CAAC;AAChF,eAAO,MAAM,eAAe,QAAO,MAAkC,CAAC;AACtE,eAAO,MAAM,qBAAqB,QAAO,MACT,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"idUtils.mjs","sourceRoot":"","sources":["../../src/utils/idUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,IAAI,MAAM,EAAE,aAAa;AAEpC,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,MAAe,EAAU,EAAE;IACzD,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC;IACpB,OAAO,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;AACzC,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAW,EAAE,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC;AAC1E,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAW,EAAE,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC;AAChF,MAAM,CAAC,MAAM,eAAe,GAAG,GAAW,EAAE,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;AACtE,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAW,EAAE,CAChD,eAAe,CAAC,aAAa,CAAC,CAAC","sourcesContent":["import { v4 as uuidv4 } from 'uuid';\n\nexport const generatePerpsId = (prefix?: string): string => {\n const id = uuidv4();\n return prefix ? `${prefix}-${id}` : id;\n};\n\nexport const generateDepositId = (): string => generatePerpsId('deposit');\nexport const generateWithdrawalId = (): string => generatePerpsId('withdrawal');\nexport const generateOrderId = (): string => generatePerpsId('order');\nexport const generateTransactionId = (): string =>\n generatePerpsId('transaction');\n"]}
@@ -1,65 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.getEnvironment = exports.adaptHyperLiquidLedgerUpdateToUserHistoryItem = exports.parseAssetName = exports.calculateHip3AssetId = exports.formatHyperLiquidSize = exports.formatHyperLiquidPrice = exports.buildAssetMapping = exports.adaptAccountStateFromSDK = exports.adaptMarketFromSDK = exports.adaptTriggerOrderTypeFromSDK = exports.adaptTpslLinkageToGrouping = exports.adaptPositionTriggerOrderFromSDK = exports.adaptOrderFromSDK = exports.adaptPositionFromSDK = exports.adaptOrderToSDK = void 0;
18
- /**
19
- * Barrel re-export for all portable utilities in controllers/utils/
20
- *
21
- * Note: hyperLiquidAdapter and orderCalculations both export calculatePositionSize.
22
- * We use selective exports to avoid the name collision.
23
- */
24
- __exportStar(require("./accountUtils.cjs"), exports);
25
- __exportStar(require("./errorUtils.cjs"), exports);
26
- // hyperLiquidAdapter: selective export to avoid calculatePositionSize clash with orderCalculations
27
- var hyperLiquidAdapter_js_1 = require("./hyperLiquidAdapter.cjs");
28
- Object.defineProperty(exports, "adaptOrderToSDK", { enumerable: true, get: function () { return hyperLiquidAdapter_js_1.adaptOrderToSDK; } });
29
- Object.defineProperty(exports, "adaptPositionFromSDK", { enumerable: true, get: function () { return hyperLiquidAdapter_js_1.adaptPositionFromSDK; } });
30
- Object.defineProperty(exports, "adaptOrderFromSDK", { enumerable: true, get: function () { return hyperLiquidAdapter_js_1.adaptOrderFromSDK; } });
31
- Object.defineProperty(exports, "adaptPositionTriggerOrderFromSDK", { enumerable: true, get: function () { return hyperLiquidAdapter_js_1.adaptPositionTriggerOrderFromSDK; } });
32
- Object.defineProperty(exports, "adaptTpslLinkageToGrouping", { enumerable: true, get: function () { return hyperLiquidAdapter_js_1.adaptTpslLinkageToGrouping; } });
33
- Object.defineProperty(exports, "adaptTriggerOrderTypeFromSDK", { enumerable: true, get: function () { return hyperLiquidAdapter_js_1.adaptTriggerOrderTypeFromSDK; } });
34
- Object.defineProperty(exports, "adaptMarketFromSDK", { enumerable: true, get: function () { return hyperLiquidAdapter_js_1.adaptMarketFromSDK; } });
35
- Object.defineProperty(exports, "adaptAccountStateFromSDK", { enumerable: true, get: function () { return hyperLiquidAdapter_js_1.adaptAccountStateFromSDK; } });
36
- Object.defineProperty(exports, "buildAssetMapping", { enumerable: true, get: function () { return hyperLiquidAdapter_js_1.buildAssetMapping; } });
37
- Object.defineProperty(exports, "formatHyperLiquidPrice", { enumerable: true, get: function () { return hyperLiquidAdapter_js_1.formatHyperLiquidPrice; } });
38
- Object.defineProperty(exports, "formatHyperLiquidSize", { enumerable: true, get: function () { return hyperLiquidAdapter_js_1.formatHyperLiquidSize; } });
39
- Object.defineProperty(exports, "calculateHip3AssetId", { enumerable: true, get: function () { return hyperLiquidAdapter_js_1.calculateHip3AssetId; } });
40
- Object.defineProperty(exports, "parseAssetName", { enumerable: true, get: function () { return hyperLiquidAdapter_js_1.parseAssetName; } });
41
- Object.defineProperty(exports, "adaptHyperLiquidLedgerUpdateToUserHistoryItem", { enumerable: true, get: function () { return hyperLiquidAdapter_js_1.adaptHyperLiquidLedgerUpdateToUserHistoryItem; } });
42
- __exportStar(require("./hyperLiquidOrderBookProcessor.cjs"), exports);
43
- __exportStar(require("./hyperLiquidValidation.cjs"), exports);
44
- __exportStar(require("./idUtils.cjs"), exports);
45
- __exportStar(require("./marketDataTransform.cjs"), exports);
46
- __exportStar(require("./marketSearch.cjs"), exports);
47
- __exportStar(require("./marketUtils.cjs"), exports);
48
- __exportStar(require("./orderCalculations.cjs"), exports);
49
- __exportStar(require("./orderTypes.cjs"), exports);
50
- __exportStar(require("./perpsDiskPersistence.cjs"), exports);
51
- __exportStar(require("./rewardsUtils.cjs"), exports);
52
- __exportStar(require("./significantFigures.cjs"), exports);
53
- __exportStar(require("./sortMarkets.cjs"), exports);
54
- __exportStar(require("./standaloneInfoClient.cjs"), exports);
55
- __exportStar(require("./stringParseUtils.cjs"), exports);
56
- __exportStar(require("./transferData.cjs"), exports);
57
- __exportStar(require("./wait.cjs"), exports);
58
- // Inline from former utils.ts (getEnvironment was previously at perps/utils.ts root)
59
- const getEnvironment = () => {
60
- const env = globalThis.process?.env?.NODE_ENV ?? 'production';
61
- return env === 'production' ? 'PROD' : 'DEV';
62
- };
63
- exports.getEnvironment = getEnvironment;
64
- __exportStar(require("./perpsFormatters.cjs"), exports);
65
- //# sourceMappingURL=index.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA;;;;;GAKG;AACH,qDAAkC;AAClC,mDAAgC;AAChC,mGAAmG;AACnG,kEAeiC;AAd/B,wHAAA,eAAe,OAAA;AACf,6HAAA,oBAAoB,OAAA;AACpB,0HAAA,iBAAiB,OAAA;AACjB,yIAAA,gCAAgC,OAAA;AAChC,mIAAA,0BAA0B,OAAA;AAC1B,qIAAA,4BAA4B,OAAA;AAC5B,2HAAA,kBAAkB,OAAA;AAClB,iIAAA,wBAAwB,OAAA;AACxB,0HAAA,iBAAiB,OAAA;AACjB,+HAAA,sBAAsB,OAAA;AACtB,8HAAA,qBAAqB,OAAA;AACrB,6HAAA,oBAAoB,OAAA;AACpB,uHAAA,cAAc,OAAA;AACd,sJAAA,6CAA6C,OAAA;AAE/C,sEAAmD;AACnD,8DAA2C;AAC3C,gDAA6B;AAC7B,4DAAyC;AACzC,qDAAkC;AAClC,oDAAiC;AACjC,0DAAuC;AACvC,mDAAgC;AAChC,6DAA0C;AAC1C,qDAAkC;AAClC,2DAAwC;AACxC,oDAAiC;AACjC,6DAA0C;AAC1C,yDAAsC;AACtC,qDAAkC;AAClC,6CAA0B;AAE1B,qFAAqF;AAC9E,MAAM,cAAc,GAAG,GAAmB,EAAE;IACjD,MAAM,GAAG,GAAG,UAAU,CAAC,OAAO,EAAE,GAAG,EAAE,QAAQ,IAAI,YAAY,CAAC;IAC9D,OAAO,GAAG,KAAK,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC;AAC/C,CAAC,CAAC;AAHW,QAAA,cAAc,kBAGzB;AACF,wDAAqC","sourcesContent":["/**\n * Barrel re-export for all portable utilities in controllers/utils/\n *\n * Note: hyperLiquidAdapter and orderCalculations both export calculatePositionSize.\n * We use selective exports to avoid the name collision.\n */\nexport * from './accountUtils.js';\nexport * from './errorUtils.js';\n// hyperLiquidAdapter: selective export to avoid calculatePositionSize clash with orderCalculations\nexport {\n adaptOrderToSDK,\n adaptPositionFromSDK,\n adaptOrderFromSDK,\n adaptPositionTriggerOrderFromSDK,\n adaptTpslLinkageToGrouping,\n adaptTriggerOrderTypeFromSDK,\n adaptMarketFromSDK,\n adaptAccountStateFromSDK,\n buildAssetMapping,\n formatHyperLiquidPrice,\n formatHyperLiquidSize,\n calculateHip3AssetId,\n parseAssetName,\n adaptHyperLiquidLedgerUpdateToUserHistoryItem,\n} from './hyperLiquidAdapter.js';\nexport * from './hyperLiquidOrderBookProcessor.js';\nexport * from './hyperLiquidValidation.js';\nexport * from './idUtils.js';\nexport * from './marketDataTransform.js';\nexport * from './marketSearch.js';\nexport * from './marketUtils.js';\nexport * from './orderCalculations.js';\nexport * from './orderTypes.js';\nexport * from './perpsDiskPersistence.js';\nexport * from './rewardsUtils.js';\nexport * from './significantFigures.js';\nexport * from './sortMarkets.js';\nexport * from './standaloneInfoClient.js';\nexport * from './stringParseUtils.js';\nexport * from './transferData.js';\nexport * from './wait.js';\n\n// Inline from former utils.ts (getEnvironment was previously at perps/utils.ts root)\nexport const getEnvironment = (): 'DEV' | 'PROD' => {\n const env = globalThis.process?.env?.NODE_ENV ?? 'production';\n return env === 'production' ? 'PROD' : 'DEV';\n};\nexport * from './perpsFormatters.js';\n"]}
@@ -1,28 +0,0 @@
1
- /**
2
- * Barrel re-export for all portable utilities in controllers/utils/
3
- *
4
- * Note: hyperLiquidAdapter and orderCalculations both export calculatePositionSize.
5
- * We use selective exports to avoid the name collision.
6
- */
7
- export * from "./accountUtils.cjs";
8
- export * from "./errorUtils.cjs";
9
- export { adaptOrderToSDK, adaptPositionFromSDK, adaptOrderFromSDK, adaptPositionTriggerOrderFromSDK, adaptTpslLinkageToGrouping, adaptTriggerOrderTypeFromSDK, adaptMarketFromSDK, adaptAccountStateFromSDK, buildAssetMapping, formatHyperLiquidPrice, formatHyperLiquidSize, calculateHip3AssetId, parseAssetName, adaptHyperLiquidLedgerUpdateToUserHistoryItem, } from "./hyperLiquidAdapter.cjs";
10
- export * from "./hyperLiquidOrderBookProcessor.cjs";
11
- export * from "./hyperLiquidValidation.cjs";
12
- export * from "./idUtils.cjs";
13
- export * from "./marketDataTransform.cjs";
14
- export * from "./marketSearch.cjs";
15
- export * from "./marketUtils.cjs";
16
- export * from "./orderCalculations.cjs";
17
- export * from "./orderTypes.cjs";
18
- export * from "./perpsDiskPersistence.cjs";
19
- export * from "./rewardsUtils.cjs";
20
- export * from "./significantFigures.cjs";
21
- export * from "./sortMarkets.cjs";
22
- export * from "./standaloneInfoClient.cjs";
23
- export * from "./stringParseUtils.cjs";
24
- export * from "./transferData.cjs";
25
- export * from "./wait.cjs";
26
- export declare const getEnvironment: () => 'DEV' | 'PROD';
27
- export * from "./perpsFormatters.cjs";
28
- //# sourceMappingURL=index.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,mCAAkC;AAClC,iCAAgC;AAEhC,OAAO,EACL,eAAe,EACf,oBAAoB,EACpB,iBAAiB,EACjB,gCAAgC,EAChC,0BAA0B,EAC1B,4BAA4B,EAC5B,kBAAkB,EAClB,wBAAwB,EACxB,iBAAiB,EACjB,sBAAsB,EACtB,qBAAqB,EACrB,oBAAoB,EACpB,cAAc,EACd,6CAA6C,GAC9C,iCAAgC;AACjC,oDAAmD;AACnD,4CAA2C;AAC3C,8BAA6B;AAC7B,0CAAyC;AACzC,mCAAkC;AAClC,kCAAiC;AACjC,wCAAuC;AACvC,iCAAgC;AAChC,2CAA0C;AAC1C,mCAAkC;AAClC,yCAAwC;AACxC,kCAAiC;AACjC,2CAA0C;AAC1C,uCAAsC;AACtC,mCAAkC;AAClC,2BAA0B;AAG1B,eAAO,MAAM,cAAc,QAAO,KAAK,GAAG,MAGzC,CAAC;AACF,sCAAqC"}