@metamask-previews/perps-controller 0.0.0-preview-b0148922a → 0.0.0-preview-ee1fa5d01

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 +0 -25
  2. package/dist/PerpsController.cjs +65 -3077
  3. package/dist/PerpsController.cjs.map +1 -1
  4. package/dist/PerpsController.d.cts +82 -969
  5. package/dist/PerpsController.d.cts.map +1 -1
  6. package/dist/PerpsController.d.mts +82 -969
  7. package/dist/PerpsController.d.mts.map +1 -1
  8. package/dist/PerpsController.mjs +62 -3073
  9. package/dist/PerpsController.mjs.map +1 -1
  10. package/dist/index.cjs +1 -63
  11. package/dist/index.cjs.map +1 -1
  12. package/dist/index.d.cts +2 -38
  13. package/dist/index.d.cts.map +1 -1
  14. package/dist/index.d.mts +2 -38
  15. package/dist/index.d.mts.map +1 -1
  16. package/dist/index.mjs +1 -46
  17. package/dist/index.mjs.map +1 -1
  18. package/package.json +2 -16
  19. package/dist/aggregation/SubscriptionMultiplexer.cjs +0 -441
  20. package/dist/aggregation/SubscriptionMultiplexer.cjs.map +0 -1
  21. package/dist/aggregation/SubscriptionMultiplexer.d.cts +0 -171
  22. package/dist/aggregation/SubscriptionMultiplexer.d.cts.map +0 -1
  23. package/dist/aggregation/SubscriptionMultiplexer.d.mts +0 -171
  24. package/dist/aggregation/SubscriptionMultiplexer.d.mts.map +0 -1
  25. package/dist/aggregation/SubscriptionMultiplexer.mjs +0 -437
  26. package/dist/aggregation/SubscriptionMultiplexer.mjs.map +0 -1
  27. package/dist/aggregation/index.cjs +0 -9
  28. package/dist/aggregation/index.cjs.map +0 -1
  29. package/dist/aggregation/index.d.cts +0 -6
  30. package/dist/aggregation/index.d.cts.map +0 -1
  31. package/dist/aggregation/index.d.mts +0 -6
  32. package/dist/aggregation/index.d.mts.map +0 -1
  33. package/dist/aggregation/index.mjs +0 -5
  34. package/dist/aggregation/index.mjs.map +0 -1
  35. package/dist/constants/chartConfig.cjs +0 -227
  36. package/dist/constants/chartConfig.cjs.map +0 -1
  37. package/dist/constants/chartConfig.d.cts +0 -216
  38. package/dist/constants/chartConfig.d.cts.map +0 -1
  39. package/dist/constants/chartConfig.d.mts +0 -216
  40. package/dist/constants/chartConfig.d.mts.map +0 -1
  41. package/dist/constants/chartConfig.mjs +0 -221
  42. package/dist/constants/chartConfig.mjs.map +0 -1
  43. package/dist/constants/eventNames.cjs +0 -436
  44. package/dist/constants/eventNames.cjs.map +0 -1
  45. package/dist/constants/eventNames.d.cts +0 -387
  46. package/dist/constants/eventNames.d.cts.map +0 -1
  47. package/dist/constants/eventNames.d.mts +0 -387
  48. package/dist/constants/eventNames.d.mts.map +0 -1
  49. package/dist/constants/eventNames.mjs +0 -433
  50. package/dist/constants/eventNames.mjs.map +0 -1
  51. package/dist/constants/hyperLiquidConfig.cjs +0 -380
  52. package/dist/constants/hyperLiquidConfig.cjs.map +0 -1
  53. package/dist/constants/hyperLiquidConfig.d.cts +0 -236
  54. package/dist/constants/hyperLiquidConfig.d.cts.map +0 -1
  55. package/dist/constants/hyperLiquidConfig.d.mts +0 -236
  56. package/dist/constants/hyperLiquidConfig.d.mts.map +0 -1
  57. package/dist/constants/hyperLiquidConfig.mjs +0 -371
  58. package/dist/constants/hyperLiquidConfig.mjs.map +0 -1
  59. package/dist/constants/index.cjs +0 -28
  60. package/dist/constants/index.cjs.map +0 -1
  61. package/dist/constants/index.d.cts +0 -12
  62. package/dist/constants/index.d.cts.map +0 -1
  63. package/dist/constants/index.d.mts +0 -12
  64. package/dist/constants/index.d.mts.map +0 -1
  65. package/dist/constants/index.mjs +0 -12
  66. package/dist/constants/index.mjs.map +0 -1
  67. package/dist/constants/myxConfig.cjs +0 -229
  68. package/dist/constants/myxConfig.cjs.map +0 -1
  69. package/dist/constants/myxConfig.d.cts +0 -106
  70. package/dist/constants/myxConfig.d.cts.map +0 -1
  71. package/dist/constants/myxConfig.d.mts +0 -106
  72. package/dist/constants/myxConfig.d.mts.map +0 -1
  73. package/dist/constants/myxConfig.mjs +0 -219
  74. package/dist/constants/myxConfig.mjs.map +0 -1
  75. package/dist/constants/orderTypes.cjs +0 -31
  76. package/dist/constants/orderTypes.cjs.map +0 -1
  77. package/dist/constants/orderTypes.d.cts +0 -19
  78. package/dist/constants/orderTypes.d.cts.map +0 -1
  79. package/dist/constants/orderTypes.d.mts +0 -19
  80. package/dist/constants/orderTypes.d.mts.map +0 -1
  81. package/dist/constants/orderTypes.mjs +0 -27
  82. package/dist/constants/orderTypes.mjs.map +0 -1
  83. package/dist/constants/performanceMetrics.cjs +0 -63
  84. package/dist/constants/performanceMetrics.cjs.map +0 -1
  85. package/dist/constants/performanceMetrics.d.cts +0 -46
  86. package/dist/constants/performanceMetrics.d.cts.map +0 -1
  87. package/dist/constants/performanceMetrics.d.mts +0 -46
  88. package/dist/constants/performanceMetrics.d.mts.map +0 -1
  89. package/dist/constants/performanceMetrics.mjs +0 -60
  90. package/dist/constants/performanceMetrics.mjs.map +0 -1
  91. package/dist/constants/perpsConfig.cjs +0 -295
  92. package/dist/constants/perpsConfig.cjs.map +0 -1
  93. package/dist/constants/perpsConfig.d.cts +0 -221
  94. package/dist/constants/perpsConfig.d.cts.map +0 -1
  95. package/dist/constants/perpsConfig.d.mts +0 -221
  96. package/dist/constants/perpsConfig.d.mts.map +0 -1
  97. package/dist/constants/perpsConfig.mjs +0 -292
  98. package/dist/constants/perpsConfig.mjs.map +0 -1
  99. package/dist/constants/transactionsHistoryConfig.cjs +0 -19
  100. package/dist/constants/transactionsHistoryConfig.cjs.map +0 -1
  101. package/dist/constants/transactionsHistoryConfig.d.cts +0 -16
  102. package/dist/constants/transactionsHistoryConfig.d.cts.map +0 -1
  103. package/dist/constants/transactionsHistoryConfig.d.mts +0 -16
  104. package/dist/constants/transactionsHistoryConfig.d.mts.map +0 -1
  105. package/dist/constants/transactionsHistoryConfig.mjs +0 -16
  106. package/dist/constants/transactionsHistoryConfig.mjs.map +0 -1
  107. package/dist/perpsErrorCodes.cjs +0 -80
  108. package/dist/perpsErrorCodes.cjs.map +0 -1
  109. package/dist/perpsErrorCodes.d.cts +0 -65
  110. package/dist/perpsErrorCodes.d.cts.map +0 -1
  111. package/dist/perpsErrorCodes.d.mts +0 -65
  112. package/dist/perpsErrorCodes.d.mts.map +0 -1
  113. package/dist/perpsErrorCodes.mjs +0 -77
  114. package/dist/perpsErrorCodes.mjs.map +0 -1
  115. package/dist/providers/AggregatedPerpsProvider.cjs +0 -508
  116. package/dist/providers/AggregatedPerpsProvider.cjs.map +0 -1
  117. package/dist/providers/AggregatedPerpsProvider.d.cts +0 -171
  118. package/dist/providers/AggregatedPerpsProvider.d.cts.map +0 -1
  119. package/dist/providers/AggregatedPerpsProvider.d.mts +0 -171
  120. package/dist/providers/AggregatedPerpsProvider.d.mts.map +0 -1
  121. package/dist/providers/AggregatedPerpsProvider.mjs +0 -504
  122. package/dist/providers/AggregatedPerpsProvider.mjs.map +0 -1
  123. package/dist/providers/HyperLiquidProvider.cjs +0 -5679
  124. package/dist/providers/HyperLiquidProvider.cjs.map +0 -1
  125. package/dist/providers/HyperLiquidProvider.d.cts +0 -516
  126. package/dist/providers/HyperLiquidProvider.d.cts.map +0 -1
  127. package/dist/providers/HyperLiquidProvider.d.mts +0 -516
  128. package/dist/providers/HyperLiquidProvider.d.mts.map +0 -1
  129. package/dist/providers/HyperLiquidProvider.mjs +0 -5675
  130. package/dist/providers/HyperLiquidProvider.mjs.map +0 -1
  131. package/dist/providers/MYXProvider.cjs +0 -514
  132. package/dist/providers/MYXProvider.cjs.map +0 -1
  133. package/dist/providers/MYXProvider.d.cts +0 -105
  134. package/dist/providers/MYXProvider.d.cts.map +0 -1
  135. package/dist/providers/MYXProvider.d.mts +0 -105
  136. package/dist/providers/MYXProvider.d.mts.map +0 -1
  137. package/dist/providers/MYXProvider.mjs +0 -510
  138. package/dist/providers/MYXProvider.mjs.map +0 -1
  139. package/dist/routing/ProviderRouter.cjs +0 -154
  140. package/dist/routing/ProviderRouter.cjs.map +0 -1
  141. package/dist/routing/ProviderRouter.d.cts +0 -112
  142. package/dist/routing/ProviderRouter.d.cts.map +0 -1
  143. package/dist/routing/ProviderRouter.d.mts +0 -112
  144. package/dist/routing/ProviderRouter.d.mts.map +0 -1
  145. package/dist/routing/ProviderRouter.mjs +0 -150
  146. package/dist/routing/ProviderRouter.mjs.map +0 -1
  147. package/dist/routing/index.cjs +0 -9
  148. package/dist/routing/index.cjs.map +0 -1
  149. package/dist/routing/index.d.cts +0 -6
  150. package/dist/routing/index.d.cts.map +0 -1
  151. package/dist/routing/index.d.mts +0 -6
  152. package/dist/routing/index.d.mts.map +0 -1
  153. package/dist/routing/index.mjs +0 -5
  154. package/dist/routing/index.mjs.map +0 -1
  155. package/dist/selectors.cjs +0 -166
  156. package/dist/selectors.cjs.map +0 -1
  157. package/dist/selectors.d.cts +0 -362
  158. package/dist/selectors.d.cts.map +0 -1
  159. package/dist/selectors.d.mts +0 -362
  160. package/dist/selectors.d.mts.map +0 -1
  161. package/dist/selectors.mjs +0 -158
  162. package/dist/selectors.mjs.map +0 -1
  163. package/dist/services/AccountService.cjs +0 -324
  164. package/dist/services/AccountService.cjs.map +0 -1
  165. package/dist/services/AccountService.d.cts +0 -56
  166. package/dist/services/AccountService.d.cts.map +0 -1
  167. package/dist/services/AccountService.d.mts +0 -56
  168. package/dist/services/AccountService.d.mts.map +0 -1
  169. package/dist/services/AccountService.mjs +0 -320
  170. package/dist/services/AccountService.mjs.map +0 -1
  171. package/dist/services/DataLakeService.cjs +0 -233
  172. package/dist/services/DataLakeService.cjs.map +0 -1
  173. package/dist/services/DataLakeService.d.cts +0 -51
  174. package/dist/services/DataLakeService.d.cts.map +0 -1
  175. package/dist/services/DataLakeService.d.mts +0 -51
  176. package/dist/services/DataLakeService.d.mts.map +0 -1
  177. package/dist/services/DataLakeService.mjs +0 -229
  178. package/dist/services/DataLakeService.mjs.map +0 -1
  179. package/dist/services/DepositService.cjs +0 -98
  180. package/dist/services/DepositService.cjs.map +0 -1
  181. package/dist/services/DepositService.d.cts +0 -39
  182. package/dist/services/DepositService.d.cts.map +0 -1
  183. package/dist/services/DepositService.d.mts +0 -39
  184. package/dist/services/DepositService.d.mts.map +0 -1
  185. package/dist/services/DepositService.mjs +0 -94
  186. package/dist/services/DepositService.mjs.map +0 -1
  187. package/dist/services/EligibilityService.cjs +0 -173
  188. package/dist/services/EligibilityService.cjs.map +0 -1
  189. package/dist/services/EligibilityService.d.cts +0 -39
  190. package/dist/services/EligibilityService.d.cts.map +0 -1
  191. package/dist/services/EligibilityService.d.mts +0 -39
  192. package/dist/services/EligibilityService.d.mts.map +0 -1
  193. package/dist/services/EligibilityService.mjs +0 -169
  194. package/dist/services/EligibilityService.mjs.map +0 -1
  195. package/dist/services/FeatureFlagConfigurationService.cjs +0 -257
  196. package/dist/services/FeatureFlagConfigurationService.cjs.map +0 -1
  197. package/dist/services/FeatureFlagConfigurationService.d.cts +0 -73
  198. package/dist/services/FeatureFlagConfigurationService.d.cts.map +0 -1
  199. package/dist/services/FeatureFlagConfigurationService.d.mts +0 -73
  200. package/dist/services/FeatureFlagConfigurationService.d.mts.map +0 -1
  201. package/dist/services/FeatureFlagConfigurationService.mjs +0 -253
  202. package/dist/services/FeatureFlagConfigurationService.mjs.map +0 -1
  203. package/dist/services/HyperLiquidClientService.cjs +0 -867
  204. package/dist/services/HyperLiquidClientService.cjs.map +0 -1
  205. package/dist/services/HyperLiquidClientService.d.cts +0 -214
  206. package/dist/services/HyperLiquidClientService.d.cts.map +0 -1
  207. package/dist/services/HyperLiquidClientService.d.mts +0 -214
  208. package/dist/services/HyperLiquidClientService.d.mts.map +0 -1
  209. package/dist/services/HyperLiquidClientService.mjs +0 -862
  210. package/dist/services/HyperLiquidClientService.mjs.map +0 -1
  211. package/dist/services/HyperLiquidSubscriptionService.cjs +0 -2199
  212. package/dist/services/HyperLiquidSubscriptionService.cjs.map +0 -1
  213. package/dist/services/HyperLiquidSubscriptionService.d.cts +0 -187
  214. package/dist/services/HyperLiquidSubscriptionService.d.cts.map +0 -1
  215. package/dist/services/HyperLiquidSubscriptionService.d.mts +0 -187
  216. package/dist/services/HyperLiquidSubscriptionService.d.mts.map +0 -1
  217. package/dist/services/HyperLiquidSubscriptionService.mjs +0 -2195
  218. package/dist/services/HyperLiquidSubscriptionService.mjs.map +0 -1
  219. package/dist/services/HyperLiquidWalletService.cjs +0 -163
  220. package/dist/services/HyperLiquidWalletService.cjs.map +0 -1
  221. package/dist/services/HyperLiquidWalletService.d.cts +0 -78
  222. package/dist/services/HyperLiquidWalletService.d.cts.map +0 -1
  223. package/dist/services/HyperLiquidWalletService.d.mts +0 -78
  224. package/dist/services/HyperLiquidWalletService.d.mts.map +0 -1
  225. package/dist/services/HyperLiquidWalletService.mjs +0 -159
  226. package/dist/services/HyperLiquidWalletService.mjs.map +0 -1
  227. package/dist/services/MYXClientService.cjs +0 -304
  228. package/dist/services/MYXClientService.cjs.map +0 -1
  229. package/dist/services/MYXClientService.d.cts +0 -81
  230. package/dist/services/MYXClientService.d.cts.map +0 -1
  231. package/dist/services/MYXClientService.d.mts +0 -81
  232. package/dist/services/MYXClientService.d.mts.map +0 -1
  233. package/dist/services/MYXClientService.mjs +0 -300
  234. package/dist/services/MYXClientService.mjs.map +0 -1
  235. package/dist/services/MarketDataService.cjs +0 -848
  236. package/dist/services/MarketDataService.cjs.map +0 -1
  237. package/dist/services/MarketDataService.d.cts +0 -291
  238. package/dist/services/MarketDataService.d.cts.map +0 -1
  239. package/dist/services/MarketDataService.d.mts +0 -291
  240. package/dist/services/MarketDataService.d.mts.map +0 -1
  241. package/dist/services/MarketDataService.mjs +0 -844
  242. package/dist/services/MarketDataService.mjs.map +0 -1
  243. package/dist/services/RewardsIntegrationService.cjs +0 -120
  244. package/dist/services/RewardsIntegrationService.cjs.map +0 -1
  245. package/dist/services/RewardsIntegrationService.d.cts +0 -28
  246. package/dist/services/RewardsIntegrationService.d.cts.map +0 -1
  247. package/dist/services/RewardsIntegrationService.d.mts +0 -28
  248. package/dist/services/RewardsIntegrationService.d.mts.map +0 -1
  249. package/dist/services/RewardsIntegrationService.mjs +0 -116
  250. package/dist/services/RewardsIntegrationService.mjs.map +0 -1
  251. package/dist/services/ServiceContext.cjs +0 -3
  252. package/dist/services/ServiceContext.cjs.map +0 -1
  253. package/dist/services/ServiceContext.d.cts +0 -86
  254. package/dist/services/ServiceContext.d.cts.map +0 -1
  255. package/dist/services/ServiceContext.d.mts +0 -86
  256. package/dist/services/ServiceContext.d.mts.map +0 -1
  257. package/dist/services/ServiceContext.mjs +0 -2
  258. package/dist/services/ServiceContext.mjs.map +0 -1
  259. package/dist/services/TradingReadinessCache.cjs +0 -288
  260. package/dist/services/TradingReadinessCache.cjs.map +0 -1
  261. package/dist/services/TradingReadinessCache.d.cts +0 -174
  262. package/dist/services/TradingReadinessCache.d.cts.map +0 -1
  263. package/dist/services/TradingReadinessCache.d.mts +0 -174
  264. package/dist/services/TradingReadinessCache.d.mts.map +0 -1
  265. package/dist/services/TradingReadinessCache.mjs +0 -285
  266. package/dist/services/TradingReadinessCache.mjs.map +0 -1
  267. package/dist/services/TradingService.cjs +0 -1457
  268. package/dist/services/TradingService.cjs.map +0 -1
  269. package/dist/services/TradingService.d.cts +0 -195
  270. package/dist/services/TradingService.d.cts.map +0 -1
  271. package/dist/services/TradingService.d.mts +0 -195
  272. package/dist/services/TradingService.d.mts.map +0 -1
  273. package/dist/services/TradingService.mjs +0 -1453
  274. package/dist/services/TradingService.mjs.map +0 -1
  275. package/dist/types/config.cjs +0 -3
  276. package/dist/types/config.cjs.map +0 -1
  277. package/dist/types/config.d.cts +0 -49
  278. package/dist/types/config.d.cts.map +0 -1
  279. package/dist/types/config.d.mts +0 -49
  280. package/dist/types/config.d.mts.map +0 -1
  281. package/dist/types/config.mjs +0 -2
  282. package/dist/types/config.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 -20
  286. package/dist/types/hyperliquid-types.d.cts.map +0 -1
  287. package/dist/types/hyperliquid-types.d.mts +0 -20
  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 -115
  292. package/dist/types/index.cjs.map +0 -1
  293. package/dist/types/index.d.cts +0 -1262
  294. package/dist/types/index.d.cts.map +0 -1
  295. package/dist/types/index.d.mts +0 -1262
  296. package/dist/types/index.d.mts.map +0 -1
  297. package/dist/types/index.mjs +0 -97
  298. package/dist/types/index.mjs.map +0 -1
  299. package/dist/types/messenger.cjs +0 -3
  300. package/dist/types/messenger.cjs.map +0 -1
  301. package/dist/types/messenger.d.cts +0 -27
  302. package/dist/types/messenger.d.cts.map +0 -1
  303. package/dist/types/messenger.d.mts +0 -27
  304. package/dist/types/messenger.d.mts.map +0 -1
  305. package/dist/types/messenger.mjs +0 -2
  306. package/dist/types/messenger.mjs.map +0 -1
  307. package/dist/types/myx-types.cjs +0 -25
  308. package/dist/types/myx-types.cjs.map +0 -1
  309. package/dist/types/myx-types.d.cts +0 -63
  310. package/dist/types/myx-types.d.cts.map +0 -1
  311. package/dist/types/myx-types.d.mts +0 -63
  312. package/dist/types/myx-types.d.mts.map +0 -1
  313. package/dist/types/myx-types.mjs +0 -22
  314. package/dist/types/myx-types.mjs.map +0 -1
  315. package/dist/types/perps-types.cjs +0 -4
  316. package/dist/types/perps-types.cjs.map +0 -1
  317. package/dist/types/perps-types.d.cts +0 -105
  318. package/dist/types/perps-types.d.cts.map +0 -1
  319. package/dist/types/perps-types.d.mts +0 -105
  320. package/dist/types/perps-types.d.mts.map +0 -1
  321. package/dist/types/perps-types.mjs +0 -2
  322. package/dist/types/perps-types.mjs.map +0 -1
  323. package/dist/types/token.cjs +0 -3
  324. package/dist/types/token.cjs.map +0 -1
  325. package/dist/types/token.d.cts +0 -25
  326. package/dist/types/token.d.cts.map +0 -1
  327. package/dist/types/token.d.mts +0 -25
  328. package/dist/types/token.d.mts.map +0 -1
  329. package/dist/types/token.mjs +0 -2
  330. package/dist/types/token.mjs.map +0 -1
  331. package/dist/types/transactionTypes.cjs +0 -28
  332. package/dist/types/transactionTypes.cjs.map +0 -1
  333. package/dist/types/transactionTypes.d.cts +0 -64
  334. package/dist/types/transactionTypes.d.cts.map +0 -1
  335. package/dist/types/transactionTypes.d.mts +0 -64
  336. package/dist/types/transactionTypes.d.mts.map +0 -1
  337. package/dist/types/transactionTypes.mjs +0 -23
  338. package/dist/types/transactionTypes.mjs.map +0 -1
  339. package/dist/utils/accountUtils.cjs +0 -100
  340. package/dist/utils/accountUtils.cjs.map +0 -1
  341. package/dist/utils/accountUtils.d.cts +0 -30
  342. package/dist/utils/accountUtils.d.cts.map +0 -1
  343. package/dist/utils/accountUtils.d.mts +0 -30
  344. package/dist/utils/accountUtils.d.mts.map +0 -1
  345. package/dist/utils/accountUtils.mjs +0 -92
  346. package/dist/utils/accountUtils.mjs.map +0 -1
  347. package/dist/utils/errorUtils.cjs +0 -35
  348. package/dist/utils/errorUtils.cjs.map +0 -1
  349. package/dist/utils/errorUtils.d.cts +0 -15
  350. package/dist/utils/errorUtils.d.cts.map +0 -1
  351. package/dist/utils/errorUtils.d.mts +0 -15
  352. package/dist/utils/errorUtils.d.mts.map +0 -1
  353. package/dist/utils/errorUtils.mjs +0 -31
  354. package/dist/utils/errorUtils.mjs.map +0 -1
  355. package/dist/utils/hyperLiquidAdapter.cjs +0 -331
  356. package/dist/utils/hyperLiquidAdapter.cjs.map +0 -1
  357. package/dist/utils/hyperLiquidAdapter.d.cts +0 -42
  358. package/dist/utils/hyperLiquidAdapter.d.cts.map +0 -1
  359. package/dist/utils/hyperLiquidAdapter.d.mts +0 -42
  360. package/dist/utils/hyperLiquidAdapter.d.mts.map +0 -1
  361. package/dist/utils/hyperLiquidAdapter.mjs +0 -316
  362. package/dist/utils/hyperLiquidAdapter.mjs.map +0 -1
  363. package/dist/utils/hyperLiquidOrderBookProcessor.cjs +0 -83
  364. package/dist/utils/hyperLiquidOrderBookProcessor.cjs.map +0 -1
  365. package/dist/utils/hyperLiquidOrderBookProcessor.d.cts +0 -55
  366. package/dist/utils/hyperLiquidOrderBookProcessor.d.cts.map +0 -1
  367. package/dist/utils/hyperLiquidOrderBookProcessor.d.mts +0 -55
  368. package/dist/utils/hyperLiquidOrderBookProcessor.d.mts.map +0 -1
  369. package/dist/utils/hyperLiquidOrderBookProcessor.mjs +0 -78
  370. package/dist/utils/hyperLiquidOrderBookProcessor.mjs.map +0 -1
  371. package/dist/utils/hyperLiquidValidation.cjs +0 -426
  372. package/dist/utils/hyperLiquidValidation.cjs.map +0 -1
  373. package/dist/utils/hyperLiquidValidation.d.cts +0 -143
  374. package/dist/utils/hyperLiquidValidation.d.cts.map +0 -1
  375. package/dist/utils/hyperLiquidValidation.d.mts +0 -143
  376. package/dist/utils/hyperLiquidValidation.d.mts.map +0 -1
  377. package/dist/utils/hyperLiquidValidation.mjs +0 -413
  378. package/dist/utils/hyperLiquidValidation.mjs.map +0 -1
  379. package/dist/utils/idUtils.cjs +0 -18
  380. package/dist/utils/idUtils.cjs.map +0 -1
  381. package/dist/utils/idUtils.d.cts +0 -6
  382. package/dist/utils/idUtils.d.cts.map +0 -1
  383. package/dist/utils/idUtils.d.mts +0 -6
  384. package/dist/utils/idUtils.d.mts.map +0 -1
  385. package/dist/utils/idUtils.mjs +0 -10
  386. package/dist/utils/idUtils.mjs.map +0 -1
  387. package/dist/utils/index.cjs +0 -59
  388. package/dist/utils/index.cjs.map +0 -1
  389. package/dist/utils/index.d.cts +0 -25
  390. package/dist/utils/index.d.cts.map +0 -1
  391. package/dist/utils/index.d.mts +0 -25
  392. package/dist/utils/index.d.mts.map +0 -1
  393. package/dist/utils/index.mjs +0 -30
  394. package/dist/utils/index.mjs.map +0 -1
  395. package/dist/utils/marketDataTransform.cjs +0 -211
  396. package/dist/utils/marketDataTransform.cjs.map +0 -1
  397. package/dist/utils/marketDataTransform.d.cts +0 -40
  398. package/dist/utils/marketDataTransform.d.cts.map +0 -1
  399. package/dist/utils/marketDataTransform.d.mts +0 -40
  400. package/dist/utils/marketDataTransform.d.mts.map +0 -1
  401. package/dist/utils/marketDataTransform.mjs +0 -205
  402. package/dist/utils/marketDataTransform.mjs.map +0 -1
  403. package/dist/utils/marketUtils.cjs +0 -151
  404. package/dist/utils/marketUtils.cjs.map +0 -1
  405. package/dist/utils/marketUtils.d.cts +0 -30
  406. package/dist/utils/marketUtils.d.cts.map +0 -1
  407. package/dist/utils/marketUtils.d.mts +0 -30
  408. package/dist/utils/marketUtils.d.mts.map +0 -1
  409. package/dist/utils/marketUtils.mjs +0 -138
  410. package/dist/utils/marketUtils.mjs.map +0 -1
  411. package/dist/utils/myxAdapter.cjs +0 -224
  412. package/dist/utils/myxAdapter.cjs.map +0 -1
  413. package/dist/utils/myxAdapter.d.cts +0 -81
  414. package/dist/utils/myxAdapter.d.cts.map +0 -1
  415. package/dist/utils/myxAdapter.d.mts +0 -81
  416. package/dist/utils/myxAdapter.d.mts.map +0 -1
  417. package/dist/utils/myxAdapter.mjs +0 -213
  418. package/dist/utils/myxAdapter.mjs.map +0 -1
  419. package/dist/utils/orderCalculations.cjs +0 -283
  420. package/dist/utils/orderCalculations.cjs.map +0 -1
  421. package/dist/utils/orderCalculations.d.cts +0 -107
  422. package/dist/utils/orderCalculations.d.cts.map +0 -1
  423. package/dist/utils/orderCalculations.d.mts +0 -107
  424. package/dist/utils/orderCalculations.d.mts.map +0 -1
  425. package/dist/utils/orderCalculations.mjs +0 -274
  426. package/dist/utils/orderCalculations.mjs.map +0 -1
  427. package/dist/utils/rewardsUtils.cjs +0 -98
  428. package/dist/utils/rewardsUtils.cjs.map +0 -1
  429. package/dist/utils/rewardsUtils.d.cts +0 -33
  430. package/dist/utils/rewardsUtils.d.cts.map +0 -1
  431. package/dist/utils/rewardsUtils.d.mts +0 -33
  432. package/dist/utils/rewardsUtils.d.mts.map +0 -1
  433. package/dist/utils/rewardsUtils.mjs +0 -92
  434. package/dist/utils/rewardsUtils.mjs.map +0 -1
  435. package/dist/utils/significantFigures.cjs +0 -88
  436. package/dist/utils/significantFigures.cjs.map +0 -1
  437. package/dist/utils/significantFigures.d.cts +0 -25
  438. package/dist/utils/significantFigures.d.cts.map +0 -1
  439. package/dist/utils/significantFigures.d.mts +0 -25
  440. package/dist/utils/significantFigures.d.mts.map +0 -1
  441. package/dist/utils/significantFigures.mjs +0 -82
  442. package/dist/utils/significantFigures.mjs.map +0 -1
  443. package/dist/utils/sortMarkets.cjs +0 -93
  444. package/dist/utils/sortMarkets.cjs.map +0 -1
  445. package/dist/utils/sortMarkets.d.cts +0 -27
  446. package/dist/utils/sortMarkets.d.cts.map +0 -1
  447. package/dist/utils/sortMarkets.d.mts +0 -27
  448. package/dist/utils/sortMarkets.d.mts.map +0 -1
  449. package/dist/utils/sortMarkets.mjs +0 -88
  450. package/dist/utils/sortMarkets.mjs.map +0 -1
  451. package/dist/utils/standaloneInfoClient.cjs +0 -70
  452. package/dist/utils/standaloneInfoClient.cjs.map +0 -1
  453. package/dist/utils/standaloneInfoClient.d.cts +0 -37
  454. package/dist/utils/standaloneInfoClient.d.cts.map +0 -1
  455. package/dist/utils/standaloneInfoClient.d.mts +0 -37
  456. package/dist/utils/standaloneInfoClient.d.mts.map +0 -1
  457. package/dist/utils/standaloneInfoClient.mjs +0 -64
  458. package/dist/utils/standaloneInfoClient.mjs.map +0 -1
  459. package/dist/utils/stringParseUtils.cjs +0 -18
  460. package/dist/utils/stringParseUtils.cjs.map +0 -1
  461. package/dist/utils/stringParseUtils.d.cts +0 -3
  462. package/dist/utils/stringParseUtils.d.cts.map +0 -1
  463. package/dist/utils/stringParseUtils.d.mts +0 -3
  464. package/dist/utils/stringParseUtils.d.mts.map +0 -1
  465. package/dist/utils/stringParseUtils.mjs +0 -13
  466. package/dist/utils/stringParseUtils.mjs.map +0 -1
  467. package/dist/utils/transferData.cjs +0 -33
  468. package/dist/utils/transferData.cjs.map +0 -1
  469. package/dist/utils/transferData.d.cts +0 -9
  470. package/dist/utils/transferData.d.cts.map +0 -1
  471. package/dist/utils/transferData.d.mts +0 -9
  472. package/dist/utils/transferData.d.mts.map +0 -1
  473. package/dist/utils/transferData.mjs +0 -29
  474. package/dist/utils/transferData.mjs.map +0 -1
  475. package/dist/utils/wait.cjs +0 -6
  476. package/dist/utils/wait.cjs.map +0 -1
  477. package/dist/utils/wait.d.cts +0 -2
  478. package/dist/utils/wait.d.cts.map +0 -1
  479. package/dist/utils/wait.d.mts +0 -2
  480. package/dist/utils/wait.d.mts.map +0 -1
  481. package/dist/utils/wait.mjs +0 -2
  482. package/dist/utils/wait.mjs.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"myx-types.mjs","sourceRoot":"","sources":["../../src/types/myx-types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAwDH,+EAA+E;AAC/E,+BAA+B;AAC/B,+EAA+E;AAE/E;;;;GAIG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,KAAK;IACL,KAAK;IACL,KAAK;IACL,MAAM;IACN,MAAM;CACE,CAAC","sourcesContent":["/**\n * MYX Protocol Type Definitions\n *\n * Minimal types needed for Stage 1 (market display and price fetching).\n * Only defines what's needed - SDK types are re-exported with MYX prefix.\n */\n\nimport type { CaipChainId } from '@metamask/utils';\n\n// ============================================================================\n// Re-export SDK Types with MYX prefix for consistency\n// ============================================================================\n\nexport type { PoolSymbolAllResponse as MYXPoolSymbol } from '@myx-trade/sdk';\nexport type { TickerDataItem as MYXTicker } from '@myx-trade/sdk';\n\n// ============================================================================\n// Network Configuration Types\n// ============================================================================\n\n/**\n * MYX Network type - mainnet or testnet\n */\nexport type MYXNetwork = 'mainnet' | 'testnet';\n\n/**\n * MYX Endpoint configuration for a single network\n */\nexport type MYXEndpointConfig = {\n http: string;\n ws: string;\n};\n\n/**\n * MYX Endpoints for all networks\n */\nexport type MYXEndpoints = {\n mainnet: MYXEndpointConfig;\n testnet: MYXEndpointConfig;\n};\n\n/**\n * MYX Asset network configuration (token addresses per network)\n */\nexport type MYXAssetNetworkConfig = {\n chainId: CaipChainId;\n tokenAddress: string;\n};\n\n/**\n * MYX Asset configurations by network\n */\nexport type MYXAssetConfigs = {\n // USDT is the token symbol used as API key - not a variable name\n // eslint-disable-next-line @typescript-eslint/naming-convention\n USDT: {\n mainnet: MYXAssetNetworkConfig;\n testnet: MYXAssetNetworkConfig;\n };\n};\n\n// ============================================================================\n// Market Overlap Configuration\n// ============================================================================\n\n/**\n * Markets that overlap with HyperLiquid\n * These are excluded from MYX display in v1.0 to avoid confusion\n * In Stage 7, we'll implement market collision handling\n */\nexport const MYX_HL_OVERLAPPING_MARKETS = [\n 'BTC',\n 'ETH',\n 'BNB',\n 'PUMP',\n 'WLFI',\n] as const;\n\nexport type MYXOverlappingMarket = (typeof MYX_HL_OVERLAPPING_MARKETS)[number];\n\n// ============================================================================\n// Client Service Types\n// ============================================================================\n\n/**\n * Price callback for REST polling\n */\nexport type MYXPriceCallback = (\n tickers: { symbol: string; price: string; change24h: number }[],\n) => void;\n\n/**\n * Error callback for client operations\n */\nexport type MYXErrorCallback = (error: Error) => void;\n"]}
