@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,992 +1,107 @@
1
- import { BaseController, ControllerGetStateAction, ControllerStateChangeEvent } from "@metamask/base-controller";
1
+ import type { ControllerGetStateAction, ControllerStateChangeEvent } from "@metamask/base-controller";
2
+ import { BaseController } from "@metamask/base-controller";
2
3
  import type { Messenger } from "@metamask/messenger";
3
- import type { Json } from "@metamask/utils";
4
- import { CandlePeriod } from "./constants/chartConfig.cjs";
5
- import type { SortOptionId } from "./constants/perpsConfig.cjs";
6
- import { WebSocketConnectionState } from "./types/index.cjs";
7
- import type { AccountState, AssetRoute, CancelOrderParams, CancelOrderResult, CancelOrdersParams, CancelOrdersResult, ClosePositionParams, ClosePositionsParams, ClosePositionsResult, DepositWithConfirmationParams, EditOrderParams, FeeCalculationParams, FeeCalculationResult, FlipPositionParams, Funding, GetAccountStateParams, GetAvailableDexsParams, GetFundingParams, GetMarketsParams, GetOrderFillsParams, GetOrdersParams, GetPositionsParams, PerpsProvider, LiquidationPriceParams, LiveDataConfig, MaintenanceMarginParams, MarginResult, MarketInfo, Order, OrderFill, OrderParams, OrderResult, PerpsControllerConfig, PerpsMarketData, Position, SubscribeAccountParams, SubscribeCandlesParams, SubscribeOICapsParams, SubscribeOrderBookParams, SubscribeOrderFillsParams, SubscribeOrdersParams, SubscribePositionsParams, SubscribePricesParams, SwitchProviderResult, ToggleTestnetResult, UpdateMarginParams, UpdatePositionTPSLParams, WithdrawParams, WithdrawResult, GetHistoricalPortfolioParams, HistoricalPortfolioResult, OrderType, PerpsPlatformDependencies, PerpsActiveProviderMode, PerpsProviderType, PerpsSelectedPaymentToken, PerpsRemoteFeatureFlagState } from "./types/index.cjs";
8
- import type { CandleData } from "./types/perps-types.cjs";
9
- import { LastTransactionResult, TransactionStatus } from "./types/transactionTypes.cjs";
10
- import type { SortDirection } from "./utils/sortMarkets.cjs";
11
4
  /**
12
- * Minimal payment token stored in PerpsController state.
13
- * Only required fields for identification, Perps balance detection, and analytics.
5
+ * The name of the {@link PerpsController}, used to namespace the
6
+ * controller's actions and events and to namespace the controller's state data
7
+ * when composed with other controllers.
14
8
  */
15
- export type SelectedPaymentTokenSnapshot = {
16
- description?: string;
17
- address: string;
18
- chainId: string;
19
- symbol?: string;
20
- };
21
- export { PERPS_ERROR_CODES, type PerpsErrorCode } from "./perpsErrorCodes.cjs";
9
+ export declare const controllerName = "PerpsController";
22
10
  /**
23
- * Initialization state enum for state machine tracking
11
+ * Describes the shape of the state object for {@link PerpsController}.
24
12
  */
25
- export declare enum InitializationState {
26
- Uninitialized = "uninitialized",
27
- Initializing = "initializing",
28
- Initialized = "initialized",
29
- Failed = "failed"
30
- }
13
+ export type PerpsControllerState = {};
31
14
  /**
32
- * State shape for PerpsController
15
+ * Constructs the default {@link PerpsController} state. This allows
16
+ * consumers to provide a partial state object when initializing the controller
17
+ * and also helps in constructing complete state objects for this controller in
18
+ * tests.
19
+ *
20
+ * @returns The default {@link PerpsController} state.
33
21
  */
