@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,357 +0,0 @@
1
- // ============================================================================
2
- // Network Constants
3
- // ============================================================================
4
- export const ARBITRUM_MAINNET_CHAIN_ID_HEX = '0xa4b1';
5
- export const ARBITRUM_MAINNET_CHAIN_ID = '42161';
6
- export const ARBITRUM_TESTNET_CHAIN_ID = '421614';
7
- export const ARBITRUM_MAINNET_CAIP_CHAIN_ID = `eip155:${ARBITRUM_MAINNET_CHAIN_ID}`;
8
- export const ARBITRUM_TESTNET_CAIP_CHAIN_ID = `eip155:${ARBITRUM_TESTNET_CHAIN_ID}`;
9
- // Hyperliquid chain constants
10
- export const HYPERLIQUID_MAINNET_CHAIN_ID = '0x3e7'; // 999 in decimal
11
- export const HYPERLIQUID_TESTNET_CHAIN_ID = '0x3e6'; // 998 in decimal (assumed)
12
- export const HYPERLIQUID_MAINNET_CAIP_CHAIN_ID = 'eip155:999';
13
- export const HYPERLIQUID_TESTNET_CAIP_CHAIN_ID = 'eip155:998';
14
- export const HYPERLIQUID_NETWORK_NAME = 'Hyperliquid';
15
- // ============================================================================
16
- // Token Constants
17
- // ============================================================================
18
- export const USDC_SYMBOL = 'USDC';
19
- export const USDC_NAME = 'USD Coin';
20
- export const USDC_DECIMALS = 6;
21
- export const TOKEN_DECIMALS = 18;
22
- export const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000';
23
- export const ZERO_BALANCE = '0x0';
24
- // Network constants
25
- export const ARBITRUM_SEPOLIA_CHAIN_ID = '0x66eee'; // 421614 in decimal
26
- // USDC token addresses
27
- export const USDC_ETHEREUM_MAINNET_ADDRESS = '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48';
28
- export const USDC_ARBITRUM_MAINNET_ADDRESS = '0xaf88d065e77c8cC2239327C5EDb3A432268e5831';
29
- export const USDC_ARBITRUM_TESTNET_ADDRESS = '0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d';
30
- // USDC token icon URL using MetaMask's official Token Icons API
31
- // Format: https://static.cx.metamask.io/api/v1/tokenIcons/{chainId}/{contractAddress}.png
32
- // This URL follows the same pattern used throughout MetaMask (bridges, swaps, etc.)
33
- export const USDC_TOKEN_ICON_URL = `https://static.cx.metamask.io/api/v1/tokenIcons/1/${USDC_ETHEREUM_MAINNET_ADDRESS}.png`;
34
- // ============================================================================
35
- // WebSocket Endpoints
36
- // ============================================================================
37
- export const HYPERLIQUID_ENDPOINTS = {
38
- mainnet: 'wss://api.hyperliquid.xyz/ws',
39
- testnet: 'wss://api.hyperliquid-testnet.xyz/ws',
40
- };
41
- // Asset icons base URL (HyperLiquid CDN - fallback source)
42
- export const HYPERLIQUID_ASSET_ICONS_BASE_URL = 'https://app.hyperliquid.xyz/coins/';
43
- // MetaMask-hosted Perps asset icons (primary source)
44
- // Assets uploaded to: https://github.com/MetaMask/contract-metadata/tree/master/icons/eip155:999
45
- // HIP-3 assets use format: hip3:dex_SYMBOL.svg (e.g., hip3:xyz_AAPL.svg)
46
- // Regular assets use format: SYMBOL.svg (e.g., BTC.svg)
47
- export const METAMASK_PERPS_ICONS_BASE_URL = 'https://raw.githubusercontent.com/MetaMask/contract-metadata/master/icons/eip155:999/';
48
- // ============================================================================
49
- // Asset Configurations
50
- // ============================================================================
51
- export const HYPERLIQUID_ASSET_CONFIGS = {
52
- usdc: {
53
- mainnet: `${ARBITRUM_MAINNET_CAIP_CHAIN_ID}/erc20:0xaf88d065e77c8cC2239327C5EDb3A432268e5831/default`,
54
- testnet: `${ARBITRUM_TESTNET_CAIP_CHAIN_ID}/erc20:0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d/default`,
55
- },
56
- };
57
- // HyperLiquid bridge contract addresses for direct USDC deposits
58
- // These are the official bridge contracts where USDC must be sent to credit user's HyperLiquid account
59
- export const HYPERLIQUID_BRIDGE_CONTRACTS = {
60
- mainnet: {
61
- chainId: ARBITRUM_MAINNET_CAIP_CHAIN_ID,
62
- contractAddress: '0x2df1c51e09aecf9cacb7bc98cb1742757f163df7',
63
- },
64
- testnet: {
65
- chainId: ARBITRUM_TESTNET_CAIP_CHAIN_ID,
66
- contractAddress: '0x08cfc1B6b2dCF36A1480b99353A354AA8AC56f89',
67
- },
68
- };
69
- // ============================================================================
70
- // SDK Transport Configuration
71
- // ============================================================================
72
- export const HYPERLIQUID_TRANSPORT_CONFIG = {
73
- timeout: 10000,
74
- keepAlive: { interval: 30000 },
75
- reconnect: {
76
- maxRetries: 5,
77
- connectionTimeout: 10000,
78
- },
79
- };
80
- // ============================================================================
81
- // Trading Configuration Constants
82
- // ============================================================================
83
- export const TRADING_DEFAULTS = {
84
- leverage: 3, // 3x default leverage
85
- marginPercent: 10, // 10% fixed margin default
86
- takeProfitPercent: 0.3, // 30% take profit
87
- stopLossPercent: 0.1, // 10% stop loss
88
- amount: {
89
- mainnet: 10, // $10 minimum order size
90
- testnet: 10, // $10 minimum order size
91
- },
92
- };
93
- // Fee configuration
94
- // Note: These are base rates (Tier 0, no discounts)
95
- // Actual fees will be calculated based on user's volume tier and staking
96
- export const FEE_RATES = {
97
- taker: 0.00045, // 0.045% - Market orders and aggressive limit orders
98
- maker: 0.00015, // 0.015% - Limit orders that add liquidity
99
- };
100
- // ============================================================================
101
- // HIP-3 Fee Configuration
102
- // ============================================================================
103
- /**
104
- * HIP-3 dynamic fee calculation configuration
105
- *
106
- * HIP-3 (builder-deployed) perpetual markets have variable fees based on:
107
- * 1. deployerFeeScale - Per-DEX fee multiplier (fetched from perpDexs API)
108
- * 2. growthMode - Per-asset 90% fee reduction (fetched from meta API)
109
- *
110
- * Fee Formula (from HyperLiquid docs):
111
- * - scaleIfHip3 = deployerFeeScale < 1 ? deployerFeeScale + 1 : deployerFeeScale * 2
112
- * - growthModeScale = growthMode ? 0.1 : 1
113
- * - finalRate = baseRate * scaleIfHip3 * growthModeScale
114
- *
115
- * Example: For xyz:TSLA with deployerFeeScale=1.0 and growthMode="enabled":
116
- * - scaleIfHip3 = 1.0 * 2 = 2.0
117
- * - growthModeScale = 0.1 (90% reduction)
118
- * - Final multiplier = 2.0 * 0.1 = 0.2 (effectively 80% off standard 2x HIP-3 fees)
119
- *
120
- * @see https://hyperliquid.gitbook.io/hyperliquid-docs/trading/fees#fee-formula-for-developers
121
- * @see parseAssetName() in HyperLiquidProvider for HIP-3 asset detection
122
- */
123
- export const HIP3_FEE_CONFIG = {
124
- /**
125
- * Growth Mode multiplier - 90% fee reduction for assets in growth phase
126
- * This is a protocol constant from HyperLiquid's fee formula
127
- */
128
- GrowthModeScale: 0.1,
129
- /**
130
- * Default deployerFeeScale when API is unavailable
131
- * Most HIP-3 DEXs use 1.0, which results in 2x base fees
132
- */
133
- DefaultDeployerFeeScale: 1.0,
134
- /**
135
- * Cache TTL for perpDexs data (5 minutes)
136
- * Fee scales rarely change, so longer cache is acceptable
137
- */
138
- PerpDexsCacheTtlMs: 5 * 60 * 1000,
139
- /**
140
- * @deprecated Use dynamic calculation via calculateHip3FeeMultiplier()
141
- * Kept for backwards compatibility during migration
142
- */
143
- FeeMultiplier: 2,
144
- };
145
- const BUILDER_FEE_MAX_FEE_DECIMAL = 0.001;
146
- // Builder fee configuration
147
- export const BUILDER_FEE_CONFIG = {
148
- // Test builder wallet
149
- TestnetBuilder: '0x724e57771ba749650875bd8adb2e29a85d0cacfa',
150
- // Production builder wallet
151
- MainnetBuilder: '0xe95a5e31904e005066614247d309e00d8ad753aa',
152
- // Fee in decimal (10 bp = 0.1%)
153
- MaxFeeDecimal: BUILDER_FEE_MAX_FEE_DECIMAL,
154
- MaxFeeTenthsBps: BUILDER_FEE_MAX_FEE_DECIMAL * 100000,
155
- MaxFeeRate: `${(BUILDER_FEE_MAX_FEE_DECIMAL * 100)
156
- .toFixed(4)
157
- .replace(/\.?0+$/u, '')}%`,
158
- };
159
- // Referral code configuration
160
- export const REFERRAL_CONFIG = {
161
- // Production referral code
162
- MainnetCode: 'MMCSI',
163
- // Development/testnet referral code
164
- TestnetCode: 'MMCSITEST',
165
- };
166
- // MetaMask fee for deposits (temporary placeholder)
167
- export const METAMASK_DEPOSIT_FEE = '$0.00';
168
- // Withdrawal fees
169
- export const HYPERLIQUID_WITHDRAWAL_FEE = 1; // $1 USD fixed fee
170
- export const METAMASK_WITHDRAWAL_FEE = 0; // $0 - no MM fee for withdrawals
171
- export const METAMASK_WITHDRAWAL_FEE_PLACEHOLDER = '$0.00'; // Display format
172
- // Withdrawal timing
173
- export const WITHDRAWAL_ESTIMATED_TIME = '5 minutes';
174
- // Order book spread constants
175
- export const ORDER_BOOK_SPREAD = {
176
- // Default bid/ask spread when real order book data is not available
177
- // This represents a 0.02% spread (2 basis points) which is typical for liquid markets
178
- DefaultBidMultiplier: 0.9999, // Bid price is 0.01% below current price
179
- DefaultAskMultiplier: 1.0001, // Ask price is 0.01% above current price
180
- };
181
- // Deposit constants
182
- export const DEPOSIT_CONFIG = {
183
- EstimatedGasLimit: 150000, // Estimated gas limit for bridge deposit
184
- DefaultSlippage: 1, // 1% default slippage for bridge quotes
185
- BridgeQuoteTimeout: 1000, // 1 second timeout for bridge quotes
186
- RefreshRate: 30000, // 30 seconds quote refresh rate
187
- EstimatedTime: {
188
- DirectDeposit: '3-5 seconds', // Direct USDC deposit on Arbitrum
189
- SameChainSwap: '30-60 seconds', // Swap on same chain before deposit
190
- },
191
- };
192
- // Withdrawal constants (HyperLiquid-specific)
193
- export const HYPERLIQUID_WITHDRAWAL_MINUTES = 5; // HyperLiquid withdrawal processing time in minutes
194
- export const HYPERLIQUID_WITHDRAWAL_PROGRESS_INTERVAL_MS = 30000; // 30 seconds progress update interval
195
- // ============================================================================
196
- // Configuration Helpers
197
- // ============================================================================
198
- export function getWebSocketEndpoint(isTestnet) {
199
- return isTestnet
200
- ? HYPERLIQUID_ENDPOINTS.testnet
201
- : HYPERLIQUID_ENDPOINTS.mainnet;
202
- }
203
- export function getChainId(isTestnet) {
204
- return isTestnet ? ARBITRUM_TESTNET_CHAIN_ID : ARBITRUM_MAINNET_CHAIN_ID;
205
- }
206
- export function getCaipChainId(isTestnet) {
207
- const network = isTestnet ? 'testnet' : 'mainnet';
208
- return HYPERLIQUID_BRIDGE_CONTRACTS[network].chainId;
209
- }
210
- export function getBridgeInfo(isTestnet) {
211
- const network = isTestnet ? 'testnet' : 'mainnet';
212
- return HYPERLIQUID_BRIDGE_CONTRACTS[network];
213
- }
214
- export function getSupportedAssets(isTestnet) {
215
- const network = isTestnet ? 'testnet' : 'mainnet';
216
- return Object.values(HYPERLIQUID_ASSET_CONFIGS).map((config) => config[network]);
217
- }
218
- // CAIP asset namespace constants
219
- export const CAIP_ASSET_NAMESPACES = {
220
- Erc20: 'erc20',
221
- };
222
- /**
223
- * HyperLiquid protocol-specific configuration
224
- * Contains constants specific to HyperLiquid's perps exchange
225
- */
226
- export const HYPERLIQUID_CONFIG = {
227
- // Exchange name used in predicted funding data
228
- // HyperLiquid uses 'HlPerp' as their perps exchange identifier
229
- ExchangeName: 'HlPerp',
230
- };
231
- /**
232
- * HIP-3 multi-DEX asset ID calculation constants
233
- * Per HIP-3-IMPLEMENTATION.md:
234
- * - Main DEX: assetId = index (0, 1, 2, ...)
235
- * - HIP-3 DEX: assetId = BASE_ASSET_ID + (perpDexIndex × DEX_MULTIPLIER) + index
236
- *
237
- * This formula enables proper order routing across multiple DEXs:
238
- * - Main DEX (perpDexIndex=0): Uses index directly (BTC=0, ETH=1, SOL=2, etc.)
239
- * - xyz DEX (perpDexIndex=1): 100000 + (1 × 10000) + index = 110000-110999
240
- * - abc DEX (perpDexIndex=2): 100000 + (2 × 10000) + index = 120000-120999
241
- *
242
- * Supports up to 10 HIP-3 DEXs with 10000 assets each.
243
- */
244
- export const HIP3_ASSET_ID_CONFIG = {
245
- // Base offset for HIP-3 asset IDs (100000)
246
- // Ensures HIP-3 asset IDs don't conflict with main DEX indices
247
- BaseAssetId: 100000,
248
- // Multiplier for DEX index in asset ID calculation (10000)
249
- // Allocates 10000 asset ID slots per DEX (0-9999)
250
- DexMultiplier: 10000,
251
- };
252
- /**
253
- * Basis points conversion constant
254
- * 1 basis point (bp) = 0.01% = 0.0001 as decimal
255
- * Used for fee discount calculations (e.g., 6500 bps = 65%)
256
- */
257
- export const BASIS_POINTS_DIVISOR = 10000;
258
- /**
259
- * HIP-3 asset market type classifications (PRODUCTION DEFAULT)
260
- *
261
- * This is the production default configuration, can be overridden via feature flag
262
- * (remoteFeatureFlags.perpsAssetMarketTypes) for dynamic control.
263
- *
264
- * Maps asset symbols (e.g., "xyz:TSLA") to their market type for badge display.
265
- *
266
- * Market type determines the badge shown in the UI:
267
- * - 'equity': STOCK badge (stocks like TSLA, NVDA)
268
- * - 'commodity': COMMODITY badge (commodities like GOLD)
269
- * - 'forex': FOREX badge (forex pairs)
270
- * - undefined: No badge for crypto or unmapped assets
271
- *
272
- * Format: 'dex:SYMBOL' → MarketType
273
- * This allows flexible per-asset classification.
274
- * Assets not listed here will have no market type (undefined).
275
- */
276
- export const HIP3_ASSET_MARKET_TYPES = {
277
- // xyz DEX - Equities
278
- 'xyz:TSLA': 'equity',
279
- 'xyz:NVDA': 'equity',
280
- 'xyz:XYZ100': 'equity',
281
- // xyz DEX - Commodities
282
- 'xyz:GOLD': 'commodity',
283
- 'xyz:SILVER': 'commodity',
284
- 'xyz:CL': 'commodity',
285
- 'xyz:COPPER': 'commodity',
286
- // Future asset mappings as xyz adds more markets
287
- };
288
- /**
289
- * Testnet-specific HIP-3 DEX configuration
290
- *
291
- * On testnet, there are many HIP-3 DEXs (test deployments from various builders).
292
- * Subscribing to all of them causes connection/subscription overload and instability.
293
- * This configuration limits which DEXs are discovered and subscribed to on testnet.
294
- *
295
- * On mainnet, full DEX discovery continues unchanged.
296
- */
297
- export const TESTNET_HIP3_CONFIG = {
298
- /**
299
- * Allowed DEX names for testnet
300
- * Empty array = main DEX only (no HIP-3 DEXs)
301
- * Add specific DEX names to test with particular HIP-3 DEXs: ['testdex1', 'testdex2']
302
- */
303
- EnabledDexs: ['xyz'],
304
- /**
305
- * Set to true to enable full HIP-3 discovery on testnet (not recommended)
306
- * When false, only DEXs in ENABLED_DEXS are used
307
- */
308
- AutoDiscoverAll: false,
309
- };
310
- /**
311
- * HIP-3 margin management configuration
312
- * Controls margin buffers and auto-rebalance behavior for HIP-3 DEXes with isolated margin
313
- *
314
- * Background: HyperLiquid validates availableBalance >= totalRequiredMargin BEFORE reallocating
315
- * existing locked margin. This requires temporary over-funding when increasing positions,
316
- * followed by automatic cleanup to minimize locked capital.
317
- */
318
- export const HIP3_MARGIN_CONFIG = {
319
- /**
320
- * Margin buffer multiplier for fees and slippage (0.3% = multiply by 1.003)
321
- * Covers HyperLiquid's max taker fee (0.035%) with comfortable margin
322
- */
323
- BufferMultiplier: 1.003,
324
- /**
325
- * Desired buffer to keep on HIP-3 DEX after auto-rebalance (USDC amount)
326
- * Small buffer allows quick follow-up orders without transfers
327
- */
328
- RebalanceDesiredBuffer: 0.1,
329
- /**
330
- * Minimum excess threshold to trigger auto-rebalance (USDC amount)
331
- * Prevents unnecessary transfers for tiny amounts
332
- */
333
- RebalanceMinThreshold: 0.1,
334
- };
335
- /**
336
- * Configuration for USDH collateral handling on HIP-3 DEXs
337
- * Per HyperLiquid docs: USDH DEXs pull collateral from spot balance automatically
338
- *
339
- * USDH is HyperLiquid's native stablecoin pegged 1:1 to USDC
340
- */
341
- export const USDH_CONFIG = {
342
- /** Token name for USDH collateral */
343
- TokenName: 'USDH',
344
- /**
345
- * Maximum slippage for USDC→USDH spot swap in basis points
346
- * USDH is pegged 1:1 to USDC so slippage should be minimal
347
- * 10 bps (0.1%) provides small buffer for spread
348
- */
349
- SwapSlippageBps: 10,
350
- };
351
- // Progress bar constants
352
- export const INITIAL_AMOUNT_UI_PROGRESS = 10;
353
- export const WITHDRAWAL_PROGRESS_STAGES = [
354
- 25, 35, 45, 55, 65, 75, 85, 90, 95, 98,
355
- ];
356
- export const PROGRESS_BAR_COMPLETION_DELAY_MS = 500;
357
- //# sourceMappingURL=hyperLiquidConfig.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hyperLiquidConfig.mjs","sourceRoot":"","sources":["../../src/constants/hyperL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AoB,GAAG,KAAK,CAAC;AAE1C;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAGhC;IACF,qBAAqB;IACrB,UAAU,EAAE,QAAQ;IACpB,UAAU,EAAE,QAAQ;IACpB,YAAY,EAAE,QAAQ;IAEtB,wBAAwB;IACxB,UAAU,EAAE,WAAW;IACvB,YAAY,EAAE,WAAW;IACzB,QAAQ,EAAE,WAAW;IACrB,YAAY,EAAE,WAAW;IAEzB,iDAAiD;CACzC,CAAC;AAEX;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC;;;;OAIG;IACH,WAAW,EAAE,CAAC,KAAK,CAAa;IAEhC;;;OAGG;IACH,eAAe,EAAE,KAAK;CACd,CAAC;AAEX;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC;;;OAGG;IACH,gBAAgB,EAAE,KAAK;IAEvB;;;OAGG;IACH,sBAAsB,EAAE,GAAG;IAE3B;;;OAGG;IACH,qBAAqB,EAAE,GAAG;CAClB,CAAC;AAEX;;;;;GAKG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,qCAAqC;IACrC,SAAS,EAAE,MAAM;IAEjB;;;;OAIG;IACH,eAAe,EAAE,EAAE;CACX,CAAC;AAEX,yBAAyB;AACzB,MAAM,CAAC,MAAM,0BAA0B,GAAG,EAAE,CAAC;AAC7C,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE;CACvC,CAAC;AACF,MAAM,CAAC,MAAM,gCAAgC,GAAG,GAAG,CAAC","sourcesContent":["import type { CaipAssetId, CaipChainId, Hex } from '@metamask/utils';\n\n// ============================================================================\n// HyperLiquid Configuration Types\n// ============================================================================\n\n// WebSocket endpoints type\nexport type HyperLiquidEndpoints = {\n mainnet: string;\n testnet: string;\n};\n\n// Asset configuration type\nexport type AssetNetworkConfig = {\n mainnet: CaipAssetId;\n testnet: CaipAssetId;\n};\n\nexport type HyperLiquidAssetConfigs = {\n usdc: AssetNetworkConfig;\n};\n\n// Bridge contract configuration type\nexport type BridgeContractConfig = {\n chainId: CaipChainId;\n contractAddress: Hex;\n};\n\nexport type HyperLiquidBridgeContracts = {\n mainnet: BridgeContractConfig;\n testnet: BridgeContractConfig;\n};\n\n// SDK transport configuration type\nexport type TransportReconnectConfig = {\n maxRetries: number;\n connectionTimeout: number;\n};\n\nexport type TransportKeepAliveConfig = {\n interval: number;\n};\n\nexport type HyperLiquidTransportConfig = {\n timeout: number;\n keepAlive: TransportKeepAliveConfig;\n reconnect: TransportReconnectConfig;\n};\n\n// Trading configuration type\nexport type TradingAmountConfig = {\n mainnet: number;\n testnet: number;\n};\n\nexport type TradingDefaultsConfig = {\n leverage: number;\n marginPercent: number;\n takeProfitPercent: number;\n stopLossPercent: number;\n amount: TradingAmountConfig;\n};\n\n// Fee configuration type\nexport type FeeRatesConfig = {\n taker: number;\n maker: number;\n};\n\n// Network type helper\nexport type HyperLiquidNetwork = 'mainnet' | 'testnet';\n\n// ============================================================================\n// Network Constants\n// ============================================================================\n\nexport const ARBITRUM_MAINNET_CHAIN_ID_HEX = '0xa4b1';\nexport const ARBITRUM_MAINNET_CHAIN_ID = '42161';\nexport const ARBITRUM_TESTNET_CHAIN_ID = '421614';\nexport const ARBITRUM_MAINNET_CAIP_CHAIN_ID = `eip155:${ARBITRUM_MAINNET_CHAIN_ID}`;\nexport const ARBITRUM_TESTNET_CAIP_CHAIN_ID = `eip155:${ARBITRUM_TESTNET_CHAIN_ID}`;\n\n// Hyperliquid chain constants\nexport const HYPERLIQUID_MAINNET_CHAIN_ID = '0x3e7'; // 999 in decimal\nexport const HYPERLIQUID_TESTNET_CHAIN_ID = '0x3e6'; // 998 in decimal (assumed)\nexport const HYPERLIQUID_MAINNET_CAIP_CHAIN_ID = 'eip155:999' as CaipChainId;\nexport const HYPERLIQUID_TESTNET_CAIP_CHAIN_ID = 'eip155:998' as CaipChainId;\nexport const HYPERLIQUID_NETWORK_NAME = 'Hyperliquid';\n\n// ============================================================================\n// Token Constants\n// ============================================================================\n\nexport const USDC_SYMBOL = 'USDC';\nexport const USDC_NAME = 'USD Coin';\nexport const USDC_DECIMALS = 6;\nexport const TOKEN_DECIMALS = 18;\nexport const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000';\nexport const ZERO_BALANCE = '0x0';\n\n// Network constants\nexport const ARBITRUM_SEPOLIA_CHAIN_ID = '0x66eee'; // 421614 in decimal\n\n// USDC token addresses\nexport const USDC_ETHEREUM_MAINNET_ADDRESS =\n '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48';\nexport const USDC_ARBITRUM_MAINNET_ADDRESS =\n '0xaf88d065e77c8cC2239327C5EDb3A432268e5831';\nexport const USDC_ARBITRUM_TESTNET_ADDRESS =\n '0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d';\n\n// USDC token icon URL using MetaMask's official Token Icons API\n// Format: https://static.cx.metamask.io/api/v1/tokenIcons/{chainId}/{contractAddress}.png\n// This URL follows the same pattern used throughout MetaMask (bridges, swaps, etc.)\nexport const USDC_TOKEN_ICON_URL = `https://static.cx.metamask.io/api/v1/tokenIcons/1/${USDC_ETHEREUM_MAINNET_ADDRESS}.png`;\n\n// ============================================================================\n// WebSocket Endpoints\n// ============================================================================\n\nexport const HYPERLIQUID_ENDPOINTS: HyperLiquidEndpoints = {\n mainnet: 'wss://api.hyperliquid.xyz/ws',\n testnet: 'wss://api.hyperliquid-testnet.xyz/ws',\n};\n\n// Asset icons base URL (HyperLiquid CDN - fallback source)\nexport const HYPERLIQUID_ASSET_ICONS_BASE_URL =\n 'https://app.hyperliquid.xyz/coins/';\n\n// MetaMask-hosted Perps asset icons (primary source)\n// Assets uploaded to: https://github.com/MetaMask/contract-metadata/tree/master/icons/eip155:999\n// HIP-3 assets use format: hip3:dex_SYMBOL.svg (e.g., hip3:xyz_AAPL.svg)\n// Regular assets use format: SYMBOL.svg (e.g., BTC.svg)\nexport const METAMASK_PERPS_ICONS_BASE_URL =\n 'https://raw.githubusercontent.com/MetaMask/contract-metadata/master/icons/eip155:999/';\n\n// ============================================================================\n// Asset Configurations\n// ============================================================================\n\nexport const HYPERLIQUID_ASSET_CONFIGS: HyperLiquidAssetConfigs = {\n usdc: {\n mainnet: `${ARBITRUM_MAINNET_CAIP_CHAIN_ID}/erc20:0xaf88d065e77c8cC2239327C5EDb3A432268e5831/default`,\n testnet: `${ARBITRUM_TESTNET_CAIP_CHAIN_ID}/erc20:0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d/default`,\n },\n};\n\n// HyperLiquid bridge contract addresses for direct USDC deposits\n// These are the official bridge contracts where USDC must be sent to credit user's HyperLiquid account\nexport const HYPERLIQUID_BRIDGE_CONTRACTS: HyperLiquidBridgeContracts = {\n mainnet: {\n chainId: ARBITRUM_MAINNET_CAIP_CHAIN_ID,\n contractAddress: '0x2df1c51e09aecf9cacb7bc98cb1742757f163df7',\n },\n testnet: {\n chainId: ARBITRUM_TESTNET_CAIP_CHAIN_ID,\n contractAddress: '0x08cfc1B6b2dCF36A1480b99353A354AA8AC56f89',\n },\n};\n\n// ============================================================================\n// SDK Transport Configuration\n// ============================================================================\n\nexport const HYPERLIQUID_TRANSPORT_CONFIG: HyperLiquidTransportConfig = {\n timeout: 10_000,\n keepAlive: { interval: 30_000 },\n reconnect: {\n maxRetries: 5,\n connectionTimeout: 10_000,\n },\n};\n\n// ============================================================================\n// Trading Configuration Constants\n// ============================================================================\n\nexport const TRADING_DEFAULTS: TradingDefaultsConfig = {\n leverage: 3, // 3x default leverage\n marginPercent: 10, // 10% fixed margin default\n takeProfitPercent: 0.3, // 30% take profit\n stopLossPercent: 0.1, // 10% stop loss\n amount: {\n mainnet: 10, // $10 minimum order size\n testnet: 10, // $10 minimum order size\n },\n};\n\n// Fee configuration\n// Note: These are base rates (Tier 0, no discounts)\n// Actual fees will be calculated based on user's volume tier and staking\nexport const FEE_RATES: FeeRatesConfig = {\n taker: 0.00045, // 0.045% - Market orders and aggressive limit orders\n maker: 0.00015, // 0.015% - Limit orders that add liquidity\n};\n\n// ============================================================================\n// HIP-3 Fee Configuration\n// ============================================================================\n\n/**\n * HIP-3 dynamic fee calculation configuration\n *\n * HIP-3 (builder-deployed) perpetual markets have variable fees based on:\n * 1. deployerFeeScale - Per-DEX fee multiplier (fetched from perpDexs API)\n * 2. growthMode - Per-asset 90% fee reduction (fetched from meta API)\n *\n * Fee Formula (from HyperLiquid docs):\n * - scaleIfHip3 = deployerFeeScale < 1 ? deployerFeeScale + 1 : deployerFeeScale * 2\n * - growthModeScale = growthMode ? 0.1 : 1\n * - finalRate = baseRate * scaleIfHip3 * growthModeScale\n *\n * Example: For xyz:TSLA with deployerFeeScale=1.0 and growthMode=\"enabled\":\n * - scaleIfHip3 = 1.0 * 2 = 2.0\n * - growthModeScale = 0.1 (90% reduction)\n * - Final multiplier = 2.0 * 0.1 = 0.2 (effectively 80% off standard 2x HIP-3 fees)\n *\n * @see https://hyperliquid.gitbook.io/hyperliquid-docs/trading/fees#fee-formula-for-developers\n * @see parseAssetName() in HyperLiquidProvider for HIP-3 asset detection\n */\nexport const HIP3_FEE_CONFIG = {\n /**\n * Growth Mode multiplier - 90% fee reduction for assets in growth phase\n * This is a protocol constant from HyperLiquid's fee formula\n */\n GrowthModeScale: 0.1,\n\n /**\n * Default deployerFeeScale when API is unavailable\n * Most HIP-3 DEXs use 1.0, which results in 2x base fees\n */\n DefaultDeployerFeeScale: 1.0,\n\n /**\n * Cache TTL for perpDexs data (5 minutes)\n * Fee scales rarely change, so longer cache is acceptable\n */\n PerpDexsCacheTtlMs: 5 * 60 * 1000,\n\n /**\n * @deprecated Use dynamic calculation via calculateHip3FeeMultiplier()\n * Kept for backwards compatibility during migration\n */\n FeeMultiplier: 2,\n} as const;\n\nconst BUILDER_FEE_MAX_FEE_DECIMAL = 0.001;\n\n// Builder fee configuration\nexport const BUILDER_FEE_CONFIG = {\n // Test builder wallet\n TestnetBuilder: '0x724e57771ba749650875bd8adb2e29a85d0cacfa' as Hex,\n // Production builder wallet\n MainnetBuilder: '0xe95a5e31904e005066614247d309e00d8ad753aa' as Hex,\n // Fee in decimal (10 bp = 0.1%)\n MaxFeeDecimal: BUILDER_FEE_MAX_FEE_DECIMAL,\n MaxFeeTenthsBps: BUILDER_FEE_MAX_FEE_DECIMAL * 100000,\n MaxFeeRate: `${(BUILDER_FEE_MAX_FEE_DECIMAL * 100)\n .toFixed(4)\n .replace(/\\.?0+$/u, '')}%`,\n};\n\n// Referral code configuration\nexport const REFERRAL_CONFIG = {\n // Production referral code\n MainnetCode: 'MMCSI',\n // Development/testnet referral code\n TestnetCode: 'MMCSITEST',\n};\n\n// MetaMask fee for deposits (temporary placeholder)\nexport const METAMASK_DEPOSIT_FEE = '$0.00';\n\n// Withdrawal fees\nexport const HYPERLIQUID_WITHDRAWAL_FEE = 1; // $1 USD fixed fee\nexport const METAMASK_WITHDRAWAL_FEE = 0; // $0 - no MM fee for withdrawals\nexport const METAMASK_WITHDRAWAL_FEE_PLACEHOLDER = '$0.00'; // Display format\n\n// Withdrawal timing\nexport const WITHDRAWAL_ESTIMATED_TIME = '5 minutes';\n\n// Order book spread constants\nexport const ORDER_BOOK_SPREAD = {\n // Default bid/ask spread when real order book data is not available\n // This represents a 0.02% spread (2 basis points) which is typical for liquid markets\n DefaultBidMultiplier: 0.9999, // Bid price is 0.01% below current price\n DefaultAskMultiplier: 1.0001, // Ask price is 0.01% above current price\n};\n\n// Deposit constants\nexport const DEPOSIT_CONFIG = {\n EstimatedGasLimit: 150000, // Estimated gas limit for bridge deposit\n DefaultSlippage: 1, // 1% default slippage for bridge quotes\n BridgeQuoteTimeout: 1000, // 1 second timeout for bridge quotes\n RefreshRate: 30000, // 30 seconds quote refresh rate\n EstimatedTime: {\n DirectDeposit: '3-5 seconds', // Direct USDC deposit on Arbitrum\n SameChainSwap: '30-60 seconds', // Swap on same chain before deposit\n },\n};\n\n// Withdrawal constants (HyperLiquid-specific)\nexport const HYPERLIQUID_WITHDRAWAL_MINUTES = 5; // HyperLiquid withdrawal processing time in minutes\nexport const HYPERLIQUID_WITHDRAWAL_PROGRESS_INTERVAL_MS = 30000; // 30 seconds progress update interval\n\n// Type helpers\nexport type SupportedAsset = keyof typeof HYPERLIQUID_ASSET_CONFIGS;\n\n// ============================================================================\n// Configuration Helpers\n// ============================================================================\n\nexport function getWebSocketEndpoint(isTestnet: boolean): string {\n return isTestnet\n ? HYPERLIQUID_ENDPOINTS.testnet\n : HYPERLIQUID_ENDPOINTS.mainnet;\n}\n\nexport function getChainId(isTestnet: boolean): string {\n return isTestnet ? ARBITRUM_TESTNET_CHAIN_ID : ARBITRUM_MAINNET_CHAIN_ID;\n}\n\nexport function getCaipChainId(isTestnet: boolean): CaipChainId {\n const network: HyperLiquidNetwork = isTestnet ? 'testnet' : 'mainnet';\n return HYPERLIQUID_BRIDGE_CONTRACTS[network].chainId;\n}\n\nexport function getBridgeInfo(isTestnet: boolean): BridgeContractConfig {\n const network: HyperLiquidNetwork = isTestnet ? 'testnet' : 'mainnet';\n return HYPERLIQUID_BRIDGE_CONTRACTS[network];\n}\n\nexport function getSupportedAssets(isTestnet?: boolean): CaipAssetId[] {\n const network = isTestnet ? 'testnet' : 'mainnet';\n return Object.values(HYPERLIQUID_ASSET_CONFIGS).map(\n (config) => config[network],\n );\n}\n\n// CAIP asset namespace constants\nexport const CAIP_ASSET_NAMESPACES = {\n Erc20: 'erc20',\n} as const;\n\n/**\n * HyperLiquid protocol-specific configuration\n * Contains constants specific to HyperLiquid's perps exchange\n */\nexport const HYPERLIQUID_CONFIG = {\n // Exchange name used in predicted funding data\n // HyperLiquid uses 'HlPerp' as their perps exchange identifier\n ExchangeName: 'HlPerp',\n} as const;\n\n/**\n * HIP-3 multi-DEX asset ID calculation constants\n * Per HIP-3-IMPLEMENTATION.md:\n * - Main DEX: assetId = index (0, 1, 2, ...)\n * - HIP-3 DEX: assetId = BASE_ASSET_ID + (perpDexIndex × DEX_MULTIPLIER) + index\n *\n * This formula enables proper order routing across multiple DEXs:\n * - Main DEX (perpDexIndex=0): Uses index directly (BTC=0, ETH=1, SOL=2, etc.)\n * - xyz DEX (perpDexIndex=1): 100000 + (1 × 10000) + index = 110000-110999\n * - abc DEX (perpDexIndex=2): 100000 + (2 × 10000) + index = 120000-120999\n *\n * Supports up to 10 HIP-3 DEXs with 10000 assets each.\n */\nexport const HIP3_ASSET_ID_CONFIG = {\n // Base offset for HIP-3 asset IDs (100000)\n // Ensures HIP-3 asset IDs don't conflict with main DEX indices\n BaseAssetId: 100000,\n\n // Multiplier for DEX index in asset ID calculation (10000)\n // Allocates 10000 asset ID slots per DEX (0-9999)\n DexMultiplier: 10000,\n} as const;\n\n/**\n * Basis points conversion constant\n * 1 basis point (bp) = 0.01% = 0.0001 as decimal\n * Used for fee discount calculations (e.g., 6500 bps = 65%)\n */\nexport const BASIS_POINTS_DIVISOR = 10000;\n\n/**\n * HIP-3 asset market type classifications (PRODUCTION DEFAULT)\n *\n * This is the production default configuration, can be overridden via feature flag\n * (remoteFeatureFlags.perpsAssetMarketTypes) for dynamic control.\n *\n * Maps asset symbols (e.g., \"xyz:TSLA\") to their market type for badge display.\n *\n * Market type determines the badge shown in the UI:\n * - 'equity': STOCK badge (stocks like TSLA, NVDA)\n * - 'commodity': COMMODITY badge (commodities like GOLD)\n * - 'forex': FOREX badge (forex pairs)\n * - undefined: No badge for crypto or unmapped assets\n *\n * Format: 'dex:SYMBOL' → MarketType\n * This allows flexible per-asset classification.\n * Assets not listed here will have no market type (undefined).\n */\nexport const HIP3_ASSET_MARKET_TYPES: Record<\n string,\n 'equity' | 'commodity' | 'forex' | 'crypto'\n> = {\n // xyz DEX - Equities\n 'xyz:TSLA': 'equity',\n 'xyz:NVDA': 'equity',\n 'xyz:XYZ100': 'equity',\n\n // xyz DEX - Commodities\n 'xyz:GOLD': 'commodity',\n 'xyz:SILVER': 'commodity',\n 'xyz:CL': 'commodity',\n 'xyz:COPPER': 'commodity',\n\n // Future asset mappings as xyz adds more markets\n} as const;\n\n/**\n * Testnet-specific HIP-3 DEX configuration\n *\n * On testnet, there are many HIP-3 DEXs (test deployments from various builders).\n * Subscribing to all of them causes connection/subscription overload and instability.\n * This configuration limits which DEXs are discovered and subscribed to on testnet.\n *\n * On mainnet, full DEX discovery continues unchanged.\n */\nexport const TESTNET_HIP3_CONFIG = {\n /**\n * Allowed DEX names for testnet\n * Empty array = main DEX only (no HIP-3 DEXs)\n * Add specific DEX names to test with particular HIP-3 DEXs: ['testdex1', 'testdex2']\n */\n EnabledDexs: ['xyz'] as string[],\n\n /**\n * Set to true to enable full HIP-3 discovery on testnet (not recommended)\n * When false, only DEXs in ENABLED_DEXS are used\n */\n AutoDiscoverAll: false,\n} as const;\n\n/**\n * HIP-3 margin management configuration\n * Controls margin buffers and auto-rebalance behavior for HIP-3 DEXes with isolated margin\n *\n * Background: HyperLiquid validates availableBalance >= totalRequiredMargin BEFORE reallocating\n * existing locked margin. This requires temporary over-funding when increasing positions,\n * followed by automatic cleanup to minimize locked capital.\n */\nexport const HIP3_MARGIN_CONFIG = {\n /**\n * Margin buffer multiplier for fees and slippage (0.3% = multiply by 1.003)\n * Covers HyperLiquid's max taker fee (0.035%) with comfortable margin\n */\n BufferMultiplier: 1.003,\n\n /**\n * Desired buffer to keep on HIP-3 DEX after auto-rebalance (USDC amount)\n * Small buffer allows quick follow-up orders without transfers\n */\n RebalanceDesiredBuffer: 0.1,\n\n /**\n * Minimum excess threshold to trigger auto-rebalance (USDC amount)\n * Prevents unnecessary transfers for tiny amounts\n */\n RebalanceMinThreshold: 0.1,\n} as const;\n\n/**\n * Configuration for USDH collateral handling on HIP-3 DEXs\n * Per HyperLiquid docs: USDH DEXs pull collateral from spot balance automatically\n *\n * USDH is HyperLiquid's native stablecoin pegged 1:1 to USDC\n */\nexport const USDH_CONFIG = {\n /** Token name for USDH collateral */\n TokenName: 'USDH',\n\n /**\n * Maximum slippage for USDC→USDH spot swap in basis points\n * USDH is pegged 1:1 to USDC so slippage should be minimal\n * 10 bps (0.1%) provides small buffer for spread\n */\n SwapSlippageBps: 10,\n} as const;\n\n// Progress bar constants\nexport const INITIAL_AMOUNT_UI_PROGRESS = 10;\nexport const WITHDRAWAL_PROGRESS_STAGES = [\n 25, 35, 45, 55, 65, 75, 85, 90, 95, 98,\n];\nexport const PROGRESS_BAR_COMPLETION_DELAY_MS = 500;\n"]}
@@ -1,23 +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
- __exportStar(require("./perpsConfig.cjs"), exports);
18
- __exportStar(require("./hyperLiquidConfig.cjs"), exports);
19
- __exportStar(require("./perpsErrorCodes.cjs"), exports);
20
- __exportStar(require("./performanceMetrics.cjs"), exports);
21
- __exportStar(require("./eventNames.cjs"), exports);
22
- __exportStar(require("./orderTypes.cjs"), exports);
23
- //# sourceMappingURL=index.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../src/constants/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAA8B;AAC9B,0DAAoC;AACpC,wDAAkC;AAClC,2DAAqC;AACrC,mDAA6B;AAC7B,mDAA6B","sourcesContent":["export * from './perpsConfig';\nexport * from './hyperLiquidConfig';\nexport * from './perpsErrorCodes';\nexport * from './performanceMetrics';\nexport * from './eventNames';\nexport * from './orderTypes';\n"]}
@@ -1,7 +0,0 @@
1
- export * from "./perpsConfig.cjs";
2
- export * from "./hyperLiquidConfig.cjs";
3
- export * from "./perpsErrorCodes.cjs";
4
- export * from "./performanceMetrics.cjs";
5
- export * from "./eventNames.cjs";
6
- export * from "./orderTypes.cjs";
7
- //# sourceMappingURL=index.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../src/constants/index.ts"],"names":[],"mappings":"AAAA,kCAA8B;AAC9B,wCAAoC;AACpC,sCAAkC;AAClC,yCAAqC;AACrC,iCAA6B;AAC7B,iCAA6B"}
@@ -1,7 +0,0 @@
1
- export * from "./perpsConfig.mjs";
2
- export * from "./hyperLiquidConfig.mjs";
3
- export * from "./perpsErrorCodes.mjs";
4
- export * from "./performanceMetrics.mjs";
5
- export * from "./eventNames.mjs";
6
- export * from "./orderTypes.mjs";
7
- //# sourceMappingURL=index.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/constants/index.ts"],"names":[],"mappings":"AAAA,kCAA8B;AAC9B,wCAAoC;AACpC,sCAAkC;AAClC,yCAAqC;AACrC,iCAA6B;AAC7B,iCAA6B"}
@@ -1,7 +0,0 @@
1
- export * from "./perpsConfig.mjs";
2
- export * from "./hyperLiquidConfig.mjs";
3
- export * from "./perpsErrorCodes.mjs";
4
- export * from "./performanceMetrics.mjs";
5
- export * from "./eventNames.mjs";
6
- export * from "./orderTypes.mjs";
7
- //# sourceMappingURL=index.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/constants/index.ts"],"names":[],"mappings":"AAAA,kCAA8B;AAC9B,wCAAoC;AACpC,sCAAkC;AAClC,yCAAqC;AACrC,iCAA6B;AAC7B,iCAA6B","sourcesContent":["export * from './perpsConfig';\nexport * from './hyperLiquidConfig';\nexport * from './perpsErrorCodes';\nexport * from './performanceMetrics';\nexport * from './eventNames';\nexport * from './orderTypes';\n"]}
@@ -1,31 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isTPSLOrder = exports.DETAILED_ORDER_TYPES = void 0;
4
- /**
5
- * Detailed order types from HyperLiquid API
6
- */
7
- exports.DETAILED_ORDER_TYPES = {
8
- LIMIT: 'Limit',
9
- MARKET: 'Market',
10
- STOP_LIMIT: 'Stop Limit',
11
- STOP_MARKET: 'Stop Market',
12
- TAKE_PROFIT_LIMIT: 'Take Profit Limit',
13
- TAKE_PROFIT_MARKET: 'Take Profit Market',
14
- };
15
- /**
16
- * Check if an order type is a TP/SL order.
17
- *
18
- * @param detailedOrderType - The detailed order type string
19
- * @returns True if the order type is a TP/SL order
20
- */
21
- const isTPSLOrder = (detailedOrderType) => {
22
- if (!detailedOrderType) {
23
- return false;
24
- }
25
- return (detailedOrderType === exports.DETAILED_ORDER_TYPES.STOP_LIMIT ||
26
- detailedOrderType === exports.DETAILED_ORDER_TYPES.STOP_MARKET ||
27
- detailedOrderType === exports.DETAILED_ORDER_TYPES.TAKE_PROFIT_LIMIT ||
28
- detailedOrderType === exports.DETAILED_ORDER_TYPES.TAKE_PROFIT_MARKET);
29
- };
30
- exports.isTPSLOrder = isTPSLOrder;
31
- //# sourceMappingURL=orderTypes.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"orderTypes.cjs","sourceRoot":"","sources":["../../src/constants/orderTypes.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACU,QAAA,oBAAoB,GAAG;IAClC,KAAK,EAAE,OAAO;IACd,MAAM,EAAE,QAAQ;IAChB,UAAU,EAAE,YAAY;IACxB,WAAW,EAAE,aAAa;IAC1B,iBAAiB,EAAE,mBAAmB;IACtC,kBAAkB,EAAE,oBAAoB;CAChC,CAAC;AAEX;;;;;GAKG;AACI,MAAM,WAAW,GAAG,CAAC,iBAA0B,EAAW,EAAE;IACjE,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACvB,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,CACL,iBAAiB,KAAK,4BAAoB,CAAC,UAAU;QACrD,iBAAiB,KAAK,4BAAoB,CAAC,WAAW;QACtD,iBAAiB,KAAK,4BAAoB,CAAC,iBAAiB;QAC5D,iBAAiB,KAAK,4BAAoB,CAAC,kBAAkB,CAC9D,CAAC;AACJ,CAAC,CAAC;AAVW,QAAA,WAAW,eAUtB","sourcesContent":["/**\n * Detailed order types from HyperLiquid API\n */\nexport const DETAILED_ORDER_TYPES = {\n LIMIT: 'Limit',\n MARKET: 'Market',\n STOP_LIMIT: 'Stop Limit',\n STOP_MARKET: 'Stop Market',\n TAKE_PROFIT_LIMIT: 'Take Profit Limit',\n TAKE_PROFIT_MARKET: 'Take Profit Market',\n} as const;\n\n/**\n * Check if an order type is a TP/SL order.\n *\n * @param detailedOrderType - The detailed order type string\n * @returns True if the order type is a TP/SL order\n */\nexport const isTPSLOrder = (detailedOrderType?: string): boolean => {\n if (!detailedOrderType) {\n return false;\n }\n return (\n detailedOrderType === DETAILED_ORDER_TYPES.STOP_LIMIT ||\n detailedOrderType === DETAILED_ORDER_TYPES.STOP_MARKET ||\n detailedOrderType === DETAILED_ORDER_TYPES.TAKE_PROFIT_LIMIT ||\n detailedOrderType === DETAILED_ORDER_TYPES.TAKE_PROFIT_MARKET\n );\n};\n"]}
@@ -1,19 +0,0 @@
1
- /**
2
- * Detailed order types from HyperLiquid API
3
- */
4
- export declare const DETAILED_ORDER_TYPES: {
5
- readonly LIMIT: "Limit";
6
- readonly MARKET: "Market";
7
- readonly STOP_LIMIT: "Stop Limit";
8
- readonly STOP_MARKET: "Stop Market";
9
- readonly TAKE_PROFIT_LIMIT: "Take Profit Limit";
10
- readonly TAKE_PROFIT_MARKET: "Take Profit Market";
11
- };
12
- /**
13
- * Check if an order type is a TP/SL order.
14
- *
15
- * @param detailedOrderType - The detailed order type string
16
- * @returns True if the order type is a TP/SL order
17
- */
18
- export declare const isTPSLOrder: (detailedOrderType?: string) => boolean;
19
- //# sourceMappingURL=orderTypes.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"orderTypes.d.cts","sourceRoot":"","sources":["../../src/constants/orderTypes.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;;;;;CAOvB,CAAC;AAEX;;;;;GAKG;AACH,eAAO,MAAM,WAAW,uBAAwB,MAAM,KAAG,OAUxD,CAAC"}
@@ -1,19 +0,0 @@
1
- /**
2
- * Detailed order types from HyperLiquid API
3
- */
4
- export declare const DETAILED_ORDER_TYPES: {
5
- readonly LIMIT: "Limit";
6
- readonly MARKET: "Market";
7
- readonly STOP_LIMIT: "Stop Limit";
8
- readonly STOP_MARKET: "Stop Market";
9
- readonly TAKE_PROFIT_LIMIT: "Take Profit Limit";
10
- readonly TAKE_PROFIT_MARKET: "Take Profit Market";
11
- };
12
- /**
13
- * Check if an order type is a TP/SL order.
14
- *
15
- * @param detailedOrderType - The detailed order type string
16
- * @returns True if the order type is a TP/SL order
17
- */
18
- export declare const isTPSLOrder: (detailedOrderType?: string) => boolean;
19
- //# sourceMappingURL=orderTypes.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"orderTypes.d.mts","sourceRoot":"","sources":["../../src/constants/orderTypes.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;;;;;CAOvB,CAAC;AAEX;;;;;GAKG;AACH,eAAO,MAAM,WAAW,uBAAwB,MAAM,KAAG,OAUxD,CAAC"}
@@ -1,27 +0,0 @@
1
- /**
2
- * Detailed order types from HyperLiquid API
3
- */
4
- export const DETAILED_ORDER_TYPES = {
5
- LIMIT: 'Limit',
6
- MARKET: 'Market',
7
- STOP_LIMIT: 'Stop Limit',
8
- STOP_MARKET: 'Stop Market',
9
- TAKE_PROFIT_LIMIT: 'Take Profit Limit',
10
- TAKE_PROFIT_MARKET: 'Take Profit Market',
11
- };
12
- /**
13
- * Check if an order type is a TP/SL order.
14
- *
15
- * @param detailedOrderType - The detailed order type string
16
- * @returns True if the order type is a TP/SL order
17
- */
18
- export const isTPSLOrder = (detailedOrderType) => {
19
- if (!detailedOrderType) {
20
- return false;
21
- }
22
- return (detailedOrderType === DETAILED_ORDER_TYPES.STOP_LIMIT ||
23
- detailedOrderType === DETAILED_ORDER_TYPES.STOP_MARKET ||
24
- detailedOrderType === DETAILED_ORDER_TYPES.TAKE_PROFIT_LIMIT ||
25
- detailedOrderType === DETAILED_ORDER_TYPES.TAKE_PROFIT_MARKET);
26
- };
27
- //# sourceMappingURL=orderTypes.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"orderTypes.mjs","sourceRoot":"","sources":["../../src/constants/orderTypes.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,KAAK,EAAE,OAAO;IACd,MAAM,EAAE,QAAQ;IAChB,UAAU,EAAE,YAAY;IACxB,WAAW,EAAE,aAAa;IAC1B,iBAAiB,EAAE,mBAAmB;IACtC,kBAAkB,EAAE,oBAAoB;CAChC,CAAC;AAEX;;;;;GAKG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,iBAA0B,EAAW,EAAE;IACjE,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACvB,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,CACL,iBAAiB,KAAK,oBAAoB,CAAC,UAAU;QACrD,iBAAiB,KAAK,oBAAoB,CAAC,WAAW;QACtD,iBAAiB,KAAK,oBAAoB,CAAC,iBAAiB;QAC5D,iBAAiB,KAAK,oBAAoB,CAAC,kBAAkB,CAC9D,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/**\n * Detailed order types from HyperLiquid API\n */\nexport const DETAILED_ORDER_TYPES = {\n LIMIT: 'Limit',\n MARKET: 'Market',\n STOP_LIMIT: 'Stop Limit',\n STOP_MARKET: 'Stop Market',\n TAKE_PROFIT_LIMIT: 'Take Profit Limit',\n TAKE_PROFIT_MARKET: 'Take Profit Market',\n} as const;\n\n/**\n * Check if an order type is a TP/SL order.\n *\n * @param detailedOrderType - The detailed order type string\n * @returns True if the order type is a TP/SL order\n */\nexport const isTPSLOrder = (detailedOrderType?: string): boolean => {\n if (!detailedOrderType) {\n return false;\n }\n return (\n detailedOrderType === DETAILED_ORDER_TYPES.STOP_LIMIT ||\n detailedOrderType === DETAILED_ORDER_TYPES.STOP_MARKET ||\n detailedOrderType === DETAILED_ORDER_TYPES.TAKE_PROFIT_LIMIT ||\n detailedOrderType === DETAILED_ORDER_TYPES.TAKE_PROFIT_MARKET\n );\n};\n"]}