@metamask-previews/perps-controller 0.0.0-preview-567bc78af → 0.0.0-preview-3d4d0d0ef

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 (474) hide show
  1. package/CHANGELOG.md +0 -25
  2. package/dist/PerpsController.cjs +65 -3036
  3. package/dist/PerpsController.cjs.map +1 -1
  4. package/dist/PerpsController.d.cts +82 -967
  5. package/dist/PerpsController.d.cts.map +1 -1
  6. package/dist/PerpsController.d.mts +82 -967
  7. package/dist/PerpsController.d.mts.map +1 -1
  8. package/dist/PerpsController.mjs +62 -3032
  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 +3 -10
  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 -435
  44. package/dist/constants/eventNames.cjs.map +0 -1
  45. package/dist/constants/eventNames.d.cts +0 -386
  46. package/dist/constants/eventNames.d.cts.map +0 -1
  47. package/dist/constants/eventNames.d.mts +0 -386
  48. package/dist/constants/eventNames.d.mts.map +0 -1
  49. package/dist/constants/eventNames.mjs +0 -432
  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 -5677
  124. package/dist/providers/HyperLiquidProvider.cjs.map +0 -1
  125. package/dist/providers/HyperLiquidProvider.d.cts +0 -514
  126. package/dist/providers/HyperLiquidProvider.d.cts.map +0 -1
  127. package/dist/providers/HyperLiquidProvider.d.mts +0 -514
  128. package/dist/providers/HyperLiquidProvider.d.mts.map +0 -1
  129. package/dist/providers/HyperLiquidProvider.mjs +0 -5673
  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 -321
  164. package/dist/services/AccountService.cjs.map +0 -1
  165. package/dist/services/AccountService.d.cts +0 -54
  166. package/dist/services/AccountService.d.cts.map +0 -1
  167. package/dist/services/AccountService.d.mts +0 -54
  168. package/dist/services/AccountService.d.mts.map +0 -1
  169. package/dist/services/AccountService.mjs +0 -317
  170. package/dist/services/AccountService.mjs.map +0 -1
  171. package/dist/services/DataLakeService.cjs +0 -230
  172. package/dist/services/DataLakeService.cjs.map +0 -1
  173. package/dist/services/DataLakeService.d.cts +0 -49
  174. package/dist/services/DataLakeService.d.cts.map +0 -1
  175. package/dist/services/DataLakeService.d.mts +0 -49
  176. package/dist/services/DataLakeService.d.mts.map +0 -1
  177. package/dist/services/DataLakeService.mjs +0 -226
  178. package/dist/services/DataLakeService.mjs.map +0 -1
  179. package/dist/services/DepositService.cjs +0 -95
  180. package/dist/services/DepositService.cjs.map +0 -1
  181. package/dist/services/DepositService.d.cts +0 -37
  182. package/dist/services/DepositService.d.cts.map +0 -1
  183. package/dist/services/DepositService.d.mts +0 -37
  184. package/dist/services/DepositService.d.mts.map +0 -1
  185. package/dist/services/DepositService.mjs +0 -91
  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 -2204
  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 -2200
  218. package/dist/services/HyperLiquidSubscriptionService.mjs.map +0 -1
  219. package/dist/services/HyperLiquidWalletService.cjs +0 -155
  220. package/dist/services/HyperLiquidWalletService.cjs.map +0 -1
  221. package/dist/services/HyperLiquidWalletService.d.cts +0 -77
  222. package/dist/services/HyperLiquidWalletService.d.cts.map +0 -1
  223. package/dist/services/HyperLiquidWalletService.d.mts +0 -77
  224. package/dist/services/HyperLiquidWalletService.d.mts.map +0 -1
  225. package/dist/services/HyperLiquidWalletService.mjs +0 -151
  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 -117
  244. package/dist/services/RewardsIntegrationService.cjs.map +0 -1
  245. package/dist/services/RewardsIntegrationService.d.cts +0 -26
  246. package/dist/services/RewardsIntegrationService.d.cts.map +0 -1
  247. package/dist/services/RewardsIntegrationService.d.mts +0 -26
  248. package/dist/services/RewardsIntegrationService.d.mts.map +0 -1
  249. package/dist/services/RewardsIntegrationService.mjs +0 -113
  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 -1453
  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 -1449
  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 -1299
  294. package/dist/types/index.d.cts.map +0 -1
  295. package/dist/types/index.d.mts +0 -1299
  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/myx-types.cjs +0 -25
  300. package/dist/types/myx-types.cjs.map +0 -1
  301. package/dist/types/myx-types.d.cts +0 -63
  302. package/dist/types/myx-types.d.cts.map +0 -1
  303. package/dist/types/myx-types.d.mts +0 -63
  304. package/dist/types/myx-types.d.mts.map +0 -1
  305. package/dist/types/myx-types.mjs +0 -22
  306. package/dist/types/myx-types.mjs.map +0 -1
  307. package/dist/types/perps-types.cjs +0 -4
  308. package/dist/types/perps-types.cjs.map +0 -1
  309. package/dist/types/perps-types.d.cts +0 -105
  310. package/dist/types/perps-types.d.cts.map +0 -1
  311. package/dist/types/perps-types.d.mts +0 -105
  312. package/dist/types/perps-types.d.mts.map +0 -1
  313. package/dist/types/perps-types.mjs +0 -2
  314. package/dist/types/perps-types.mjs.map +0 -1
  315. package/dist/types/token.cjs +0 -3
  316. package/dist/types/token.cjs.map +0 -1
  317. package/dist/types/token.d.cts +0 -25
  318. package/dist/types/token.d.cts.map +0 -1
  319. package/dist/types/token.d.mts +0 -25
  320. package/dist/types/token.d.mts.map +0 -1
  321. package/dist/types/token.mjs +0 -2
  322. package/dist/types/token.mjs.map +0 -1
  323. package/dist/types/transactionTypes.cjs +0 -28
  324. package/dist/types/transactionTypes.cjs.map +0 -1
  325. package/dist/types/transactionTypes.d.cts +0 -64
  326. package/dist/types/transactionTypes.d.cts.map +0 -1
  327. package/dist/types/transactionTypes.d.mts +0 -64
  328. package/dist/types/transactionTypes.d.mts.map +0 -1
  329. package/dist/types/transactionTypes.mjs +0 -23
  330. package/dist/types/transactionTypes.mjs.map +0 -1
  331. package/dist/utils/accountUtils.cjs +0 -101
  332. package/dist/utils/accountUtils.cjs.map +0 -1
  333. package/dist/utils/accountUtils.d.cts +0 -34
  334. package/dist/utils/accountUtils.d.cts.map +0 -1
  335. package/dist/utils/accountUtils.d.mts +0 -34
  336. package/dist/utils/accountUtils.d.mts.map +0 -1
  337. package/dist/utils/accountUtils.mjs +0 -93
  338. package/dist/utils/accountUtils.mjs.map +0 -1
  339. package/dist/utils/errorUtils.cjs +0 -35
  340. package/dist/utils/errorUtils.cjs.map +0 -1
  341. package/dist/utils/errorUtils.d.cts +0 -15
  342. package/dist/utils/errorUtils.d.cts.map +0 -1
  343. package/dist/utils/errorUtils.d.mts +0 -15
  344. package/dist/utils/errorUtils.d.mts.map +0 -1
  345. package/dist/utils/errorUtils.mjs +0 -31
  346. package/dist/utils/errorUtils.mjs.map +0 -1
  347. package/dist/utils/hyperLiquidAdapter.cjs +0 -302
  348. package/dist/utils/hyperLiquidAdapter.cjs.map +0 -1
  349. package/dist/utils/hyperLiquidAdapter.d.cts +0 -42
  350. package/dist/utils/hyperLiquidAdapter.d.cts.map +0 -1
  351. package/dist/utils/hyperLiquidAdapter.d.mts +0 -42
  352. package/dist/utils/hyperLiquidAdapter.d.mts.map +0 -1
  353. package/dist/utils/hyperLiquidAdapter.mjs +0 -287
  354. package/dist/utils/hyperLiquidAdapter.mjs.map +0 -1
  355. package/dist/utils/hyperLiquidOrderBookProcessor.cjs +0 -83
  356. package/dist/utils/hyperLiquidOrderBookProcessor.cjs.map +0 -1
  357. package/dist/utils/hyperLiquidOrderBookProcessor.d.cts +0 -55
  358. package/dist/utils/hyperLiquidOrderBookProcessor.d.cts.map +0 -1
  359. package/dist/utils/hyperLiquidOrderBookProcessor.d.mts +0 -55
  360. package/dist/utils/hyperLiquidOrderBookProcessor.d.mts.map +0 -1
  361. package/dist/utils/hyperLiquidOrderBookProcessor.mjs +0 -78
  362. package/dist/utils/hyperLiquidOrderBookProcessor.mjs.map +0 -1
  363. package/dist/utils/hyperLiquidValidation.cjs +0 -426
  364. package/dist/utils/hyperLiquidValidation.cjs.map +0 -1
  365. package/dist/utils/hyperLiquidValidation.d.cts +0 -143
  366. package/dist/utils/hyperLiquidValidation.d.cts.map +0 -1
  367. package/dist/utils/hyperLiquidValidation.d.mts +0 -143
  368. package/dist/utils/hyperLiquidValidation.d.mts.map +0 -1
  369. package/dist/utils/hyperLiquidValidation.mjs +0 -413
  370. package/dist/utils/hyperLiquidValidation.mjs.map +0 -1
  371. package/dist/utils/idUtils.cjs +0 -18
  372. package/dist/utils/idUtils.cjs.map +0 -1
  373. package/dist/utils/idUtils.d.cts +0 -6
  374. package/dist/utils/idUtils.d.cts.map +0 -1
  375. package/dist/utils/idUtils.d.mts +0 -6
  376. package/dist/utils/idUtils.d.mts.map +0 -1
  377. package/dist/utils/idUtils.mjs +0 -10
  378. package/dist/utils/idUtils.mjs.map +0 -1
  379. package/dist/utils/index.cjs +0 -59
  380. package/dist/utils/index.cjs.map +0 -1
  381. package/dist/utils/index.d.cts +0 -25
  382. package/dist/utils/index.d.cts.map +0 -1
  383. package/dist/utils/index.d.mts +0 -25
  384. package/dist/utils/index.d.mts.map +0 -1
  385. package/dist/utils/index.mjs +0 -30
  386. package/dist/utils/index.mjs.map +0 -1
  387. package/dist/utils/marketDataTransform.cjs +0 -211
  388. package/dist/utils/marketDataTransform.cjs.map +0 -1
  389. package/dist/utils/marketDataTransform.d.cts +0 -40
  390. package/dist/utils/marketDataTransform.d.cts.map +0 -1
  391. package/dist/utils/marketDataTransform.d.mts +0 -40
  392. package/dist/utils/marketDataTransform.d.mts.map +0 -1
  393. package/dist/utils/marketDataTransform.mjs +0 -205
  394. package/dist/utils/marketDataTransform.mjs.map +0 -1
  395. package/dist/utils/marketUtils.cjs +0 -151
  396. package/dist/utils/marketUtils.cjs.map +0 -1
  397. package/dist/utils/marketUtils.d.cts +0 -30
  398. package/dist/utils/marketUtils.d.cts.map +0 -1
  399. package/dist/utils/marketUtils.d.mts +0 -30
  400. package/dist/utils/marketUtils.d.mts.map +0 -1
  401. package/dist/utils/marketUtils.mjs +0 -138
  402. package/dist/utils/marketUtils.mjs.map +0 -1
  403. package/dist/utils/myxAdapter.cjs +0 -224
  404. package/dist/utils/myxAdapter.cjs.map +0 -1
  405. package/dist/utils/myxAdapter.d.cts +0 -81
  406. package/dist/utils/myxAdapter.d.cts.map +0 -1
  407. package/dist/utils/myxAdapter.d.mts +0 -81
  408. package/dist/utils/myxAdapter.d.mts.map +0 -1
  409. package/dist/utils/myxAdapter.mjs +0 -213
  410. package/dist/utils/myxAdapter.mjs.map +0 -1
  411. package/dist/utils/orderCalculations.cjs +0 -283
  412. package/dist/utils/orderCalculations.cjs.map +0 -1
  413. package/dist/utils/orderCalculations.d.cts +0 -107
  414. package/dist/utils/orderCalculations.d.cts.map +0 -1
  415. package/dist/utils/orderCalculations.d.mts +0 -107
  416. package/dist/utils/orderCalculations.d.mts.map +0 -1
  417. package/dist/utils/orderCalculations.mjs +0 -274
  418. package/dist/utils/orderCalculations.mjs.map +0 -1
  419. package/dist/utils/rewardsUtils.cjs +0 -95
  420. package/dist/utils/rewardsUtils.cjs.map +0 -1
  421. package/dist/utils/rewardsUtils.d.cts +0 -33
  422. package/dist/utils/rewardsUtils.d.cts.map +0 -1
  423. package/dist/utils/rewardsUtils.d.mts +0 -33
  424. package/dist/utils/rewardsUtils.d.mts.map +0 -1
  425. package/dist/utils/rewardsUtils.mjs +0 -89
  426. package/dist/utils/rewardsUtils.mjs.map +0 -1
  427. package/dist/utils/significantFigures.cjs +0 -88
  428. package/dist/utils/significantFigures.cjs.map +0 -1
  429. package/dist/utils/significantFigures.d.cts +0 -25
  430. package/dist/utils/significantFigures.d.cts.map +0 -1
  431. package/dist/utils/significantFigures.d.mts +0 -25
  432. package/dist/utils/significantFigures.d.mts.map +0 -1
  433. package/dist/utils/significantFigures.mjs +0 -82
  434. package/dist/utils/significantFigures.mjs.map +0 -1
  435. package/dist/utils/sortMarkets.cjs +0 -93
  436. package/dist/utils/sortMarkets.cjs.map +0 -1
  437. package/dist/utils/sortMarkets.d.cts +0 -27
  438. package/dist/utils/sortMarkets.d.cts.map +0 -1
  439. package/dist/utils/sortMarkets.d.mts +0 -27
  440. package/dist/utils/sortMarkets.d.mts.map +0 -1
  441. package/dist/utils/sortMarkets.mjs +0 -88
  442. package/dist/utils/sortMarkets.mjs.map +0 -1
  443. package/dist/utils/standaloneInfoClient.cjs +0 -70
  444. package/dist/utils/standaloneInfoClient.cjs.map +0 -1
  445. package/dist/utils/standaloneInfoClient.d.cts +0 -37
  446. package/dist/utils/standaloneInfoClient.d.cts.map +0 -1
  447. package/dist/utils/standaloneInfoClient.d.mts +0 -37
  448. package/dist/utils/standaloneInfoClient.d.mts.map +0 -1
  449. package/dist/utils/standaloneInfoClient.mjs +0 -64
  450. package/dist/utils/standaloneInfoClient.mjs.map +0 -1
  451. package/dist/utils/stringParseUtils.cjs +0 -18
  452. package/dist/utils/stringParseUtils.cjs.map +0 -1
  453. package/dist/utils/stringParseUtils.d.cts +0 -3
  454. package/dist/utils/stringParseUtils.d.cts.map +0 -1
  455. package/dist/utils/stringParseUtils.d.mts +0 -3
  456. package/dist/utils/stringParseUtils.d.mts.map +0 -1
  457. package/dist/utils/stringParseUtils.mjs +0 -13
  458. package/dist/utils/stringParseUtils.mjs.map +0 -1
  459. package/dist/utils/transferData.cjs +0 -33
  460. package/dist/utils/transferData.cjs.map +0 -1
  461. package/dist/utils/transferData.d.cts +0 -9
  462. package/dist/utils/transferData.d.cts.map +0 -1
  463. package/dist/utils/transferData.d.mts +0 -9
  464. package/dist/utils/transferData.d.mts.map +0 -1
  465. package/dist/utils/transferData.mjs +0 -29
  466. package/dist/utils/transferData.mjs.map +0 -1
  467. package/dist/utils/wait.cjs +0 -6
  468. package/dist/utils/wait.cjs.map +0 -1
  469. package/dist/utils/wait.d.cts +0 -2
  470. package/dist/utils/wait.d.cts.map +0 -1
  471. package/dist/utils/wait.d.mts +0 -2
  472. package/dist/utils/wait.d.mts.map +0 -1
  473. package/dist/utils/wait.mjs +0 -2
  474. package/dist/utils/wait.mjs.map +0 -1