34
- export type PerpsControllerState = {
35
- activeProvider: PerpsActiveProviderMode;
36
- isTestnet: boolean;
37
- initializationState: InitializationState;
38
- initializationError: string | null;
39
- initializationAttempts: number;
40
- accountState: AccountState | null;
41
- perpsBalances: {
42
- [provider: string]: {
43
- totalBalance: string;
44
- unrealizedPnl: string;
45
- accountValue1dAgo: string;
46
- lastUpdated: number;
47
- };
48
- };
49
- depositInProgress: boolean;
50
- lastDepositTransactionId: string | null;
51
- lastDepositResult: LastTransactionResult | null;
52
- withdrawInProgress: boolean;
53
- lastWithdrawResult: LastTransactionResult | null;
54
- withdrawalRequests: {
55
- id: string;
56
- amount: string;
57
- asset: string;
58
- accountAddress: string;
59
- txHash?: string;
60
- timestamp: number;
61
- success: boolean;
62
- status: TransactionStatus;
63
- destination?: string;
64
- source?: string;
65
- transactionId?: string;
66
- withdrawalId?: string;
67
- depositId?: string;
68
- }[];
69
- withdrawalProgress: {
70
- progress: number;
71
- lastUpdated: number;
72
- activeWithdrawalId: string | null;
73
- };
74
- depositRequests: {
75
- id: string;
76
- amount: string;
77
- asset: string;
78
- accountAddress: string;
79
- txHash?: string;
80
- timestamp: number;
81
- success: boolean;
82
- status: TransactionStatus;
83
- destination?: string;
84
- source?: string;
85
- transactionId?: string;
86
- withdrawalId?: string;
87
- depositId?: string;
88
- }[];
89
- isEligible: boolean;
90
- isFirstTimeUser: {
91
- testnet: boolean;
92
- mainnet: boolean;
93
- };
94
- hasPlacedFirstOrder: {
95
- testnet: boolean;
96
- mainnet: boolean;
97
- };
98
- watchlistMarkets: {
99
- testnet: string[];
100
- mainnet: string[];
101
- };
102
- tradeConfigurations: {
103
- testnet: {
104
- [marketSymbol: string]: {
105
- leverage?: number;
106
- orderBookGrouping?: number;
107
- pendingConfig?: {
108
- amount?: string;
109
- leverage?: number;
110
- takeProfitPrice?: string;
111
- stopLossPrice?: string;
112
- limitPrice?: string;
113
- orderType?: OrderType;
114
- timestamp: number;
115
- };
116
- };
117
- };
118
- mainnet: {
119
- [marketSymbol: string]: {
120
- leverage?: number;
121
- orderBookGrouping?: number;
122
- pendingConfig?: {
123
- amount?: string;
124
- leverage?: number;
125
- takeProfitPrice?: string;
126
- stopLossPrice?: string;
127
- limitPrice?: string;
128
- orderType?: OrderType;
129
- timestamp: number;
130
- };
131
- };
132
- };
133
- };
134
- marketFilterPreferences: {
135
- optionId: SortOptionId;
136
- direction: SortDirection;
137
- };
138
- lastError: string | null;
139
- lastUpdateTimestamp: number;
140
- hip3ConfigVersion: number;
141
- selectedPaymentToken: Json | null;
142
- cachedMarketData: PerpsMarketData[] | null;
143
- cachedMarketDataTimestamp: number;
144
- cachedPositions: Position[] | null;
145
- cachedOrders: Order[] | null;
146
- cachedAccountState: AccountState | null;
147
- cachedUserDataTimestamp: number;
148
- cachedUserDataAddress: string | null;
149
- };
22
+ export declare function getDefaultPerpsControllerState(): PerpsControllerState;
150
23
  /**
151
- * Get default PerpsController state
152
- *
153
- * To change the active provider, modify the `activeProvider` value below:
154
- * - 'hyperliquid': HyperLiquid provider (default, production)
155
- * - 'aggregated': Multi-provider aggregation mode
156
- * - 'myx': MYX provider (future implementation)
157
- *
158
- * @returns The default perps controller state.
24
+ * Retrieves the state of the {@link PerpsController}.
159
25
  */
160
- export declare const getDefaultPerpsControllerState: () => PerpsControllerState;
26
+ export type PerpsControllerGetStateAction = ControllerGetStateAction<typeof controllerName, PerpsControllerState>;
161
27
  /**
162
- * PerpsController events
28
+ * Actions that {@link PerpsControllerMessenger} exposes to other consumers.
163
29
  */
164
- export type PerpsControllerEvents = ControllerStateChangeEvent<'PerpsController', PerpsControllerState>;
30
+ export type PerpsControllerActions = PerpsControllerGetStateAction;
165
31
  /**
166
- * PerpsController actions
32
+ * Actions from other messengers that {@link PerpsControllerMessenger} calls.
167
33
  */
168
- export type PerpsControllerActions = ControllerGetStateAction<'PerpsController', PerpsControllerState> | {
169
- type: 'PerpsController:placeOrder';
170
- handler: PerpsController['placeOrder'];
171
- } | {
172
- type: 'PerpsController:editOrder';
173
- handler: PerpsController['editOrder'];
174
- } | {
175
- type: 'PerpsController:cancelOrder';
176
- handler: PerpsController['cancelOrder'];
177
- } | {
178
- type: 'PerpsController:cancelOrders';
179
- handler: PerpsController['cancelOrders'];
180
- } | {
181
- type: 'PerpsController:closePosition';
182
- handler: PerpsController['closePosition'];
183
- } | {
184
- type: 'PerpsController:closePositions';
185
- handler: PerpsController['closePositions'];
186
- } | {
187
- type: 'PerpsController:withdraw';
188
- handler: PerpsController['withdraw'];
189
- } | {
190
- type: 'PerpsController:getPositions';
191
- handler: PerpsController['getPositions'];
192
- } | {
193
- type: 'PerpsController:getOrderFills';
194
- handler: PerpsController['getOrderFills'];
195
- } | {
196
- type: 'PerpsController:getOrders';
197
- handler: PerpsController['getOrders'];
198
- } | {
199
- type: 'PerpsController:getOpenOrders';
200
- handler: PerpsController['getOpenOrders'];
201
- } | {
202
- type: 'PerpsController:getFunding';
203
- handler: PerpsController['getFunding'];
204
- } | {
205
- type: 'PerpsController:getAccountState';
206
- handler: PerpsController['getAccountState'];
207
- } | {
208
- type: 'PerpsController:getMarkets';
209
- handler: PerpsController['getMarkets'];
210
- } | {
211
- type: 'PerpsController:refreshEligibility';
212
- handler: PerpsController['refreshEligibility'];
213
- } | {
214
- type: 'PerpsController:toggleTestnet';
215
- handler: PerpsController['toggleTestnet'];
216
- } | {
217
- type: 'PerpsController:disconnect';
218
- handler: PerpsController['disconnect'];
219
- } | {
220
- type: 'PerpsController:calculateFees';
221
- handler: PerpsController['calculateFees'];
222
- } | {
223
- type: 'PerpsController:markTutorialCompleted';
224
- handler: PerpsController['markTutorialCompleted'];
225
- } | {
226
- type: 'PerpsController:markFirstOrderCompleted';
227
- handler: PerpsController['markFirstOrderCompleted'];
228
- } | {
229
- type: 'PerpsController:getHistoricalPortfolio';
230
- handler: PerpsController['getHistoricalPortfolio'];
231
- } | {
232
- type: 'PerpsController:resetFirstTimeUserState';
233
- handler: PerpsController['resetFirstTimeUserState'];
234
- } | {
235
- type: 'PerpsController:clearPendingTransactionRequests';
236
- handler: PerpsController['clearPendingTransactionRequests'];
237
- } | {
238
- type: 'PerpsController:saveTradeConfiguration';
239
- handler: PerpsController['saveTradeConfiguration'];
240
- } | {
241
- type: 'PerpsController:getTradeConfiguration';
242
- handler: PerpsController['getTradeConfiguration'];
243
- } | {
244
- type: 'PerpsController:saveMarketFilterPreferences';
245
- handler: PerpsController['saveMarketFilterPreferences'];
246
- } | {
247
- type: 'PerpsController:getMarketFilterPreferences';
248
- handler: PerpsController['getMarketFilterPreferences'];
249
- } | {
250
- type: 'PerpsController:savePendingTradeConfiguration';
251
- handler: PerpsController['savePendingTradeConfiguration'];
252
- } | {
253
- type: 'PerpsController:getPendingTradeConfiguration';
254
- handler: PerpsController['getPendingTradeConfiguration'];
255
- } | {
256
- type: 'PerpsController:clearPendingTradeConfiguration';
257
- handler: PerpsController['clearPendingTradeConfiguration'];
258
- } | {
259
- type: 'PerpsController:getOrderBookGrouping';
260
- handler: PerpsController['getOrderBookGrouping'];
261
- } | {
262
- type: 'PerpsController:saveOrderBookGrouping';
263
- handler: PerpsController['saveOrderBookGrouping'];
264
- } | {
265
- type: 'PerpsController:setSelectedPaymentToken';
266
- handler: PerpsController['setSelectedPaymentToken'];
267
- } | {
268
- type: 'PerpsController:resetSelectedPaymentToken';
269
- handler: PerpsController['resetSelectedPaymentToken'];
270
- };
34
+ type AllowedActions = never;
271
35
  /**
272
- * PerpsController messenger constraints.
273
- * Only PerpsController's own actions and events — no delegated external controller actions.
274
- * Cross-controller interactions go through PerpsPlatformDependencies.controllers.
36
+ * Published when the state of {@link PerpsController} changes.
275
37
  */
