@metamask-previews/perps-controller 0.0.0-preview-685dbf46b → 1.0.0-preview-bc00f2c

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 (482) hide show
  1. package/CHANGELOG.md +30 -2
  2. package/dist/PerpsController.cjs +3077 -65
  3. package/dist/PerpsController.cjs.map +1 -1
  4. package/dist/PerpsController.d.cts +969 -82
  5. package/dist/PerpsController.d.cts.map +1 -1
  6. package/dist/PerpsController.d.mts +969 -82
  7. package/dist/PerpsController.d.mts.map +1 -1
  8. package/dist/PerpsController.mjs +3073 -62
  9. package/dist/PerpsController.mjs.map +1 -1
  10. package/dist/aggregation/SubscriptionMultiplexer.cjs +441 -0
  11. package/dist/aggregation/SubscriptionMultiplexer.cjs.map +1 -0
  12. package/dist/aggregation/SubscriptionMultiplexer.d.cts +171 -0
  13. package/dist/aggregation/SubscriptionMultiplexer.d.cts.map +1 -0
  14. package/dist/aggregation/SubscriptionMultiplexer.d.mts +171 -0
  15. package/dist/aggregation/SubscriptionMultiplexer.d.mts.map +1 -0
  16. package/dist/aggregation/SubscriptionMultiplexer.mjs +437 -0
  17. package/dist/aggregation/SubscriptionMultiplexer.mjs.map +1 -0
  18. package/dist/aggregation/index.cjs +9 -0
  19. package/dist/aggregation/index.cjs.map +1 -0
  20. package/dist/aggregation/index.d.cts +6 -0
  21. package/dist/aggregation/index.d.cts.map +1 -0
  22. package/dist/aggregation/index.d.mts +6 -0
  23. package/dist/aggregation/index.d.mts.map +1 -0
  24. package/dist/aggregation/index.mjs +5 -0
  25. package/dist/aggregation/index.mjs.map +1 -0
  26. package/dist/constants/chartConfig.cjs +227 -0
  27. package/dist/constants/chartConfig.cjs.map +1 -0
  28. package/dist/constants/chartConfig.d.cts +216 -0
  29. package/dist/constants/chartConfig.d.cts.map +1 -0
  30. package/dist/constants/chartConfig.d.mts +216 -0
  31. package/dist/constants/chartConfig.d.mts.map +1 -0
  32. package/dist/constants/chartConfig.mjs +221 -0
  33. package/dist/constants/chartConfig.mjs.map +1 -0
  34. package/dist/constants/eventNames.cjs +436 -0
  35. package/dist/constants/eventNames.cjs.map +1 -0
  36. package/dist/constants/eventNames.d.cts +387 -0
  37. package/dist/constants/eventNames.d.cts.map +1 -0
  38. package/dist/constants/eventNames.d.mts +387 -0
  39. package/dist/constants/eventNames.d.mts.map +1 -0
  40. package/dist/constants/eventNames.mjs +433 -0
  41. package/dist/constants/eventNames.mjs.map +1 -0
  42. package/dist/constants/hyperLiquidConfig.cjs +380 -0
  43. package/dist/constants/hyperLiquidConfig.cjs.map +1 -0
  44. package/dist/constants/hyperLiquidConfig.d.cts +236 -0
  45. package/dist/constants/hyperLiquidConfig.d.cts.map +1 -0
  46. package/dist/constants/hyperLiquidConfig.d.mts +236 -0
  47. package/dist/constants/hyperLiquidConfig.d.mts.map +1 -0
  48. package/dist/constants/hyperLiquidConfig.mjs +371 -0
  49. package/dist/constants/hyperLiquidConfig.mjs.map +1 -0
  50. package/dist/constants/index.cjs +28 -0
  51. package/dist/constants/index.cjs.map +1 -0
  52. package/dist/constants/index.d.cts +12 -0
  53. package/dist/constants/index.d.cts.map +1 -0
  54. package/dist/constants/index.d.mts +12 -0
  55. package/dist/constants/index.d.mts.map +1 -0
  56. package/dist/constants/index.mjs +12 -0
  57. package/dist/constants/index.mjs.map +1 -0
  58. package/dist/constants/myxConfig.cjs +229 -0
  59. package/dist/constants/myxConfig.cjs.map +1 -0
  60. package/dist/constants/myxConfig.d.cts +106 -0
  61. package/dist/constants/myxConfig.d.cts.map +1 -0
  62. package/dist/constants/myxConfig.d.mts +106 -0
  63. package/dist/constants/myxConfig.d.mts.map +1 -0
  64. package/dist/constants/myxConfig.mjs +219 -0
  65. package/dist/constants/myxConfig.mjs.map +1 -0
  66. package/dist/constants/orderTypes.cjs +31 -0
  67. package/dist/constants/orderTypes.cjs.map +1 -0
  68. package/dist/constants/orderTypes.d.cts +19 -0
  69. package/dist/constants/orderTypes.d.cts.map +1 -0
  70. package/dist/constants/orderTypes.d.mts +19 -0
  71. package/dist/constants/orderTypes.d.mts.map +1 -0
  72. package/dist/constants/orderTypes.mjs +27 -0
  73. package/dist/constants/orderTypes.mjs.map +1 -0
  74. package/dist/constants/performanceMetrics.cjs +63 -0
  75. package/dist/constants/performanceMetrics.cjs.map +1 -0
  76. package/dist/constants/performanceMetrics.d.cts +46 -0
  77. package/dist/constants/performanceMetrics.d.cts.map +1 -0
  78. package/dist/constants/performanceMetrics.d.mts +46 -0
  79. package/dist/constants/performanceMetrics.d.mts.map +1 -0
  80. package/dist/constants/performanceMetrics.mjs +60 -0
  81. package/dist/constants/performanceMetrics.mjs.map +1 -0
  82. package/dist/constants/perpsConfig.cjs +295 -0
  83. package/dist/constants/perpsConfig.cjs.map +1 -0
  84. package/dist/constants/perpsConfig.d.cts +221 -0
  85. package/dist/constants/perpsConfig.d.cts.map +1 -0
  86. package/dist/constants/perpsConfig.d.mts +221 -0
  87. package/dist/constants/perpsConfig.d.mts.map +1 -0
  88. package/dist/constants/perpsConfig.mjs +292 -0
  89. package/dist/constants/perpsConfig.mjs.map +1 -0
  90. package/dist/constants/transactionsHistoryConfig.cjs +19 -0
  91. package/dist/constants/transactionsHistoryConfig.cjs.map +1 -0
  92. package/dist/constants/transactionsHistoryConfig.d.cts +16 -0
  93. package/dist/constants/transactionsHistoryConfig.d.cts.map +1 -0
  94. package/dist/constants/transactionsHistoryConfig.d.mts +16 -0
  95. package/dist/constants/transactionsHistoryConfig.d.mts.map +1 -0
  96. package/dist/constants/transactionsHistoryConfig.mjs +16 -0
  97. package/dist/constants/transactionsHistoryConfig.mjs.map +1 -0
  98. package/dist/index.cjs +63 -1
  99. package/dist/index.cjs.map +1 -1
  100. package/dist/index.d.cts +38 -2
  101. package/dist/index.d.cts.map +1 -1
  102. package/dist/index.d.mts +38 -2
  103. package/dist/index.d.mts.map +1 -1
  104. package/dist/index.mjs +46 -1
  105. package/dist/index.mjs.map +1 -1
  106. package/dist/perpsErrorCodes.cjs +80 -0
  107. package/dist/perpsErrorCodes.cjs.map +1 -0
  108. package/dist/perpsErrorCodes.d.cts +65 -0
  109. package/dist/perpsErrorCodes.d.cts.map +1 -0
  110. package/dist/perpsErrorCodes.d.mts +65 -0
  111. package/dist/perpsErrorCodes.d.mts.map +1 -0
  112. package/dist/perpsErrorCodes.mjs +77 -0
  113. package/dist/perpsErrorCodes.mjs.map +1 -0
  114. package/dist/providers/AggregatedPerpsProvider.cjs +508 -0
  115. package/dist/providers/AggregatedPerpsProvider.cjs.map +1 -0
  116. package/dist/providers/AggregatedPerpsProvider.d.cts +171 -0
  117. package/dist/providers/AggregatedPerpsProvider.d.cts.map +1 -0
  118. package/dist/providers/AggregatedPerpsProvider.d.mts +171 -0
  119. package/dist/providers/AggregatedPerpsProvider.d.mts.map +1 -0
  120. package/dist/providers/AggregatedPerpsProvider.mjs +504 -0
  121. package/dist/providers/AggregatedPerpsProvider.mjs.map +1 -0
  122. package/dist/providers/HyperLiquidProvider.cjs +5679 -0
  123. package/dist/providers/HyperLiquidProvider.cjs.map +1 -0
  124. package/dist/providers/HyperLiquidProvider.d.cts +516 -0
  125. package/dist/providers/HyperLiquidProvider.d.cts.map +1 -0
  126. package/dist/providers/HyperLiquidProvider.d.mts +516 -0
  127. package/dist/providers/HyperLiquidProvider.d.mts.map +1 -0
  128. package/dist/providers/HyperLiquidProvider.mjs +5675 -0
  129. package/dist/providers/HyperLiquidProvider.mjs.map +1 -0
  130. package/dist/providers/MYXProvider.cjs +514 -0
  131. package/dist/providers/MYXProvider.cjs.map +1 -0
  132. package/dist/providers/MYXProvider.d.cts +105 -0
  133. package/dist/providers/MYXProvider.d.cts.map +1 -0
  134. package/dist/providers/MYXProvider.d.mts +105 -0
  135. package/dist/providers/MYXProvider.d.mts.map +1 -0
  136. package/dist/providers/MYXProvider.mjs +510 -0
  137. package/dist/providers/MYXProvider.mjs.map +1 -0
  138. package/dist/routing/ProviderRouter.cjs +154 -0
  139. package/dist/routing/ProviderRouter.cjs.map +1 -0
  140. package/dist/routing/ProviderRouter.d.cts +112 -0
  141. package/dist/routing/ProviderRouter.d.cts.map +1 -0
  142. package/dist/routing/ProviderRouter.d.mts +112 -0
  143. package/dist/routing/ProviderRouter.d.mts.map +1 -0
  144. package/dist/routing/ProviderRouter.mjs +150 -0
  145. package/dist/routing/ProviderRouter.mjs.map +1 -0
  146. package/dist/routing/index.cjs +9 -0
  147. package/dist/routing/index.cjs.map +1 -0
  148. package/dist/routing/index.d.cts +6 -0
  149. package/dist/routing/index.d.cts.map +1 -0
  150. package/dist/routing/index.d.mts +6 -0
  151. package/dist/routing/index.d.mts.map +1 -0
  152. package/dist/routing/index.mjs +5 -0
  153. package/dist/routing/index.mjs.map +1 -0
  154. package/dist/selectors.cjs +166 -0
  155. package/dist/selectors.cjs.map +1 -0
  156. package/dist/selectors.d.cts +362 -0
  157. package/dist/selectors.d.cts.map +1 -0
  158. package/dist/selectors.d.mts +362 -0
  159. package/dist/selectors.d.mts.map +1 -0
  160. package/dist/selectors.mjs +158 -0
  161. package/dist/selectors.mjs.map +1 -0
  162. package/dist/services/AccountService.cjs +324 -0
  163. package/dist/services/AccountService.cjs.map +1 -0
  164. package/dist/services/AccountService.d.cts +56 -0
  165. package/dist/services/AccountService.d.cts.map +1 -0
  166. package/dist/services/AccountService.d.mts +56 -0
  167. package/dist/services/AccountService.d.mts.map +1 -0
  168. package/dist/services/AccountService.mjs +320 -0
  169. package/dist/services/AccountService.mjs.map +1 -0
  170. package/dist/services/DataLakeService.cjs +233 -0
  171. package/dist/services/DataLakeService.cjs.map +1 -0
  172. package/dist/services/DataLakeService.d.cts +51 -0
  173. package/dist/services/DataLakeService.d.cts.map +1 -0
  174. package/dist/services/DataLakeService.d.mts +51 -0
  175. package/dist/services/DataLakeService.d.mts.map +1 -0
  176. package/dist/services/DataLakeService.mjs +229 -0
  177. package/dist/services/DataLakeService.mjs.map +1 -0
  178. package/dist/services/DepositService.cjs +98 -0
  179. package/dist/services/DepositService.cjs.map +1 -0
  180. package/dist/services/DepositService.d.cts +39 -0
  181. package/dist/services/DepositService.d.cts.map +1 -0
  182. package/dist/services/DepositService.d.mts +39 -0
  183. package/dist/services/DepositService.d.mts.map +1 -0
  184. package/dist/services/DepositService.mjs +94 -0
  185. package/dist/services/DepositService.mjs.map +1 -0
  186. package/dist/services/EligibilityService.cjs +173 -0
  187. package/dist/services/EligibilityService.cjs.map +1 -0
  188. package/dist/services/EligibilityService.d.cts +39 -0
  189. package/dist/services/EligibilityService.d.cts.map +1 -0
  190. package/dist/services/EligibilityService.d.mts +39 -0
  191. package/dist/services/EligibilityService.d.mts.map +1 -0
  192. package/dist/services/EligibilityService.mjs +169 -0
  193. package/dist/services/EligibilityService.mjs.map +1 -0
  194. package/dist/services/FeatureFlagConfigurationService.cjs +257 -0
  195. package/dist/services/FeatureFlagConfigurationService.cjs.map +1 -0
  196. package/dist/services/FeatureFlagConfigurationService.d.cts +73 -0
  197. package/dist/services/FeatureFlagConfigurationService.d.cts.map +1 -0
  198. package/dist/services/FeatureFlagConfigurationService.d.mts +73 -0
  199. package/dist/services/FeatureFlagConfigurationService.d.mts.map +1 -0
  200. package/dist/services/FeatureFlagConfigurationService.mjs +253 -0
  201. package/dist/services/FeatureFlagConfigurationService.mjs.map +1 -0
  202. package/dist/services/HyperLiquidClientService.cjs +867 -0
  203. package/dist/services/HyperLiquidClientService.cjs.map +1 -0
  204. package/dist/services/HyperLiquidClientService.d.cts +214 -0
  205. package/dist/services/HyperLiquidClientService.d.cts.map +1 -0
  206. package/dist/services/HyperLiquidClientService.d.mts +214 -0
  207. package/dist/services/HyperLiquidClientService.d.mts.map +1 -0
  208. package/dist/services/HyperLiquidClientService.mjs +862 -0
  209. package/dist/services/HyperLiquidClientService.mjs.map +1 -0
  210. package/dist/services/HyperLiquidSubscriptionService.cjs +2199 -0
  211. package/dist/services/HyperLiquidSubscriptionService.cjs.map +1 -0
  212. package/dist/services/HyperLiquidSubscriptionService.d.cts +187 -0
  213. package/dist/services/HyperLiquidSubscriptionService.d.cts.map +1 -0
  214. package/dist/services/HyperLiquidSubscriptionService.d.mts +187 -0
  215. package/dist/services/HyperLiquidSubscriptionService.d.mts.map +1 -0
  216. package/dist/services/HyperLiquidSubscriptionService.mjs +2195 -0
  217. package/dist/services/HyperLiquidSubscriptionService.mjs.map +1 -0
  218. package/dist/services/HyperLiquidWalletService.cjs +163 -0
  219. package/dist/services/HyperLiquidWalletService.cjs.map +1 -0
  220. package/dist/services/HyperLiquidWalletService.d.cts +78 -0
  221. package/dist/services/HyperLiquidWalletService.d.cts.map +1 -0
  222. package/dist/services/HyperLiquidWalletService.d.mts +78 -0
  223. package/dist/services/HyperLiquidWalletService.d.mts.map +1 -0
  224. package/dist/services/HyperLiquidWalletService.mjs +159 -0
  225. package/dist/services/HyperLiquidWalletService.mjs.map +1 -0
  226. package/dist/services/MYXClientService.cjs +304 -0
  227. package/dist/services/MYXClientService.cjs.map +1 -0
  228. package/dist/services/MYXClientService.d.cts +81 -0
  229. package/dist/services/MYXClientService.d.cts.map +1 -0
  230. package/dist/services/MYXClientService.d.mts +81 -0
  231. package/dist/services/MYXClientService.d.mts.map +1 -0
  232. package/dist/services/MYXClientService.mjs +300 -0
  233. package/dist/services/MYXClientService.mjs.map +1 -0
  234. package/dist/services/MarketDataService.cjs +848 -0
  235. package/dist/services/MarketDataService.cjs.map +1 -0
  236. package/dist/services/MarketDataService.d.cts +291 -0
  237. package/dist/services/MarketDataService.d.cts.map +1 -0
  238. package/dist/services/MarketDataService.d.mts +291 -0
  239. package/dist/services/MarketDataService.d.mts.map +1 -0
  240. package/dist/services/MarketDataService.mjs +844 -0
  241. package/dist/services/MarketDataService.mjs.map +1 -0
  242. package/dist/services/RewardsIntegrationService.cjs +120 -0
  243. package/dist/services/RewardsIntegrationService.cjs.map +1 -0
  244. package/dist/services/RewardsIntegrationService.d.cts +28 -0
  245. package/dist/services/RewardsIntegrationService.d.cts.map +1 -0
  246. package/dist/services/RewardsIntegrationService.d.mts +28 -0
  247. package/dist/services/RewardsIntegrationService.d.mts.map +1 -0
  248. package/dist/services/RewardsIntegrationService.mjs +116 -0
  249. package/dist/services/RewardsIntegrationService.mjs.map +1 -0
  250. package/dist/services/ServiceContext.cjs +3 -0
  251. package/dist/services/ServiceContext.cjs.map +1 -0
  252. package/dist/services/ServiceContext.d.cts +86 -0
  253. package/dist/services/ServiceContext.d.cts.map +1 -0
  254. package/dist/services/ServiceContext.d.mts +86 -0
  255. package/dist/services/ServiceContext.d.mts.map +1 -0
  256. package/dist/services/ServiceContext.mjs +2 -0
  257. package/dist/services/ServiceContext.mjs.map +1 -0
  258. package/dist/services/TradingReadinessCache.cjs +288 -0
  259. package/dist/services/TradingReadinessCache.cjs.map +1 -0
  260. package/dist/services/TradingReadinessCache.d.cts +174 -0
  261. package/dist/services/TradingReadinessCache.d.cts.map +1 -0
  262. package/dist/services/TradingReadinessCache.d.mts +174 -0
  263. package/dist/services/TradingReadinessCache.d.mts.map +1 -0
  264. package/dist/services/TradingReadinessCache.mjs +285 -0
  265. package/dist/services/TradingReadinessCache.mjs.map +1 -0
  266. package/dist/services/TradingService.cjs +1457 -0
  267. package/dist/services/TradingService.cjs.map +1 -0
  268. package/dist/services/TradingService.d.cts +195 -0
  269. package/dist/services/TradingService.d.cts.map +1 -0
  270. package/dist/services/TradingService.d.mts +195 -0
  271. package/dist/services/TradingService.d.mts.map +1 -0
  272. package/dist/services/TradingService.mjs +1453 -0
  273. package/dist/services/TradingService.mjs.map +1 -0
  274. package/dist/types/config.cjs +3 -0
  275. package/dist/types/config.cjs.map +1 -0
  276. package/dist/types/config.d.cts +49 -0
  277. package/dist/types/config.d.cts.map +1 -0
  278. package/dist/types/config.d.mts +49 -0
  279. package/dist/types/config.d.mts.map +1 -0
  280. package/dist/types/config.mjs +2 -0
  281. package/dist/types/config.mjs.map +1 -0
  282. package/dist/types/hyperliquid-types.cjs +3 -0
  283. package/dist/types/hyperliquid-types.cjs.map +1 -0
  284. package/dist/types/hyperliquid-types.d.cts +20 -0
  285. package/dist/types/hyperliquid-types.d.cts.map +1 -0
  286. package/dist/types/hyperliquid-types.d.mts +20 -0
  287. package/dist/types/hyperliquid-types.d.mts.map +1 -0
  288. package/dist/types/hyperliquid-types.mjs +2 -0
  289. package/dist/types/hyperliquid-types.mjs.map +1 -0
  290. package/dist/types/index.cjs +115 -0
  291. package/dist/types/index.cjs.map +1 -0
  292. package/dist/types/index.d.cts +1262 -0
  293. package/dist/types/index.d.cts.map +1 -0
  294. package/dist/types/index.d.mts +1262 -0
  295. package/dist/types/index.d.mts.map +1 -0
  296. package/dist/types/index.mjs +97 -0
  297. package/dist/types/index.mjs.map +1 -0
  298. package/dist/types/messenger.cjs +3 -0
  299. package/dist/types/messenger.cjs.map +1 -0
  300. package/dist/types/messenger.d.cts +27 -0
  301. package/dist/types/messenger.d.cts.map +1 -0
  302. package/dist/types/messenger.d.mts +27 -0
  303. package/dist/types/messenger.d.mts.map +1 -0
  304. package/dist/types/messenger.mjs +2 -0
  305. package/dist/types/messenger.mjs.map +1 -0
  306. package/dist/types/myx-types.cjs +25 -0
  307. package/dist/types/myx-types.cjs.map +1 -0
  308. package/dist/types/myx-types.d.cts +63 -0
  309. package/dist/types/myx-types.d.cts.map +1 -0
  310. package/dist/types/myx-types.d.mts +63 -0
  311. package/dist/types/myx-types.d.mts.map +1 -0
  312. package/dist/types/myx-types.mjs +22 -0
  313. package/dist/types/myx-types.mjs.map +1 -0
  314. package/dist/types/perps-types.cjs +4 -0
  315. package/dist/types/perps-types.cjs.map +1 -0
  316. package/dist/types/perps-types.d.cts +105 -0
  317. package/dist/types/perps-types.d.cts.map +1 -0
  318. package/dist/types/perps-types.d.mts +105 -0
  319. package/dist/types/perps-types.d.mts.map +1 -0
  320. package/dist/types/perps-types.mjs +2 -0
  321. package/dist/types/perps-types.mjs.map +1 -0
  322. package/dist/types/token.cjs +3 -0
  323. package/dist/types/token.cjs.map +1 -0
  324. package/dist/types/token.d.cts +25 -0
  325. package/dist/types/token.d.cts.map +1 -0
  326. package/dist/types/token.d.mts +25 -0
  327. package/dist/types/token.d.mts.map +1 -0
  328. package/dist/types/token.mjs +2 -0
  329. package/dist/types/token.mjs.map +1 -0
  330. package/dist/types/transactionTypes.cjs +28 -0
  331. package/dist/types/transactionTypes.cjs.map +1 -0
  332. package/dist/types/transactionTypes.d.cts +64 -0
  333. package/dist/types/transactionTypes.d.cts.map +1 -0
  334. package/dist/types/transactionTypes.d.mts +64 -0
  335. package/dist/types/transactionTypes.d.mts.map +1 -0
  336. package/dist/types/transactionTypes.mjs +23 -0
  337. package/dist/types/transactionTypes.mjs.map +1 -0
  338. package/dist/utils/accountUtils.cjs +100 -0
  339. package/dist/utils/accountUtils.cjs.map +1 -0
  340. package/dist/utils/accountUtils.d.cts +30 -0
  341. package/dist/utils/accountUtils.d.cts.map +1 -0
  342. package/dist/utils/accountUtils.d.mts +30 -0
  343. package/dist/utils/accountUtils.d.mts.map +1 -0
  344. package/dist/utils/accountUtils.mjs +92 -0
  345. package/dist/utils/accountUtils.mjs.map +1 -0
  346. package/dist/utils/errorUtils.cjs +35 -0
  347. package/dist/utils/errorUtils.cjs.map +1 -0
  348. package/dist/utils/errorUtils.d.cts +15 -0
  349. package/dist/utils/errorUtils.d.cts.map +1 -0
  350. package/dist/utils/errorUtils.d.mts +15 -0
  351. package/dist/utils/errorUtils.d.mts.map +1 -0
  352. package/dist/utils/errorUtils.mjs +31 -0
  353. package/dist/utils/errorUtils.mjs.map +1 -0
  354. package/dist/utils/hyperLiquidAdapter.cjs +331 -0
  355. package/dist/utils/hyperLiquidAdapter.cjs.map +1 -0
  356. package/dist/utils/hyperLiquidAdapter.d.cts +42 -0
  357. package/dist/utils/hyperLiquidAdapter.d.cts.map +1 -0
  358. package/dist/utils/hyperLiquidAdapter.d.mts +42 -0
  359. package/dist/utils/hyperLiquidAdapter.d.mts.map +1 -0
  360. package/dist/utils/hyperLiquidAdapter.mjs +316 -0
  361. package/dist/utils/hyperLiquidAdapter.mjs.map +1 -0
  362. package/dist/utils/hyperLiquidOrderBookProcessor.cjs +83 -0
  363. package/dist/utils/hyperLiquidOrderBookProcessor.cjs.map +1 -0
  364. package/dist/utils/hyperLiquidOrderBookProcessor.d.cts +55 -0
  365. package/dist/utils/hyperLiquidOrderBookProcessor.d.cts.map +1 -0
  366. package/dist/utils/hyperLiquidOrderBookProcessor.d.mts +55 -0
  367. package/dist/utils/hyperLiquidOrderBookProcessor.d.mts.map +1 -0
  368. package/dist/utils/hyperLiquidOrderBookProcessor.mjs +78 -0
  369. package/dist/utils/hyperLiquidOrderBookProcessor.mjs.map +1 -0
  370. package/dist/utils/hyperLiquidValidation.cjs +426 -0
  371. package/dist/utils/hyperLiquidValidation.cjs.map +1 -0
  372. package/dist/utils/hyperLiquidValidation.d.cts +143 -0
  373. package/dist/utils/hyperLiquidValidation.d.cts.map +1 -0
  374. package/dist/utils/hyperLiquidValidation.d.mts +143 -0
  375. package/dist/utils/hyperLiquidValidation.d.mts.map +1 -0
  376. package/dist/utils/hyperLiquidValidation.mjs +413 -0
  377. package/dist/utils/hyperLiquidValidation.mjs.map +1 -0
  378. package/dist/utils/idUtils.cjs +18 -0
  379. package/dist/utils/idUtils.cjs.map +1 -0
  380. package/dist/utils/idUtils.d.cts +6 -0
  381. package/dist/utils/idUtils.d.cts.map +1 -0
  382. package/dist/utils/idUtils.d.mts +6 -0
  383. package/dist/utils/idUtils.d.mts.map +1 -0
  384. package/dist/utils/idUtils.mjs +10 -0
  385. package/dist/utils/idUtils.mjs.map +1 -0
  386. package/dist/utils/index.cjs +59 -0
  387. package/dist/utils/index.cjs.map +1 -0
  388. package/dist/utils/index.d.cts +25 -0
  389. package/dist/utils/index.d.cts.map +1 -0
  390. package/dist/utils/index.d.mts +25 -0
  391. package/dist/utils/index.d.mts.map +1 -0
  392. package/dist/utils/index.mjs +30 -0
  393. package/dist/utils/index.mjs.map +1 -0
  394. package/dist/utils/marketDataTransform.cjs +211 -0
  395. package/dist/utils/marketDataTransform.cjs.map +1 -0
  396. package/dist/utils/marketDataTransform.d.cts +40 -0
  397. package/dist/utils/marketDataTransform.d.cts.map +1 -0
  398. package/dist/utils/marketDataTransform.d.mts +40 -0
  399. package/dist/utils/marketDataTransform.d.mts.map +1 -0
  400. package/dist/utils/marketDataTransform.mjs +205 -0
  401. package/dist/utils/marketDataTransform.mjs.map +1 -0
  402. package/dist/utils/marketUtils.cjs +151 -0
  403. package/dist/utils/marketUtils.cjs.map +1 -0
  404. package/dist/utils/marketUtils.d.cts +30 -0
  405. package/dist/utils/marketUtils.d.cts.map +1 -0
  406. package/dist/utils/marketUtils.d.mts +30 -0
  407. package/dist/utils/marketUtils.d.mts.map +1 -0
  408. package/dist/utils/marketUtils.mjs +138 -0
  409. package/dist/utils/marketUtils.mjs.map +1 -0
  410. package/dist/utils/myxAdapter.cjs +224 -0
  411. package/dist/utils/myxAdapter.cjs.map +1 -0
  412. package/dist/utils/myxAdapter.d.cts +81 -0
  413. package/dist/utils/myxAdapter.d.cts.map +1 -0
  414. package/dist/utils/myxAdapter.d.mts +81 -0
  415. package/dist/utils/myxAdapter.d.mts.map +1 -0
  416. package/dist/utils/myxAdapter.mjs +213 -0
  417. package/dist/utils/myxAdapter.mjs.map +1 -0
  418. package/dist/utils/orderCalculations.cjs +283 -0
  419. package/dist/utils/orderCalculations.cjs.map +1 -0
  420. package/dist/utils/orderCalculations.d.cts +107 -0
  421. package/dist/utils/orderCalculations.d.cts.map +1 -0
  422. package/dist/utils/orderCalculations.d.mts +107 -0
  423. package/dist/utils/orderCalculations.d.mts.map +1 -0
  424. package/dist/utils/orderCalculations.mjs +274 -0
  425. package/dist/utils/orderCalculations.mjs.map +1 -0
  426. package/dist/utils/rewardsUtils.cjs +98 -0
  427. package/dist/utils/rewardsUtils.cjs.map +1 -0
  428. package/dist/utils/rewardsUtils.d.cts +33 -0
  429. package/dist/utils/rewardsUtils.d.cts.map +1 -0
  430. package/dist/utils/rewardsUtils.d.mts +33 -0
  431. package/dist/utils/rewardsUtils.d.mts.map +1 -0
  432. package/dist/utils/rewardsUtils.mjs +92 -0
  433. package/dist/utils/rewardsUtils.mjs.map +1 -0
  434. package/dist/utils/significantFigures.cjs +88 -0
  435. package/dist/utils/significantFigures.cjs.map +1 -0
  436. package/dist/utils/significantFigures.d.cts +25 -0
  437. package/dist/utils/significantFigures.d.cts.map +1 -0
  438. package/dist/utils/significantFigures.d.mts +25 -0
  439. package/dist/utils/significantFigures.d.mts.map +1 -0
  440. package/dist/utils/significantFigures.mjs +82 -0
  441. package/dist/utils/significantFigures.mjs.map +1 -0
  442. package/dist/utils/sortMarkets.cjs +93 -0
  443. package/dist/utils/sortMarkets.cjs.map +1 -0
  444. package/dist/utils/sortMarkets.d.cts +27 -0
  445. package/dist/utils/sortMarkets.d.cts.map +1 -0
  446. package/dist/utils/sortMarkets.d.mts +27 -0
  447. package/dist/utils/sortMarkets.d.mts.map +1 -0
  448. package/dist/utils/sortMarkets.mjs +88 -0
  449. package/dist/utils/sortMarkets.mjs.map +1 -0
  450. package/dist/utils/standaloneInfoClient.cjs +70 -0
  451. package/dist/utils/standaloneInfoClient.cjs.map +1 -0
  452. package/dist/utils/standaloneInfoClient.d.cts +37 -0
  453. package/dist/utils/standaloneInfoClient.d.cts.map +1 -0
  454. package/dist/utils/standaloneInfoClient.d.mts +37 -0
  455. package/dist/utils/standaloneInfoClient.d.mts.map +1 -0
  456. package/dist/utils/standaloneInfoClient.mjs +64 -0
  457. package/dist/utils/standaloneInfoClient.mjs.map +1 -0
  458. package/dist/utils/stringParseUtils.cjs +18 -0
  459. package/dist/utils/stringParseUtils.cjs.map +1 -0
  460. package/dist/utils/stringParseUtils.d.cts +3 -0
  461. package/dist/utils/stringParseUtils.d.cts.map +1 -0
  462. package/dist/utils/stringParseUtils.d.mts +3 -0
  463. package/dist/utils/stringParseUtils.d.mts.map +1 -0
  464. package/dist/utils/stringParseUtils.mjs +13 -0
  465. package/dist/utils/stringParseUtils.mjs.map +1 -0
  466. package/dist/utils/transferData.cjs +33 -0
  467. package/dist/utils/transferData.cjs.map +1 -0
  468. package/dist/utils/transferData.d.cts +9 -0
  469. package/dist/utils/transferData.d.cts.map +1 -0
  470. package/dist/utils/transferData.d.mts +9 -0
  471. package/dist/utils/transferData.d.mts.map +1 -0
  472. package/dist/utils/transferData.mjs +29 -0
  473. package/dist/utils/transferData.mjs.map +1 -0
  474. package/dist/utils/wait.cjs +6 -0
  475. package/dist/utils/wait.cjs.map +1 -0
  476. package/dist/utils/wait.d.cts +2 -0
  477. package/dist/utils/wait.d.cts.map +1 -0
  478. package/dist/utils/wait.d.mts +2 -0
  479. package/dist/utils/wait.d.mts.map +1 -0
  480. package/dist/utils/wait.mjs +2 -0
  481. package/dist/utils/wait.mjs.map +1 -0
  482. package/package.json +16 -2
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hyperLiquidConfig.d.cts","sourceRoot":"","sources":["../../src/constants/hyperLiquidConfig.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,236 @@
1
+ import type { CaipAssetId, CaipChainId } from "@metamask/utils";
2
+ import type { HyperLiquidEndpoints, HyperLiquidAssetConfigs, BridgeContractConfig, HyperLiquidBridgeContracts, HyperLiquidTransportConfig, TradingDefaultsConfig, FeeRatesConfig } from "../types/perps-types.mjs";
3
+ export declare const ARBITRUM_MAINNET_CHAIN_ID_HEX = "0xa4b1";
4
+ export declare const ARBITRUM_MAINNET_CHAIN_ID = "42161";
5
+ export declare const ARBITRUM_TESTNET_CHAIN_ID = "421614";
6
+ export declare const ARBITRUM_MAINNET_CAIP_CHAIN_ID = "eip155:42161";
7
+ export declare const ARBITRUM_TESTNET_CAIP_CHAIN_ID = "eip155:421614";
8
+ export declare const HYPERLIQUID_MAINNET_CHAIN_ID = "0x3e7";
9
+ export declare const HYPERLIQUID_TESTNET_CHAIN_ID = "0x3e6";
10
+ export declare const HYPERLIQUID_MAINNET_CAIP_CHAIN_ID: `${string}:${string}`;
11
+ export declare const HYPERLIQUID_TESTNET_CAIP_CHAIN_ID: `${string}:${string}`;
12
+ export declare const HYPERLIQUID_NETWORK_NAME = "Hyperliquid";
13
+ export declare const USDC_SYMBOL = "USDC";
14
+ export declare const USDC_NAME = "USD Coin";
15
+ export declare const USDC_DECIMALS = 6;
16
+ export declare const TOKEN_DECIMALS = 18;
17
+ export declare const ZERO_ADDRESS = "0x0000000000000000000000000000000000000000";
18
+ export declare const ZERO_BALANCE = "0x0";
19
+ export declare const ARBITRUM_SEPOLIA_CHAIN_ID = "0x66eee";
20
+ export declare const USDC_ETHEREUM_MAINNET_ADDRESS = "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48";
21
+ export declare const USDC_ARBITRUM_MAINNET_ADDRESS = "0xaf88d065e77c8cC2239327C5EDb3A432268e5831";
22
+ export declare const USDC_ARBITRUM_TESTNET_ADDRESS = "0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d";
23
+ export declare const USDC_TOKEN_ICON_URL = "https://static.cx.metamask.io/api/v1/tokenIcons/1/0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48.png";
24
+ export declare const HYPERLIQUID_ENDPOINTS: HyperLiquidEndpoints;
25
+ export declare const HYPERLIQUID_ASSET_ICONS_BASE_URL = "https://app.hyperliquid.xyz/coins/";
26
+ export declare const METAMASK_PERPS_ICONS_BASE_URL = "https://raw.githubusercontent.com/MetaMask/contract-metadata/master/icons/eip155:999/";
27
+ export declare const HYPERLIQUID_ASSET_CONFIGS: HyperLiquidAssetConfigs;
28
+ export declare const HYPERLIQUID_BRIDGE_CONTRACTS: HyperLiquidBridgeContracts;
29
+ export declare const HYPERLIQUID_TRANSPORT_CONFIG: HyperLiquidTransportConfig;
30
+ export declare const TRADING_DEFAULTS: TradingDefaultsConfig;
31
+ export declare const FEE_RATES: FeeRatesConfig;
32
+ /**
33
+ * HIP-3 dynamic fee calculation configuration
34
+ *
35
+ * HIP-3 (builder-deployed) perpetual markets have variable fees based on:
36
+ * 1. deployerFeeScale - Per-DEX fee multiplier (fetched from perpDexs API)
37
+ * 2. growthMode - Per-asset 90% fee reduction (fetched from meta API)
38
+ *
39
+ * Fee Formula (from HyperLiquid docs):
40
+ * - scaleIfHip3 = deployerFeeScale < 1 ? deployerFeeScale + 1 : deployerFeeScale * 2
41
+ * - growthModeScale = growthMode ? 0.1 : 1
42
+ * - finalRate = baseRate * scaleIfHip3 * growthModeScale
43
+ *
44
+ * Example: For xyz:TSLA with deployerFeeScale=1.0 and growthMode="enabled":
45
+ * - scaleIfHip3 = 1.0 * 2 = 2.0
46
+ * - growthModeScale = 0.1 (90% reduction)
47
+ * - Final multiplier = 2.0 * 0.1 = 0.2 (effectively 80% off standard 2x HIP-3 fees)
48
+ *
49
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/trading/fees#fee-formula-for-developers
50
+ * @see parseAssetName() in HyperLiquidProvider for HIP-3 asset detection
51
+ */
52
+ export declare const HIP3_FEE_CONFIG: {
53
+ /**
54
+ * Growth Mode multiplier - 90% fee reduction for assets in growth phase
55
+ * This is a protocol constant from HyperLiquid's fee formula
56
+ */
57
+ readonly GrowthModeScale: 0.1;
58
+ /**
59
+ * Default deployerFeeScale when API is unavailable
60
+ * Most HIP-3 DEXs use 1.0, which results in 2x base fees
61
+ */
62
+ readonly DefaultDeployerFeeScale: 1;
63
+ /**
64
+ * Cache TTL for perpDexs data (5 minutes)
65
+ * Fee scales rarely change, so longer cache is acceptable
66
+ */
67
+ readonly PerpDexsCacheTtlMs: number;
68
+ /**
69
+ * @deprecated Use dynamic calculation via calculateHip3FeeMultiplier()
70
+ * Kept for backwards compatibility during migration
71
+ */
72
+ readonly FeeMultiplier: 2;
73
+ };
74
+ export declare const BUILDER_FEE_CONFIG: {
75
+ TestnetBuilder: `0x${string}`;
76
+ MainnetBuilder: `0x${string}`;
77
+ MaxFeeDecimal: number;
78
+ MaxFeeTenthsBps: number;
79
+ MaxFeeRate: string;
80
+ };
81
+ export declare const REFERRAL_CONFIG: {
82
+ MainnetCode: string;
83
+ TestnetCode: string;
84
+ };
85
+ export declare const DEPOSIT_CONFIG: {
86
+ EstimatedGasLimit: number;
87
+ DefaultSlippage: number;
88
+ BridgeQuoteTimeout: number;
89
+ RefreshRate: number;
90
+ EstimatedTime: {
91
+ DirectDeposit: string;
92
+ SameChainSwap: string;
93
+ };
94
+ };
95
+ export declare const HYPERLIQUID_WITHDRAWAL_MINUTES = 5;
96
+ export type SupportedAsset = keyof typeof HYPERLIQUID_ASSET_CONFIGS;
97
+ export declare function getWebSocketEndpoint(isTestnet: boolean): string;
98
+ export declare function getChainId(isTestnet: boolean): string;
99
+ export declare function getCaipChainId(isTestnet: boolean): CaipChainId;
100
+ export declare function getBridgeInfo(isTestnet: boolean): BridgeContractConfig;
101
+ export declare function getSupportedAssets(isTestnet?: boolean): CaipAssetId[];
102
+ export declare const CAIP_ASSET_NAMESPACES: {
103
+ readonly Erc20: "erc20";
104
+ };
105
+ /**
106
+ * HyperLiquid protocol-specific configuration
107
+ * Contains constants specific to HyperLiquid's perps exchange
108
+ */
109
+ export declare const HYPERLIQUID_CONFIG: {
110
+ readonly ExchangeName: "HlPerp";
111
+ };
112
+ /**
113
+ * HIP-3 multi-DEX asset ID calculation constants
114
+ * Per HIP-3-IMPLEMENTATION.md:
115
+ * - Main DEX: assetId = index (0, 1, 2, ...)
116
+ * - HIP-3 DEX: assetId = BASE_ASSET_ID + (perpDexIndex × DEX_MULTIPLIER) + index
117
+ *
118
+ * This formula enables proper order routing across multiple DEXs:
119
+ * - Main DEX (perpDexIndex=0): Uses index directly (BTC=0, ETH=1, SOL=2, etc.)
120
+ * - xyz DEX (perpDexIndex=1): 100000 + (1 × 10000) + index = 110000-110999
121
+ * - abc DEX (perpDexIndex=2): 100000 + (2 × 10000) + index = 120000-120999
122
+ *
123
+ * Supports up to 10 HIP-3 DEXs with 10000 assets each.
124
+ */
125
+ export declare const HIP3_ASSET_ID_CONFIG: {
126
+ readonly BaseAssetId: 100000;
127
+ readonly DexMultiplier: 10000;
128
+ };
129
+ /**
130
+ * Basis points conversion constant
131
+ * 1 basis point (bp) = 0.01% = 0.0001 as decimal
132
+ * Used for fee discount calculations (e.g., 6500 bps = 65%)
133
+ */
134
+ export declare const BASIS_POINTS_DIVISOR = 10000;
135
+ /**
136
+ * HIP-3 asset market type classifications (PRODUCTION DEFAULT)
137
+ *
138
+ * This is the production default configuration, can be overridden via feature flag
139
+ * (remoteFeatureFlags.perpsAssetMarketTypes) for dynamic control.
140
+ *
141
+ * Maps asset symbols (e.g., "xyz:TSLA") to their market type for badge display.
142
+ *
143
+ * Market type determines the badge shown in the UI:
144
+ * - 'equity': STOCK badge (stocks like TSLA, NVDA)
145
+ * - 'commodity': COMMODITY badge (commodities like GOLD)
146
+ * - 'forex': FOREX badge (forex pairs)
147
+ * - undefined: No badge for crypto or unmapped assets
148
+ *
149
+ * Format: 'dex:SYMBOL' → MarketType
150
+ * This allows flexible per-asset classification.
151
+ * Assets not listed here will have no market type (undefined).
152
+ */
153
+ export declare const HIP3_ASSET_MARKET_TYPES: Record<string, 'equity' | 'commodity' | 'forex' | 'crypto'>;
154
+ /**
155
+ * Testnet-specific HIP-3 DEX configuration
156
+ *
157
+ * On testnet, there are many HIP-3 DEXs (test deployments from various builders).
158
+ * Subscribing to all of them causes connection/subscription overload and instability.
159
+ * This configuration limits which DEXs are discovered and subscribed to on testnet.
160
+ */
161
+ export declare const TESTNET_HIP3_CONFIG: {
162
+ /**
163
+ * Allowed DEX names for testnet
164
+ * Empty array = main DEX only (no HIP-3 DEXs)
165
+ * Add specific DEX names to test with particular HIP-3 DEXs: ['testdex1', 'testdex2']
166
+ */
167
+ readonly EnabledDexs: string[];
168
+ /**
169
+ * Set to true to enable full HIP-3 discovery on testnet (not recommended)
170
+ * When false, only DEXs in ENABLED_DEXS are used
171
+ */
172
+ readonly AutoDiscoverAll: false;
173
+ };
174
+ /**
175
+ * Mainnet-specific HIP-3 DEX configuration
176
+ *
177
+ * On mainnet, DEX filtering is dynamically determined from the allowlist markets
178
+ * feature flag. This avoids hardcoding DEX names and ensures consistency with
179
+ * the market filtering logic.
180
+ *
181
+ * When AutoDiscoverAll is false and no allowlist is provided, only the main DEX is used.
182
+ * When an allowlist is provided, DEXs are extracted from the allowlist patterns.
183
+ */
184
+ export declare const MAINNET_HIP3_CONFIG: {
185
+ /**
186
+ * Set to true to enable full HIP-3 discovery on mainnet
187
+ * When false, DEXs are filtered based on the allowlist markets feature flag
188
+ * (recommended for production to reduce subscription overhead)
189
+ */
190
+ readonly AutoDiscoverAll: false;
191
+ };
192
+ /**
193
+ * HIP-3 margin management configuration
194
+ * Controls margin buffers and auto-rebalance behavior for HIP-3 DEXes with isolated margin
195
+ *
196
+ * Background: HyperLiquid validates availableBalance >= totalRequiredMargin BEFORE reallocating
197
+ * existing locked margin. This requires temporary over-funding when increasing positions,
198
+ * followed by automatic cleanup to minimize locked capital.
199
+ */
200
+ export declare const HIP3_MARGIN_CONFIG: {
201
+ /**
202
+ * Margin buffer multiplier for fees and slippage (0.3% = multiply by 1.003)
203
+ * Covers HyperLiquid's max taker fee (0.035%) with comfortable margin
204
+ */
205
+ readonly BufferMultiplier: 1.003;
206
+ /**
207
+ * Desired buffer to keep on HIP-3 DEX after auto-rebalance (USDC amount)
208
+ * Small buffer allows quick follow-up orders without transfers
209
+ */
210
+ readonly RebalanceDesiredBuffer: 0.1;
211
+ /**
212
+ * Minimum excess threshold to trigger auto-rebalance (USDC amount)
213
+ * Prevents unnecessary transfers for tiny amounts
214
+ */
215
+ readonly RebalanceMinThreshold: 0.1;
216
+ };
217
+ /**
218
+ * Configuration for USDH collateral handling on HIP-3 DEXs
219
+ * Per HyperLiquid docs: USDH DEXs pull collateral from spot balance automatically
220
+ *
221
+ * USDH is HyperLiquid's native stablecoin pegged 1:1 to USDC
222
+ */
223
+ export declare const USDH_CONFIG: {
224
+ /** Token name for USDH collateral */
225
+ readonly TokenName: "USDH";
226
+ /**
227
+ * Maximum slippage for USDC→USDH spot swap in basis points
228
+ * USDH is pegged 1:1 to USDC so slippage should be minimal
229
+ * 10 bps (0.1%) provides small buffer for spread
230
+ */
231
+ readonly SwapSlippageBps: 10;
232
+ };
233
+ export declare const INITIAL_AMOUNT_UI_PROGRESS = 10;
234
+ export declare const WITHDRAWAL_PROGRESS_STAGES: number[];
235
+ export declare const PROGRESS_BAR_COMPLETION_DELAY_MS = 500;
236
+ //# sourceMappingURL=hyperLiquidConfig.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hyperLiquidConfig.d.mts","sourceRoot":"","sources":["../../src/constants/hyperLiquidConfig.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,371 @@
1
+ // Network constants
2
+ export const ARBITRUM_MAINNET_CHAIN_ID_HEX = '0xa4b1';
3
+ export const ARBITRUM_MAINNET_CHAIN_ID = '42161';
4
+ export const ARBITRUM_TESTNET_CHAIN_ID = '421614';
5
+ export const ARBITRUM_MAINNET_CAIP_CHAIN_ID = `eip155:${ARBITRUM_MAINNET_CHAIN_ID}`;
6
+ export const ARBITRUM_TESTNET_CAIP_CHAIN_ID = `eip155:${ARBITRUM_TESTNET_CHAIN_ID}`;
7
+ // Hyperliquid chain constants
8
+ export const HYPERLIQUID_MAINNET_CHAIN_ID = '0x3e7'; // 999 in decimal
9
+ export const HYPERLIQUID_TESTNET_CHAIN_ID = '0x3e6'; // 998 in decimal (assumed)
10
+ export const HYPERLIQUID_MAINNET_CAIP_CHAIN_ID = 'eip155:999';
11
+ export const HYPERLIQUID_TESTNET_CAIP_CHAIN_ID = 'eip155:998';
12
+ export const HYPERLIQUID_NETWORK_NAME = 'Hyperliquid';
13
+ // Token constants
14
+ export const USDC_SYMBOL = 'USDC';
15
+ export const USDC_NAME = 'USD Coin';
16
+ export const USDC_DECIMALS = 6;
17
+ export const TOKEN_DECIMALS = 18;
18
+ export const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000';
19
+ export const ZERO_BALANCE = '0x0';
20
+ // Network constants
21
+ export const ARBITRUM_SEPOLIA_CHAIN_ID = '0x66eee'; // 421614 in decimal
22
+ // USDC token addresses
23
+ export const USDC_ETHEREUM_MAINNET_ADDRESS = '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48';
24
+ export const USDC_ARBITRUM_MAINNET_ADDRESS = '0xaf88d065e77c8cC2239327C5EDb3A432268e5831';
25
+ export const USDC_ARBITRUM_TESTNET_ADDRESS = '0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d';
26
+ // USDC token icon URL using MetaMask's official Token Icons API
27
+ // Format: https://static.cx.metamask.io/api/v1/tokenIcons/{chainId}/{contractAddress}.png
28
+ // This URL follows the same pattern used throughout MetaMask (bridges, swaps, etc.)
29
+ export const USDC_TOKEN_ICON_URL = `https://static.cx.metamask.io/api/v1/tokenIcons/1/${USDC_ETHEREUM_MAINNET_ADDRESS}.png`;
30
+ // WebSocket endpoints
31
+ export const HYPERLIQUID_ENDPOINTS = {
32
+ mainnet: 'wss://api.hyperliquid.xyz/ws',
33
+ testnet: 'wss://api.hyperliquid-testnet.xyz/ws',
34
+ };
35
+ // Asset icons base URL (HyperLiquid CDN - fallback source)
36
+ export const HYPERLIQUID_ASSET_ICONS_BASE_URL = 'https://app.hyperliquid.xyz/coins/';
37
+ // MetaMask-hosted Perps asset icons (primary source)
38
+ // Assets uploaded to: https://github.com/MetaMask/contract-metadata/tree/master/icons/eip155:999
39
+ // HIP-3 assets use format: hip3:dex_SYMBOL.svg (e.g., hip3:xyz_AAPL.svg)
40
+ // Regular assets use format: SYMBOL.svg (e.g., BTC.svg)
41
+ export const METAMASK_PERPS_ICONS_BASE_URL = 'https://raw.githubusercontent.com/MetaMask/contract-metadata/master/icons/eip155:999/';
42
+ // Asset configurations for multichain abstraction
43
+ export const HYPERLIQUID_ASSET_CONFIGS = {
44
+ usdc: {
45
+ mainnet: `${ARBITRUM_MAINNET_CAIP_CHAIN_ID}/erc20:0xaf88d065e77c8cC2239327C5EDb3A432268e5831/default`,
46
+ testnet: `${ARBITRUM_TESTNET_CAIP_CHAIN_ID}/erc20:0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d/default`,
47
+ },
48
+ };
49
+ // HyperLiquid bridge contract addresses for direct USDC deposits
50
+ // These are the official bridge contracts where USDC must be sent to credit user's HyperLiquid account
51
+ export const HYPERLIQUID_BRIDGE_CONTRACTS = {
52
+ mainnet: {
53
+ chainId: ARBITRUM_MAINNET_CAIP_CHAIN_ID,
54
+ contractAddress: '0x2df1c51e09aecf9cacb7bc98cb1742757f163df7',
55
+ },
56
+ testnet: {
57
+ chainId: ARBITRUM_TESTNET_CAIP_CHAIN_ID,
58
+ contractAddress: '0x08cfc1B6b2dCF36A1480b99353A354AA8AC56f89',
59
+ },
60
+ };
61
+ // SDK transport configuration
62
+ export const HYPERLIQUID_TRANSPORT_CONFIG = {
63
+ timeout: 10000,
64
+ keepAlive: { interval: 30000 },
65
+ reconnect: {
66
+ maxRetries: 5,
67
+ connectionTimeout: 10000,
68
+ },
69
+ };
70
+ // Trading configuration constants
71
+ export const TRADING_DEFAULTS = {
72
+ leverage: 3, // 3x default leverage
73
+ marginPercent: 10, // 10% fixed margin default
74
+ takeProfitPercent: 0.3, // 30% take profit
75
+ stopLossPercent: 0.1, // 10% stop loss
76
+ amount: {
77
+ mainnet: 10, // $10 minimum order size
78
+ testnet: 10, // $10 minimum order size
79
+ },
80
+ };
81
+ // Fee configuration
82
+ // Note: These are base rates (Tier 0, no discounts)
83
+ // Actual fees will be calculated based on user's volume tier and staking
84
+ export const FEE_RATES = {
85
+ taker: 0.00045, // 0.045% - Market orders and aggressive limit orders
86
+ maker: 0.00015, // 0.015% - Limit orders that add liquidity
87
+ };
88
+ /**
89
+ * HIP-3 dynamic fee calculation configuration
90
+ *
91
+ * HIP-3 (builder-deployed) perpetual markets have variable fees based on:
92
+ * 1. deployerFeeScale - Per-DEX fee multiplier (fetched from perpDexs API)
93
+ * 2. growthMode - Per-asset 90% fee reduction (fetched from meta API)
94
+ *
95
+ * Fee Formula (from HyperLiquid docs):
96
+ * - scaleIfHip3 = deployerFeeScale < 1 ? deployerFeeScale + 1 : deployerFeeScale * 2
97
+ * - growthModeScale = growthMode ? 0.1 : 1
98
+ * - finalRate = baseRate * scaleIfHip3 * growthModeScale
99
+ *
100
+ * Example: For xyz:TSLA with deployerFeeScale=1.0 and growthMode="enabled":
101
+ * - scaleIfHip3 = 1.0 * 2 = 2.0
102
+ * - growthModeScale = 0.1 (90% reduction)
103
+ * - Final multiplier = 2.0 * 0.1 = 0.2 (effectively 80% off standard 2x HIP-3 fees)
104
+ *
105
+ * @see https://hyperliquid.gitbook.io/hyperliquid-docs/trading/fees#fee-formula-for-developers
106
+ * @see parseAssetName() in HyperLiquidProvider for HIP-3 asset detection
107
+ */
108
+ export const HIP3_FEE_CONFIG = {
109
+ /**
110
+ * Growth Mode multiplier - 90% fee reduction for assets in growth phase
111
+ * This is a protocol constant from HyperLiquid's fee formula
112
+ */
113
+ GrowthModeScale: 0.1,
114
+ /**
115
+ * Default deployerFeeScale when API is unavailable
116
+ * Most HIP-3 DEXs use 1.0, which results in 2x base fees
117
+ */
118
+ DefaultDeployerFeeScale: 1.0,
119
+ /**
120
+ * Cache TTL for perpDexs data (5 minutes)
121
+ * Fee scales rarely change, so longer cache is acceptable
122
+ */
123
+ PerpDexsCacheTtlMs: 5 * 60 * 1000,
124
+ /**
125
+ * @deprecated Use dynamic calculation via calculateHip3FeeMultiplier()
126
+ * Kept for backwards compatibility during migration
127
+ */
128
+ FeeMultiplier: 2,
129
+ };
130
+ const BUILDER_FEE_MAX_FEE_DECIMAL = 0.001;
131
+ // Builder fee configuration
132
+ export const BUILDER_FEE_CONFIG = {
133
+ // Test builder wallet
134
+ TestnetBuilder: '0x724e57771ba749650875bd8adb2e29a85d0cacfa',
135
+ // Production builder wallet
136
+ MainnetBuilder: '0xe95a5e31904e005066614247d309e00d8ad753aa',
137
+ // Fee in decimal (10 bp = 0.1%)
138
+ MaxFeeDecimal: BUILDER_FEE_MAX_FEE_DECIMAL,
139
+ MaxFeeTenthsBps: BUILDER_FEE_MAX_FEE_DECIMAL * 100000,
140
+ MaxFeeRate: `${(BUILDER_FEE_MAX_FEE_DECIMAL * 100)
141
+ .toFixed(4)
142
+ .replace(/\.?0+$/u, '')}%`,
143
+ };
144
+ // Referral code configuration
145
+ export const REFERRAL_CONFIG = {
146
+ // Production referral code
147
+ MainnetCode: 'MMCSI',
148
+ // Development/testnet referral code
149
+ TestnetCode: 'MMCSITEST',
150
+ };
151
+ // Deposit constants
152
+ export const DEPOSIT_CONFIG = {
153
+ EstimatedGasLimit: 150000, // Estimated gas limit for bridge deposit
154
+ DefaultSlippage: 1, // 1% default slippage for bridge quotes
155
+ BridgeQuoteTimeout: 1000, // 1 second timeout for bridge quotes
156
+ RefreshRate: 30000, // 30 seconds quote refresh rate
157
+ EstimatedTime: {
158
+ DirectDeposit: '3-5 seconds', // Direct USDC deposit on Arbitrum
159
+ SameChainSwap: '30-60 seconds', // Swap on same chain before deposit
160
+ },
161
+ };
162
+ // Withdrawal constants (HyperLiquid-specific)
163
+ export const HYPERLIQUID_WITHDRAWAL_MINUTES = 5; // HyperLiquid withdrawal processing time in minutes
164
+ // Configuration helpers
165
+ export function getWebSocketEndpoint(isTestnet) {
166
+ return isTestnet
167
+ ? HYPERLIQUID_ENDPOINTS.testnet
168
+ : HYPERLIQUID_ENDPOINTS.mainnet;
169
+ }
170
+ export function getChainId(isTestnet) {
171
+ return isTestnet ? ARBITRUM_TESTNET_CHAIN_ID : ARBITRUM_MAINNET_CHAIN_ID;
172
+ }
173
+ export function getCaipChainId(isTestnet) {
174
+ const network = isTestnet ? 'testnet' : 'mainnet';
175
+ return HYPERLIQUID_BRIDGE_CONTRACTS[network].chainId;
176
+ }
177
+ export function getBridgeInfo(isTestnet) {
178
+ const network = isTestnet ? 'testnet' : 'mainnet';
179
+ return HYPERLIQUID_BRIDGE_CONTRACTS[network];
180
+ }
181
+ export function getSupportedAssets(isTestnet) {
182
+ const network = isTestnet ? 'testnet' : 'mainnet';
183
+ return Object.values(HYPERLIQUID_ASSET_CONFIGS).map((config) => config[network]);
184
+ }
185
+ // CAIP asset namespace constants
186
+ export const CAIP_ASSET_NAMESPACES = {
187
+ Erc20: 'erc20',
188
+ };
189
+ /**
190
+ * HyperLiquid protocol-specific configuration
191
+ * Contains constants specific to HyperLiquid's perps exchange
192
+ */
193
+ export const HYPERLIQUID_CONFIG = {
194
+ // Exchange name used in predicted funding data
195
+ // HyperLiquid uses 'HlPerp' as their perps exchange identifier
196
+ ExchangeName: 'HlPerp',
197
+ };
198
+ /**
199
+ * HIP-3 multi-DEX asset ID calculation constants
200
+ * Per HIP-3-IMPLEMENTATION.md:
201
+ * - Main DEX: assetId = index (0, 1, 2, ...)
202
+ * - HIP-3 DEX: assetId = BASE_ASSET_ID + (perpDexIndex × DEX_MULTIPLIER) + index
203
+ *
204
+ * This formula enables proper order routing across multiple DEXs:
205
+ * - Main DEX (perpDexIndex=0): Uses index directly (BTC=0, ETH=1, SOL=2, etc.)
206
+ * - xyz DEX (perpDexIndex=1): 100000 + (1 × 10000) + index = 110000-110999
207
+ * - abc DEX (perpDexIndex=2): 100000 + (2 × 10000) + index = 120000-120999
208
+ *
209
+ * Supports up to 10 HIP-3 DEXs with 10000 assets each.
210
+ */
211
+ export const HIP3_ASSET_ID_CONFIG = {
212
+ // Base offset for HIP-3 asset IDs (100000)
213
+ // Ensures HIP-3 asset IDs don't conflict with main DEX indices
214
+ BaseAssetId: 100000,
215
+ // Multiplier for DEX index in asset ID calculation (10000)
216
+ // Allocates 10000 asset ID slots per DEX (0-9999)
217
+ DexMultiplier: 10000,
218
+ };
219
+ /**
220
+ * Basis points conversion constant
221
+ * 1 basis point (bp) = 0.01% = 0.0001 as decimal
222
+ * Used for fee discount calculations (e.g., 6500 bps = 65%)
223
+ */
224
+ export const BASIS_POINTS_DIVISOR = 10000;
225
+ /**
226
+ * HIP-3 asset market type classifications (PRODUCTION DEFAULT)
227
+ *
228
+ * This is the production default configuration, can be overridden via feature flag
229
+ * (remoteFeatureFlags.perpsAssetMarketTypes) for dynamic control.
230
+ *
231
+ * Maps asset symbols (e.g., "xyz:TSLA") to their market type for badge display.
232
+ *
233
+ * Market type determines the badge shown in the UI:
234
+ * - 'equity': STOCK badge (stocks like TSLA, NVDA)
235
+ * - 'commodity': COMMODITY badge (commodities like GOLD)
236
+ * - 'forex': FOREX badge (forex pairs)
237
+ * - undefined: No badge for crypto or unmapped assets
238
+ *
239
+ * Format: 'dex:SYMBOL' → MarketType
240
+ * This allows flexible per-asset classification.
241
+ * Assets not listed here will have no market type (undefined).
242
+ */
243
+ export const HIP3_ASSET_MARKET_TYPES = {
244
+ // xyz DEX - Equities
245
+ 'xyz:TSLA': 'equity',
246
+ 'xyz:NVDA': 'equity',
247
+ 'xyz:XYZ100': 'equity',
248
+ 'xyz:INTC': 'equity',
249
+ 'xyz:MU': 'equity',
250
+ 'xyz:CRCL': 'equity',
251
+ 'xyz:HOOD': 'equity',
252
+ 'xyz:SNDK': 'equity',
253
+ 'xyz:GOOGL': 'equity',
254
+ 'xyz:COIN': 'equity',
255
+ 'xyz:ORCL': 'equity',
256
+ 'xyz:AMZN': 'equity',
257
+ 'xyz:PLTR': 'equity',
258
+ 'xyz:AAPL': 'equity',
259
+ 'xyz:META': 'equity',
260
+ 'xyz:AMD': 'equity',
261
+ 'xyz:MSFT': 'equity',
262
+ 'xyz:BABA': 'equity',
263
+ 'xyz:RIVN': 'equity',
264
+ 'xyz:NFLX': 'equity',
265
+ 'xyz:COST': 'equity',
266
+ 'xyz:LLY': 'equity',
267
+ 'xyz:TSM': 'equity',
268
+ 'xyz:SKHX': 'equity',
269
+ 'xyz:MSTR': 'equity',
270
+ 'xyz:CRWV': 'equity',
271
+ 'xyz:SMSN': 'equity',
272
+ // xyz DEX - Commodities
273
+ 'xyz:GOLD': 'commodity',
274
+ 'xyz:SILVER': 'commodity',
275
+ 'xyz:CL': 'commodity',
276
+ 'xyz:COPPER': 'commodity',
277
+ 'xyz:ALUMINIUM': 'commodity',
278
+ 'xyz:URANIUM': 'commodity',
279
+ 'xyz:USAR': 'commodity',
280
+ 'xyz:NATGAS': 'commodity',
281
+ 'xyz:PLATINUM': 'commodity',
282
+ // xyz DEX - Forex
283
+ 'xyz:EUR': 'forex',
284
+ 'xyz:JPY': 'forex',
285
+ };
286
+ /**
287
+ * Testnet-specific HIP-3 DEX configuration
288
+ *
289
+ * On testnet, there are many HIP-3 DEXs (test deployments from various builders).
290
+ * Subscribing to all of them causes connection/subscription overload and instability.
291
+ * This configuration limits which DEXs are discovered and subscribed to on testnet.
292
+ */
293
+ export const TESTNET_HIP3_CONFIG = {
294
+ /**
295
+ * Allowed DEX names for testnet
296
+ * Empty array = main DEX only (no HIP-3 DEXs)
297
+ * Add specific DEX names to test with particular HIP-3 DEXs: ['testdex1', 'testdex2']
298
+ */
299
+ EnabledDexs: ['xyz'],
300
+ /**
301
+ * Set to true to enable full HIP-3 discovery on testnet (not recommended)
302
+ * When false, only DEXs in ENABLED_DEXS are used
303
+ */
304
+ AutoDiscoverAll: false,
305
+ };
306
+ /**
307
+ * Mainnet-specific HIP-3 DEX configuration
308
+ *
309
+ * On mainnet, DEX filtering is dynamically determined from the allowlist markets
310
+ * feature flag. This avoids hardcoding DEX names and ensures consistency with
311
+ * the market filtering logic.
312
+ *
313
+ * When AutoDiscoverAll is false and no allowlist is provided, only the main DEX is used.
314
+ * When an allowlist is provided, DEXs are extracted from the allowlist patterns.
315
+ */
316
+ export const MAINNET_HIP3_CONFIG = {
317
+ /**
318
+ * Set to true to enable full HIP-3 discovery on mainnet
319
+ * When false, DEXs are filtered based on the allowlist markets feature flag
320
+ * (recommended for production to reduce subscription overhead)
321
+ */
322
+ AutoDiscoverAll: false,
323
+ };
324
+ /**
325
+ * HIP-3 margin management configuration
326
+ * Controls margin buffers and auto-rebalance behavior for HIP-3 DEXes with isolated margin
327
+ *
328
+ * Background: HyperLiquid validates availableBalance >= totalRequiredMargin BEFORE reallocating
329
+ * existing locked margin. This requires temporary over-funding when increasing positions,
330
+ * followed by automatic cleanup to minimize locked capital.
331
+ */
332
+ export const HIP3_MARGIN_CONFIG = {
333
+ /**
334
+ * Margin buffer multiplier for fees and slippage (0.3% = multiply by 1.003)
335
+ * Covers HyperLiquid's max taker fee (0.035%) with comfortable margin
336
+ */
337
+ BufferMultiplier: 1.003,
338
+ /**
339
+ * Desired buffer to keep on HIP-3 DEX after auto-rebalance (USDC amount)
340
+ * Small buffer allows quick follow-up orders without transfers
341
+ */
342
+ RebalanceDesiredBuffer: 0.1,
343
+ /**
344
+ * Minimum excess threshold to trigger auto-rebalance (USDC amount)
345
+ * Prevents unnecessary transfers for tiny amounts
346
+ */
347
+ RebalanceMinThreshold: 0.1,
348
+ };
349
+ /**
350
+ * Configuration for USDH collateral handling on HIP-3 DEXs
351
+ * Per HyperLiquid docs: USDH DEXs pull collateral from spot balance automatically
352
+ *
353
+ * USDH is HyperLiquid's native stablecoin pegged 1:1 to USDC
354
+ */
355
+ export const USDH_CONFIG = {
356
+ /** Token name for USDH collateral */
357
+ TokenName: 'USDH',
358
+ /**
359
+ * Maximum slippage for USDC→USDH spot swap in basis points
360
+ * USDH is pegged 1:1 to USDC so slippage should be minimal
361
+ * 10 bps (0.1%) provides small buffer for spread
362
+ */
363
+ SwapSlippageBps: 10,
364
+ };
365
+ // Progress bar constants
366
+ export const INITIAL_AMOUNT_UI_PROGRESS = 10;
367
+ export const WITHDRAWAL_PROGRESS_STAGES = [
368
+ 25, 35, 45, 55, 65, 75, 85, 90, 95, 98,
369
+ ];
370
+ export const PROGRESS_BAR_COMPLETION_DELAY_MS = 500;
371
+ //# sourceMappingURL=hyperLiquidConfig.mjs.map