@@ -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,EA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AAO,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","s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c,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,101 +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(accountTree) {
20
- const accounts = accountTree.getAccountsFromSelectedGroup();
21
- return getEvmAccountFromAccountGroup(accounts);
22
- }
23
- exports.getSelectedEvmAccount = getSelectedEvmAccount;
24
- function calculateWeightedReturnOnEquity(accounts) {
25
- if (accounts.length === 0) {
26
- return '0';
27
- }
28
- let totalWeightedROE = 0;
29
- let totalMarginUsed = 0;
30
- for (const account of accounts) {
31
- const unrealizedPnl = typeof account.unrealizedPnl === 'string'
32
- ? Number.parseFloat(account.unrealizedPnl)
33
- : account.unrealizedPnl;
34
- const returnOnEquity = typeof account.returnOnEquity === 'string'
35
- ? Number.parseFloat(account.returnOnEquity)
36
- : account.returnOnEquity;
37
- if (Number.isNaN(unrealizedPnl) || Number.isNaN(returnOnEquity)) {
38
- continue;
39
- }
40
- if (returnOnEquity === 0) {
41
- continue;
42
- }
43
- const marginUsed = (unrealizedPnl / returnOnEquity) * 100;
44
- if (Number.isNaN(marginUsed) || marginUsed <= 0) {
45
- continue;
46
- }
47
- const roeDecimal = returnOnEquity / 100;
48
- totalWeightedROE += roeDecimal * marginUsed;
49
- totalMarginUsed += marginUsed;
50
- }
51
- if (totalMarginUsed <= 0) {
52
- return '0';
53
- }
54
- const weightedROE = (totalWeightedROE / totalMarginUsed) * 100;
55
- return weightedROE.toString();
56
- }
57
- exports.calculateWeightedReturnOnEquity = calculateWeightedReturnOnEquity;
58
- /**
59
- * Aggregate multiple per-DEX AccountState objects into one by summing numeric fields.
60
- * ROE is recalculated as (totalUnrealizedPnl / totalMarginUsed) * 100.
61
- *
62
- * @param states - The array of per-DEX account states to aggregate.
63
- * @returns The combined account state with summed balances and recalculated ROE.
64
- */
65
- function aggregateAccountStates(states) {
66
- const fallback = {
67
- availableBalance: perpsConfig_1.PERPS_CONSTANTS.FallbackDataDisplay,
68
- totalBalance: perpsConfig_1.PERPS_CONSTANTS.FallbackDataDisplay,
69
- marginUsed: perpsConfig_1.PERPS_CONSTANTS.FallbackDataDisplay,
70
- unrealizedPnl: perpsConfig_1.PERPS_CONSTANTS.FallbackDataDisplay,
71
- returnOnEquity: perpsConfig_1.PERPS_CONSTANTS.FallbackDataDisplay,
72
- };
73
- if (states.length === 0) {
74
- return fallback;
75
- }
76
- const aggregated = states.reduce((acc, state, index) => {
77
- if (index === 0) {
78
- return { ...state };
79
- }
80
- return {
81
- availableBalance: (parseFloat(acc.availableBalance) + parseFloat(state.availableBalance)).toString(),
82
- totalBalance: (parseFloat(acc.totalBalance) + parseFloat(state.totalBalance)).toString(),
83
- marginUsed: (parseFloat(acc.marginUsed) + parseFloat(state.marginUsed)).toString(),
84
- unrealizedPnl: (parseFloat(acc.unrealizedPnl) + parseFloat(state.unrealizedPnl)).toString(),
85
- returnOnEquity: '0',
86
- };
87
- }, fallback);
88
- // Recalculate ROE across all DEXs
89
- const totalMarginUsed = parseFloat(aggregated.marginUsed);
90
- const totalUnrealizedPnl = parseFloat(aggregated.unrealizedPnl);
91
- if (totalMarginUsed > 0) {
92
- aggregated.returnOnEquity = ((totalUnrealizedPnl / totalMarginUsed) *
93
- 100).toString();
94
- }
95
- else {
96
- aggregated.returnOnEquity = '0';
97
- }
98
- return aggregated;
99
- }
100
- exports.aggregateAccountStates = aggregateAccountStates;
101
- //# sourceMappingURL=accountUtils.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"accountUtils.cjs","sourceRoot":"","sources":["../../src/utils/accountUtils.ts"],"names":[],"mappings":";;;AAMA,8DAA2D;AAG3D,MAAM,iBAAiB,GAAG,IAAI,GAAG,CAAC,CAAC,YAAY,EAAE,gBAAgB,CAAC,CAAC,CAAC;AAEpE,SAAS,gBAAgB,CAAC,IAAY;IACpC,OAAO,iBAAiB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AACrC,CAAC;AAED,SAAgB,cAAc,CAC5B,QAAoD;IAEpD,MAAM,UAAU,GAAG,QAAQ,CAAC,IAAI,CAC9B,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,IAAI,gBAAgB,CAAC,OAAO,CAAC,IAAI,CAAC,CACvD,CAAC;IACF,OAAO,UAAU,IAAI,IAAI,CAAC;AAC5B,CAAC;AAPD,wCAOC;AAED,SAAgB,6BAA6B,CAC3C,QAAoD;IAEpD,MAAM,UAAU,GAAG,cAAc,CAAC,QAAQ,CAAC,CAAC;IAC5C,OAAO,UAAU,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,UAAU,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;AAClE,CAAC;AALD,sEAKC;AAMD,SAAgB,qBAAqB,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UAAU,CAAC,GAAG,CAAC,aAAa,CAAC,GAAG,UAAU,CAAC,KAAK,CAAC,aAAa,CAAC,CAChE,CAAC,QAAQ,EAAE;YACZ,cAAc,EAAE,GAAG;SACpB,CAAC;IACJ,CAAC,EAAE,QAAQ,CAAC,CAAC;IAEb,kCAAkC;IAClC,MAAM,eAAe,GAAG,UAAU,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;IAC1D,MAAM,kBAAkB,GAAG,UAAU,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;IAChE,IAAI,eAAe,GAAG,CAAC,EAAE,CAAC;QACxB,UAAU,CAAC,cAAc,GAAG,CAC1B,CAAC,kBAAkB,GAAG,eAAe,CAAC;YACtC,GAAG,CACJ,CAAC,QAAQ,EAAE,CAAC;IACf,CAAC;SAAM,CAAC;QACN,UAAU,CAAC,cAAc,GAAG,GAAG,CAAC;IAClC,CAAC;IAED,OAAO,UAAU,CAAC;AACpB,CAAC;AA/CD,wDA+CC","sourcesContent":["/**\n * Account utilities for Perps components\n * Handles account selection and EVM account filtering\n */\nimport type { InternalAccount } from '@metamask/keyring-internal-api';\n\nimport { PERPS_CONSTANTS } from '../constants/perpsConfig';\nimport type { AccountState, PerpsInternalAccount } from '../types';\n\nconst EVM_ACCOUNT_TYPES = new Set(['eip155:eoa', 'eip155:erc4337']);\n\nfunction isEvmAccountType(type: string): boolean {\n return EVM_ACCOUNT_TYPES.has(type);\n}\n\nexport function findEvmAccount(\n accounts: (InternalAccount | PerpsInternalAccount)[],\n): { address: string; type: string } | null {\n const evmAccount = accounts.find(\n (account) => account && isEvmAccountType(account.type),\n );\n return evmAccount ?? null;\n}\n\nexport function getEvmAccountFromAccountGroup(\n accounts: (InternalAccount | PerpsInternalAccount)[],\n): { address: string } | undefined {\n const evmAccount = findEvmAccount(accounts);\n return evmAccount ? { address: evmAccount.address } : undefined;\n}\n\ntype AccountTreeDep = {\n getAccountsFromSelectedGroup(): PerpsInternalAccount[];\n};\n\nexport function getSelectedEvmAccount(\n accountTree: AccountTreeDep,\n): { address: string } | undefined {\n const accounts = accountTree.getAccountsFromSelectedGroup();\n return getEvmAccountFromAccountGroup(accounts);\n}\n\nexport type ReturnOnEquityInput = {\n unrealizedPnl: string | number;\n returnOnEquity: string | number;\n};\n\nexport function calculateWeightedReturnOnEquity(\n accounts: ReturnOnEquityInput[],\n): string {\n if (accounts.length === 0) {\n return '0';\n }\n\n let totalWeightedROE = 0;\n let totalMarginUsed = 0;\n\n for (const account of accounts) {\n const unrealizedPnl =\n typeof account.unrealizedPnl === 'string'\n ? Number.parseFloat(account.unrealizedPnl)\n : account.unrealizedPnl;\n const returnOnEquity =\n typeof account.returnOnEquity === 'string'\n ? Number.parseFloat(account.returnOnEquity)\n : account.returnOnEquity;\n\n if (Number.isNaN(unrealizedPnl) || Number.isNaN(returnOnEquity)) {\n continue;\n }\n\n if (returnOnEquity === 0) {\n continue;\n }\n\n const marginUsed = (unrealizedPnl / returnOnEquity) * 100;\n\n if (Number.isNaN(marginUsed) || marginUsed <= 0) {\n continue;\n }\n\n const roeDecimal = returnOnEquity / 100;\n\n totalWeightedROE += roeDecimal * marginUsed;\n totalMarginUsed += marginUsed;\n }\n\n if (totalMarginUsed <= 0) {\n return '0';\n }\n\n const weightedROE = (totalWeightedROE / totalMarginUsed) * 100;\n return weightedROE.toString();\n}\n\n/**\n * Aggregate multiple per-DEX AccountState objects into one by summing numeric fields.\n * ROE is recalculated as (totalUnrealizedPnl / totalMarginUsed) * 100.\n *\n * @param states - The array of per-DEX account states to aggregate.\n * @returns The combined account state with summed balances and recalculated ROE.\n */\nexport function aggregateAccountStates(states: AccountState[]): AccountState {\n const fallback: AccountState = {\n availableBalance: PERPS_CONSTANTS.FallbackDataDisplay,\n totalBalance: PERPS_CONSTANTS.FallbackDataDisplay,\n marginUsed: PERPS_CONSTANTS.FallbackDataDisplay,\n unrealizedPnl: PERPS_CONSTANTS.FallbackDataDisplay,\n returnOnEquity: PERPS_CONSTANTS.FallbackDataDisplay,\n };\n\n if (states.length === 0) {\n return fallback;\n }\n\n const aggregated = states.reduce<AccountState>((acc, state, index) => {\n if (index === 0) {\n return { ...state };\n }\n return {\n availableBalance: (\n parseFloat(acc.availableBalance) + parseFloat(state.availableBalance)\n ).toString(),\n totalBalance: (\n parseFloat(acc.totalBalance) + parseFloat(state.totalBalance)\n ).toString(),\n marginUsed: (\n parseFloat(acc.marginUsed) + parseFloat(state.marginUsed)\n ).toString(),\n unrealizedPnl: (\n parseFloat(acc.unrealizedPnl) + parseFloat(state.unrealizedPnl)\n ).toString(),\n returnOnEquity: '0',\n };\n }, fallback);\n\n // Recalculate ROE across all DEXs\n const totalMarginUsed = parseFloat(aggregated.marginUsed);\n const totalUnrealizedPnl = parseFloat(aggregated.unrealizedPnl);\n if (totalMarginUsed > 0) {\n aggregated.returnOnEquity = (\n (totalUnrealizedPnl / totalMarginUsed) *\n 100\n ).toString();\n } else {\n aggregated.returnOnEquity = '0';\n }\n\n return aggregated;\n}\n"]}