276
- export type PerpsControllerMessenger = Messenger<'PerpsController', PerpsControllerActions, PerpsControllerEvents>;
38
+ export type PerpsControllerStateChangeEvent = ControllerStateChangeEvent<typeof controllerName, PerpsControllerState>;
277
39
  /**
278
- * PerpsController options
40
+ * Events that {@link PerpsControllerMessenger} exposes to other consumers.
279
41
  */
280
- export type PerpsControllerOptions = {
281
- messenger: PerpsControllerMessenger;
282
- state?: Partial<PerpsControllerState>;
283
- clientConfig?: PerpsControllerConfig;
284
- /**
285
- * Platform-specific dependencies (required)
286
- * Provides logging, metrics, tracing, stream management, and account utilities.
287
- * Must be provided by the platform (mobile/extension) at instantiation time.
288
- */
289
- infrastructure: PerpsPlatformDependencies;
290
- };
291
- type BlockedRegionList = {
292
- list: string[];
293
- source: 'remote' | 'fallback';
294
- };
42
+ export type PerpsControllerEvents = PerpsControllerStateChangeEvent;
43
+ /**
44
+ * Events from other messengers that {@link PerpsControllerMessenger} subscribes
45
+ * to.
46
+ */
47
+ type AllowedEvents = never;
295
48
  /**
296
- * PerpsController - Protocol-agnostic perpetuals trading controller
49
+ * The messenger restricted to actions and events accessed by
50
+ * {@link PerpsController}.
51
+ */
52
+ export type PerpsControllerMessenger = Messenger<typeof controllerName, PerpsControllerActions | AllowedActions, PerpsControllerEvents | AllowedEvents>;
53
+ /**
54
+ * `PerpsController` manages perpetual trading functionality in MetaMask.
55
+ *
56
+ * This controller provides platform-agnostic perps trading capabilities.
57
+ *
58
+ * @example
297
59
  *
298
- * Provides a unified interface for perpetual futures trading across multiple protocols.
299
- * Features dual data flow architecture:
300
- * - Trading actions use Redux for persistence and optimistic updates
301
- * - Live data uses direct callbacks for maximum performance
60
+ * ``` ts
61
+ * import { Messenger } from '@metamask/messenger';
62
+ * import type {
63
+ * PerpsControllerActions,
64
+ * PerpsControllerEvents,
65
+ * } from '@metamask/perps-controller';
66
+ * import { PerpsController } from '@metamask/perps-controller';
67
+ *
68
+ * const rootMessenger = new Messenger<
69
+ * 'Root',
70
+ * PerpsControllerActions,
71
+ * PerpsControllerEvents
72
+ * >({ namespace: 'Root' });
73
+ * const perpsControllerMessenger = new Messenger<
74
+ * 'PerpsController',
75
+ * PerpsControllerActions,
76
+ * PerpsControllerEvents,
77
+ * typeof rootMessenger,
78
+ * >({
79
+ * namespace: 'PerpsController',
80
+ * parent: rootMessenger,
81
+ * });
82
+ * // Instantiate the controller to register its actions on the messenger
83
+ * new PerpsController({
84
+ * messenger: perpsControllerMessenger,
85
+ * });
86
+ *
87
+ * const perpsControllerState = await rootMessenger.call(
88
+ * 'PerpsController:getState',
89
+ * );
90
+ * ```
302
91
  */