@@ -1,4 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const chartConfig_1 = require("../constants/chartConfig.cjs");
4
- //# sourceMappingURL=perps-types.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"perps-types.cjs","sourceRoot":"","sources":["../../src/types/perps-types.ts"],"names":[],"mappings":";;AAIA,8DAAwD","sourcesContent":["/**\n * Test result states for SDK validation\n */\nimport { OrderType } from '.';\nimport { CandlePeriod } from '../constants/chartConfig';\n\nexport type TestResultStatus =\n | 'idle'\n | 'loading'\n | 'success'\n | 'warning'\n | 'error';\n\n/**\n * Test result data structure\n */\nexport type TestResult = {\n status: TestResultStatus;\n message: string;\n data?: Record<string, unknown>;\n};\n\n/**\n * SDK test types\n */\nexport type SDKTestType = 'connection' | 'asset-listing' | 'websocket';\n\n/**\n * Hyperliquid asset interface (basic structure)\n */\nexport type HyperliquidAsset = {\n name: string;\n [key: string]: unknown;\n};\n\n/**\n * Represents a single candlestick data point\n */\nexport type CandleStick = {\n time: number;\n open: string;\n high: string;\n low: string;\n close: string;\n volume: string;\n};\n\n/**\n * Represents historical candlestick data for a specific symbol and interval\n */\nexport type CandleData = {\n /** Asset identifier (e.g., 'BTC', 'ETH'). Protocol-agnostic terminology for multi-provider support. */\n symbol: string;\n interval: CandlePeriod;\n candles: CandleStick[];\n};\n\n// Export all configuration types directly\nexport type * from './config';\nexport type * from './token';\n\n/**\n * Order form state for the Perps order view\n */\nexport type OrderFormState = {\n asset: string;\n direction: 'long' | 'short';\n amount: string;\n leverage: number;\n balancePercent: number;\n takeProfitPrice?: string;\n stopLossPrice?: string;\n limitPrice?: string;\n type: OrderType;\n};\n\nexport type OrderDirection = 'long' | 'short';\n\n/**\n * Options for reconnecting the Perps connection\n */\nexport type ReconnectOptions = {\n /**\n * If true, forces immediate disconnect and cancels all pending operations.\n * Use for user-initiated retry actions.\n * If false (default), waits for pending operations to complete.\n * Use for automatic reconnections like account switches.\n */\n force?: boolean;\n};\n\n/**\n * Extended asset metadata including Growth Mode fields not in SDK types.\n * The HyperLiquid API returns these fields but the SDK doesn't type them.\n *\n * @see https://hyperliquid.gitbook.io/hyperliquid-docs/trading/fees#fee-formula-for-developers\n */\nexport type ExtendedAssetMeta = {\n name: string;\n szDecimals: number;\n maxLeverage: number;\n /** Per-asset Growth Mode status - \"enabled\" means 90% fee reduction */\n growthMode?: 'enabled' | null;\n /** ISO timestamp of last Growth Mode change */\n lastGrowthModeChangeTime?: string;\n};\n\n/**\n * Extended perp DEX info including fee scale fields not in SDK types.\n * The HyperLiquid API returns these fields but the SDK doesn't type them.\n *\n * @see https://hyperliquid.gitbook.io/hyperliquid-docs/trading/fees#fee-formula-for-developers\n */\nexport type ExtendedPerpDex = {\n name: string;\n fullName?: string;\n deployer?: string;\n /** DEX-level fee scale (e.g., \"1.0\" for xyz DEX) - determines HIP-3 multiplier */\n deployerFeeScale?: string;\n /** ISO timestamp of last fee scale change */\n lastDeployerFeeScaleChangeTime?: string;\n};\n"]}
@@ -1,105 +0,0 @@
1
- /**
2
- * Test result states for SDK validation
3
- */
4
- import { OrderType } from "./index.cjs";
5
- import { CandlePeriod } from "../constants/chartConfig.cjs";
6
- export type TestResultStatus = 'idle' | 'loading' | 'success' | 'warning' | 'error';
7
- /**
8
- * Test result data structure
9
- */
10
- export type TestResult = {
11
- status: TestResultStatus;
12
- message: string;
13
- data?: Record<string, unknown>;
14
- };
15
- /**
16
- * SDK test types
17
- */
18
- export type SDKTestType = 'connection' | 'asset-listing' | 'websocket';
19
- /**
20
- * Hyperliquid asset interface (basic structure)
21
- */
22
- export type HyperliquidAsset = {
23
- name: string;
24
- [key: string]: unknown;
25
- };
26
- /**
27
- * Represents a single candlestick data point
28
- */
29
- export type CandleStick = {
30
- time: number;
31
- open: string;
32
- high: string;
33
- low: string;
34
- close: string;
35
- volume: string;
36
- };
37
- /**
38
- * Represents historical candlestick data for a specific symbol and interval
39
- */
40
- export type CandleData = {
41
- /** Asset identifier (e.g., 'BTC', 'ETH'). Protocol-agnostic terminology for multi-provider support. */
42
- symbol: string;
43
- interval: CandlePeriod;
44
- candles: CandleStick[];
45
- };
46
- export type * from "./config.cjs";
47
- export type * from "./token.cjs";
48
- /**
49
- * Order form state for the Perps order view
50
- */
51
- export type OrderFormState = {
52
- asset: string;
53
- direction: 'long' | 'short';
54
- amount: string;
55
- leverage: number;
56
- balancePercent: number;
57
- takeProfitPrice?: string;
58
- stopLossPrice?: string;
59
- limitPrice?: string;
60
- type: OrderType;
61
- };
62
- export type OrderDirection = 'long' | 'short';
63
- /**
64
- * Options for reconnecting the Perps connection
65
- */
66
- export type ReconnectOptions = {
67
- /**
68
- * If true, forces immediate disconnect and cancels all pending operations.
69
- * Use for user-initiated retry actions.
70
- * If false (default), waits for pending operations to complete.
71
- * Use for automatic reconnections like account switches.
72
- */
73
- force?: boolean;
74
- };
75
- /**
76
- * Extended asset metadata including Growth Mode fields not in SDK types.
77
- * The HyperLiquid API returns these fields but the SDK doesn't type them.
78
- *
79
- * @see https://hyperliquid.gitbook.io/hyperliquid-docs/trading/fees#fee-formula-for-developers
80
- */
81
- export type ExtendedAssetMeta = {
82
- name: string;
83
- szDecimals: number;
84
- maxLeverage: number;
85
- /** Per-asset Growth Mode status - "enabled" means 90% fee reduction */
86
- growthMode?: 'enabled' | null;
87
- /** ISO timestamp of last Growth Mode change */
88
- lastGrowthModeChangeTime?: string;
89
- };
90
- /**
91
- * Extended perp DEX info including fee scale fields not in SDK types.
92
- * The HyperLiquid API returns these fields but the SDK doesn't type them.
93
- *
94
- * @see https://hyperliquid.gitbook.io/hyperliquid-docs/trading/fees#fee-formula-for-developers
95
- */
96
- export type ExtendedPerpDex = {
97
- name: string;
98
- fullName?: string;
99
- deployer?: string;
100
- /** DEX-level fee scale (e.g., "1.0" for xyz DEX) - determines HIP-3 multiplier */
101
- deployerFeeScale?: string;
102
- /** ISO timestamp of last fee scale change */
103
- lastDeployerFeeScaleChangeTime?: string;
104
- };
105
- //# sourceMappingURL=perps-types.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"perps-types.d.cts","sourceRoot":"","sources":["../../src/types/perps-types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,SAAS,EAAE,oBAAU;AAC9B,OAAO,EAAE,YAAY,EAAE,qCAAiC;AAExD,MAAM,MAAM,gBAAgB,GACxB,MAAM,GACN,SAAS,GACT,SAAS,GACT,SAAS,GACT,OAAO,CAAC;AAEZ;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,MAAM,EAAE,gBAAgB,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAChC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,YAAY,GAAG,eAAe,GAAG,WAAW,CAAC;AAEvE;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,uGAAuG;IACvG,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,YAAY,CAAC;IACvB,OAAO,EAAE,WAAW,EAAE,CAAC;CACxB,CAAC;AAGF,kCAA8B;AAC9B,iCAA6B;AAE7B;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,SAAS,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,OAAO,CAAC;AAE9C;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B;;;;;OAKG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,uEAAuE;IACvE,UAAU,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IAC9B,+CAA+C;IAC/C,wBAAwB,CAAC,EAAE,MAAM,CAAC;CACnC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,kFAAkF;IAClF,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,6CAA6C;IAC7C,8BAA8B,CAAC,EAAE,MAAM,CAAC;CACzC,CAAC"}
@@ -1,105 +0,0 @@
1
- /**
2
- * Test result states for SDK validation
3
- */
4
- import { OrderType } from "./index.mjs";
5
- import { CandlePeriod } from "../constants/chartConfig.mjs";
6
- export type TestResultStatus = 'idle' | 'loading' | 'success' | 'warning' | 'error';
7
- /**
8
- * Test result data structure
9
- */
10
- export type TestResult = {
11
- status: TestResultStatus;
12
- message: string;
13
- data?: Record<string, unknown>;
14
- };
15
- /**
16
- * SDK test types
17
- */
18
- export type SDKTestType = 'connection' | 'asset-listing' | 'websocket';
19
- /**
20
- * Hyperliquid asset interface (basic structure)
21
- */
22
- export type HyperliquidAsset = {
23
- name: string;
24
- [key: string]: unknown;
25
- };
26
- /**
27
- * Represents a single candlestick data point
28
- */
29
- export type CandleStick = {
30
- time: number;
31
- open: string;
32
- high: string;
33
- low: string;
34
- close: string;
35
- volume: string;
36
- };
37
- /**
38
- * Represents historical candlestick data for a specific symbol and interval
39
- */
40
- export type CandleData = {
41
- /** Asset identifier (e.g., 'BTC', 'ETH'). Protocol-agnostic terminology for multi-provider support. */
42
- symbol: string;
43
- interval: CandlePeriod;
44
- candles: CandleStick[];
45
- };
46
- export type * from "./config.mjs";
47
- export type * from "./token.mjs";
48
- /**
49
- * Order form state for the Perps order view
50
- */
51
- export type OrderFormState = {
52
- asset: string;
53
- direction: 'long' | 'short';
54
- amount: string;
55
- leverage: number;
56
- balancePercent: number;
57
- takeProfitPrice?: string;
58
- stopLossPrice?: string;
59
- limitPrice?: string;
60
- type: OrderType;
61
- };
62
- export type OrderDirection = 'long' | 'short';
63
- /**
64
- * Options for reconnecting the Perps connection
65
- */
66
- export type ReconnectOptions = {
67
- /**
68
- * If true, forces immediate disconnect and cancels all pending operations.
69
- * Use for user-initiated retry actions.
70
- * If false (default), waits for pending operations to complete.
71
- * Use for automatic reconnections like account switches.
72
- */
73
- force?: boolean;
74
- };
75
- /**
76
- * Extended asset metadata including Growth Mode fields not in SDK types.
77
- * The HyperLiquid API returns these fields but the SDK doesn't type them.
78
- *
79
- * @see https://hyperliquid.gitbook.io/hyperliquid-docs/trading/fees#fee-formula-for-developers
80
- */
81
- export type ExtendedAssetMeta = {
82
- name: string;
83
- szDecimals: number;
84
- maxLeverage: number;
85
- /** Per-asset Growth Mode status - "enabled" means 90% fee reduction */
86
- growthMode?: 'enabled' | null;
87
- /** ISO timestamp of last Growth Mode change */
88
- lastGrowthModeChangeTime?: string;
89
- };
90
- /**
91
- * Extended perp DEX info including fee scale fields not in SDK types.
92
- * The HyperLiquid API returns these fields but the SDK doesn't type them.
93
- *
94
- * @see https://hyperliquid.gitbook.io/hyperliquid-docs/trading/fees#fee-formula-for-developers
95
- */
96
- export type ExtendedPerpDex = {
97
- name: string;
98
- fullName?: string;
99
- deployer?: string;
100
- /** DEX-level fee scale (e.g., "1.0" for xyz DEX) - determines HIP-3 multiplier */
101
- deployerFeeScale?: string;
102
- /** ISO timestamp of last fee scale change */
103
- lastDeployerFeeScaleChangeTime?: string;
104
- };
105
- //# sourceMappingURL=perps-types.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"perps-types.d.mts","sourceRoot":"","sources":["../../src/types/perps-types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,SAAS,EAAE,oBAAU;AAC9B,OAAO,EAAE,YAAY,EAAE,qCAAiC;AAExD,MAAM,MAAM,gBAAgB,GACxB,MAAM,GACN,SAAS,GACT,SAAS,GACT,SAAS,GACT,OAAO,CAAC;AAEZ;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,MAAM,EAAE,gBAAgB,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAChC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,YAAY,GAAG,eAAe,GAAG,WAAW,CAAC;AAEvE;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,uGAAuG;IACvG,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,YAAY,CAAC;IACvB,OAAO,EAAE,WAAW,EAAE,CAAC;CACxB,CAAC;AAGF,kCAA8B;AAC9B,iCAA6B;AAE7B;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,SAAS,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,OAAO,CAAC;AAE9C;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B;;;;;OAKG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,uEAAuE;IACvE,UAAU,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IAC9B,+CAA+C;IAC/C,wBAAwB,CAAC,EAAE,MAAM,CAAC;CACnC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,kFAAkF;IAClF,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,6CAA6C;IAC7C,8BAA8B,CAAC,EAAE,MAAM,CAAC;CACzC,CAAC"}
@@ -1,2 +0,0 @@
1
- import { CandlePeriod } from "../constants/chartConfig.mjs";
2
- //# sourceMappingURL=perps-types.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"perps-types.mjs","sourceRoot":"","sources":["../../src/types/perps-types.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,qCAAiC","sourcesContent":["/**\n * Test result states for SDK validation\n */\nimport { OrderType } from '.';\nimport { CandlePeriod } from '../constants/chartConfig';\n\nexport type TestResultStatus =\n | 'idle'\n | 'loading'\n | 'success'\n | 'warning'\n | 'error';\n\n/**\n * Test result data structure\n */\nexport type TestResult = {\n status: TestResultStatus;\n message: string;\n data?: Record<string, unknown>;\n};\n\n/**\n * SDK test types\n */\nexport type SDKTestType = 'connection' | 'asset-listing' | 'websocket';\n\n/**\n * Hyperliquid asset interface (basic structure)\n */\nexport type HyperliquidAsset = {\n name: string;\n [key: string]: unknown;\n};\n\n/**\n * Represents a single candlestick data point\n */\nexport type CandleStick = {\n time: number;\n open: string;\n high: string;\n low: string;\n close: string;\n volume: string;\n};\n\n/**\n * Represents historical candlestick data for a specific symbol and interval\n */\nexport type CandleData = {\n /** Asset identifier (e.g., 'BTC', 'ETH'). Protocol-agnostic terminology for multi-provider support. */\n symbol: string;\n interval: CandlePeriod;\n candles: CandleStick[];\n};\n\n// Export all configuration types directly\nexport type * from './config';\nexport type * from './token';\n\n/**\n * Order form state for the Perps order view\n */\nexport type OrderFormState = {\n asset: string;\n direction: 'long' | 'short';\n amount: string;\n leverage: number;\n balancePercent: number;\n takeProfitPrice?: string;\n stopLossPrice?: string;\n limitPrice?: string;\n type: OrderType;\n};\n\nexport type OrderDirection = 'long' | 'short';\n\n/**\n * Options for reconnecting the Perps connection\n */\nexport type ReconnectOptions = {\n /**\n * If true, forces immediate disconnect and cancels all pending operations.\n * Use for user-initiated retry actions.\n * If false (default), waits for pending operations to complete.\n * Use for automatic reconnections like account switches.\n */\n force?: boolean;\n};\n\n/**\n * Extended asset metadata including Growth Mode fields not in SDK types.\n * The HyperLiquid API returns these fields but the SDK doesn't type them.\n *\n * @see https://hyperliquid.gitbook.io/hyperliquid-docs/trading/fees#fee-formula-for-developers\n */\nexport type ExtendedAssetMeta = {\n name: string;\n szDecimals: number;\n maxLeverage: number;\n /** Per-asset Growth Mode status - \"enabled\" means 90% fee reduction */\n growthMode?: 'enabled' | null;\n /** ISO timestamp of last Growth Mode change */\n lastGrowthModeChangeTime?: string;\n};\n\n/**\n * Extended perp DEX info including fee scale fields not in SDK types.\n * The HyperLiquid API returns these fields but the SDK doesn't type them.\n *\n * @see https://hyperliquid.gitbook.io/hyperliquid-docs/trading/fees#fee-formula-for-developers\n */\nexport type ExtendedPerpDex = {\n name: string;\n fullName?: string;\n deployer?: string;\n /** DEX-level fee scale (e.g., \"1.0\" for xyz DEX) - determines HIP-3 multiplier */\n deployerFeeScale?: string;\n /** ISO timestamp of last fee scale change */\n lastDeployerFeeScaleChangeTime?: string;\n};\n"]}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=token.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"token.cjs","sourceRoot":"","sources":["../../src/types/token.ts"],"names":[],"mappings":"","sourcesContent":["import type { Hex, CaipChainId } from '@metamask/utils';\n\n/**\n * Token interface for Perps trading.\n * Independent from BridgeToken to avoid Mobile-only dependencies.\n * Shape matches BridgeToken for backward compatibility.\n */\nexport type PerpsToken = {\n address: string;\n name?: string;\n symbol: string;\n image?: string;\n decimals: number;\n chainId: Hex | CaipChainId;\n balance?: string;\n balanceFiat?: string;\n tokenFiatAmount?: number;\n currencyExchangeRate?: number;\n noFee?: { isSource: boolean; isDestination: boolean };\n aggregators?: string[];\n metadata?: Record<string, unknown>;\n};\n"]}
@@ -1,25 +0,0 @@
1
- import type { Hex, CaipChainId } from "@metamask/utils";
2
- /**
3
- * Token interface for Perps trading.
4
- * Independent from BridgeToken to avoid Mobile-only dependencies.
5
- * Shape matches BridgeToken for backward compatibility.
6
- */
7
- export type PerpsToken = {
8
- address: string;
9
- name?: string;
10
- symbol: string;
11
- image?: string;
12
- decimals: number;
13
- chainId: Hex | CaipChainId;
14
- balance?: string;
15
- balanceFiat?: string;
16
- tokenFiatAmount?: number;
17
- currencyExchangeRate?: number;
18
- noFee?: {
19
- isSource: boolean;
20
- isDestination: boolean;
21
- };
22
- aggregators?: string[];
23
- metadata?: Record<string, unknown>;
24
- };
25
- //# sourceMappingURL=token.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"token.d.cts","sourceRoot":"","sources":["../../src/types/token.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,WAAW,EAAE,wBAAwB;AAExD;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,GAAG,GAAG,WAAW,CAAC;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,KAAK,CAAC,EAAE;QAAE,QAAQ,EAAE,OAAO,CAAC;QAAC,aAAa,EAAE,OAAO,CAAA;KAAE,CAAC;IACtD,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC,CAAC"}
@@ -1,25 +0,0 @@
1
- import type { Hex, CaipChainId } from "@metamask/utils";
2
- /**
3
- * Token interface for Perps trading.
4
- * Independent from BridgeToken to avoid Mobile-only dependencies.
5
- * Shape matches BridgeToken for backward compatibility.
6
- */
7
- export type PerpsToken = {
8
- address: string;
9
- name?: string;
10
- symbol: string;
11
- image?: string;
12
- decimals: number;
13
- chainId: Hex | CaipChainId;
14
- balance?: string;
15
- balanceFiat?: string;
16
- tokenFiatAmount?: number;
17
- currencyExchangeRate?: number;
18
- noFee?: {
19
- isSource: boolean;
20
- isDestination: boolean;
21
- };
22
- aggregators?: string[];
23
- metadata?: Record<string, unknown>;
24
- };
25
- //# sourceMappingURL=token.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"token.d.mts","sourceRoot":"","sources":["../../src/types/token.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,WAAW,EAAE,wBAAwB;AAExD;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,GAAG,GAAG,WAAW,CAAC;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,KAAK,CAAC,EAAE;QAAE,QAAQ,EAAE,OAAO,CAAC;QAAC,aAAa,EAAE,OAAO,CAAA;KAAE,CAAC;IACtD,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=token.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"token.mjs","sourceRoot":"","sources":["../../src/types/token.ts"],"names":[],"mappings":"","sourcesContent":["import type { Hex, CaipChainId } from '@metamask/utils';\n\n/**\n * Token interface for Perps trading.\n * Independent from BridgeToken to avoid Mobile-only dependencies.\n * Shape matches BridgeToken for backward compatibility.\n */\nexport type PerpsToken = {\n address: string;\n name?: string;\n symbol: string;\n image?: string;\n decimals: number;\n chainId: Hex | CaipChainId;\n balance?: string;\n balanceFiat?: string;\n tokenFiatAmount?: number;\n currencyExchangeRate?: number;\n noFee?: { isSource: boolean; isDestination: boolean };\n aggregators?: string[];\n metadata?: Record<string, unknown>;\n};\n"]}
@@ -1,28 +0,0 @@
1
- "use strict";
2
- /**
3
- * Shared transaction types for Perps deposits and withdrawals
4
- * Provides a unified structure while maintaining separate use cases
5
- */
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.isLastTransactionResult = exports.isTransactionRecord = void 0;
8
- /**
9
- * Type guard to check if a transaction result is a TransactionRecord
10
- *
11
- * @param result - The transaction result to check.
12
- * @returns True if the result is a TransactionRecord with id and status fields.
13
- */
14
- function isTransactionRecord(result) {
15
- return 'id' in result && 'status' in result;
16
- }
17
- exports.isTransactionRecord = isTransactionRecord;
18
- /**
19
- * Type guard to check if a transaction result is a LastTransactionResult
20
- *
21
- * @param result - The transaction result to check.
22
- * @returns True if the result is a LastTransactionResult without id or status fields.
23
- */
24
- function isLastTransactionResult(result) {
25
- return !('id' in result) || !('status' in result);
26
- }
27
- exports.isLastTransactionResult = isLastTransactionResult;
28
- //# sourceMappingURL=transactionTypes.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"transactionTypes.cjs","sourceRoot":"","sources":["../../src/types/transactionTypes.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAoDH;;;;;GAKG;AACH,SAAgB,mBAAmB,CACjC,MAAiD;IAEjD,OAAO,IAAI,IAAI,MAAM,IAAI,QAAQ,IAAI,MAAM,CAAC;AAC9C,CAAC;AAJD,kDAIC;AAED;;;;;GAKG;AACH,SAAgB,uBAAuB,CACrC,MAAiD;IAEjD,OAAO,CAAC,CAAC,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC,QAAQ,IAAI,MAAM,CAAC,CAAC;AACpD,CAAC;AAJD,0DAIC","sourcesContent":["/**\n * Shared transaction types for Perps deposits and withdrawals\n * Provides a unified structure while maintaining separate use cases\n */\n\n/**\n * Base type with core properties shared between all transaction results\n * All properties are JSON serializable for controller state compatibility\n */\nexport type BaseTransactionResult = {\n amount: string;\n asset: string;\n txHash?: string;\n timestamp: number;\n success: boolean; // explicit to avoid regressions\n};\n\n/**\n * For transient UI feedback (toasts, progress indicators)\n * Used for immediate success/failure notifications\n * JSON serializable for controller state\n */\nexport type LastTransactionResult = {\n amount: string;\n asset: string;\n txHash: string;\n timestamp: number;\n success: boolean;\n error: string;\n [key: string]: string | number | boolean;\n};\n\n/**\n * For persistent transaction history tracking\n * Used for transaction history display and detailed status tracking\n * JSON serializable for controller state\n */\nexport type TransactionStatus = 'pending' | 'bridging' | 'completed' | 'failed';\n\nexport type TransactionRecord = {\n id: string;\n amount: string;\n asset: string;\n txHash?: string;\n timestamp: number;\n success: boolean;\n status: TransactionStatus;\n destination?: string; // mainly for withdrawals\n source?: string; // mainly for deposits\n transactionId?: string; // generic - could be withdrawalId or depositId\n // Legacy fields for backward compatibility\n withdrawalId?: string; // for withdrawals\n depositId?: string; // for deposits\n};\n\n/**\n * Type guard to check if a transaction result is a TransactionRecord\n *\n * @param result - The transaction result to check.\n * @returns True if the result is a TransactionRecord with id and status fields.\n */\nexport function isTransactionRecord(\n result: LastTransactionResult | TransactionRecord,\n): result is TransactionRecord {\n return 'id' in result && 'status' in result;\n}\n\n/**\n * Type guard to check if a transaction result is a LastTransactionResult\n *\n * @param result - The transaction result to check.\n * @returns True if the result is a LastTransactionResult without id or status fields.\n */\nexport function isLastTransactionResult(\n result: LastTransactionResult | TransactionRecord,\n): result is LastTransactionResult {\n return !('id' in result) || !('status' in result);\n}\n"]}
@@ -1,64 +0,0 @@
1
- /**
2
- * Shared transaction types for Perps deposits and withdrawals
3
- * Provides a unified structure while maintaining separate use cases
4
- */
5
- /**
6
- * Base type with core properties shared between all transaction results
7
- * All properties are JSON serializable for controller state compatibility
8
- */
9
- export type BaseTransactionResult = {
10
- amount: string;
11
- asset: string;
12
- txHash?: string;
13
- timestamp: number;
14
- success: boolean;
15
- };
16
- /**
17
- * For transient UI feedback (toasts, progress indicators)
18
- * Used for immediate success/failure notifications
19
- * JSON serializable for controller state
20
- */
21
- export type LastTransactionResult = {
22
- amount: string;
23
- asset: string;
24
- txHash: string;
25
- timestamp: number;
26
- success: boolean;
27
- error: string;
28
- [key: string]: string | number | boolean;
29
- };
30
- /**
31
- * For persistent transaction history tracking
32
- * Used for transaction history display and detailed status tracking
33
- * JSON serializable for controller state
34
- */
35
- export type TransactionStatus = 'pending' | 'bridging' | 'completed' | 'failed';
36
- export type TransactionRecord = {
37
- id: string;
38
- amount: string;
39
- asset: string;
40
- txHash?: string;
41
- timestamp: number;
42
- success: boolean;
43
- status: TransactionStatus;
44
- destination?: string;
45
- source?: string;
46
- transactionId?: string;
47
- withdrawalId?: string;
48
- depositId?: string;
49
- };
50
- /**
51
- * Type guard to check if a transaction result is a TransactionRecord
52
- *
53
- * @param result - The transaction result to check.
54
- * @returns True if the result is a TransactionRecord with id and status fields.
55
- */
56
- export declare function isTransactionRecord(result: LastTransactionResult | TransactionRecord): result is TransactionRecord;
57
- /**
58
- * Type guard to check if a transaction result is a LastTransactionResult
59
- *
60
- * @param result - The transaction result to check.
61
- * @returns True if the result is a LastTransactionResult without id or status fields.
62
- */
63
- export declare function isLastTransactionResult(result: LastTransactionResult | TransactionRecord): result is LastTransactionResult;
64
- //# sourceMappingURL=transactionTypes.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"transactionTypes.d.cts","sourceRoot":"","sources":["../../src/types/transactionTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;CAC1C,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,UAAU,GAAG,WAAW,GAAG,QAAQ,CAAC;AAEhF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,iBAAiB,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,qBAAqB,GAAG,iBAAiB,GAChD,MAAM,IAAI,iBAAiB,CAE7B;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,qBAAqB,GAAG,iBAAiB,GAChD,MAAM,IAAI,qBAAqB,CAEjC"}
@@ -1,64 +0,0 @@
1
- /**
2
- * Shared transaction types for Perps deposits and withdrawals
3
- * Provides a unified structure while maintaining separate use cases
4
- */
5
- /**
6
- * Base type with core properties shared between all transaction results
7
- * All properties are JSON serializable for controller state compatibility
8
- */
9
- export type BaseTransactionResult = {
10
- amount: string;
11
- asset: string;
12
- txHash?: string;
13
- timestamp: number;
14
- success: boolean;
15
- };
16
- /**
17
- * For transient UI feedback (toasts, progress indicators)
18
- * Used for immediate success/failure notifications
19
- * JSON serializable for controller state
20
- */
21
- export type LastTransactionResult = {
22
- amount: string;
23
- asset: string;
24
- txHash: string;
25
- timestamp: number;
26
- success: boolean;
27
- error: string;
28
- [key: string]: string | number | boolean;
29
- };
30
- /**
31
- * For persistent transaction history tracking
32
- * Used for transaction history display and detailed status tracking
33
- * JSON serializable for controller state
34
- */
35
- export type TransactionStatus = 'pending' | 'bridging' | 'completed' | 'failed';
36
- export type TransactionRecord = {
37
- id: string;
38
- amount: string;
39
- asset: string;
40
- txHash?: string;
41
- timestamp: number;
42
- success: boolean;
43
- status: TransactionStatus;
44
- destination?: string;
45
- source?: string;
46
- transactionId?: string;
47
- withdrawalId?: string;
48
- depositId?: string;
49
- };
50
- /**
51
- * Type guard to check if a transaction result is a TransactionRecord
52
- *
53
- * @param result - The transaction result to check.
54
- * @returns True if the result is a TransactionRecord with id and status fields.
55
- */
56
- export declare function isTransactionRecord(result: LastTransactionResult | TransactionRecord): result is TransactionRecord;
57
- /**
58
- * Type guard to check if a transaction result is a LastTransactionResult
59
- *
60
- * @param result - The transaction result to check.
61
- * @returns True if the result is a LastTransactionResult without id or status fields.
62
- */
63
- export declare function isLastTransactionResult(result: LastTransactionResult | TransactionRecord): result is LastTransactionResult;
64
- //# sourceMappingURL=transactionTypes.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"transactionTypes.d.mts","sourceRoot":"","sources":["../../src/types/transactionTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;CAC1C,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,UAAU,GAAG,WAAW,GAAG,QAAQ,CAAC;AAEhF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,iBAAiB,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,qBAAqB,GAAG,iBAAiB,GAChD,MAAM,IAAI,iBAAiB,CAE7B;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,qBAAqB,GAAG,iBAAiB,GAChD,MAAM,IAAI,qBAAqB,CAEjC"}
@@ -1,23 +0,0 @@
1
- /**
2
- * Shared transaction types for Perps deposits and withdrawals
3
- * Provides a unified structure while maintaining separate use cases
4
- */
5
- /**
6
- * Type guard to check if a transaction result is a TransactionRecord
7
- *
8
- * @param result - The transaction result to check.
9
- * @returns True if the result is a TransactionRecord with id and status fields.
10
- */
11
- export function isTransactionRecord(result) {
12
- return 'id' in result && 'status' in result;
13
- }
14
- /**
15
- * Type guard to check if a transaction result is a LastTransactionResult
16
- *
17
- * @param result - The transaction result to check.
18
- * @returns True if the result is a LastTransactionResult without id or status fields.
19
- */
20
- export function isLastTransactionResult(result) {
21
- return !('id' in result) || !('status' in result);
22
- }
23
- //# sourceMappingURL=transactionTypes.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"transactionTypes.mjs","sourceRoot":"","sources":["../../src/types/transactionTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAoDH;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB,CACjC,MAAiD;IAEjD,OAAO,IAAI,IAAI,MAAM,IAAI,QAAQ,IAAI,MAAM,CAAC;AAC9C,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,uBAAuB,CACrC,MAAiD;IAEjD,OAAO,CAAC,CAAC,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC,QAAQ,IAAI,MAAM,CAAC,CAAC;AACpD,CAAC","sourcesContent":["/**\n * Shared transaction types for Perps deposits and withdrawals\n * Provides a unified structure while maintaining separate use cases\n */\n\n/**\n * Base type with core properties shared between all transaction results\n * All properties are JSON serializable for controller state compatibility\n */\nexport type BaseTransactionResult = {\n amount: string;\n asset: string;\n txHash?: string;\n timestamp: number;\n success: boolean; // explicit to avoid regressions\n};\n\n/**\n * For transient UI feedback (toasts, progress indicators)\n * Used for immediate success/failure notifications\n * JSON serializable for controller state\n */\nexport type LastTransactionResult = {\n amount: string;\n asset: string;\n txHash: string;\n timestamp: number;\n success: boolean;\n error: string;\n [key: string]: string | number | boolean;\n};\n\n/**\n * For persistent transaction history tracking\n * Used for transaction history display and detailed status tracking\n * JSON serializable for controller state\n */\nexport type TransactionStatus = 'pending' | 'bridging' | 'completed' | 'failed';\n\nexport type TransactionRecord = {\n id: string;\n amount: string;\n asset: string;\n txHash?: string;\n timestamp: number;\n success: boolean;\n status: TransactionStatus;\n destination?: string; // mainly for withdrawals\n source?: string; // mainly for deposits\n transactionId?: string; // generic - could be withdrawalId or depositId\n // Legacy fields for backward compatibility\n withdrawalId?: string; // for withdrawals\n depositId?: string; // for deposits\n};\n\n/**\n * Type guard to check if a transaction result is a TransactionRecord\n *\n * @param result - The transaction result to check.\n * @returns True if the result is a TransactionRecord with id and status fields.\n */\nexport function isTransactionRecord(\n result: LastTransactionResult | TransactionRecord,\n): result is TransactionRecord {\n return 'id' in result && 'status' in result;\n}\n\n/**\n * Type guard to check if a transaction result is a LastTransactionResult\n *\n * @param result - The transaction result to check.\n * @returns True if the result is a LastTransactionResult without id or status fields.\n */\nexport function isLastTransactionResult(\n result: LastTransactionResult | TransactionRecord,\n): result is LastTransactionResult {\n return !('id' in result) || !('status' in result);\n}\n"]}
@@ -1,100 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.aggregateAccountStates = exports.calculateWeightedReturnOnEquity = exports.getSelectedEvmAccount = exports.getEvmAccountFromAccountGroup = exports.findEvmAccount = void 0;
4
- const perpsConfig_1 = require("../constants/perpsConfig.cjs");
5
- const EVM_ACCOUNT_TYPES = new Set(['eip155:eoa', 'eip155:erc4337']);
6
- function isEvmAccountType(type) {
7
- return EVM_ACCOUNT_TYPES.has(type);
8
- }
9
- function findEvmAccount(accounts) {
10
- const evmAccount = accounts.find((account) => account && isEvmAccountType(account.type));
11
- return evmAccount ?? null;
12
- }
13
- exports.findEvmAccount = findEvmAccount;
14
- function getEvmAccountFromAccountGroup(accounts) {
15
- const evmAccount = findEvmAccount(accounts);
16
- return evmAccount ? { address: evmAccount.address } : undefined;
17
- }
18
- exports.getEvmAccountFromAccountGroup = getEvmAccountFromAccountGroup;
19
- function getSelectedEvmAccount(accounts) {
20
- return getEvmAccountFromAccountGroup(accounts);
21
- }
22
- exports.getSelectedEvmAccount = getSelectedEvmAccount;
23
- function calculateWeightedReturnOnEquity(accounts) {
24
- if (accounts.length === 0) {
25
- return '0';
26
- }
27
- let totalWeightedROE = 0;
28
- let totalMarginUsed = 0;
29
- for (const account of accounts) {
30
- const unrealizedPnl = typeof account.unrealizedPnl === 'string'
31
- ? Number.parseFloat(account.unrealizedPnl)
32
- : account.unrealizedPnl;
33
- const returnOnEquity = typeof account.returnOnEquity === 'string'
34
- ? Number.parseFloat(account.returnOnEquity)
35
- : account.returnOnEquity;
36
- if (Number.isNaN(unrealizedPnl) || Number.isNaN(returnOnEquity)) {
37
- continue;
38
- }
39
- if (returnOnEquity === 0) {
40
- continue;
41
- }
42
- const marginUsed = (unrealizedPnl / returnOnEquity) * 100;
43
- if (Number.isNaN(marginUsed) || marginUsed <= 0) {
44
- continue;
45
- }
46
- const roeDecimal = returnOnEquity / 100;
47
- totalWeightedROE += roeDecimal * marginUsed;
48
- totalMarginUsed += marginUsed;
49
- }
50
- if (totalMarginUsed <= 0) {
51
- return '0';
52
- }
53
- const weightedROE = (totalWeightedROE / totalMarginUsed) * 100;
54
- return weightedROE.toString();
55
- }
56
- exports.calculateWeightedReturnOnEquity = calculateWeightedReturnOnEquity;
57
- /**
58
- * Aggregate multiple per-DEX AccountState objects into one by summing numeric fields.
59
- * ROE is recalculated as (totalUnrealizedPnl / totalMarginUsed) * 100.
60
- *
61
- * @param states - The array of per-DEX account states to aggregate.
62
- * @returns The combined account state with summed balances and recalculated ROE.
63
- */
64
- function aggregateAccountStates(states) {
65
- const fallback = {
66
- availableBalance: perpsConfig_1.PERPS_CONSTANTS.FallbackDataDisplay,
67
- totalBalance: perpsConfig_1.PERPS_CONSTANTS.FallbackDataDisplay,
68
- marginUsed: perpsConfig_1.PERPS_CONSTANTS.FallbackDataDisplay,
69
- unrealizedPnl: perpsConfig_1.PERPS_CONSTANTS.FallbackDataDisplay,
70
- returnOnEquity: perpsConfig_1.PERPS_CONSTANTS.FallbackDataDisplay,
71
- };
72
- if (states.length === 0) {
73
- return fallback;
74
- }
75
- const aggregated = states.reduce((acc, state, index) => {
76
- if (index === 0) {
77
- return { ...state };
78
- }
79
- return {
80
- availableBalance: (parseFloat(acc.availableBalance) + parseFloat(state.availableBalance)).toString(),
81
- totalBalance: (parseFloat(acc.totalBalance) + parseFloat(state.totalBalance)).toString(),
82
- marginUsed: (parseFloat(acc.marginUsed) + parseFloat(state.marginUsed)).toString(),
83
- unrealizedPnl: (parseFloat(acc.unrealizedPnl) + parseFloat(state.unrealizedPnl)).toString(),
84
- returnOnEquity: '0',
85
- };
86
- }, fallback);
87
- // Recalculate ROE across all DEXs
88
- const totalMarginUsed = parseFloat(aggregated.marginUsed);
89
- const totalUnrealizedPnl = parseFloat(aggregated.unrealizedPnl);
90
- if (totalMarginUsed > 0) {
91
- aggregated.returnOnEquity = ((totalUnrealizedPnl / totalMarginUsed) *
92
- 100).toString();
93
- }
94
- else {
95
- aggregated.returnOnEquity = '0';
96
- }
97
- return aggregated;
98
- }
99
- exports.aggregateAccountStates = aggregateAccountStates;
100
- //# sourceMappingURL=accountUtils.cjs.map