@metamask-previews/perps-controller 0.0.0-preview-e4aa1532 → 0.0.0-preview-6dfa4aeba

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 (498) hide show
  1. package/CHANGELOG.md +1 -11
  2. package/dist/PerpsController.cjs +66 -2224
  3. package/dist/PerpsController.cjs.map +1 -1
  4. package/dist/PerpsController.d.cts +79 -933
  5. package/dist/PerpsController.d.cts.map +1 -1
  6. package/dist/PerpsController.d.mts +79 -933
  7. package/dist/PerpsController.d.mts.map +1 -1
  8. package/dist/PerpsController.mjs +64 -2221
  9. package/dist/PerpsController.mjs.map +1 -1
  10. package/dist/index.cjs +1 -32
  11. package/dist/index.cjs.map +1 -1
  12. package/dist/index.d.cts +2 -6
  13. package/dist/index.d.cts.map +1 -1
  14. package/dist/index.d.mts +2 -6
  15. package/dist/index.d.mts.map +1 -1
  16. package/dist/index.mjs +1 -9
  17. package/dist/index.mjs.map +1 -1
  18. package/package.json +4 -19
  19. package/dist/__mocks__/hyperliquidMock.cjs +0 -68
  20. package/dist/__mocks__/hyperliquidMock.cjs.map +0 -1
  21. package/dist/__mocks__/hyperliquidMock.d.cts +0 -15
  22. package/dist/__mocks__/hyperliquidMock.d.cts.map +0 -1
  23. package/dist/__mocks__/hyperliquidMock.d.mts +0 -15
  24. package/dist/__mocks__/hyperliquidMock.d.mts.map +0 -1
  25. package/dist/__mocks__/hyperliquidMock.mjs +0 -65
  26. package/dist/__mocks__/hyperliquidMock.mjs.map +0 -1
  27. package/dist/__mocks__/providerMocks.cjs +0 -144
  28. package/dist/__mocks__/providerMocks.cjs.map +0 -1
  29. package/dist/__mocks__/providerMocks.d.cts +0 -44
  30. package/dist/__mocks__/providerMocks.d.cts.map +0 -1
  31. package/dist/__mocks__/providerMocks.d.mts +0 -44
  32. package/dist/__mocks__/providerMocks.d.mts.map +0 -1
  33. package/dist/__mocks__/providerMocks.mjs +0 -136
  34. package/dist/__mocks__/providerMocks.mjs.map +0 -1
  35. package/dist/__mocks__/serviceMocks.cjs +0 -187
  36. package/dist/__mocks__/serviceMocks.cjs.map +0 -1
  37. package/dist/__mocks__/serviceMocks.d.cts +0 -58
  38. package/dist/__mocks__/serviceMocks.d.cts.map +0 -1
  39. package/dist/__mocks__/serviceMocks.d.mts +0 -58
  40. package/dist/__mocks__/serviceMocks.d.mts.map +0 -1
  41. package/dist/__mocks__/serviceMocks.mjs +0 -180
  42. package/dist/__mocks__/serviceMocks.mjs.map +0 -1
  43. package/dist/aggregation/SubscriptionMultiplexer.cjs +0 -459
  44. package/dist/aggregation/SubscriptionMultiplexer.cjs.map +0 -1
  45. package/dist/aggregation/SubscriptionMultiplexer.d.cts +0 -222
  46. package/dist/aggregation/SubscriptionMultiplexer.d.cts.map +0 -1
  47. package/dist/aggregation/SubscriptionMultiplexer.d.mts +0 -222
  48. package/dist/aggregation/SubscriptionMultiplexer.d.mts.map +0 -1
  49. package/dist/aggregation/SubscriptionMultiplexer.mjs +0 -455
  50. package/dist/aggregation/SubscriptionMultiplexer.mjs.map +0 -1
  51. package/dist/aggregation/index.cjs +0 -9
  52. package/dist/aggregation/index.cjs.map +0 -1
  53. package/dist/aggregation/index.d.cts +0 -6
  54. package/dist/aggregation/index.d.cts.map +0 -1
  55. package/dist/aggregation/index.d.mts +0 -6
  56. package/dist/aggregation/index.d.mts.map +0 -1
  57. package/dist/aggregation/index.mjs +0 -5
  58. package/dist/aggregation/index.mjs.map +0 -1
  59. package/dist/constants/eventNames.cjs +0 -117
  60. package/dist/constants/eventNames.cjs.map +0 -1
  61. package/dist/constants/eventNames.d.cts +0 -106
  62. package/dist/constants/eventNames.d.cts.map +0 -1
  63. package/dist/constants/eventNames.d.mts +0 -106
  64. package/dist/constants/eventNames.d.mts.map +0 -1
  65. package/dist/constants/eventNames.mjs +0 -114
  66. package/dist/constants/eventNames.mjs.map +0 -1
  67. package/dist/constants/hyperLiquidConfig.cjs +0 -366
  68. package/dist/constants/hyperLiquidConfig.cjs.map +0 -1
  69. package/dist/constants/hyperLiquidConfig.d.cts +0 -276
  70. package/dist/constants/hyperLiquidConfig.d.cts.map +0 -1
  71. package/dist/constants/hyperLiquidConfig.d.mts +0 -276
  72. package/dist/constants/hyperLiquidConfig.d.mts.map +0 -1
  73. package/dist/constants/hyperLiquidConfig.mjs +0 -357
  74. package/dist/constants/hyperLiquidConfig.mjs.map +0 -1
  75. package/dist/constants/index.cjs +0 -23
  76. package/dist/constants/index.cjs.map +0 -1
  77. package/dist/constants/index.d.cts +0 -7
  78. package/dist/constants/index.d.cts.map +0 -1
  79. package/dist/constants/index.d.mts +0 -7
  80. package/dist/constants/index.d.mts.map +0 -1
  81. package/dist/constants/index.mjs +0 -7
  82. package/dist/constants/index.mjs.map +0 -1
  83. package/dist/constants/orderTypes.cjs +0 -31
  84. package/dist/constants/orderTypes.cjs.map +0 -1
  85. package/dist/constants/orderTypes.d.cts +0 -19
  86. package/dist/constants/orderTypes.d.cts.map +0 -1
  87. package/dist/constants/orderTypes.d.mts +0 -19
  88. package/dist/constants/orderTypes.d.mts.map +0 -1
  89. package/dist/constants/orderTypes.mjs +0 -27
  90. package/dist/constants/orderTypes.mjs.map +0 -1
  91. package/dist/constants/performanceMetrics.cjs +0 -61
  92. package/dist/constants/performanceMetrics.cjs.map +0 -1
  93. package/dist/constants/performanceMetrics.d.cts +0 -44
  94. package/dist/constants/performanceMetrics.d.cts.map +0 -1
  95. package/dist/constants/performanceMetrics.d.mts +0 -44
  96. package/dist/constants/performanceMetrics.d.mts.map +0 -1
  97. package/dist/constants/performanceMetrics.mjs +0 -58
  98. package/dist/constants/performanceMetrics.mjs.map +0 -1
  99. package/dist/constants/perpsConfig.cjs +0 -461
  100. package/dist/constants/perpsConfig.cjs.map +0 -1
  101. package/dist/constants/perpsConfig.d.cts +0 -343
  102. package/dist/constants/perpsConfig.d.cts.map +0 -1
  103. package/dist/constants/perpsConfig.d.mts +0 -343
  104. package/dist/constants/perpsConfig.d.mts.map +0 -1
  105. package/dist/constants/perpsConfig.mjs +0 -458
  106. package/dist/constants/perpsConfig.mjs.map +0 -1
  107. package/dist/constants/perpsErrorCodes.cjs +0 -79
  108. package/dist/constants/perpsErrorCodes.cjs.map +0 -1
  109. package/dist/constants/perpsErrorCodes.d.cts +0 -64
  110. package/dist/constants/perpsErrorCodes.d.cts.map +0 -1
  111. package/dist/constants/perpsErrorCodes.d.mts +0 -64
  112. package/dist/constants/perpsErrorCodes.d.mts.map +0 -1
  113. package/dist/constants/perpsErrorCodes.mjs +0 -76
  114. package/dist/constants/perpsErrorCodes.mjs.map +0 -1
  115. package/dist/platform-services/HyperLiquidClientService.cjs +0 -857
  116. package/dist/platform-services/HyperLiquidClientService.cjs.map +0 -1
  117. package/dist/platform-services/HyperLiquidClientService.d.cts +0 -263
  118. package/dist/platform-services/HyperLiquidClientService.d.cts.map +0 -1
  119. package/dist/platform-services/HyperLiquidClientService.d.mts +0 -263
  120. package/dist/platform-services/HyperLiquidClientService.d.mts.map +0 -1
  121. package/dist/platform-services/HyperLiquidClientService.mjs +0 -853
  122. package/dist/platform-services/HyperLiquidClientService.mjs.map +0 -1
  123. package/dist/platform-services/HyperLiquidSubscriptionService.cjs +0 -2170
  124. package/dist/platform-services/HyperLiquidSubscriptionService.cjs.map +0 -1
  125. package/dist/platform-services/HyperLiquidSubscriptionService.d.cts +0 -424
  126. package/dist/platform-services/HyperLiquidSubscriptionService.d.cts.map +0 -1
  127. package/dist/platform-services/HyperLiquidSubscriptionService.d.mts +0 -424
  128. package/dist/platform-services/HyperLiquidSubscriptionService.d.mts.map +0 -1
  129. package/dist/platform-services/HyperLiquidSubscriptionService.mjs +0 -2166
  130. package/dist/platform-services/HyperLiquidSubscriptionService.mjs.map +0 -1
  131. package/dist/platform-services/HyperLiquidWalletService.cjs +0 -140
  132. package/dist/platform-services/HyperLiquidWalletService.cjs.map +0 -1
  133. package/dist/platform-services/HyperLiquidWalletService.d.cts +0 -78
  134. package/dist/platform-services/HyperLiquidWalletService.d.cts.map +0 -1
  135. package/dist/platform-services/HyperLiquidWalletService.d.mts +0 -78
  136. package/dist/platform-services/HyperLiquidWalletService.d.mts.map +0 -1
  137. package/dist/platform-services/HyperLiquidWalletService.mjs +0 -136
  138. package/dist/platform-services/HyperLiquidWalletService.mjs.map +0 -1
  139. package/dist/providers/AggregatedPerpsProvider.cjs +0 -777
  140. package/dist/providers/AggregatedPerpsProvider.cjs.map +0 -1
  141. package/dist/providers/AggregatedPerpsProvider.d.cts +0 -466
  142. package/dist/providers/AggregatedPerpsProvider.d.cts.map +0 -1
  143. package/dist/providers/AggregatedPerpsProvider.d.mts +0 -466
  144. package/dist/providers/AggregatedPerpsProvider.d.mts.map +0 -1
  145. package/dist/providers/AggregatedPerpsProvider.mjs +0 -773
  146. package/dist/providers/AggregatedPerpsProvider.mjs.map +0 -1
  147. package/dist/providers/HyperLiquidProvider.cjs +0 -5172
  148. package/dist/providers/HyperLiquidProvider.cjs.map +0 -1
  149. package/dist/providers/HyperLiquidProvider.d.cts +0 -881
  150. package/dist/providers/HyperLiquidProvider.d.cts.map +0 -1
  151. package/dist/providers/HyperLiquidProvider.d.mts +0 -881
  152. package/dist/providers/HyperLiquidProvider.d.mts.map +0 -1
  153. package/dist/providers/HyperLiquidProvider.mjs +0 -5168
  154. package/dist/providers/HyperLiquidProvider.mjs.map +0 -1
  155. package/dist/providers/index.cjs +0 -11
  156. package/dist/providers/index.cjs.map +0 -1
  157. package/dist/providers/index.d.cts +0 -6
  158. package/dist/providers/index.d.cts.map +0 -1
  159. package/dist/providers/index.d.mts +0 -6
  160. package/dist/providers/index.d.mts.map +0 -1
  161. package/dist/providers/index.mjs +0 -6
  162. package/dist/providers/index.mjs.map +0 -1
  163. package/dist/routing/ProviderRouter.cjs +0 -148
  164. package/dist/routing/ProviderRouter.cjs.map +0 -1
  165. package/dist/routing/ProviderRouter.d.cts +0 -124
  166. package/dist/routing/ProviderRouter.d.cts.map +0 -1
  167. package/dist/routing/ProviderRouter.d.mts +0 -124
  168. package/dist/routing/ProviderRouter.d.mts.map +0 -1
  169. package/dist/routing/ProviderRouter.mjs +0 -144
  170. package/dist/routing/ProviderRouter.mjs.map +0 -1
  171. package/dist/routing/index.cjs +0 -9
  172. package/dist/routing/index.cjs.map +0 -1
  173. package/dist/routing/index.d.cts +0 -6
  174. package/dist/routing/index.d.cts.map +0 -1
  175. package/dist/routing/index.d.mts +0 -6
  176. package/dist/routing/index.d.mts.map +0 -1
  177. package/dist/routing/index.mjs +0 -5
  178. package/dist/routing/index.mjs.map +0 -1
  179. package/dist/selectors.cjs +0 -161
  180. package/dist/selectors.cjs.map +0 -1
  181. package/dist/selectors.d.cts +0 -345
  182. package/dist/selectors.d.cts.map +0 -1
  183. package/dist/selectors.d.mts +0 -345
  184. package/dist/selectors.d.mts.map +0 -1
  185. package/dist/selectors.mjs +0 -153
  186. package/dist/selectors.mjs.map +0 -1
  187. package/dist/services/AccountService.cjs +0 -313
  188. package/dist/services/AccountService.cjs.map +0 -1
  189. package/dist/services/AccountService.d.cts +0 -53
  190. package/dist/services/AccountService.d.cts.map +0 -1
  191. package/dist/services/AccountService.d.mts +0 -53
  192. package/dist/services/AccountService.d.mts.map +0 -1
  193. package/dist/services/AccountService.mjs +0 -309
  194. package/dist/services/AccountService.mjs.map +0 -1
  195. package/dist/services/DataLakeService.cjs +0 -219
  196. package/dist/services/DataLakeService.cjs.map +0 -1
  197. package/dist/services/DataLakeService.d.cts +0 -49
  198. package/dist/services/DataLakeService.d.cts.map +0 -1
  199. package/dist/services/DataLakeService.d.mts +0 -49
  200. package/dist/services/DataLakeService.d.mts.map +0 -1
  201. package/dist/services/DataLakeService.mjs +0 -215
  202. package/dist/services/DataLakeService.mjs.map +0 -1
  203. package/dist/services/DepositService.cjs +0 -96
  204. package/dist/services/DepositService.cjs.map +0 -1
  205. package/dist/services/DepositService.d.cts +0 -37
  206. package/dist/services/DepositService.d.cts.map +0 -1
  207. package/dist/services/DepositService.d.mts +0 -37
  208. package/dist/services/DepositService.d.mts.map +0 -1
  209. package/dist/services/DepositService.mjs +0 -92
  210. package/dist/services/DepositService.mjs.map +0 -1
  211. package/dist/services/EligibilityService.cjs +0 -156
  212. package/dist/services/EligibilityService.cjs.map +0 -1
  213. package/dist/services/EligibilityService.d.cts +0 -48
  214. package/dist/services/EligibilityService.d.cts.map +0 -1
  215. package/dist/services/EligibilityService.d.mts +0 -48
  216. package/dist/services/EligibilityService.d.mts.map +0 -1
  217. package/dist/services/EligibilityService.mjs +0 -152
  218. package/dist/services/EligibilityService.mjs.map +0 -1
  219. package/dist/services/FeatureFlagConfigurationService.cjs +0 -258
  220. package/dist/services/FeatureFlagConfigurationService.cjs.map +0 -1
  221. package/dist/services/FeatureFlagConfigurationService.d.cts +0 -100
  222. package/dist/services/FeatureFlagConfigurationService.d.cts.map +0 -1
  223. package/dist/services/FeatureFlagConfigurationService.d.mts +0 -100
  224. package/dist/services/FeatureFlagConfigurationService.d.mts.map +0 -1
  225. package/dist/services/FeatureFlagConfigurationService.mjs +0 -254
  226. package/dist/services/FeatureFlagConfigurationService.mjs.map +0 -1
  227. package/dist/services/MarketDataService.cjs +0 -875
  228. package/dist/services/MarketDataService.cjs.map +0 -1
  229. package/dist/services/MarketDataService.d.cts +0 -289
  230. package/dist/services/MarketDataService.d.cts.map +0 -1
  231. package/dist/services/MarketDataService.d.mts +0 -289
  232. package/dist/services/MarketDataService.d.mts.map +0 -1
  233. package/dist/services/MarketDataService.mjs +0 -871
  234. package/dist/services/MarketDataService.mjs.map +0 -1
  235. package/dist/services/RewardsIntegrationService.cjs +0 -94
  236. package/dist/services/RewardsIntegrationService.cjs.map +0 -1
  237. package/dist/services/RewardsIntegrationService.d.cts +0 -30
  238. package/dist/services/RewardsIntegrationService.d.cts.map +0 -1
  239. package/dist/services/RewardsIntegrationService.d.mts +0 -30
  240. package/dist/services/RewardsIntegrationService.d.mts.map +0 -1
  241. package/dist/services/RewardsIntegrationService.mjs +0 -90
  242. package/dist/services/RewardsIntegrationService.mjs.map +0 -1
  243. package/dist/services/ServiceContext.cjs +0 -3
  244. package/dist/services/ServiceContext.cjs.map +0 -1
  245. package/dist/services/ServiceContext.d.cts +0 -110
  246. package/dist/services/ServiceContext.d.cts.map +0 -1
  247. package/dist/services/ServiceContext.d.mts +0 -110
  248. package/dist/services/ServiceContext.d.mts.map +0 -1
  249. package/dist/services/ServiceContext.mjs +0 -2
  250. package/dist/services/ServiceContext.mjs.map +0 -1
  251. package/dist/services/TradingService.cjs +0 -1481
  252. package/dist/services/TradingService.cjs.map +0 -1
  253. package/dist/services/TradingService.d.cts +0 -308
  254. package/dist/services/TradingService.d.cts.map +0 -1
  255. package/dist/services/TradingService.d.mts +0 -308
  256. package/dist/services/TradingService.d.mts.map +0 -1
  257. package/dist/services/TradingService.mjs +0 -1477
  258. package/dist/services/TradingService.mjs.map +0 -1
  259. package/dist/services/index.cjs +0 -26
  260. package/dist/services/index.cjs.map +0 -1
  261. package/dist/services/index.d.cts +0 -11
  262. package/dist/services/index.d.cts.map +0 -1
  263. package/dist/services/index.d.mts +0 -11
  264. package/dist/services/index.d.mts.map +0 -1
  265. package/dist/services/index.mjs +0 -10
  266. package/dist/services/index.mjs.map +0 -1
  267. package/dist/services/utils.cjs +0 -16
  268. package/dist/services/utils.cjs.map +0 -1
  269. package/dist/services/utils.d.cts +0 -8
  270. package/dist/services/utils.d.cts.map +0 -1
  271. package/dist/services/utils.d.mts +0 -8
  272. package/dist/services/utils.d.mts.map +0 -1
  273. package/dist/services/utils.mjs +0 -12
  274. package/dist/services/utils.mjs.map +0 -1
  275. package/dist/types/chart.cjs +0 -42
  276. package/dist/types/chart.cjs.map +0 -1
  277. package/dist/types/chart.d.cts +0 -62
  278. package/dist/types/chart.d.cts.map +0 -1
  279. package/dist/types/chart.d.mts +0 -62
  280. package/dist/types/chart.d.mts.map +0 -1
  281. package/dist/types/chart.mjs +0 -39
  282. package/dist/types/chart.mjs.map +0 -1
  283. package/dist/types/hyperliquid-types.cjs +0 -3
  284. package/dist/types/hyperliquid-types.cjs.map +0 -1
  285. package/dist/types/hyperliquid-types.d.cts +0 -52
  286. package/dist/types/hyperliquid-types.d.cts.map +0 -1
  287. package/dist/types/hyperliquid-types.d.mts +0 -52
  288. package/dist/types/hyperliquid-types.d.mts.map +0 -1
  289. package/dist/types/hyperliquid-types.mjs +0 -2
  290. package/dist/types/hyperliquid-types.mjs.map +0 -1
  291. package/dist/types/index.cjs +0 -96
  292. package/dist/types/index.cjs.map +0 -1
  293. package/dist/types/index.d.cts +0 -1153
  294. package/dist/types/index.d.cts.map +0 -1
  295. package/dist/types/index.d.mts +0 -1153
  296. package/dist/types/index.d.mts.map +0 -1
  297. package/dist/types/index.mjs +0 -79
  298. package/dist/types/index.mjs.map +0 -1
  299. package/dist/types/transactionTypes.cjs +0 -28
  300. package/dist/types/transactionTypes.cjs.map +0 -1
  301. package/dist/types/transactionTypes.d.cts +0 -64
  302. package/dist/types/transactionTypes.d.cts.map +0 -1
  303. package/dist/types/transactionTypes.d.mts +0 -64
  304. package/dist/types/transactionTypes.d.mts.map +0 -1
  305. package/dist/types/transactionTypes.mjs +0 -23
  306. package/dist/types/transactionTypes.mjs.map +0 -1
  307. package/dist/utils/accountUtils.cjs +0 -65
  308. package/dist/utils/accountUtils.cjs.map +0 -1
  309. package/dist/utils/accountUtils.d.cts +0 -26
  310. package/dist/utils/accountUtils.d.cts.map +0 -1
  311. package/dist/utils/accountUtils.d.mts +0 -26
  312. package/dist/utils/accountUtils.d.mts.map +0 -1
  313. package/dist/utils/accountUtils.mjs +0 -61
  314. package/dist/utils/accountUtils.mjs.map +0 -1
  315. package/dist/utils/amountConversion.cjs +0 -61
  316. package/dist/utils/amountConversion.cjs.map +0 -1
  317. package/dist/utils/amountConversion.d.cts +0 -16
  318. package/dist/utils/amountConversion.d.cts.map +0 -1
  319. package/dist/utils/amountConversion.d.mts +0 -16
  320. package/dist/utils/amountConversion.d.mts.map +0 -1
  321. package/dist/utils/amountConversion.mjs +0 -54
  322. package/dist/utils/amountConversion.mjs.map +0 -1
  323. package/dist/utils/chartUtils.cjs +0 -98
  324. package/dist/utils/chartUtils.cjs.map +0 -1
  325. package/dist/utils/chartUtils.d.cts +0 -14
  326. package/dist/utils/chartUtils.d.cts.map +0 -1
  327. package/dist/utils/chartUtils.d.mts +0 -14
  328. package/dist/utils/chartUtils.d.mts.map +0 -1
  329. package/dist/utils/chartUtils.mjs +0 -94
  330. package/dist/utils/chartUtils.mjs.map +0 -1
  331. package/dist/utils/errorUtils.cjs +0 -22
  332. package/dist/utils/errorUtils.cjs.map +0 -1
  333. package/dist/utils/errorUtils.d.cts +0 -13
  334. package/dist/utils/errorUtils.d.cts.map +0 -1
  335. package/dist/utils/errorUtils.d.mts +0 -13
  336. package/dist/utils/errorUtils.d.mts.map +0 -1
  337. package/dist/utils/errorUtils.mjs +0 -18
  338. package/dist/utils/errorUtils.mjs.map +0 -1
  339. package/dist/utils/formatUtils.cjs +0 -987
  340. package/dist/utils/formatUtils.cjs.map +0 -1
  341. package/dist/utils/formatUtils.d.cts +0 -387
  342. package/dist/utils/formatUtils.d.cts.map +0 -1
  343. package/dist/utils/formatUtils.d.mts +0 -387
  344. package/dist/utils/formatUtils.d.mts.map +0 -1
  345. package/dist/utils/formatUtils.mjs +0 -966
  346. package/dist/utils/formatUtils.mjs.map +0 -1
  347. package/dist/utils/hyperLiquidAdapter.cjs +0 -454
  348. package/dist/utils/hyperLiquidAdapter.cjs.map +0 -1
  349. package/dist/utils/hyperLiquidAdapter.d.cts +0 -158
  350. package/dist/utils/hyperLiquidAdapter.d.cts.map +0 -1
  351. package/dist/utils/hyperLiquidAdapter.d.mts +0 -158
  352. package/dist/utils/hyperLiquidAdapter.d.mts.map +0 -1
  353. package/dist/utils/hyperLiquidAdapter.mjs +0 -439
  354. package/dist/utils/hyperLiquidAdapter.mjs.map +0 -1
  355. package/dist/utils/hyperLiquidOrderBookProcessor.cjs +0 -89
  356. package/dist/utils/hyperLiquidOrderBookProcessor.cjs.map +0 -1
  357. package/dist/utils/hyperLiquidOrderBookProcessor.d.cts +0 -58
  358. package/dist/utils/hyperLiquidOrderBookProcessor.d.cts.map +0 -1
  359. package/dist/utils/hyperLiquidOrderBookProcessor.d.mts +0 -58
  360. package/dist/utils/hyperLiquidOrderBookProcessor.d.mts.map +0 -1
  361. package/dist/utils/hyperLiquidOrderBookProcessor.mjs +0 -84
  362. package/dist/utils/hyperLiquidOrderBookProcessor.mjs.map +0 -1
  363. package/dist/utils/hyperLiquidValidation.cjs +0 -426
  364. package/dist/utils/hyperLiquidValidation.cjs.map +0 -1
  365. package/dist/utils/hyperLiquidValidation.d.cts +0 -143
  366. package/dist/utils/hyperLiquidValidation.d.cts.map +0 -1
  367. package/dist/utils/hyperLiquidValidation.d.mts +0 -143
  368. package/dist/utils/hyperLiquidValidation.d.mts.map +0 -1
  369. package/dist/utils/hyperLiquidValidation.mjs +0 -413
  370. package/dist/utils/hyperLiquidValidation.mjs.map +0 -1
  371. package/dist/utils/idUtils.cjs +0 -50
  372. package/dist/utils/idUtils.cjs.map +0 -1
  373. package/dist/utils/idUtils.d.cts +0 -38
  374. package/dist/utils/idUtils.d.cts.map +0 -1
  375. package/dist/utils/idUtils.d.mts +0 -38
  376. package/dist/utils/idUtils.d.mts.map +0 -1
  377. package/dist/utils/idUtils.mjs +0 -42
  378. package/dist/utils/idUtils.mjs.map +0 -1
  379. package/dist/utils/marginUtils.cjs +0 -137
  380. package/dist/utils/marginUtils.cjs.map +0 -1
  381. package/dist/utils/marginUtils.d.cts +0 -64
  382. package/dist/utils/marginUtils.d.cts.map +0 -1
  383. package/dist/utils/marginUtils.d.mts +0 -64
  384. package/dist/utils/marginUtils.d.mts.map +0 -1
  385. package/dist/utils/marginUtils.mjs +0 -131
  386. package/dist/utils/marginUtils.mjs.map +0 -1
  387. package/dist/utils/marketDataTransform.cjs +0 -227
  388. package/dist/utils/marketDataTransform.cjs.map +0 -1
  389. package/dist/utils/marketDataTransform.d.cts +0 -45
  390. package/dist/utils/marketDataTransform.d.cts.map +0 -1
  391. package/dist/utils/marketDataTransform.d.mts +0 -45
  392. package/dist/utils/marketDataTransform.d.mts.map +0 -1
  393. package/dist/utils/marketDataTransform.mjs +0 -220
  394. package/dist/utils/marketDataTransform.mjs.map +0 -1
  395. package/dist/utils/marketUtils.cjs +0 -420
  396. package/dist/utils/marketUtils.cjs.map +0 -1
  397. package/dist/utils/marketUtils.d.cts +0 -227
  398. package/dist/utils/marketUtils.d.cts.map +0 -1
  399. package/dist/utils/marketUtils.d.mts +0 -227
  400. package/dist/utils/marketUtils.d.mts.map +0 -1
  401. package/dist/utils/marketUtils.mjs +0 -404
  402. package/dist/utils/marketUtils.mjs.map +0 -1
  403. package/dist/utils/orderBookGrouping.cjs +0 -151
  404. package/dist/utils/orderBookGrouping.cjs.map +0 -1
  405. package/dist/utils/orderBookGrouping.d.cts +0 -76
  406. package/dist/utils/orderBookGrouping.d.cts.map +0 -1
  407. package/dist/utils/orderBookGrouping.d.mts +0 -76
  408. package/dist/utils/orderBookGrouping.d.mts.map +0 -1
  409. package/dist/utils/orderBookGrouping.mjs +0 -143
  410. package/dist/utils/orderBookGrouping.mjs.map +0 -1
  411. package/dist/utils/orderCalculations.cjs +0 -283
  412. package/dist/utils/orderCalculations.cjs.map +0 -1
  413. package/dist/utils/orderCalculations.d.cts +0 -107
  414. package/dist/utils/orderCalculations.d.cts.map +0 -1
  415. package/dist/utils/orderCalculations.d.mts +0 -107
  416. package/dist/utils/orderCalculations.d.mts.map +0 -1
  417. package/dist/utils/orderCalculations.mjs +0 -274
  418. package/dist/utils/orderCalculations.mjs.map +0 -1
  419. package/dist/utils/orderUtils.cjs +0 -159
  420. package/dist/utils/orderUtils.cjs.map +0 -1
  421. package/dist/utils/orderUtils.d.cts +0 -66
  422. package/dist/utils/orderUtils.d.cts.map +0 -1
  423. package/dist/utils/orderUtils.d.mts +0 -66
  424. package/dist/utils/orderUtils.d.mts.map +0 -1
  425. package/dist/utils/orderUtils.mjs +0 -151
  426. package/dist/utils/orderUtils.mjs.map +0 -1
  427. package/dist/utils/pnlCalculations.cjs +0 -107
  428. package/dist/utils/pnlCalculations.cjs.map +0 -1
  429. package/dist/utils/pnlCalculations.d.cts +0 -79
  430. package/dist/utils/pnlCalculations.d.cts.map +0 -1
  431. package/dist/utils/pnlCalculations.d.mts +0 -79
  432. package/dist/utils/pnlCalculations.d.mts.map +0 -1
  433. package/dist/utils/pnlCalculations.mjs +0 -97
  434. package/dist/utils/pnlCalculations.mjs.map +0 -1
  435. package/dist/utils/positionCalculations.cjs +0 -176
  436. package/dist/utils/positionCalculations.cjs.map +0 -1
  437. package/dist/utils/positionCalculations.d.cts +0 -85
  438. package/dist/utils/positionCalculations.d.cts.map +0 -1
  439. package/dist/utils/positionCalculations.d.mts +0 -85
  440. package/dist/utils/positionCalculations.d.mts.map +0 -1
  441. package/dist/utils/positionCalculations.mjs +0 -165
  442. package/dist/utils/positionCalculations.mjs.map +0 -1
  443. package/dist/utils/sortMarkets.cjs +0 -88
  444. package/dist/utils/sortMarkets.cjs.map +0 -1
  445. package/dist/utils/sortMarkets.d.cts +0 -21
  446. package/dist/utils/sortMarkets.d.cts.map +0 -1
  447. package/dist/utils/sortMarkets.d.mts +0 -21
  448. package/dist/utils/sortMarkets.d.mts.map +0 -1
  449. package/dist/utils/sortMarkets.mjs +0 -84
  450. package/dist/utils/sortMarkets.mjs.map +0 -1
  451. package/dist/utils/standaloneInfoClient.cjs +0 -34
  452. package/dist/utils/standaloneInfoClient.cjs.map +0 -1
  453. package/dist/utils/standaloneInfoClient.d.cts +0 -31
  454. package/dist/utils/standaloneInfoClient.d.cts.map +0 -1
  455. package/dist/utils/standaloneInfoClient.d.mts +0 -31
  456. package/dist/utils/standaloneInfoClient.d.mts.map +0 -1
  457. package/dist/utils/standaloneInfoClient.mjs +0 -30
  458. package/dist/utils/standaloneInfoClient.mjs.map +0 -1
  459. package/dist/utils/stringParseUtils.cjs +0 -49
  460. package/dist/utils/stringParseUtils.cjs.map +0 -1
  461. package/dist/utils/stringParseUtils.d.cts +0 -35
  462. package/dist/utils/stringParseUtils.d.cts.map +0 -1
  463. package/dist/utils/stringParseUtils.d.mts +0 -35
  464. package/dist/utils/stringParseUtils.d.mts.map +0 -1
  465. package/dist/utils/stringParseUtils.mjs +0 -44
  466. package/dist/utils/stringParseUtils.mjs.map +0 -1
  467. package/dist/utils/time.cjs +0 -37
  468. package/dist/utils/time.cjs.map +0 -1
  469. package/dist/utils/time.d.cts +0 -17
  470. package/dist/utils/time.d.cts.map +0 -1
  471. package/dist/utils/time.d.mts +0 -17
  472. package/dist/utils/time.d.mts.map +0 -1
  473. package/dist/utils/time.mjs +0 -33
  474. package/dist/utils/time.mjs.map +0 -1
  475. package/dist/utils/tpslValidation.cjs +0 -505
  476. package/dist/utils/tpslValidation.cjs.map +0 -1
  477. package/dist/utils/tpslValidation.d.cts +0 -182
  478. package/dist/utils/tpslValidation.d.cts.map +0 -1
  479. package/dist/utils/tpslValidation.d.mts +0 -182
  480. package/dist/utils/tpslValidation.d.mts.map +0 -1
  481. package/dist/utils/tpslValidation.mjs +0 -482
  482. package/dist/utils/tpslValidation.mjs.map +0 -1
  483. package/dist/utils/transactionUtils.cjs +0 -36
  484. package/dist/utils/transactionUtils.cjs.map +0 -1
  485. package/dist/utils/transactionUtils.d.cts +0 -17
  486. package/dist/utils/transactionUtils.d.cts.map +0 -1
  487. package/dist/utils/transactionUtils.d.mts +0 -17
  488. package/dist/utils/transactionUtils.d.mts.map +0 -1
  489. package/dist/utils/transactionUtils.mjs +0 -32
  490. package/dist/utils/transactionUtils.mjs.map +0 -1
  491. package/dist/utils/wait.cjs +0 -12
  492. package/dist/utils/wait.cjs.map +0 -1
  493. package/dist/utils/wait.d.cts +0 -8
  494. package/dist/utils/wait.d.cts.map +0 -1
  495. package/dist/utils/wait.d.mts +0 -8
  496. package/dist/utils/wait.d.mts.map +0 -1
  497. package/dist/utils/wait.mjs +0 -8
  498. 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,0EAIwC;AACxC,8DAAoE;AACpE,sEAAiE;AAUjE;;GAEG;AAEH;;;;;;GAMG;AACH,SAAgB,iBAAiB,CAE/B,KAAc,EAAE,eAAyB;IACzC,OAAO;QACL,GAAG,eAAe;QAClB,OAAO,EAAE,KAAK;QACd,KAAK,EACH,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,mCAAiB,CAAC,aAAa;KAC3E,CAAC;AACJ,CAAC;AATD,8CASC;AAED;;;;;;;;;GASG;AACH,SAAgB,wBAAwB,CACtC,MAIC,EACD,WAAmC;IAEnC,WAAW,EAAE,GAAG,CAAC,+CAA+C,EAAE;QAChE,MAAM;QACN,UAAU,EAAE,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC;QACnC,SAAS,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC;QACjC,cAAc,EAAE,OAAO,CAAC,MAAM,CAAC,WAAW,CAAC;KAC5C,CAAC,CAAC;IAEH,+BAA+B;IAC/B,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACpB,WAAW,EAAE,GAAG,CAAC,2CAA2C,EAAE;YAC5D,KAAK,EAAE,mCAAiB,CAAC,0BAA0B;YACnD,MAAM;SACP,CAAC,CAAC;QACH,OAAO;YACL,OAAO,EAAE,KAAK;YACd,KAAK,EAAE,mCAAiB,CAAC,0BAA0B;SACpD,CAAC;IACJ,CAAC;IAED,kBAAkB;IAClB,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;QACnB,WAAW,EAAE,GAAG,CAAC,0CAA0C,EAAE;YAC3D,KAAK,EAAE,mCAAiB,CAAC,wBAAwB;YACjD,MAAM;SACP,CAAC,CAAC;QACH,OAAO;YACL,OAAO,EAAE,KAAK;Y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AiB,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 } from '@metamask/utils';\n\nimport {\n HYPERLIQUID_ASSET_CONFIGS,\n getSupportedAssets,\n TRADING_DEFAULTS,\n} from '../constants/hyperLiquidConfig';\nimport { HYPERLIQUID_ORDER_LIMITS } from '../constants/perpsConfig';\nimport { PERPS_ERROR_CODES } from '../constants/perpsErrorCodes';\nimport type { GetSupportedPathsParams, PerpsDebugLogger } from '../types';\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 Response extends { success: boolean; error?: string },\n>(error: unknown, defaultResponse: Response): Response {\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?: `0x${string}`;\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 availableBalance - The available balance\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 availableBalance: number,\n debugLogger?: ValidationDebugLogger,\n): { isValid: boolean; error?: string } {\n debugLogger?.log('validateBalance: Checking balance sufficiency', {\n withdrawAmount,\n availableBalance,\n difference: availableBalance - withdrawAmount,\n });\n\n if (withdrawAmount > availableBalance) {\n const shortfall = withdrawAmount - availableBalance;\n\n debugLogger?.log('validateBalance: Insufficient balance', {\n error: PERPS_ERROR_CODES.WITHDRAW_INSUFFICIENT_BALANCE,\n withdrawAmount,\n availableBalance,\n shortfall,\n percentageOfAvailable: `${((withdrawAmount / availableBalance) * 100).toFixed(2)}%`,\n });\n\n return {\n isValid: false,\n error: PERPS_ERROR_CODES.WITHDRAW_INSUFFICIENT_BALANCE,\n };\n }\n\n const remainingBalance = availableBalance - withdrawAmount;\n debugLogger?.log('validateBalance: Balance is sufficient', {\n withdrawAmount,\n availableBalance,\n remainingBalance,\n percentageUsed: `${((withdrawAmount / availableBalance) * 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 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 (market or limit)\n * @returns Maximum order value in USD\n */\nexport function getMaxOrderValue(\n maxLeverage: number,\n orderType: 'market' | 'limit',\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 return orderType === 'limit'\n ? marketLimit * HYPERLIQUID_ORDER_LIMITS.LimitOrderMultiplier\n : marketLimit;\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 type (market or limit)\n * @returns Validation result with isValid flag and optional error message\n */\nexport function validateOrderParams(params: {\n coin?: string;\n size?: string;\n price?: string;\n orderType?: 'market' | 'limit';\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 // Require price for limit orders\n if (params.orderType === 'limit' && !params.price) {\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 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,143 +0,0 @@
1
- import type { CaipAssetId } from "@metamask/utils";
2
- import type { GetSupportedPathsParams, PerpsDebugLogger } from "../types/index.cjs";
3
- /**
4
- * Optional debug logger for validation functions.
5
- * When provided, enables detailed logging for debugging.
6
- * When omitted, validation runs silently.
7
- */
8
- export type ValidationDebugLogger = PerpsDebugLogger | undefined;
9
- /**
10
- * Validation utilities for HyperLiquid operations
11
- */
12
- /**
13
- * Create standardized error response.
14
- *
15
- * @param error - The error that occurred
16
- * @param defaultResponse - The default response object to use as template
17
- * @returns The error response with success=false and error message
18
- */
19
- export declare function createErrorResult<Response extends {
20
- success: boolean;
21
- error?: string;
22
- }>(error: unknown, defaultResponse: Response): Response;
23
- /**
24
- * Validate withdrawal parameters.
25
- *
26
- * @param params - Withdrawal parameters to validate
27
- * @param params.assetId - The CAIP asset ID to withdraw
28
- * @param params.amount - Amount to withdraw as string
29
- * @param params.destination - Optional destination hex address
30
- * @param debugLogger - Optional debug logger for detailed logging
31
- * @returns Validation result with isValid flag and optional error message
32
- */
33
- export declare function validateWithdrawalParams(params: {
34
- assetId?: CaipAssetId;
35
- amount?: string;
36
- destination?: `0x${string}`;
37
- }, debugLogger?: ValidationDebugLogger): {
38
- isValid: boolean;
39
- error?: string;
40
- };
41
- /**
42
- * Validate deposit parameters.
43
- *
44
- * @param params - Deposit parameters to validate
45
- * @param params.assetId - The CAIP asset ID to deposit
46
- * @param params.amount - Amount to deposit as string
47
- * @param params.isTestnet - Whether this is a testnet deposit
48
- * @param debugLogger - Optional debug logger for detailed logging
49
- * @returns Validation result with isValid flag and optional error message
50
- */
51
- export declare function validateDepositParams(params: {
52
- assetId?: CaipAssetId;
53
- amount?: string;
54
- isTestnet?: boolean;
55
- }, debugLogger?: ValidationDebugLogger): {
56
- isValid: boolean;
57
- error?: string;
58
- };
59
- /**
60
- * Validate asset support for withdrawals using AssetRoute arrays.
61
- *
62
- * @param assetId - The CAIP asset ID to validate
63
- * @param supportedRoutes - Array of supported asset routes
64
- * @param debugLogger - Optional debug logger for detailed logging
65
- * @returns Validation result with isValid flag and optional error message
66
- */
67
- export declare function validateAssetSupport(assetId: CaipAssetId, supportedRoutes: {
68
- assetId: CaipAssetId;
69
- }[], debugLogger?: ValidationDebugLogger): {
70
- isValid: boolean;
71
- error?: string;
72
- };
73
- /**
74
- * Validate balance against withdrawal amount.
75
- *
76
- * @param withdrawAmount - The amount to withdraw
77
- * @param availableBalance - The available balance
78
- * @param debugLogger - Optional debug logger for detailed logging
79
- * @returns Validation result with isValid flag and optional error message
80
- */
81
- export declare function validateBalance(withdrawAmount: number, availableBalance: number, debugLogger?: ValidationDebugLogger): {
82
- isValid: boolean;
83
- error?: string;
84
- };
85
- /**
86
- * Apply filters to asset paths with comprehensive logging.
87
- *
88
- * @param assets - Array of CAIP asset IDs to filter
89
- * @param params - Filter parameters including chainId, symbol, and assetId
90
- * @param debugLogger - Optional debug logger for detailed logging
91
- * @returns Filtered array of CAIP asset IDs
92
- */
93
- export declare function applyPathFilters(assets: CaipAssetId[], params?: GetSupportedPathsParams, debugLogger?: ValidationDebugLogger): CaipAssetId[];
94
- /**
95
- * Get supported deposit/withdrawal paths with filtering.
96
- *
97
- * @param params - Filter parameters including isTestnet, chainId, symbol
98
- * @param debugLogger - Optional debug logger for detailed logging
99
- * @returns Array of supported CAIP asset IDs
100
- */
101
- export declare function getSupportedPaths(params?: GetSupportedPathsParams, debugLogger?: ValidationDebugLogger): CaipAssetId[];
102
- /**
103
- * Get maximum order value based on leverage and order type.
104
- * Based on HyperLiquid contract specifications.
105
- *
106
- * @param maxLeverage - The maximum leverage for the market
107
- * @param orderType - The order type (market or limit)
108
- * @returns Maximum order value in USD
109
- */
110
- export declare function getMaxOrderValue(maxLeverage: number, orderType: 'market' | 'limit'): number;
111
- /**
112
- * Validate order parameters.
113
- * Basic validation - checks required fields are present.
114
- * Amount validation (size/USD) is handled by validateOrder.
115
- *
116
- * @param params - Order parameters to validate
117
- * @param params.coin - The trading pair coin symbol
118
- * @param params.size - The order size as string
119
- * @param params.price - The order price as string
120
- * @param params.orderType - The order type (market or limit)
121
- * @returns Validation result with isValid flag and optional error message
122
- */
123
- export declare function validateOrderParams(params: {
124
- coin?: string;
125
- size?: string;
126
- price?: string;
127
- orderType?: 'market' | 'limit';
128
- }): {
129
- isValid: boolean;
130
- error?: string;
131
- };
132
- /**
133
- * Validate coin exists in asset mapping.
134
- *
135
- * @param coin - The coin symbol to validate
136
- * @param coinToAssetId - Map of coin symbols to asset IDs
137
- * @returns Validation result with isValid flag and optional error message
138
- */
139
- export declare function validateCoinExists(coin: string, coinToAssetId: Map<string, number>): {
140
- isValid: boolean;
141
- error?: string;
142
- };
143
- //# sourceMappingURL=hyperLiquidValidation.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hyperLiquidValidation.d.cts","sourceRoot":"","sources":["../../src/utils/hyperLiquidValidation.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,wBAAwB;AASnD,OAAO,KAAK,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,2BAAiB;AAE1E;;;;GAIG;AACH,MAAM,MAAM,qBAAqB,GAAG,gBAAgB,GAAG,SAAS,CAAC;AAEjE;;GAEG;AAEH;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,QAAQ,SAAS;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,EACrD,KAAK,EAAE,OAAO,EAAE,eAAe,EAAE,QAAQ,GAAG,QAAQ,CAOrD;AAED;;;;;;;;;GASG;AACH,wBAAgB,wBAAwB,CACtC,MAAM,EAAE;IACN,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,KAAK,MAAM,EAAE,CAAC;CAC7B,EACD,WAAW,CAAC,EAAE,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5B,MAAM,CAgBR;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE;IAC1C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;CAChC,GAAG;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CA0BvC;AAED;;;;;;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,143 +0,0 @@
1
- import type { CaipAssetId } from "@metamask/utils";
2
- import type { GetSupportedPathsParams, PerpsDebugLogger } from "../types/index.mjs";
3
- /**
4
- * Optional debug logger for validation functions.
5
- * When provided, enables detailed logging for debugging.
6
- * When omitted, validation runs silently.
7
- */
8
- export type ValidationDebugLogger = PerpsDebugLogger | undefined;
9
- /**
10
- * Validation utilities for HyperLiquid operations
11
- */
12
- /**
13
- * Create standardized error response.
14
- *
15
- * @param error - The error that occurred
16
- * @param defaultResponse - The default response object to use as template
17
- * @returns The error response with success=false and error message
18
- */
19
- export declare function createErrorResult<Response extends {
20
- success: boolean;
21
- error?: string;
22
- }>(error: unknown, defaultResponse: Response): Response;
23
- /**
24
- * Validate withdrawal parameters.
25
- *
26
- * @param params - Withdrawal parameters to validate
27
- * @param params.assetId - The CAIP asset ID to withdraw
28
- * @param params.amount - Amount to withdraw as string
29
- * @param params.destination - Optional destination hex address
30
- * @param debugLogger - Optional debug logger for detailed logging
31
- * @returns Validation result with isValid flag and optional error message
32
- */
33
- export declare function validateWithdrawalParams(params: {
34
- assetId?: CaipAssetId;
35
- amount?: string;
36
- destination?: `0x${string}`;
37
- }, debugLogger?: ValidationDebugLogger): {
38
- isValid: boolean;
39
- error?: string;
40
- };
41
- /**
42
- * Validate deposit parameters.
43
- *
44
- * @param params - Deposit parameters to validate
45
- * @param params.assetId - The CAIP asset ID to deposit
46
- * @param params.amount - Amount to deposit as string
47
- * @param params.isTestnet - Whether this is a testnet deposit
48
- * @param debugLogger - Optional debug logger for detailed logging
49
- * @returns Validation result with isValid flag and optional error message
50
- */
51
- export declare function validateDepositParams(params: {
52
- assetId?: CaipAssetId;
53
- amount?: string;
54
- isTestnet?: boolean;
55
- }, debugLogger?: ValidationDebugLogger): {
56
- isValid: boolean;
57
- error?: string;
58
- };
59
- /**
60
- * Validate asset support for withdrawals using AssetRoute arrays.
61
- *
62
- * @param assetId - The CAIP asset ID to validate
63
- * @param supportedRoutes - Array of supported asset routes
64
- * @param debugLogger - Optional debug logger for detailed logging
65
- * @returns Validation result with isValid flag and optional error message
66
- */
67
- export declare function validateAssetSupport(assetId: CaipAssetId, supportedRoutes: {
68
- assetId: CaipAssetId;
69
- }[], debugLogger?: ValidationDebugLogger): {
70
- isValid: boolean;
71
- error?: string;
72
- };
73
- /**
74
- * Validate balance against withdrawal amount.
75
- *
76
- * @param withdrawAmount - The amount to withdraw
77
- * @param availableBalance - The available balance
78
- * @param debugLogger - Optional debug logger for detailed logging
79
- * @returns Validation result with isValid flag and optional error message
80
- */
81
- export declare function validateBalance(withdrawAmount: number, availableBalance: number, debugLogger?: ValidationDebugLogger): {
82
- isValid: boolean;
83
- error?: string;
84
- };
85
- /**
86
- * Apply filters to asset paths with comprehensive logging.
87
- *
88
- * @param assets - Array of CAIP asset IDs to filter
89
- * @param params - Filter parameters including chainId, symbol, and assetId
90
- * @param debugLogger - Optional debug logger for detailed logging
91
- * @returns Filtered array of CAIP asset IDs
92
- */
93
- export declare function applyPathFilters(assets: CaipAssetId[], params?: GetSupportedPathsParams, debugLogger?: ValidationDebugLogger): CaipAssetId[];
94
- /**
95
- * Get supported deposit/withdrawal paths with filtering.
96
- *
97
- * @param params - Filter parameters including isTestnet, chainId, symbol
98
- * @param debugLogger - Optional debug logger for detailed logging
99
- * @returns Array of supported CAIP asset IDs
100
- */
101
- export declare function getSupportedPaths(params?: GetSupportedPathsParams, debugLogger?: ValidationDebugLogger): CaipAssetId[];
102
- /**
103
- * Get maximum order value based on leverage and order type.
104
- * Based on HyperLiquid contract specifications.
105
- *
106
- * @param maxLeverage - The maximum leverage for the market
107
- * @param orderType - The order type (market or limit)
108
- * @returns Maximum order value in USD
109
- */
110
- export declare function getMaxOrderValue(maxLeverage: number, orderType: 'market' | 'limit'): number;
111
- /**
112
- * Validate order parameters.
113
- * Basic validation - checks required fields are present.
114
- * Amount validation (size/USD) is handled by validateOrder.
115
- *
116
- * @param params - Order parameters to validate
117
- * @param params.coin - The trading pair coin symbol
118
- * @param params.size - The order size as string
119
- * @param params.price - The order price as string
120
- * @param params.orderType - The order type (market or limit)
121
- * @returns Validation result with isValid flag and optional error message
122
- */
123
- export declare function validateOrderParams(params: {
124
- coin?: string;
125
- size?: string;
126
- price?: string;
127
- orderType?: 'market' | 'limit';
128
- }): {
129
- isValid: boolean;
130
- error?: string;
131
- };
132
- /**
133
- * Validate coin exists in asset mapping.
134
- *
135
- * @param coin - The coin symbol to validate
136
- * @param coinToAssetId - Map of coin symbols to asset IDs
137
- * @returns Validation result with isValid flag and optional error message
138
- */
139
- export declare function validateCoinExists(coin: string, coinToAssetId: Map<string, number>): {
140
- isValid: boolean;
141
- error?: string;
142
- };
143
- //# 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,wBAAwB;AASnD,OAAO,KAAK,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,2BAAiB;AAE1E;;;;GAIG;AACH,MAAM,MAAM,qB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