303
- export declare class PerpsController extends BaseController<'PerpsController', PerpsControllerState, PerpsControllerMessenger> {
304
- #private;
305
- protected providers: Map<PerpsProviderType, PerpsProvider>;
306
- protected isInitialized: boolean;
307
- protected blockedRegionList: BlockedRegionList;
308
- /**
309
- * Active provider instance for routing operations.
310
- * When activeProvider is 'hyperliquid' or 'myx': points to specific provider directly
311
- * When activeProvider is 'aggregated': points to AggregatedPerpsProvider wrapper
312
- */
313
- protected activeProviderInstance: PerpsProvider | null;
314
- constructor({ messenger, state, clientConfig, infrastructure, }: PerpsControllerOptions);
315
- /**
316
- * Test-observable accessor for whether a standalone provider is cached.
317
- *
318
- * @returns True if a standalone provider instance exists.
319
- */
320
- protected hasStandaloneProvider(): boolean;
321
- protected setBlockedRegionList(list: string[], source: 'remote' | 'fallback'): void;
322
- /**
323
- * Respond to RemoteFeatureFlagController state changes
324
- * Refreshes user eligibility based on geo-blocked regions defined in remote feature flag.
325
- * Uses fallback configuration when remote feature flag is undefined.
326
- * Note: Initial eligibility is set in the constructor if fallback regions are provided.
327
- *
328
- * @param remoteFeatureFlagControllerState - State from RemoteFeatureFlagController.
329
- */
330
- protected refreshEligibilityOnFeatureFlagChange(remoteFeatureFlagControllerState: PerpsRemoteFeatureFlagState): void;
331
- /**
332
- * Initialize the PerpsController providers
333
- * Must be called before using any other methods
334
- * Prevents double initialization with promise caching
335
- *
336
- * @returns A promise that resolves when the operation completes.
337
- */
338
- init(): Promise<void>;
339
- /**
340
- * Get the currently active provider.
341
- * In aggregated mode, returns AggregatedPerpsProvider which routes to underlying providers.
342
- * In single provider mode, returns HyperLiquidProvider directly.
343
- *
344
- * @returns The active provider (aggregated wrapper or direct provider based on mode)
345
- * @throws Error if provider is not initialized or reinitializing
346
- */
347
- getActiveProvider(): PerpsProvider;
348
- /**
349
- * Get the currently active provider, returning null if not available
350
- * Use this method when the caller can gracefully handle a missing provider
351
- * (e.g., UI components during initialization or reconnection)
352
- *
353
- * @returns The active provider, or null if not initialized/reinitializing
354
- */
355
- getActiveProviderOrNull(): PerpsProvider | null;
356
- /**
357
- * Place a new order
358
- * Thin delegation to TradingService
359
- *
360
- * @param params - The operation parameters.
361
- * @returns The order result with order ID and status.
362
- */
363
- placeOrder(params: OrderParams): Promise<OrderResult>;
364
- /**
365
- * Edit an existing order
366
- * Thin delegation to TradingService
367
- *
368
- * @param params - The operation parameters.
369
- * @returns The updated order result with order ID and status.
370
- */
371
- editOrder(params: EditOrderParams): Promise<OrderResult>;
372
- /**
373
- * Cancel an existing order
374
- *
375
- * @param params - The operation parameters.
376
- * @returns The cancellation result with status.
377
- */
378
- cancelOrder(params: CancelOrderParams): Promise<CancelOrderResult>;
379
- /**
380
- * Cancel multiple orders in parallel
381
- * Batch version of cancelOrder() that cancels multiple orders simultaneously
382
- *
383
- * @param params - The operation parameters.
384
- * @returns The batch cancellation results for each order.
385
- */
386
- cancelOrders(params: CancelOrdersParams): Promise<CancelOrdersResult>;
387
- /**
388
- * Close a position (partial or full)
389
- * Thin delegation to TradingService
390
- *
391
- * @param params - The operation parameters.
392
- * @returns The order result from the close position request.
393
- */
394
- closePosition(params: ClosePositionParams): Promise<OrderResult>;
395
- /**
396
- * Close multiple positions in parallel
397
- * Batch version of closePosition() that closes multiple positions simultaneously
398
- *
399
- * @param params - The operation parameters.
400
- * @returns The batch close results for each position.
401
- */
402
- closePositions(params: ClosePositionsParams): Promise<ClosePositionsResult>;
403
- /**
404
- * Update TP/SL for an existing position
405
- *
406
- * @param params - The operation parameters.
407
- * @returns The order result from the TP/SL update.
408
- */
409
- updatePositionTPSL(params: UpdatePositionTPSLParams): Promise<OrderResult>;
410
- /**
411
- * Update margin for an existing position (add or remove)
412
- *
413
- * @param params - The operation parameters.
414
- * @returns The margin update result.
415
- */
416
- updateMargin(params: UpdateMarginParams): Promise<MarginResult>;
417
- /**
418
- * Flip position (reverse direction while keeping size and leverage)
419
- *
420
- * @param params - The operation parameters.
421
- * @returns The order result from the position flip.
422
- */
423
- flipPosition(params: FlipPositionParams): Promise<OrderResult>;
424
- /**
425
- * Simplified deposit method that prepares transaction for confirmation screen
426
- * No complex state tracking - just sets a loading flag
427
- *
428
- * @param params - Parameters for the deposit flow
429
- * @param params.amount - Optional deposit amount
430
- * @param params.placeOrder - If true, uses addTransaction instead of submit to avoid navigation
431
- * @returns An object containing a promise that resolves to the transaction hash.
432
- */
433
- depositWithConfirmation(params?: DepositWithConfirmationParams): Promise<{
434
- result: Promise<string>;
435
- }>;
436
- /**
437
- * Same as depositWithConfirmation - prepares transaction for confirmation screen.
438
- *
439
- * @returns A promise that resolves to the string result.
440
- */
441
- depositWithOrder(): Promise<{
442
- result: Promise<string>;
443
- }>;
444
- /**
445
- * Clear the last deposit result after it has been shown to the user
446
- */
447
- clearDepositResult(): void;
448
- clearWithdrawResult(): void;
449
- /**
450
- * Update withdrawal request status when it completes
451
- * This is called when a withdrawal is matched with a completed withdrawal from the API
452
- *
453
- * @param withdrawalId - The withdrawal transaction ID.
454
- * @param status - The current status.
455
- * @param txHash - The transaction hash.
456
- */
457
- updateWithdrawalStatus(withdrawalId: string, status: 'completed' | 'failed', txHash?: string): void;
458
- /**
459
- * Update withdrawal progress (persistent across navigation)
460
- *
461
- * @param progress - The progress indicator.
462
- * @param activeWithdrawalId - The active withdrawal ID.
463
- */
464
- updateWithdrawalProgress(progress: number, activeWithdrawalId?: string | null): void;
465
- /**
466
- * Get current withdrawal progress
467
- *
468
- * @returns The withdrawal progress, last update timestamp, and active withdrawal ID.
469
- */
470
- getWithdrawalProgress(): {
471
- progress: number;
472
- lastUpdated: number;
473
- activeWithdrawalId: string | null;
474
- };
475
- /**
476
- * Withdraw funds from trading account
477
- *
478
- * The withdrawal process varies by provider and may involve:
479
- * - Direct on-chain transfers
480
- * - Bridge operations
481
- * - Multi-step validation processes
482
- *
483
- * Check the specific provider documentation for detailed withdrawal flows.
484
- *
485
- * @param params Withdrawal parameters
486
- * @returns WithdrawResult with withdrawal ID and tracking info
487
- */
488
- withdraw(params: WithdrawParams): Promise<WithdrawResult>;
489
- /**
490
- * Get current positions
491
- * Thin delegation to MarketDataService
492
- *
493
- * For standalone mode, bypasses getActiveProvider() to allow position queries
494
- * without full perps initialization (e.g., for showing positions on token details page)
495
- *
496
- * @param params - The operation parameters.
497
- * @returns Array of open positions for the active provider.
498
- */
499
- getPositions(params?: GetPositionsParams): Promise<Position[]>;
500
- /**
501
- * Get historical user fills (trade executions)
502
- * Thin delegation to MarketDataService
503
- *
504
- * @param params - The operation parameters.
505
- * @returns Array of historical trade executions (fills).
506
- */
507
- getOrderFills(params?: GetOrderFillsParams): Promise<OrderFill[]>;
508
- /**
509
- * Get historical user orders (order lifecycle)
510
- * Thin delegation to MarketDataService
511
- *
512
- * @param params - The operation parameters.
513
- * @returns Array of historical orders.
514
- */
515
- getOrders(params?: GetOrdersParams): Promise<Order[]>;
516
- /**
517
- * Get currently open orders (real-time status)
518
- * Thin delegation to MarketDataService
519
- *
520
- * For standalone mode, bypasses getActiveProvider() to allow open order queries
521
- * without full perps initialization (e.g., for background preloading)
522
- *
523
- * @param params - The operation parameters.
524
- * @returns A promise that resolves to the result.
525
- */
526
- getOpenOrders(params?: GetOrdersParams): Promise<Order[]>;
527
- /**
528
- * Get historical user funding history (funding payments)
529
- * Thin delegation to MarketDataService
530
- *
531
- * @param params - The operation parameters.
532
- * @returns Array of historical funding payments.
533
- */
534
- getFunding(params?: GetFundingParams): Promise<Funding[]>;
535
- /**
536
- * Get account state (balances, etc.)
537
- * Thin delegation to MarketDataService
538
- *
539
- * For standalone mode, bypasses getActiveProvider() to allow account state queries
540
- * without full perps initialization (e.g., for checking if user has perps funds)
541
- *
542
- * @param params - The operation parameters.
543
- * @returns A promise that resolves to the result.
544
- */
545
- getAccountState(params?: GetAccountStateParams): Promise<AccountState>;
546
- /**
547
- * Get historical portfolio data
548
- * Thin delegation to MarketDataService
549
- *
550
- * @param params - The operation parameters.
551
- * @returns The historical portfolio data points.
552
- */
553
- getHistoricalPortfolio(params?: GetHistoricalPortfolioParams): Promise<HistoricalPortfolioResult>;
554
- /**
555
- * Get available markets with optional filtering
556
- * Thin delegation to MarketDataService
557
- *
558
- * For standalone mode, bypasses getActiveProvider() to allow market discovery
559
- * without full perps initialization (e.g., for discovery banners on spot screens)
560
- *
561
- * @param params - The operation parameters.
562
- * @returns Array of available markets matching the filter criteria.
563
- */
564
- getMarkets(params?: GetMarketsParams): Promise<MarketInfo[]>;
565
- /**
566
- * Get market data with prices (includes price, volume, 24h change)
567
- *
568
- * For standalone mode, bypasses getActiveProvider() to allow market data queries
569
- * without full perps initialization (e.g., for background preloading on app start)
570
- *
571
- * @param params - The operation parameters.
572
- * @param params.standalone - Whether to use standalone mode.
573
- * @returns A promise that resolves to the market data.
574
- */
575
- getMarketDataWithPrices(params?: {
576
- standalone?: boolean;
577
- }): Promise<PerpsMarketData[]>;
578
- /**
579
- * Start background market data preloading.
580
- * Fetches market data immediately and refreshes every 5 minutes.
581
- * Watches for isTestnet and hip3ConfigVersion changes to re-preload.
582
- */
583
- startMarketDataPreload(): void;
584
- /**
585
- * Stop background market data preloading.
586
- */
587
- stopMarketDataPreload(): void;
588
- /**
589
- * Get list of available HIP-3 builder-deployed DEXs
590
- *
591
- * @param params - Optional parameters for filtering
592
- * @returns Array of DEX names
593
- */
594
- getAvailableDexs(params?: GetAvailableDexsParams): Promise<string[]>;
595
- /**
596
- * Fetch historical candle data
597
- * Thin delegation to MarketDataService
598
- *
599
- * @param options - The configuration options.
600
- * @param options.symbol - The trading pair symbol.
601
- * @param options.interval - The candle interval period.
602
- * @param options.limit - Maximum number of items to fetch.
603
- * @param options.endTime - End timestamp in milliseconds.
604
- * @returns The historical candle data for the requested symbol and interval.
605
- */
606
- fetchHistoricalCandles(options: {
607
- symbol: string;
608
- interval: CandlePeriod;
609
- limit?: number;
610
- endTime?: number;
611
- }): Promise<CandleData>;
612
- /**
613
- * Calculate liquidation price for a position
614
- * Uses provider-specific formulas based on protocol rules
615
- *
616
- * @param params - The operation parameters.
617
- * @returns A promise that resolves to the string result.
618
- */
619
- calculateLiquidationPrice(params: LiquidationPriceParams): Promise<string>;
620
- /**
621
- * Calculate maintenance margin for a specific asset
622
- * Returns a percentage (e.g., 0.0125 for 1.25%)
623
- *
624
- * @param params - The operation parameters.
625
- * @returns A promise that resolves to the numeric result.
626
- */
627
- calculateMaintenanceMargin(params: MaintenanceMarginParams): Promise<number>;
628
- /**
629
- * Get maximum leverage allowed for an asset
630
- *
631
- * @param asset - The asset identifier.
632
- * @returns A promise that resolves to the numeric result.
633
- */
634
- getMaxLeverage(asset: string): Promise<number>;
635
- /**
636
- * Validate order parameters according to protocol-specific rules
637
- *
638
- * @param params - The operation parameters.
639
- * @returns True if the condition is met.
640
- */
641
- validateOrder(params: OrderParams): Promise<{
642
- isValid: boolean;
643
- error?: string;
644
- }>;
645
- /**
646
- * Validate close position parameters according to protocol-specific rules
647
- *
648
- * @param params - The operation parameters.
649
- * @returns A promise that resolves to the result.
650
- */
651
- validateClosePosition(params: ClosePositionParams): Promise<{
652
- isValid: boolean;
653
- error?: string;
654
- }>;
655
- /**
656
- * Validate withdrawal parameters according to protocol-specific rules
657
- *
658
- * @param params - The operation parameters.
659
- * @returns True if the condition is met.
660
- */
661
- validateWithdrawal(params: WithdrawParams): Promise<{
662
- isValid: boolean;
663
- error?: string;
664
- }>;
665
- /**
666
- * Get supported withdrawal routes - returns complete asset and routing information
667
- *
668
- * @returns Array of supported asset routes for withdrawals.
669
- */
670
- getWithdrawalRoutes(): AssetRoute[];
671
- /**
672
- * Toggle between testnet and mainnet
673
- *
674
- * @returns The toggle result with success status and current network mode.
675
- */
676
- toggleTestnet(): Promise<ToggleTestnetResult>;
677
- /**
678
- * Switch to a different provider
679
- * Uses a full reinit approach: disconnect() → update state → init()
680
- * This ensures complete state reset including WebSocket connections and caches.
681
- *
682
- * @param providerId - The provider identifier.
683
- * @returns The switch result with success status and active provider.
684
- */
685
- switchProvider(providerId: PerpsActiveProviderMode): Promise<SwitchProviderResult>;
686
- /**
687
- * Get current network (mainnet/testnet)
688
- *
689
- * @returns Either 'mainnet' or 'testnet' based on the current configuration.
690
- */
691
- getCurrentNetwork(): 'mainnet' | 'testnet';
692
- /**
693
- * Get the current WebSocket connection state from the active provider.
694
- * Used by the UI to monitor connection health and show notifications.
695
- *
696
- * @returns The current WebSocket connection state, or DISCONNECTED if not supported
697
- */
698
- getWebSocketConnectionState(): WebSocketConnectionState;
699
- /**
700
- * Subscribe to WebSocket connection state changes from the active provider.
701
- * The listener will be called immediately with the current state and whenever the state changes.
702
- *
703
- * @param listener - Callback function that receives the new connection state and reconnection attempt
704
- * @returns Unsubscribe function to remove the listener, or no-op if not supported
705
- */
706
- subscribeToConnectionState(listener: (state: WebSocketConnectionState, reconnectionAttempt: number) => void): () => void;
707
- /**
708
- * Manually trigger a WebSocket reconnection attempt.
709
- * Used by the UI retry button when connection is lost.
710
- */
711
- reconnect(): Promise<void>;
712
- /**
713
- * Subscribe to live price updates
714
- *
715
- * @param params - The operation parameters.
716
- * @returns A cleanup function to remove the subscription.
717
- */
718
- subscribeToPrices(params: SubscribePricesParams): () => void;
719
- /**
720
- * Subscribe to live position updates
721
- *
722
- * @param params - The operation parameters.
723
- * @returns A cleanup function to remove the subscription.
724
- */
725
- subscribeToPositions(params: SubscribePositionsParams): () => void;
726
- /**
727
- * Subscribe to live order fill updates
728
- *
729
- * @param params - The operation parameters.
730
- * @returns A cleanup function to remove the subscription.
731
- */
732
- subscribeToOrderFills(params: SubscribeOrderFillsParams): () => void;
733
- /**
734
- * Subscribe to live order updates
735
- *
736
- * @param params - The operation parameters.
737
- * @returns A cleanup function to remove the subscription.
738
- */
739
- subscribeToOrders(params: SubscribeOrdersParams): () => void;
740
- /**
741
- * Subscribe to live account updates.
742
- * Updates controller state (Redux) when new account data arrives so consumers
743
- * like usePerpsBalanceTokenFilter (PayWithModal) see the latest balance.
744
- *
745
- * @param params - The operation parameters.
746
- * @returns A cleanup function to remove the subscription.
747
- */
748
- subscribeToAccount(params: SubscribeAccountParams): () => void;
749
- /**
750
- * Subscribe to full order book updates with multiple depth levels
751
- * Creates a dedicated L2Book subscription for real-time order book data
752
- *
753
- * @param params - The operation parameters.
754
- * @returns A cleanup function to remove the subscription.
755
- */
756
- subscribeToOrderBook(params: SubscribeOrderBookParams): () => void;
757
- /**
758
- * Subscribe to live candle updates
759
- *
760
- * @param params - The operation parameters.
761
- * @returns A cleanup function to remove the subscription.
762
- */
763
- subscribeToCandles(params: SubscribeCandlesParams): () => void;
764
- /**
765
- * Subscribe to open interest cap updates
766
- * Zero additional network overhead - data comes from existing webData3 subscription
767
- *
768
- * @param params - The operation parameters.
769
- * @returns A cleanup function to remove the subscription.
770
- */
771
- subscribeToOICaps(params: SubscribeOICapsParams): () => void;
772
- /**
773
- * Configure live data throttling
774
- *
775
- * @param config - The configuration object.
776
- */
777
- setLiveDataConfig(config: Partial<LiveDataConfig>): void;
778
- /**
779
- * Calculate trading fees for the active provider
780
- * Each provider implements its own fee structure
781
- *
782
- * @param params - The operation parameters.
783
- * @returns The fee calculation result for the trade.
784
- */
785
- calculateFees(params: FeeCalculationParams): Promise<FeeCalculationResult>;
786
- /**
787
- * Disconnect provider and cleanup subscriptions
788
- * Call this when navigating away from Perps screens to prevent battery drain
789
- */
790
- disconnect(): Promise<void>;
791
- /**
792
- * Eligibility (Geo-Blocking)
793
- */
794
- /**
795
- * Fetch geo location
796
- *
797
- * Returned in Country or Country-Region format
798
- * Example: FR, DE, US-MI, CA-ON
799
- */
800
- /**
801
- * Refresh eligibility status
802
- */
803
- refreshEligibility(): Promise<void>;
804
- /**
805
- * Get block explorer URL for an address or just the base URL
806
- *
807
- * @param address - Optional address to append to the base URL
808
- * @returns Block explorer URL
809
- */
810
- getBlockExplorerUrl(address?: string): string;
811
- /**
812
- * Check if user is first-time for the current network
813
- *
814
- * @returns True if the condition is met.
815
- */
816
- isFirstTimeUserOnCurrentNetwork(): boolean;
817
- /**
818
- * Mark that the user has completed the tutorial/onboarding
819
- * This prevents the tutorial from showing again
820
- */
821
- markTutorialCompleted(): void;
822
- markFirstOrderCompleted(): void;
823
- /**
824
- * Reset first-time user state for both networks
825
- * This is useful for testing the tutorial flow
826
- * Called by Reset Account feature in settings
827
- */
828
- resetFirstTimeUserState(): void;
829
- /**
830
- * Clear pending/bridging withdrawal and deposit requests
831
- * This is useful when users want to clear stuck pending indicators
832
- * Called by Reset Account feature in settings
833
- */
834
- clearPendingTransactionRequests(): void;
835
- /**
836
- * Get saved trade configuration for a market
837
- *
838
- * @param symbol - The trading pair symbol.
839
- * @returns The resulting string value.
840
- */
841
- getTradeConfiguration(symbol: string): {
842
- leverage?: number;
843
- } | undefined;
844
- /**
845
- * Save trade configuration for a market
846
- *
847
- * @param symbol - Market symbol
848
- * @param leverage - Leverage value
849
- */
850
- saveTradeConfiguration(symbol: string, leverage: number): void;
851
- /**
852
- * Save pending trade configuration for a market
853
- * This is a temporary configuration that expires after 5 minutes
854
- *
855
- * @param symbol - Market symbol
856
- * @param config - Pending trade configuration (includes optional selected payment token from Pay row)
857
- * @param config.amount - The amount value.
858
- * @param config.leverage - The leverage multiplier.
859
- * @param config.takeProfitPrice - The take profit price.
860
- * @param config.stopLossPrice - The stop loss price.
861
- * @param config.limitPrice - The limit price.
862
- * @param config.orderType - The order type.
863
- * @param config.selectedPaymentToken - The selected payment token.
864
- */
865
- savePendingTradeConfiguration(symbol: string, config: {
866
- amount?: string;
867
- leverage?: number;
868
- takeProfitPrice?: string;
869
- stopLossPrice?: string;
870
- limitPrice?: string;
871
- orderType?: OrderType;
872
- /** When user used pay-with-token in PerpsPayRow: minimal token shape to restore selection */
873
- selectedPaymentToken?: PerpsSelectedPaymentToken | null;
874
- }): void;
875
- /**
876
- * Get pending trade configuration for a market
877
- * Returns undefined if config doesn't exist or has expired (more than 5 minutes old)
878
- *
879
- * @param symbol - Market symbol
880
- * @returns Pending trade configuration or undefined
881
- */
882
- getPendingTradeConfiguration(symbol: string): {
883
- amount?: string;
884
- leverage?: number;
885
- takeProfitPrice?: string;
886
- stopLossPrice?: string;
887
- limitPrice?: string;
888
- orderType?: OrderType;
889
- selectedPaymentToken?: PerpsSelectedPaymentToken | null;
890
- } | undefined;
891
- /**
892
- * Clear pending trade configuration for a market
893
- *
894
- * @param symbol - Market symbol
895
- */
896
- clearPendingTradeConfiguration(symbol: string): void;
897
- /**
898
- * Get saved market filter preferences
899
- * Handles backward compatibility with legacy string format
900
- *
901
- * @returns The saved sort option ID and direction.
902
- */
903
- getMarketFilterPreferences(): {
904
- optionId: SortOptionId;
905
- direction: SortDirection;
906
- };
907
- /**
908
- * Save market filter preferences
909
- *
910
- * @param optionId - Sort/filter option ID
911
- * @param direction - Sort direction ('asc' or 'desc')
912
- */
913
- saveMarketFilterPreferences(optionId: SortOptionId, direction: SortDirection): void;
914
- /**
915
- * Set the selected payment token for the Perps order/deposit flow.
916
- * Pass null or a token with description PERPS_CONSTANTS.PerpsBalanceTokenDescription to select Perps balance.
917
- * Only required fields (address, chainId) are stored in state; description and symbol are optional.
918
- *
919
- * @param token - The token identifier.
920
- */
921
- setSelectedPaymentToken(token: PerpsSelectedPaymentToken | null): void;
922
- /**
923
- * Reset the selected payment token to Perps balance (null).
924
- * Call when leaving the Perps order view so the next visit defaults to Perps balance.
925
- */
926
- resetSelectedPaymentToken(): void;
927
- /**
928
- * Get saved order book grouping for a market
929
- *
930
- * @param symbol - Market symbol
931
- * @returns The saved grouping value or undefined if not set
932
- */
933
- getOrderBookGrouping(symbol: string): number | undefined;
934
- /**
935
- * Save order book grouping for a market
936
- *
937
- * @param symbol - Market symbol
938
- * @param grouping - Price grouping value
939
- */
940
- saveOrderBookGrouping(symbol: string, grouping: number): void;
941
- /**
942
- * Toggle watchlist status for a market
943
- * Watchlist markets are stored per network (testnet/mainnet)
944
- *
945
- * @param symbol - The trading pair symbol.
946
- */
947
- toggleWatchlistMarket(symbol: string): void;
948
- /**
949
- * Check if a market is in the watchlist on the current network
950
- *
951
- * @param symbol - The trading pair symbol.
952
- * @returns True if the condition is met.
953
- */
954
- isWatchlistMarket(symbol: string): boolean;
955
- /**
956
- * Get all watchlist markets for the current network
957
- *
958
- * @returns The resulting string value.
959
- */
960
- getWatchlistMarkets(): string[];
961
- /**
962
- * Report order events to data lake API with retry (non-blocking)
963
- * Thin delegation to DataLakeService
964
- *
965
- * @param params - The operation parameters.
966
- * @param params.action - The order action.
967
- * @param params.symbol - The trading pair symbol.
968
- * @param params.slPrice - The stop loss price.
969
- * @param params.tpPrice - The take profit price.
970
- * @param params.retryCount - Internal retry counter.
971
- * @param params._traceId - Internal trace ID.
972
- * @returns Whether the report was sent successfully, with an optional error message.
973
- */
974
- protected reportOrderToDataLake(params: {
975
- action: 'open' | 'close';
976
- symbol: string;
977
- slPrice?: number;
978
- tpPrice?: number;
979
- retryCount?: number;
980
- _traceId?: string;
981
- }): Promise<{
982
- success: boolean;
983
- error?: string;
984
- }>;
92
+ export declare class PerpsController extends BaseController<typeof controllerName, PerpsControllerState, PerpsControllerMessenger> {
985
93
  /**
986
- * Check if the controller is currently reinitializing
94
+ * Constructs a new {@link PerpsController}.
987
95
  *
988
- * @returns true if providers are being reinitialized
96
+ * @param args - The arguments to this controller.
97
+ * @param args.messenger - The messenger suited for this controller.
98
+ * @param args.state - The desired state with which to initialize this
99
+ * controller. Missing properties will be filled in with defaults.
989
100
  */
990
- isCurrentlyReinitializing(): boolean;
101
+ constructor({ messenger, state, }: {
102
+ messenger: PerpsControllerMessenger;
103
+ state?: Partial<PerpsControllerState>;
104
+ });
991
105
  }
106
+ export {};
992
107
  //# sourceMappingURL=PerpsController.d.cts.map