@metamask-previews/perps-controller 16.1.0-preview-abca9bcea → 17.0.0-preview-0a30e47

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 (891) hide show
  1. package/CHANGELOG.md +35 -1
  2. package/README.md +17 -0
  3. package/dist/PerpsController-method-action-types.d.ts +1235 -0
  4. package/dist/PerpsController-method-action-types.d.ts.map +1 -0
  5. package/dist/PerpsController-method-action-types.js +6 -0
  6. package/dist/PerpsController-method-action-types.js.map +1 -0
  7. package/dist/PerpsController.d.ts +1313 -0
  8. package/dist/PerpsController.d.ts.map +1 -0
  9. package/dist/PerpsController.js +5331 -0
  10. package/dist/PerpsController.js.map +1 -0
  11. package/dist/aggregation/SubscriptionMultiplexer.d.ts +171 -0
  12. package/dist/aggregation/SubscriptionMultiplexer.d.ts.map +1 -0
  13. package/dist/aggregation/SubscriptionMultiplexer.js +451 -0
  14. package/dist/aggregation/SubscriptionMultiplexer.js.map +1 -0
  15. package/dist/aggregation/index.d.ts +6 -0
  16. package/dist/aggregation/index.d.ts.map +1 -0
  17. package/dist/aggregation/index.js +5 -0
  18. package/dist/aggregation/index.js.map +1 -0
  19. package/dist/constants/chartConfig.d.ts +228 -0
  20. package/dist/constants/chartConfig.d.ts.map +1 -0
  21. package/dist/constants/chartConfig.js +233 -0
  22. package/dist/constants/chartConfig.js.map +1 -0
  23. package/dist/constants/eventNames.d.ts +565 -0
  24. package/dist/constants/eventNames.d.ts.map +1 -0
  25. package/dist/constants/eventNames.js +657 -0
  26. package/dist/constants/eventNames.js.map +1 -0
  27. package/dist/constants/hyperLiquidConfig.d.ts +280 -0
  28. package/dist/constants/hyperLiquidConfig.d.ts.map +1 -0
  29. package/dist/constants/hyperLiquidConfig.js +596 -0
  30. package/dist/constants/hyperLiquidConfig.js.map +1 -0
  31. package/dist/constants/index.d.ts +12 -0
  32. package/dist/constants/index.d.ts.map +1 -0
  33. package/dist/constants/index.js +12 -0
  34. package/dist/constants/index.js.map +1 -0
  35. package/dist/constants/lighterConfig.d.ts +204 -0
  36. package/dist/constants/lighterConfig.d.ts.map +1 -0
  37. package/dist/constants/lighterConfig.js +317 -0
  38. package/dist/constants/lighterConfig.js.map +1 -0
  39. package/dist/constants/orderTypes.d.ts +19 -0
  40. package/dist/constants/orderTypes.d.ts.map +1 -0
  41. package/dist/constants/orderTypes.js +27 -0
  42. package/dist/constants/orderTypes.js.map +1 -0
  43. package/dist/constants/performanceMetrics.d.ts +46 -0
  44. package/dist/constants/performanceMetrics.d.ts.map +1 -0
  45. package/dist/constants/performanceMetrics.js +60 -0
  46. package/dist/constants/performanceMetrics.js.map +1 -0
  47. package/dist/constants/perpsConfig.d.ts +480 -0
  48. package/dist/constants/perpsConfig.d.ts.map +1 -0
  49. package/dist/constants/perpsConfig.js +555 -0
  50. package/dist/constants/perpsConfig.js.map +1 -0
  51. package/dist/constants/transactionsHistoryConfig.d.ts +35 -0
  52. package/dist/constants/transactionsHistoryConfig.d.ts.map +1 -0
  53. package/dist/constants/transactionsHistoryConfig.js +35 -0
  54. package/dist/constants/transactionsHistoryConfig.js.map +1 -0
  55. package/dist/index.d.ts +95 -0
  56. package/dist/index.d.ts.map +1 -0
  57. package/dist/index.js +80 -0
  58. package/dist/index.js.map +1 -0
  59. package/dist/perpsErrorCodes.d.ts +113 -0
  60. package/dist/perpsErrorCodes.d.ts.map +1 -0
  61. package/dist/perpsErrorCodes.js +133 -0
  62. package/dist/perpsErrorCodes.js.map +1 -0
  63. package/dist/providers/AggregatedPerpsProvider.d.ts +277 -0
  64. package/dist/providers/AggregatedPerpsProvider.d.ts.map +1 -0
  65. package/dist/providers/AggregatedPerpsProvider.js +827 -0
  66. package/dist/providers/AggregatedPerpsProvider.js.map +1 -0
  67. package/dist/providers/HyperLiquidProvider.d.ts +656 -0
  68. package/dist/providers/HyperLiquidProvider.d.ts.map +1 -0
  69. package/dist/providers/HyperLiquidProvider.js +11308 -0
  70. package/dist/providers/HyperLiquidProvider.js.map +1 -0
  71. package/dist/providers/LighterProvider.d.ts +179 -0
  72. package/dist/providers/LighterProvider.d.ts.map +1 -0
  73. package/dist/providers/LighterProvider.js +6599 -0
  74. package/dist/providers/LighterProvider.js.map +1 -0
  75. package/dist/routing/ProviderRouter.d.ts +112 -0
  76. package/dist/routing/ProviderRouter.d.ts.map +1 -0
  77. package/dist/routing/ProviderRouter.js +137 -0
  78. package/dist/routing/ProviderRouter.js.map +1 -0
  79. package/dist/routing/index.d.ts +6 -0
  80. package/dist/routing/index.d.ts.map +1 -0
  81. package/dist/routing/index.js +5 -0
  82. package/dist/routing/index.js.map +1 -0
  83. package/dist/selectors.d.ts +336 -0
  84. package/dist/selectors.d.ts.map +1 -0
  85. package/dist/selectors.js +249 -0
  86. package/dist/selectors.js.map +1 -0
  87. package/dist/services/AccountService.d.ts +56 -0
  88. package/dist/services/AccountService.d.ts.map +1 -0
  89. package/dist/services/AccountService.js +307 -0
  90. package/dist/services/AccountService.js.map +1 -0
  91. package/dist/services/AggregatedOrderBookConnection.d.ts +106 -0
  92. package/dist/services/AggregatedOrderBookConnection.d.ts.map +1 -0
  93. package/dist/services/AggregatedOrderBookConnection.js +388 -0
  94. package/dist/services/AggregatedOrderBookConnection.js.map +1 -0
  95. package/dist/services/DataLakeService.d.ts +51 -0
  96. package/dist/services/DataLakeService.d.ts.map +1 -0
  97. package/dist/services/DataLakeService.js +215 -0
  98. package/dist/services/DataLakeService.js.map +1 -0
  99. package/dist/services/DepositService.d.ts +39 -0
  100. package/dist/services/DepositService.d.ts.map +1 -0
  101. package/dist/services/DepositService.js +88 -0
  102. package/dist/services/DepositService.js.map +1 -0
  103. package/dist/services/DexDiscoveryCacheManager.d.ts +52 -0
  104. package/dist/services/DexDiscoveryCacheManager.d.ts.map +1 -0
  105. package/dist/services/DexDiscoveryCacheManager.js +130 -0
  106. package/dist/services/DexDiscoveryCacheManager.js.map +1 -0
  107. package/dist/services/EligibilityService.d.ts +28 -0
  108. package/dist/services/EligibilityService.d.ts.map +1 -0
  109. package/dist/services/EligibilityService.js +61 -0
  110. package/dist/services/EligibilityService.js.map +1 -0
  111. package/dist/services/FeatureFlagConfigurationService.d.ts +73 -0
  112. package/dist/services/FeatureFlagConfigurationService.d.ts.map +1 -0
  113. package/dist/services/FeatureFlagConfigurationService.js +266 -0
  114. package/dist/services/FeatureFlagConfigurationService.js.map +1 -0
  115. package/dist/services/HyperLiquidClientService.d.ts +252 -0
  116. package/dist/services/HyperLiquidClientService.d.ts.map +1 -0
  117. package/dist/services/HyperLiquidClientService.js +1152 -0
  118. package/dist/services/HyperLiquidClientService.js.map +1 -0
  119. package/dist/services/HyperLiquidSubscriptionService.d.ts +265 -0
  120. package/dist/services/HyperLiquidSubscriptionService.d.ts.map +1 -0
  121. package/dist/services/HyperLiquidSubscriptionService.js +3874 -0
  122. package/dist/services/HyperLiquidSubscriptionService.js.map +1 -0
  123. package/dist/services/HyperLiquidWalletService.d.ts +84 -0
  124. package/dist/services/HyperLiquidWalletService.d.ts.map +1 -0
  125. package/dist/services/HyperLiquidWalletService.js +168 -0
  126. package/dist/services/HyperLiquidWalletService.js.map +1 -0
  127. package/dist/services/LighterClientService.d.ts +200 -0
  128. package/dist/services/LighterClientService.d.ts.map +1 -0
  129. package/dist/services/LighterClientService.js +634 -0
  130. package/dist/services/LighterClientService.js.map +1 -0
  131. package/dist/services/LighterWalletService.d.ts +51 -0
  132. package/dist/services/LighterWalletService.d.ts.map +1 -0
  133. package/dist/services/LighterWalletService.js +92 -0
  134. package/dist/services/LighterWalletService.js.map +1 -0
  135. package/dist/services/MarketDataService.d.ts +350 -0
  136. package/dist/services/MarketDataService.d.ts.map +1 -0
  137. package/dist/services/MarketDataService.js +1165 -0
  138. package/dist/services/MarketDataService.js.map +1 -0
  139. package/dist/services/RewardsIntegrationService.d.ts +84 -0
  140. package/dist/services/RewardsIntegrationService.d.ts.map +1 -0
  141. package/dist/services/RewardsIntegrationService.js +380 -0
  142. package/dist/services/RewardsIntegrationService.js.map +1 -0
  143. package/dist/services/ServiceContext.d.ts +102 -0
  144. package/dist/services/ServiceContext.d.ts.map +1 -0
  145. package/dist/services/ServiceContext.js +2 -0
  146. package/dist/services/ServiceContext.js.map +1 -0
  147. package/dist/services/TerminalMarketService.d.ts +45 -0
  148. package/dist/services/TerminalMarketService.d.ts.map +1 -0
  149. package/dist/services/TerminalMarketService.js +640 -0
  150. package/dist/services/TerminalMarketService.js.map +1 -0
  151. package/dist/services/TradingReadinessCache.d.ts +204 -0
  152. package/dist/services/TradingReadinessCache.d.ts.map +1 -0
  153. package/dist/services/TradingReadinessCache.js +313 -0
  154. package/dist/services/TradingReadinessCache.js.map +1 -0
  155. package/dist/services/TradingService.d.ts +201 -0
  156. package/dist/services/TradingService.d.ts.map +1 -0
  157. package/dist/services/TradingService.js +1967 -0
  158. package/dist/services/TradingService.js.map +1 -0
  159. package/dist/types/config.d.ts +49 -0
  160. package/dist/types/config.d.ts.map +1 -0
  161. package/dist/types/config.js +2 -0
  162. package/dist/types/config.js.map +1 -0
  163. package/dist/types/hyperliquid-types.d.ts +67 -0
  164. package/dist/types/hyperliquid-types.d.ts.map +1 -0
  165. package/dist/types/hyperliquid-types.js +41 -0
  166. package/dist/types/hyperliquid-types.js.map +1 -0
  167. package/dist/types/index.d.ts +2192 -0
  168. package/dist/types/index.d.ts.map +1 -0
  169. package/dist/types/index.js +133 -0
  170. package/dist/types/index.js.map +1 -0
  171. package/dist/types/lighter-types.d.ts +772 -0
  172. package/dist/types/lighter-types.d.ts.map +1 -0
  173. package/dist/types/lighter-types.js +10 -0
  174. package/dist/types/lighter-types.js.map +1 -0
  175. package/dist/types/messenger.d.ts +30 -0
  176. package/dist/types/messenger.d.ts.map +1 -0
  177. package/dist/types/messenger.js +2 -0
  178. package/dist/types/messenger.js.map +1 -0
  179. package/dist/types/perps-types.d.ts +184 -0
  180. package/dist/types/perps-types.d.ts.map +1 -0
  181. package/dist/types/perps-types.js +2 -0
  182. package/dist/types/perps-types.js.map +1 -0
  183. package/dist/types/token.d.ts +25 -0
  184. package/dist/types/token.d.ts.map +1 -0
  185. package/dist/types/token.js +2 -0
  186. package/dist/types/token.js.map +1 -0
  187. package/dist/types/transactionTypes.d.ts +60 -0
  188. package/dist/types/transactionTypes.d.ts.map +1 -0
  189. package/dist/types/transactionTypes.js +24 -0
  190. package/dist/types/transactionTypes.js.map +1 -0
  191. package/dist/utils/accountUtils.d.ts +72 -0
  192. package/dist/utils/accountUtils.d.ts.map +1 -0
  193. package/dist/utils/accountUtils.js +223 -0
  194. package/dist/utils/accountUtils.js.map +1 -0
  195. package/dist/utils/capabilitySymbols.d.ts +15 -0
  196. package/dist/utils/capabilitySymbols.d.ts.map +1 -0
  197. package/dist/utils/capabilitySymbols.js +21 -0
  198. package/dist/utils/capabilitySymbols.js.map +1 -0
  199. package/dist/utils/coalescePerpsRestRequest.d.ts +32 -0
  200. package/dist/utils/coalescePerpsRestRequest.d.ts.map +1 -0
  201. package/dist/utils/coalescePerpsRestRequest.js +66 -0
  202. package/dist/utils/coalescePerpsRestRequest.js.map +1 -0
  203. package/dist/utils/errorUtils.d.ts +50 -0
  204. package/dist/utils/errorUtils.d.ts.map +1 -0
  205. package/dist/utils/errorUtils.js +96 -0
  206. package/dist/utils/errorUtils.js.map +1 -0
  207. package/dist/utils/hyperLiquidAbstraction.d.ts +11 -0
  208. package/dist/utils/hyperLiquidAbstraction.d.ts.map +1 -0
  209. package/dist/utils/hyperLiquidAbstraction.js +19 -0
  210. package/dist/utils/hyperLiquidAbstraction.js.map +1 -0
  211. package/dist/utils/hyperLiquidAdapter.d.ts +77 -0
  212. package/dist/utils/hyperLiquidAdapter.d.ts.map +1 -0
  213. package/dist/utils/hyperLiquidAdapter.js +495 -0
  214. package/dist/utils/hyperLiquidAdapter.js.map +1 -0
  215. package/dist/utils/hyperLiquidOrderBookProcessor.d.ts +55 -0
  216. package/dist/utils/hyperLiquidOrderBookProcessor.d.ts.map +1 -0
  217. package/dist/utils/hyperLiquidOrderBookProcessor.js +78 -0
  218. package/dist/utils/hyperLiquidOrderBookProcessor.js.map +1 -0
  219. package/dist/utils/hyperLiquidPositionPreview.d.ts +124 -0
  220. package/dist/utils/hyperLiquidPositionPreview.d.ts.map +1 -0
  221. package/dist/utils/hyperLiquidPositionPreview.js +347 -0
  222. package/dist/utils/hyperLiquidPositionPreview.js.map +1 -0
  223. package/dist/utils/hyperLiquidValidation.d.ts +192 -0
  224. package/dist/utils/hyperLiquidValidation.d.ts.map +1 -0
  225. package/dist/utils/hyperLiquidValidation.js +786 -0
  226. package/dist/utils/hyperLiquidValidation.js.map +1 -0
  227. package/dist/utils/idUtils.d.ts +6 -0
  228. package/dist/utils/idUtils.d.ts.map +1 -0
  229. package/dist/utils/idUtils.js +10 -0
  230. package/dist/utils/idUtils.js.map +1 -0
  231. package/dist/utils/index.d.ts +29 -0
  232. package/dist/utils/index.d.ts.map +1 -0
  233. package/dist/utils/index.js +34 -0
  234. package/dist/utils/index.js.map +1 -0
  235. package/dist/utils/lighterAdapter.d.ts +117 -0
  236. package/dist/utils/lighterAdapter.d.ts.map +1 -0
  237. package/dist/utils/lighterAdapter.js +562 -0
  238. package/dist/utils/lighterAdapter.js.map +1 -0
  239. package/dist/utils/marketDataTransform.d.ts +71 -0
  240. package/dist/utils/marketDataTransform.d.ts.map +1 -0
  241. package/dist/utils/marketDataTransform.js +243 -0
  242. package/dist/utils/marketDataTransform.js.map +1 -0
  243. package/dist/utils/marketSearch.d.ts +48 -0
  244. package/dist/utils/marketSearch.d.ts.map +1 -0
  245. package/dist/utils/marketSearch.js +106 -0
  246. package/dist/utils/marketSearch.js.map +1 -0
  247. package/dist/utils/marketUtils.d.ts +73 -0
  248. package/dist/utils/marketUtils.d.ts.map +1 -0
  249. package/dist/utils/marketUtils.js +248 -0
  250. package/dist/utils/marketUtils.js.map +1 -0
  251. package/dist/utils/orderCalculations.d.ts +306 -0
  252. package/dist/utils/orderCalculations.d.ts.map +1 -0
  253. package/dist/utils/orderCalculations.js +833 -0
  254. package/dist/utils/orderCalculations.js.map +1 -0
  255. package/dist/utils/orderTypes.d.ts +166 -0
  256. package/dist/utils/orderTypes.d.ts.map +1 -0
  257. package/dist/utils/orderTypes.js +287 -0
  258. package/dist/utils/orderTypes.js.map +1 -0
  259. package/dist/utils/perpsConnectionAttemptContext.d.ts +7 -0
  260. package/dist/utils/perpsConnectionAttemptContext.d.ts.map +1 -0
  261. package/dist/utils/perpsConnectionAttemptContext.js +15 -0
  262. package/dist/utils/perpsConnectionAttemptContext.js.map +1 -0
  263. package/dist/utils/perpsDiskPersistence.d.ts +112 -0
  264. package/dist/utils/perpsDiskPersistence.d.ts.map +1 -0
  265. package/dist/utils/perpsDiskPersistence.js +251 -0
  266. package/dist/utils/perpsDiskPersistence.js.map +1 -0
  267. package/dist/utils/perpsFormatters.d.ts +204 -0
  268. package/dist/utils/perpsFormatters.d.ts.map +1 -0
  269. package/dist/utils/perpsFormatters.js +500 -0
  270. package/dist/utils/perpsFormatters.js.map +1 -0
  271. package/dist/utils/rewardsUtils.d.ts +33 -0
  272. package/dist/utils/rewardsUtils.d.ts.map +1 -0
  273. package/dist/utils/rewardsUtils.js +92 -0
  274. package/dist/utils/rewardsUtils.js.map +1 -0
  275. package/dist/utils/significantFigures.d.ts +25 -0
  276. package/dist/utils/significantFigures.d.ts.map +1 -0
  277. package/dist/utils/significantFigures.js +82 -0
  278. package/dist/utils/significantFigures.js.map +1 -0
  279. package/dist/utils/sortMarkets.d.ts +25 -0
  280. package/dist/utils/sortMarkets.d.ts.map +1 -0
  281. package/dist/utils/sortMarkets.js +88 -0
  282. package/dist/utils/sortMarkets.js.map +1 -0
  283. package/dist/utils/standaloneInfoClient.d.ts +37 -0
  284. package/dist/utils/standaloneInfoClient.d.ts.map +1 -0
  285. package/dist/utils/standaloneInfoClient.js +64 -0
  286. package/dist/utils/standaloneInfoClient.js.map +1 -0
  287. package/dist/utils/stringParseUtils.d.ts +11 -0
  288. package/dist/utils/stringParseUtils.d.ts.map +1 -0
  289. package/dist/utils/stringParseUtils.js +28 -0
  290. package/dist/utils/stringParseUtils.js.map +1 -0
  291. package/dist/utils/transferData.d.ts +9 -0
  292. package/dist/utils/transferData.d.ts.map +1 -0
  293. package/dist/utils/transferData.js +29 -0
  294. package/dist/utils/transferData.js.map +1 -0
  295. package/dist/utils/wait.d.ts +2 -0
  296. package/dist/utils/wait.d.ts.map +1 -0
  297. package/dist/utils/wait.js +2 -0
  298. package/dist/utils/wait.js.map +1 -0
  299. package/package.json +33 -61
  300. package/dist/PerpsController-method-action-types.cjs +0 -7
  301. package/dist/PerpsController-method-action-types.cjs.map +0 -1
  302. package/dist/PerpsController-method-action-types.d.cts +0 -1235
  303. package/dist/PerpsController-method-action-types.d.cts.map +0 -1
  304. package/dist/PerpsController-method-action-types.d.mts +0 -1235
  305. package/dist/PerpsController-method-action-types.d.mts.map +0 -1
  306. package/dist/PerpsController-method-action-types.mjs +0 -6
  307. package/dist/PerpsController-method-action-types.mjs.map +0 -1
  308. package/dist/PerpsController.cjs +0 -5154
  309. package/dist/PerpsController.cjs.map +0 -1
  310. package/dist/PerpsController.d.cts +0 -1313
  311. package/dist/PerpsController.d.cts.map +0 -1
  312. package/dist/PerpsController.d.mts +0 -1313
  313. package/dist/PerpsController.d.mts.map +0 -1
  314. package/dist/PerpsController.mjs +0 -5142
  315. package/dist/PerpsController.mjs.map +0 -1
  316. package/dist/aggregation/SubscriptionMultiplexer.cjs +0 -441
  317. package/dist/aggregation/SubscriptionMultiplexer.cjs.map +0 -1
  318. package/dist/aggregation/SubscriptionMultiplexer.d.cts +0 -171
  319. package/dist/aggregation/SubscriptionMultiplexer.d.cts.map +0 -1
  320. package/dist/aggregation/SubscriptionMultiplexer.d.mts +0 -171
  321. package/dist/aggregation/SubscriptionMultiplexer.d.mts.map +0 -1
  322. package/dist/aggregation/SubscriptionMultiplexer.mjs +0 -437
  323. package/dist/aggregation/SubscriptionMultiplexer.mjs.map +0 -1
  324. package/dist/aggregation/index.cjs +0 -9
  325. package/dist/aggregation/index.cjs.map +0 -1
  326. package/dist/aggregation/index.d.cts +0 -6
  327. package/dist/aggregation/index.d.cts.map +0 -1
  328. package/dist/aggregation/index.d.mts +0 -6
  329. package/dist/aggregation/index.d.mts.map +0 -1
  330. package/dist/aggregation/index.mjs +0 -5
  331. package/dist/aggregation/index.mjs.map +0 -1
  332. package/dist/constants/chartConfig.cjs +0 -239
  333. package/dist/constants/chartConfig.cjs.map +0 -1
  334. package/dist/constants/chartConfig.d.cts +0 -228
  335. package/dist/constants/chartConfig.d.cts.map +0 -1
  336. package/dist/constants/chartConfig.d.mts +0 -228
  337. package/dist/constants/chartConfig.d.mts.map +0 -1
  338. package/dist/constants/chartConfig.mjs +0 -233
  339. package/dist/constants/chartConfig.mjs.map +0 -1
  340. package/dist/constants/eventNames.cjs +0 -660
  341. package/dist/constants/eventNames.cjs.map +0 -1
  342. package/dist/constants/eventNames.d.cts +0 -565
  343. package/dist/constants/eventNames.d.cts.map +0 -1
  344. package/dist/constants/eventNames.d.mts +0 -565
  345. package/dist/constants/eventNames.d.mts.map +0 -1
  346. package/dist/constants/eventNames.mjs +0 -657
  347. package/dist/constants/eventNames.mjs.map +0 -1
  348. package/dist/constants/hyperLiquidConfig.cjs +0 -607
  349. package/dist/constants/hyperLiquidConfig.cjs.map +0 -1
  350. package/dist/constants/hyperLiquidConfig.d.cts +0 -280
  351. package/dist/constants/hyperLiquidConfig.d.cts.map +0 -1
  352. package/dist/constants/hyperLiquidConfig.d.mts +0 -280
  353. package/dist/constants/hyperLiquidConfig.d.mts.map +0 -1
  354. package/dist/constants/hyperLiquidConfig.mjs +0 -596
  355. package/dist/constants/hyperLiquidConfig.mjs.map +0 -1
  356. package/dist/constants/index.cjs +0 -28
  357. package/dist/constants/index.cjs.map +0 -1
  358. package/dist/constants/index.d.cts +0 -12
  359. package/dist/constants/index.d.cts.map +0 -1
  360. package/dist/constants/index.d.mts +0 -12
  361. package/dist/constants/index.d.mts.map +0 -1
  362. package/dist/constants/index.mjs +0 -12
  363. package/dist/constants/index.mjs.map +0 -1
  364. package/dist/constants/lighterConfig.cjs +0 -328
  365. package/dist/constants/lighterConfig.cjs.map +0 -1
  366. package/dist/constants/lighterConfig.d.cts +0 -204
  367. package/dist/constants/lighterConfig.d.cts.map +0 -1
  368. package/dist/constants/lighterConfig.d.mts +0 -204
  369. package/dist/constants/lighterConfig.d.mts.map +0 -1
  370. package/dist/constants/lighterConfig.mjs +0 -317
  371. package/dist/constants/lighterConfig.mjs.map +0 -1
  372. package/dist/constants/orderTypes.cjs +0 -31
  373. package/dist/constants/orderTypes.cjs.map +0 -1
  374. package/dist/constants/orderTypes.d.cts +0 -19
  375. package/dist/constants/orderTypes.d.cts.map +0 -1
  376. package/dist/constants/orderTypes.d.mts +0 -19
  377. package/dist/constants/orderTypes.d.mts.map +0 -1
  378. package/dist/constants/orderTypes.mjs +0 -27
  379. package/dist/constants/orderTypes.mjs.map +0 -1
  380. package/dist/constants/performanceMetrics.cjs +0 -63
  381. package/dist/constants/performanceMetrics.cjs.map +0 -1
  382. package/dist/constants/performanceMetrics.d.cts +0 -46
  383. package/dist/constants/performanceMetrics.d.cts.map +0 -1
  384. package/dist/constants/performanceMetrics.d.mts +0 -46
  385. package/dist/constants/performanceMetrics.d.mts.map +0 -1
  386. package/dist/constants/performanceMetrics.mjs +0 -60
  387. package/dist/constants/performanceMetrics.mjs.map +0 -1
  388. package/dist/constants/perpsConfig.cjs +0 -560
  389. package/dist/constants/perpsConfig.cjs.map +0 -1
  390. package/dist/constants/perpsConfig.d.cts +0 -480
  391. package/dist/constants/perpsConfig.d.cts.map +0 -1
  392. package/dist/constants/perpsConfig.d.mts +0 -480
  393. package/dist/constants/perpsConfig.d.mts.map +0 -1
  394. package/dist/constants/perpsConfig.mjs +0 -555
  395. package/dist/constants/perpsConfig.mjs.map +0 -1
  396. package/dist/constants/transactionsHistoryConfig.cjs +0 -38
  397. package/dist/constants/transactionsHistoryConfig.cjs.map +0 -1
  398. package/dist/constants/transactionsHistoryConfig.d.cts +0 -35
  399. package/dist/constants/transactionsHistoryConfig.d.cts.map +0 -1
  400. package/dist/constants/transactionsHistoryConfig.d.mts +0 -35
  401. package/dist/constants/transactionsHistoryConfig.d.mts.map +0 -1
  402. package/dist/constants/transactionsHistoryConfig.mjs +0 -35
  403. package/dist/constants/transactionsHistoryConfig.mjs.map +0 -1
  404. package/dist/index.cjs +0 -334
  405. package/dist/index.cjs.map +0 -1
  406. package/dist/index.d.cts +0 -95
  407. package/dist/index.d.cts.map +0 -1
  408. package/dist/index.d.mts +0 -95
  409. package/dist/index.d.mts.map +0 -1
  410. package/dist/index.mjs +0 -80
  411. package/dist/index.mjs.map +0 -1
  412. package/dist/perpsErrorCodes.cjs +0 -128
  413. package/dist/perpsErrorCodes.cjs.map +0 -1
  414. package/dist/perpsErrorCodes.d.cts +0 -105
  415. package/dist/perpsErrorCodes.d.cts.map +0 -1
  416. package/dist/perpsErrorCodes.d.mts +0 -105
  417. package/dist/perpsErrorCodes.d.mts.map +0 -1
  418. package/dist/perpsErrorCodes.mjs +0 -125
  419. package/dist/perpsErrorCodes.mjs.map +0 -1
  420. package/dist/providers/AggregatedPerpsProvider.cjs +0 -810
  421. package/dist/providers/AggregatedPerpsProvider.cjs.map +0 -1
  422. package/dist/providers/AggregatedPerpsProvider.d.cts +0 -277
  423. package/dist/providers/AggregatedPerpsProvider.d.cts.map +0 -1
  424. package/dist/providers/AggregatedPerpsProvider.d.mts +0 -277
  425. package/dist/providers/AggregatedPerpsProvider.d.mts.map +0 -1
  426. package/dist/providers/AggregatedPerpsProvider.mjs +0 -805
  427. package/dist/providers/AggregatedPerpsProvider.mjs.map +0 -1
  428. package/dist/providers/HyperLiquidProvider.cjs +0 -10963
  429. package/dist/providers/HyperLiquidProvider.cjs.map +0 -1
  430. package/dist/providers/HyperLiquidProvider.d.cts +0 -656
  431. package/dist/providers/HyperLiquidProvider.d.cts.map +0 -1
  432. package/dist/providers/HyperLiquidProvider.d.mts +0 -656
  433. package/dist/providers/HyperLiquidProvider.d.mts.map +0 -1
  434. package/dist/providers/HyperLiquidProvider.mjs +0 -10959
  435. package/dist/providers/HyperLiquidProvider.mjs.map +0 -1
  436. package/dist/providers/LighterProvider.cjs +0 -6575
  437. package/dist/providers/LighterProvider.cjs.map +0 -1
  438. package/dist/providers/LighterProvider.d.cts +0 -179
  439. package/dist/providers/LighterProvider.d.cts.map +0 -1
  440. package/dist/providers/LighterProvider.d.mts +0 -179
  441. package/dist/providers/LighterProvider.d.mts.map +0 -1
  442. package/dist/providers/LighterProvider.mjs +0 -6571
  443. package/dist/providers/LighterProvider.mjs.map +0 -1
  444. package/dist/routing/ProviderRouter.cjs +0 -154
  445. package/dist/routing/ProviderRouter.cjs.map +0 -1
  446. package/dist/routing/ProviderRouter.d.cts +0 -112
  447. package/dist/routing/ProviderRouter.d.cts.map +0 -1
  448. package/dist/routing/ProviderRouter.d.mts +0 -112
  449. package/dist/routing/ProviderRouter.d.mts.map +0 -1
  450. package/dist/routing/ProviderRouter.mjs +0 -150
  451. package/dist/routing/ProviderRouter.mjs.map +0 -1
  452. package/dist/routing/index.cjs +0 -9
  453. package/dist/routing/index.cjs.map +0 -1
  454. package/dist/routing/index.d.cts +0 -6
  455. package/dist/routing/index.d.cts.map +0 -1
  456. package/dist/routing/index.d.mts +0 -6
  457. package/dist/routing/index.d.mts.map +0 -1
  458. package/dist/routing/index.mjs +0 -5
  459. package/dist/routing/index.mjs.map +0 -1
  460. package/dist/selectors.cjs +0 -264
  461. package/dist/selectors.cjs.map +0 -1
  462. package/dist/selectors.d.cts +0 -336
  463. package/dist/selectors.d.cts.map +0 -1
  464. package/dist/selectors.d.mts +0 -336
  465. package/dist/selectors.d.mts.map +0 -1
  466. package/dist/selectors.mjs +0 -249
  467. package/dist/selectors.mjs.map +0 -1
  468. package/dist/services/AccountService.cjs +0 -324
  469. package/dist/services/AccountService.cjs.map +0 -1
  470. package/dist/services/AccountService.d.cts +0 -56
  471. package/dist/services/AccountService.d.cts.map +0 -1
  472. package/dist/services/AccountService.d.mts +0 -56
  473. package/dist/services/AccountService.d.mts.map +0 -1
  474. package/dist/services/AccountService.mjs +0 -320
  475. package/dist/services/AccountService.mjs.map +0 -1
  476. package/dist/services/AggregatedOrderBookConnection.cjs +0 -405
  477. package/dist/services/AggregatedOrderBookConnection.cjs.map +0 -1
  478. package/dist/services/AggregatedOrderBookConnection.d.cts +0 -106
  479. package/dist/services/AggregatedOrderBookConnection.d.cts.map +0 -1
  480. package/dist/services/AggregatedOrderBookConnection.d.mts +0 -106
  481. package/dist/services/AggregatedOrderBookConnection.d.mts.map +0 -1
  482. package/dist/services/AggregatedOrderBookConnection.mjs +0 -400
  483. package/dist/services/AggregatedOrderBookConnection.mjs.map +0 -1
  484. package/dist/services/DataLakeService.cjs +0 -233
  485. package/dist/services/DataLakeService.cjs.map +0 -1
  486. package/dist/services/DataLakeService.d.cts +0 -51
  487. package/dist/services/DataLakeService.d.cts.map +0 -1
  488. package/dist/services/DataLakeService.d.mts +0 -51
  489. package/dist/services/DataLakeService.d.mts.map +0 -1
  490. package/dist/services/DataLakeService.mjs +0 -229
  491. package/dist/services/DataLakeService.mjs.map +0 -1
  492. package/dist/services/DepositService.cjs +0 -105
  493. package/dist/services/DepositService.cjs.map +0 -1
  494. package/dist/services/DepositService.d.cts +0 -39
  495. package/dist/services/DepositService.d.cts.map +0 -1
  496. package/dist/services/DepositService.d.mts +0 -39
  497. package/dist/services/DepositService.d.mts.map +0 -1
  498. package/dist/services/DepositService.mjs +0 -101
  499. package/dist/services/DepositService.mjs.map +0 -1
  500. package/dist/services/DexDiscoveryCacheManager.cjs +0 -147
  501. package/dist/services/DexDiscoveryCacheManager.cjs.map +0 -1
  502. package/dist/services/DexDiscoveryCacheManager.d.cts +0 -52
  503. package/dist/services/DexDiscoveryCacheManager.d.cts.map +0 -1
  504. package/dist/services/DexDiscoveryCacheManager.d.mts +0 -52
  505. package/dist/services/DexDiscoveryCacheManager.d.mts.map +0 -1
  506. package/dist/services/DexDiscoveryCacheManager.mjs +0 -143
  507. package/dist/services/DexDiscoveryCacheManager.mjs.map +0 -1
  508. package/dist/services/EligibilityService.cjs +0 -78
  509. package/dist/services/EligibilityService.cjs.map +0 -1
  510. package/dist/services/EligibilityService.d.cts +0 -28
  511. package/dist/services/EligibilityService.d.cts.map +0 -1
  512. package/dist/services/EligibilityService.d.mts +0 -28
  513. package/dist/services/EligibilityService.d.mts.map +0 -1
  514. package/dist/services/EligibilityService.mjs +0 -74
  515. package/dist/services/EligibilityService.mjs.map +0 -1
  516. package/dist/services/FeatureFlagConfigurationService.cjs +0 -257
  517. package/dist/services/FeatureFlagConfigurationService.cjs.map +0 -1
  518. package/dist/services/FeatureFlagConfigurationService.d.cts +0 -73
  519. package/dist/services/FeatureFlagConfigurationService.d.cts.map +0 -1
  520. package/dist/services/FeatureFlagConfigurationService.d.mts +0 -73
  521. package/dist/services/FeatureFlagConfigurationService.d.mts.map +0 -1
  522. package/dist/services/FeatureFlagConfigurationService.mjs +0 -253
  523. package/dist/services/FeatureFlagConfigurationService.mjs.map +0 -1
  524. package/dist/services/HyperLiquidClientService.cjs +0 -1114
  525. package/dist/services/HyperLiquidClientService.cjs.map +0 -1
  526. package/dist/services/HyperLiquidClientService.d.cts +0 -252
  527. package/dist/services/HyperLiquidClientService.d.cts.map +0 -1
  528. package/dist/services/HyperLiquidClientService.d.mts +0 -252
  529. package/dist/services/HyperLiquidClientService.d.mts.map +0 -1
  530. package/dist/services/HyperLiquidClientService.mjs +0 -1109
  531. package/dist/services/HyperLiquidClientService.mjs.map +0 -1
  532. package/dist/services/HyperLiquidSubscriptionService.cjs +0 -3594
  533. package/dist/services/HyperLiquidSubscriptionService.cjs.map +0 -1
  534. package/dist/services/HyperLiquidSubscriptionService.d.cts +0 -265
  535. package/dist/services/HyperLiquidSubscriptionService.d.cts.map +0 -1
  536. package/dist/services/HyperLiquidSubscriptionService.d.mts +0 -265
  537. package/dist/services/HyperLiquidSubscriptionService.d.mts.map +0 -1
  538. package/dist/services/HyperLiquidSubscriptionService.mjs +0 -3590
  539. package/dist/services/HyperLiquidSubscriptionService.mjs.map +0 -1
  540. package/dist/services/HyperLiquidWalletService.cjs +0 -186
  541. package/dist/services/HyperLiquidWalletService.cjs.map +0 -1
  542. package/dist/services/HyperLiquidWalletService.d.cts +0 -84
  543. package/dist/services/HyperLiquidWalletService.d.cts.map +0 -1
  544. package/dist/services/HyperLiquidWalletService.d.mts +0 -84
  545. package/dist/services/HyperLiquidWalletService.d.mts.map +0 -1
  546. package/dist/services/HyperLiquidWalletService.mjs +0 -182
  547. package/dist/services/HyperLiquidWalletService.mjs.map +0 -1
  548. package/dist/services/LighterClientService.cjs +0 -643
  549. package/dist/services/LighterClientService.cjs.map +0 -1
  550. package/dist/services/LighterClientService.d.cts +0 -200
  551. package/dist/services/LighterClientService.d.cts.map +0 -1
  552. package/dist/services/LighterClientService.d.mts +0 -200
  553. package/dist/services/LighterClientService.d.mts.map +0 -1
  554. package/dist/services/LighterClientService.mjs +0 -637
  555. package/dist/services/LighterClientService.mjs.map +0 -1
  556. package/dist/services/LighterWalletService.cjs +0 -109
  557. package/dist/services/LighterWalletService.cjs.map +0 -1
  558. package/dist/services/LighterWalletService.d.cts +0 -51
  559. package/dist/services/LighterWalletService.d.cts.map +0 -1
  560. package/dist/services/LighterWalletService.d.mts +0 -51
  561. package/dist/services/LighterWalletService.d.mts.map +0 -1
  562. package/dist/services/LighterWalletService.mjs +0 -105
  563. package/dist/services/LighterWalletService.mjs.map +0 -1
  564. package/dist/services/MarketDataService.cjs +0 -1171
  565. package/dist/services/MarketDataService.cjs.map +0 -1
  566. package/dist/services/MarketDataService.d.cts +0 -350
  567. package/dist/services/MarketDataService.d.cts.map +0 -1
  568. package/dist/services/MarketDataService.d.mts +0 -350
  569. package/dist/services/MarketDataService.d.mts.map +0 -1
  570. package/dist/services/MarketDataService.mjs +0 -1167
  571. package/dist/services/MarketDataService.mjs.map +0 -1
  572. package/dist/services/RewardsIntegrationService.cjs +0 -391
  573. package/dist/services/RewardsIntegrationService.cjs.map +0 -1
  574. package/dist/services/RewardsIntegrationService.d.cts +0 -84
  575. package/dist/services/RewardsIntegrationService.d.cts.map +0 -1
  576. package/dist/services/RewardsIntegrationService.d.mts +0 -84
  577. package/dist/services/RewardsIntegrationService.d.mts.map +0 -1
  578. package/dist/services/RewardsIntegrationService.mjs +0 -387
  579. package/dist/services/RewardsIntegrationService.mjs.map +0 -1
  580. package/dist/services/ServiceContext.cjs +0 -3
  581. package/dist/services/ServiceContext.cjs.map +0 -1
  582. package/dist/services/ServiceContext.d.cts +0 -102
  583. package/dist/services/ServiceContext.d.cts.map +0 -1
  584. package/dist/services/ServiceContext.d.mts +0 -102
  585. package/dist/services/ServiceContext.d.mts.map +0 -1
  586. package/dist/services/ServiceContext.mjs +0 -2
  587. package/dist/services/ServiceContext.mjs.map +0 -1
  588. package/dist/services/TerminalMarketService.cjs +0 -623
  589. package/dist/services/TerminalMarketService.cjs.map +0 -1
  590. package/dist/services/TerminalMarketService.d.cts +0 -45
  591. package/dist/services/TerminalMarketService.d.cts.map +0 -1
  592. package/dist/services/TerminalMarketService.d.mts +0 -45
  593. package/dist/services/TerminalMarketService.d.mts.map +0 -1
  594. package/dist/services/TerminalMarketService.mjs +0 -619
  595. package/dist/services/TerminalMarketService.mjs.map +0 -1
  596. package/dist/services/TradingReadinessCache.cjs +0 -329
  597. package/dist/services/TradingReadinessCache.cjs.map +0 -1
  598. package/dist/services/TradingReadinessCache.d.cts +0 -204
  599. package/dist/services/TradingReadinessCache.d.cts.map +0 -1
  600. package/dist/services/TradingReadinessCache.d.mts +0 -204
  601. package/dist/services/TradingReadinessCache.d.mts.map +0 -1
  602. package/dist/services/TradingReadinessCache.mjs +0 -326
  603. package/dist/services/TradingReadinessCache.mjs.map +0 -1
  604. package/dist/services/TradingService.cjs +0 -1895
  605. package/dist/services/TradingService.cjs.map +0 -1
  606. package/dist/services/TradingService.d.cts +0 -201
  607. package/dist/services/TradingService.d.cts.map +0 -1
  608. package/dist/services/TradingService.d.mts +0 -201
  609. package/dist/services/TradingService.d.mts.map +0 -1
  610. package/dist/services/TradingService.mjs +0 -1891
  611. package/dist/services/TradingService.mjs.map +0 -1
  612. package/dist/types/config.cjs +0 -3
  613. package/dist/types/config.cjs.map +0 -1
  614. package/dist/types/config.d.cts +0 -49
  615. package/dist/types/config.d.cts.map +0 -1
  616. package/dist/types/config.d.mts +0 -49
  617. package/dist/types/config.d.mts.map +0 -1
  618. package/dist/types/config.mjs +0 -2
  619. package/dist/types/config.mjs.map +0 -1
  620. package/dist/types/hyperliquid-types.cjs +0 -45
  621. package/dist/types/hyperliquid-types.cjs.map +0 -1
  622. package/dist/types/hyperliquid-types.d.cts +0 -67
  623. package/dist/types/hyperliquid-types.d.cts.map +0 -1
  624. package/dist/types/hyperliquid-types.d.mts +0 -67
  625. package/dist/types/hyperliquid-types.d.mts.map +0 -1
  626. package/dist/types/hyperliquid-types.mjs +0 -41
  627. package/dist/types/hyperliquid-types.mjs.map +0 -1
  628. package/dist/types/index.cjs +0 -151
  629. package/dist/types/index.cjs.map +0 -1
  630. package/dist/types/index.d.cts +0 -2183
  631. package/dist/types/index.d.cts.map +0 -1
  632. package/dist/types/index.d.mts +0 -2183
  633. package/dist/types/index.d.mts.map +0 -1
  634. package/dist/types/index.mjs +0 -133
  635. package/dist/types/index.mjs.map +0 -1
  636. package/dist/types/lighter-types.cjs +0 -11
  637. package/dist/types/lighter-types.cjs.map +0 -1
  638. package/dist/types/lighter-types.d.cts +0 -763
  639. package/dist/types/lighter-types.d.cts.map +0 -1
  640. package/dist/types/lighter-types.d.mts +0 -763
  641. package/dist/types/lighter-types.d.mts.map +0 -1
  642. package/dist/types/lighter-types.mjs +0 -10
  643. package/dist/types/lighter-types.mjs.map +0 -1
  644. package/dist/types/messenger.cjs +0 -3
  645. package/dist/types/messenger.cjs.map +0 -1
  646. package/dist/types/messenger.d.cts +0 -30
  647. package/dist/types/messenger.d.cts.map +0 -1
  648. package/dist/types/messenger.d.mts +0 -30
  649. package/dist/types/messenger.d.mts.map +0 -1
  650. package/dist/types/messenger.mjs +0 -2
  651. package/dist/types/messenger.mjs.map +0 -1
  652. package/dist/types/perps-types.cjs +0 -7
  653. package/dist/types/perps-types.cjs.map +0 -1
  654. package/dist/types/perps-types.d.cts +0 -184
  655. package/dist/types/perps-types.d.cts.map +0 -1
  656. package/dist/types/perps-types.d.mts +0 -184
  657. package/dist/types/perps-types.d.mts.map +0 -1
  658. package/dist/types/perps-types.mjs +0 -5
  659. package/dist/types/perps-types.mjs.map +0 -1
  660. package/dist/types/token.cjs +0 -3
  661. package/dist/types/token.cjs.map +0 -1
  662. package/dist/types/token.d.cts +0 -25
  663. package/dist/types/token.d.cts.map +0 -1
  664. package/dist/types/token.d.mts +0 -25
  665. package/dist/types/token.d.mts.map +0 -1
  666. package/dist/types/token.mjs +0 -2
  667. package/dist/types/token.mjs.map +0 -1
  668. package/dist/types/transactionTypes.cjs +0 -29
  669. package/dist/types/transactionTypes.cjs.map +0 -1
  670. package/dist/types/transactionTypes.d.cts +0 -60
  671. package/dist/types/transactionTypes.d.cts.map +0 -1
  672. package/dist/types/transactionTypes.d.mts +0 -60
  673. package/dist/types/transactionTypes.d.mts.map +0 -1
  674. package/dist/types/transactionTypes.mjs +0 -24
  675. package/dist/types/transactionTypes.mjs.map +0 -1
  676. package/dist/utils/accountUtils.cjs +0 -236
  677. package/dist/utils/accountUtils.cjs.map +0 -1
  678. package/dist/utils/accountUtils.d.cts +0 -72
  679. package/dist/utils/accountUtils.d.cts.map +0 -1
  680. package/dist/utils/accountUtils.d.mts +0 -72
  681. package/dist/utils/accountUtils.d.mts.map +0 -1
  682. package/dist/utils/accountUtils.mjs +0 -223
  683. package/dist/utils/accountUtils.mjs.map +0 -1
  684. package/dist/utils/capabilitySymbols.cjs +0 -25
  685. package/dist/utils/capabilitySymbols.cjs.map +0 -1
  686. package/dist/utils/capabilitySymbols.d.cts +0 -15
  687. package/dist/utils/capabilitySymbols.d.cts.map +0 -1
  688. package/dist/utils/capabilitySymbols.d.mts +0 -15
  689. package/dist/utils/capabilitySymbols.d.mts.map +0 -1
  690. package/dist/utils/capabilitySymbols.mjs +0 -21
  691. package/dist/utils/capabilitySymbols.mjs.map +0 -1
  692. package/dist/utils/coalescePerpsRestRequest.cjs +0 -71
  693. package/dist/utils/coalescePerpsRestRequest.cjs.map +0 -1
  694. package/dist/utils/coalescePerpsRestRequest.d.cts +0 -32
  695. package/dist/utils/coalescePerpsRestRequest.d.cts.map +0 -1
  696. package/dist/utils/coalescePerpsRestRequest.d.mts +0 -32
  697. package/dist/utils/coalescePerpsRestRequest.d.mts.map +0 -1
  698. package/dist/utils/coalescePerpsRestRequest.mjs +0 -66
  699. package/dist/utils/coalescePerpsRestRequest.mjs.map +0 -1
  700. package/dist/utils/errorUtils.cjs +0 -104
  701. package/dist/utils/errorUtils.cjs.map +0 -1
  702. package/dist/utils/errorUtils.d.cts +0 -50
  703. package/dist/utils/errorUtils.d.cts.map +0 -1
  704. package/dist/utils/errorUtils.d.mts +0 -50
  705. package/dist/utils/errorUtils.d.mts.map +0 -1
  706. package/dist/utils/errorUtils.mjs +0 -96
  707. package/dist/utils/errorUtils.mjs.map +0 -1
  708. package/dist/utils/hyperLiquidAbstraction.cjs +0 -23
  709. package/dist/utils/hyperLiquidAbstraction.cjs.map +0 -1
  710. package/dist/utils/hyperLiquidAbstraction.d.cts +0 -11
  711. package/dist/utils/hyperLiquidAbstraction.d.cts.map +0 -1
  712. package/dist/utils/hyperLiquidAbstraction.d.mts +0 -11
  713. package/dist/utils/hyperLiquidAbstraction.d.mts.map +0 -1
  714. package/dist/utils/hyperLiquidAbstraction.mjs +0 -19
  715. package/dist/utils/hyperLiquidAbstraction.mjs.map +0 -1
  716. package/dist/utils/hyperLiquidAdapter.cjs +0 -512
  717. package/dist/utils/hyperLiquidAdapter.cjs.map +0 -1
  718. package/dist/utils/hyperLiquidAdapter.d.cts +0 -77
  719. package/dist/utils/hyperLiquidAdapter.d.cts.map +0 -1
  720. package/dist/utils/hyperLiquidAdapter.d.mts +0 -77
  721. package/dist/utils/hyperLiquidAdapter.d.mts.map +0 -1
  722. package/dist/utils/hyperLiquidAdapter.mjs +0 -494
  723. package/dist/utils/hyperLiquidAdapter.mjs.map +0 -1
  724. package/dist/utils/hyperLiquidOrderBookProcessor.cjs +0 -83
  725. package/dist/utils/hyperLiquidOrderBookProcessor.cjs.map +0 -1
  726. package/dist/utils/hyperLiquidOrderBookProcessor.d.cts +0 -55
  727. package/dist/utils/hyperLiquidOrderBookProcessor.d.cts.map +0 -1
  728. package/dist/utils/hyperLiquidOrderBookProcessor.d.mts +0 -55
  729. package/dist/utils/hyperLiquidOrderBookProcessor.d.mts.map +0 -1
  730. package/dist/utils/hyperLiquidOrderBookProcessor.mjs +0 -78
  731. package/dist/utils/hyperLiquidOrderBookProcessor.mjs.map +0 -1
  732. package/dist/utils/hyperLiquidPositionPreview.cjs +0 -355
  733. package/dist/utils/hyperLiquidPositionPreview.cjs.map +0 -1
  734. package/dist/utils/hyperLiquidPositionPreview.d.cts +0 -124
  735. package/dist/utils/hyperLiquidPositionPreview.d.cts.map +0 -1
  736. package/dist/utils/hyperLiquidPositionPreview.d.mts +0 -124
  737. package/dist/utils/hyperLiquidPositionPreview.d.mts.map +0 -1
  738. package/dist/utils/hyperLiquidPositionPreview.mjs +0 -347
  739. package/dist/utils/hyperLiquidPositionPreview.mjs.map +0 -1
  740. package/dist/utils/hyperLiquidValidation.cjs +0 -799
  741. package/dist/utils/hyperLiquidValidation.cjs.map +0 -1
  742. package/dist/utils/hyperLiquidValidation.d.cts +0 -192
  743. package/dist/utils/hyperLiquidValidation.d.cts.map +0 -1
  744. package/dist/utils/hyperLiquidValidation.d.mts +0 -192
  745. package/dist/utils/hyperLiquidValidation.d.mts.map +0 -1
  746. package/dist/utils/hyperLiquidValidation.mjs +0 -786
  747. package/dist/utils/hyperLiquidValidation.mjs.map +0 -1
  748. package/dist/utils/idUtils.cjs +0 -18
  749. package/dist/utils/idUtils.cjs.map +0 -1
  750. package/dist/utils/idUtils.d.cts +0 -6
  751. package/dist/utils/idUtils.d.cts.map +0 -1
  752. package/dist/utils/idUtils.d.mts +0 -6
  753. package/dist/utils/idUtils.d.mts.map +0 -1
  754. package/dist/utils/idUtils.mjs +0 -10
  755. package/dist/utils/idUtils.mjs.map +0 -1
  756. package/dist/utils/index.cjs +0 -66
  757. package/dist/utils/index.cjs.map +0 -1
  758. package/dist/utils/index.d.cts +0 -29
  759. package/dist/utils/index.d.cts.map +0 -1
  760. package/dist/utils/index.d.mts +0 -29
  761. package/dist/utils/index.d.mts.map +0 -1
  762. package/dist/utils/index.mjs +0 -34
  763. package/dist/utils/index.mjs.map +0 -1
  764. package/dist/utils/lighterAdapter.cjs +0 -575
  765. package/dist/utils/lighterAdapter.cjs.map +0 -1
  766. package/dist/utils/lighterAdapter.d.cts +0 -117
  767. package/dist/utils/lighterAdapter.d.cts.map +0 -1
  768. package/dist/utils/lighterAdapter.d.mts +0 -117
  769. package/dist/utils/lighterAdapter.d.mts.map +0 -1
  770. package/dist/utils/lighterAdapter.mjs +0 -562
  771. package/dist/utils/lighterAdapter.mjs.map +0 -1
  772. package/dist/utils/marketDataTransform.cjs +0 -250
  773. package/dist/utils/marketDataTransform.cjs.map +0 -1
  774. package/dist/utils/marketDataTransform.d.cts +0 -71
  775. package/dist/utils/marketDataTransform.d.cts.map +0 -1
  776. package/dist/utils/marketDataTransform.d.mts +0 -71
  777. package/dist/utils/marketDataTransform.d.mts.map +0 -1
  778. package/dist/utils/marketDataTransform.mjs +0 -243
  779. package/dist/utils/marketDataTransform.mjs.map +0 -1
  780. package/dist/utils/marketSearch.cjs +0 -111
  781. package/dist/utils/marketSearch.cjs.map +0 -1
  782. package/dist/utils/marketSearch.d.cts +0 -48
  783. package/dist/utils/marketSearch.d.cts.map +0 -1
  784. package/dist/utils/marketSearch.d.mts +0 -48
  785. package/dist/utils/marketSearch.d.mts.map +0 -1
  786. package/dist/utils/marketSearch.mjs +0 -106
  787. package/dist/utils/marketSearch.mjs.map +0 -1
  788. package/dist/utils/marketUtils.cjs +0 -266
  789. package/dist/utils/marketUtils.cjs.map +0 -1
  790. package/dist/utils/marketUtils.d.cts +0 -73
  791. package/dist/utils/marketUtils.d.cts.map +0 -1
  792. package/dist/utils/marketUtils.d.mts +0 -73
  793. package/dist/utils/marketUtils.d.mts.map +0 -1
  794. package/dist/utils/marketUtils.mjs +0 -248
  795. package/dist/utils/marketUtils.mjs.map +0 -1
  796. package/dist/utils/orderCalculations.cjs +0 -849
  797. package/dist/utils/orderCalculations.cjs.map +0 -1
  798. package/dist/utils/orderCalculations.d.cts +0 -306
  799. package/dist/utils/orderCalculations.d.cts.map +0 -1
  800. package/dist/utils/orderCalculations.d.mts +0 -306
  801. package/dist/utils/orderCalculations.d.mts.map +0 -1
  802. package/dist/utils/orderCalculations.mjs +0 -833
  803. package/dist/utils/orderCalculations.mjs.map +0 -1
  804. package/dist/utils/orderTypes.cjs +0 -301
  805. package/dist/utils/orderTypes.cjs.map +0 -1
  806. package/dist/utils/orderTypes.d.cts +0 -166
  807. package/dist/utils/orderTypes.d.cts.map +0 -1
  808. package/dist/utils/orderTypes.d.mts +0 -166
  809. package/dist/utils/orderTypes.d.mts.map +0 -1
  810. package/dist/utils/orderTypes.mjs +0 -287
  811. package/dist/utils/orderTypes.mjs.map +0 -1
  812. package/dist/utils/perpsConnectionAttemptContext.cjs +0 -20
  813. package/dist/utils/perpsConnectionAttemptContext.cjs.map +0 -1
  814. package/dist/utils/perpsConnectionAttemptContext.d.cts +0 -7
  815. package/dist/utils/perpsConnectionAttemptContext.d.cts.map +0 -1
  816. package/dist/utils/perpsConnectionAttemptContext.d.mts +0 -7
  817. package/dist/utils/perpsConnectionAttemptContext.d.mts.map +0 -1
  818. package/dist/utils/perpsConnectionAttemptContext.mjs +0 -15
  819. package/dist/utils/perpsConnectionAttemptContext.mjs.map +0 -1
  820. package/dist/utils/perpsDiskPersistence.cjs +0 -259
  821. package/dist/utils/perpsDiskPersistence.cjs.map +0 -1
  822. package/dist/utils/perpsDiskPersistence.d.cts +0 -112
  823. package/dist/utils/perpsDiskPersistence.d.cts.map +0 -1
  824. package/dist/utils/perpsDiskPersistence.d.mts +0 -112
  825. package/dist/utils/perpsDiskPersistence.d.mts.map +0 -1
  826. package/dist/utils/perpsDiskPersistence.mjs +0 -251
  827. package/dist/utils/perpsDiskPersistence.mjs.map +0 -1
  828. package/dist/utils/perpsFormatters.cjs +0 -509
  829. package/dist/utils/perpsFormatters.cjs.map +0 -1
  830. package/dist/utils/perpsFormatters.d.cts +0 -204
  831. package/dist/utils/perpsFormatters.d.cts.map +0 -1
  832. package/dist/utils/perpsFormatters.d.mts +0 -204
  833. package/dist/utils/perpsFormatters.d.mts.map +0 -1
  834. package/dist/utils/perpsFormatters.mjs +0 -500
  835. package/dist/utils/perpsFormatters.mjs.map +0 -1
  836. package/dist/utils/rewardsUtils.cjs +0 -98
  837. package/dist/utils/rewardsUtils.cjs.map +0 -1
  838. package/dist/utils/rewardsUtils.d.cts +0 -33
  839. package/dist/utils/rewardsUtils.d.cts.map +0 -1
  840. package/dist/utils/rewardsUtils.d.mts +0 -33
  841. package/dist/utils/rewardsUtils.d.mts.map +0 -1
  842. package/dist/utils/rewardsUtils.mjs +0 -92
  843. package/dist/utils/rewardsUtils.mjs.map +0 -1
  844. package/dist/utils/significantFigures.cjs +0 -88
  845. package/dist/utils/significantFigures.cjs.map +0 -1
  846. package/dist/utils/significantFigures.d.cts +0 -25
  847. package/dist/utils/significantFigures.d.cts.map +0 -1
  848. package/dist/utils/significantFigures.d.mts +0 -25
  849. package/dist/utils/significantFigures.d.mts.map +0 -1
  850. package/dist/utils/significantFigures.mjs +0 -82
  851. package/dist/utils/significantFigures.mjs.map +0 -1
  852. package/dist/utils/sortMarkets.cjs +0 -93
  853. package/dist/utils/sortMarkets.cjs.map +0 -1
  854. package/dist/utils/sortMarkets.d.cts +0 -25
  855. package/dist/utils/sortMarkets.d.cts.map +0 -1
  856. package/dist/utils/sortMarkets.d.mts +0 -25
  857. package/dist/utils/sortMarkets.d.mts.map +0 -1
  858. package/dist/utils/sortMarkets.mjs +0 -88
  859. package/dist/utils/sortMarkets.mjs.map +0 -1
  860. package/dist/utils/standaloneInfoClient.cjs +0 -70
  861. package/dist/utils/standaloneInfoClient.cjs.map +0 -1
  862. package/dist/utils/standaloneInfoClient.d.cts +0 -37
  863. package/dist/utils/standaloneInfoClient.d.cts.map +0 -1
  864. package/dist/utils/standaloneInfoClient.d.mts +0 -37
  865. package/dist/utils/standaloneInfoClient.d.mts.map +0 -1
  866. package/dist/utils/standaloneInfoClient.mjs +0 -64
  867. package/dist/utils/standaloneInfoClient.mjs.map +0 -1
  868. package/dist/utils/stringParseUtils.cjs +0 -34
  869. package/dist/utils/stringParseUtils.cjs.map +0 -1
  870. package/dist/utils/stringParseUtils.d.cts +0 -11
  871. package/dist/utils/stringParseUtils.d.cts.map +0 -1
  872. package/dist/utils/stringParseUtils.d.mts +0 -11
  873. package/dist/utils/stringParseUtils.d.mts.map +0 -1
  874. package/dist/utils/stringParseUtils.mjs +0 -28
  875. package/dist/utils/stringParseUtils.mjs.map +0 -1
  876. package/dist/utils/transferData.cjs +0 -33
  877. package/dist/utils/transferData.cjs.map +0 -1
  878. package/dist/utils/transferData.d.cts +0 -9
  879. package/dist/utils/transferData.d.cts.map +0 -1
  880. package/dist/utils/transferData.d.mts +0 -9
  881. package/dist/utils/transferData.d.mts.map +0 -1
  882. package/dist/utils/transferData.mjs +0 -29
  883. package/dist/utils/transferData.mjs.map +0 -1
  884. package/dist/utils/wait.cjs +0 -6
  885. package/dist/utils/wait.cjs.map +0 -1
  886. package/dist/utils/wait.d.cts +0 -2
  887. package/dist/utils/wait.d.cts.map +0 -1
  888. package/dist/utils/wait.d.mts +0 -2
  889. package/dist/utils/wait.d.mts.map +0 -1
  890. package/dist/utils/wait.mjs +0 -2
  891. package/dist/utils/wait.mjs.map +0 -1
@@ -0,0 +1,1313 @@
1
+ import type { PerpsWatchlistMarkets } from '@metamask/authenticated-user-storage';
2
+ import { BaseController, ControllerGetStateAction, ControllerStateChangedEvent, ControllerStateChangeEvent } from '@metamask/base-controller';
3
+ import type { Messenger } from '@metamask/messenger';
4
+ import type { Json } from '@metamask/utils';
5
+ import { CandlePeriod } from './constants/chartConfig.js';
6
+ import type { SortOptionId, OrderBookPreferences, ProLayoutPreferences, PerpsMode } from './constants/perpsConfig.js';
7
+ import type { PerpsControllerMethodActions } from './PerpsController-method-action-types.js';
8
+ import { WebSocketConnectionState } from './types/index.js';
9
+ import type { AccountState, AssetRoute, CancelOrderParams, CancelOrderResult, CancelOrdersParams, CancelOrdersResult, ChaseOrder, ChaseOrderMaxDistanceReached, ClosePositionParams, ClosePositionsParams, ClosePositionsResult, DepositWithConfirmationParams, EditOrderParams, FeeCalculationParams, FeeCalculationResult, FlipPositionParams, Funding, GetAccountStateParams, GetAvailableDexsParams, GetFundingParams, GetMarketDataWithPricesParams, GetMarketsParams, GetOrderCapabilitiesParams, GetScalePriceLadderParams, GetOrderFillsParams, GetOrdersParams, GetPositionsParams, PerpsProvider, LiquidationPriceParams, LiveDataConfig, MaintenanceMarginParams, PositionModifyPreviewParams, PositionModifyPreviewResult, MarginResult, MarketInfo, Order, OrderDirection, OrderFill, OrderParams, OrderResult, PerpsControllerConfig, PerpsMarketData, PerpsOrderCapabilities, PerpsScalePriceLadder, PerpsPendingManualRecovery, PerpsRecoveredDispatch, Position, SubscribeAccountParams, SubscribeCandlesParams, SubscribeOICapsParams, SubscribeOrderBookParams, SubscribeOrderFillsParams, SubscribeOrdersParams, SubscribeTwapOrdersParams, SubscribePositionsParams, SubscribePricesParams, SwitchProviderResult, ToggleTestnetResult, TwapOrder, UpdateMarginParams, UpdatePositionTPSLParams, WithdrawParams, WithdrawResult, GetHistoricalPortfolioParams, HistoricalPortfolioResult, OrderType, PerpsPlatformDependencies, PerpsActiveProviderMode, PerpsAnalyticsProperties, PerpsAttributionContext, PerpsProviderType, PerpsUserDataSnapshot, PerpsSelectedPaymentToken, PerpsRemoteFeatureFlagState, MarketTypeFilter } from './types/index.js';
10
+ import type { SortDirection } from './types/index.js';
11
+ import type { LighterAuthConfig, LighterSignerBridge } from './types/lighter-types.js';
12
+ import type { PerpsControllerAllowedActions, PerpsControllerAllowedEvents } from './types/messenger.js';
13
+ import type { CandleData } from './types/perps-types.js';
14
+ import { LastTransactionResult, TransactionStatus } from './types/transactionTypes.js';
15
+ /**
16
+ * Maps an active provider mode to the corresponding exchange key used in the
17
+ * AUS {@link PerpsWatchlistMarkets} schema.
18
+ *
19
+ * Returns `null` for modes that are not yet represented in the AUS schema
20
+ * (e.g. `'aggregated'`), which signals callers to skip remote sync and fall
21
+ * back to local state only. Add new entries here as additional DEX providers
22
+ * gain AUS watchlist support.
23
+ *
24
+ * @param activeProvider - The current active provider mode from controller state.
25
+ * @returns The matching `PerpsWatchlistMarkets` key, or `null` if unsupported.
26
+ */
27
+ export declare function resolveWatchlistExchangeKey(activeProvider: PerpsActiveProviderMode): keyof PerpsWatchlistMarkets | null;
28
+ /**
29
+ * Minimal payment token stored in PerpsController state.
30
+ * Only required fields for identification, Perps balance detection, and analytics.
31
+ */
32
+ export type SelectedPaymentTokenSnapshot = {
33
+ description?: string;
34
+ address: string;
35
+ chainId: string;
36
+ symbol?: string;
37
+ };
38
+ export { PERPS_ERROR_CODES, type PerpsErrorCode } from './perpsErrorCodes.js';
39
+ /**
40
+ * Initialization state enum for state machine tracking
41
+ */
42
+ export declare enum InitializationState {
43
+ Uninitialized = "uninitialized",
44
+ Initializing = "initializing",
45
+ Initialized = "initialized",
46
+ Failed = "failed"
47
+ }
48
+ export { PerpsMode, DEFAULT_ORDER_BOOK_PREFERENCES, DEFAULT_PERPS_MODE, DEFAULT_PRO_LAYOUT_PREFERENCES, DEFAULT_SELECTED_ORDER_TYPE, } from './constants/perpsConfig.js';
49
+ export type { OrderBookListCurrency, OrderBookListMetric, OrderBookPreferences, ProLayoutPreferences, ProOrdersSideFilter, ProOrdersSortDirection, ProOrdersSortField, ProPositionsSideFilter, ProPositionsSortDirection, ProPositionsSortField, } from './constants/perpsConfig.js';
50
+ /**
51
+ * State shape for PerpsController
52
+ */
53
+ export type PerpsControllerState = {
54
+ activeProvider: PerpsActiveProviderMode;
55
+ isTestnet: boolean;
56
+ initializationState: InitializationState;
57
+ initializationError: string | null;
58
+ initializationAttempts: number;
59
+ accountState: AccountState | null;
60
+ perpsBalances: {
61
+ [provider: string]: {
62
+ totalBalance: string;
63
+ unrealizedPnl: string;
64
+ accountValue1dAgo: string;
65
+ lastUpdated: number;
66
+ };
67
+ };
68
+ depositInProgress: boolean;
69
+ lastDepositTransactionId: string | null;
70
+ lastDepositResult: LastTransactionResult | null;
71
+ withdrawInProgress: boolean;
72
+ lastWithdrawResult: LastTransactionResult | null;
73
+ lastCompletedWithdrawalTimestamp: number | null;
74
+ lastCompletedWithdrawalTxHashes: string[];
75
+ withdrawalRequests: {
76
+ id: string;
77
+ amount: string;
78
+ asset: string;
79
+ accountAddress: string;
80
+ txHash?: string;
81
+ timestamp: number;
82
+ success: boolean;
83
+ status: TransactionStatus;
84
+ destination?: string;
85
+ source?: string;
86
+ transactionId?: string;
87
+ withdrawalId?: string;
88
+ depositId?: string;
89
+ }[];
90
+ withdrawalProgress: {
91
+ progress: number;
92
+ lastUpdated: number;
93
+ activeWithdrawalId: string | null;
94
+ };
95
+ depositRequests: {
96
+ id: string;
97
+ amount: string;
98
+ asset: string;
99
+ accountAddress: string;
100
+ txHash?: string;
101
+ timestamp: number;
102
+ success: boolean;
103
+ status: TransactionStatus;
104
+ destination?: string;
105
+ source?: string;
106
+ transactionId?: string;
107
+ withdrawalId?: string;
108
+ depositId?: string;
109
+ }[];
110
+ isEligible: boolean;
111
+ isFirstTimeUser: {
112
+ testnet: boolean;
113
+ mainnet: boolean;
114
+ };
115
+ hasPlacedFirstOrder: {
116
+ testnet: boolean;
117
+ mainnet: boolean;
118
+ };
119
+ watchlistMarkets: {
120
+ testnet: string[];
121
+ mainnet: string[];
122
+ };
123
+ recentlyViewedMarkets: {
124
+ testnet: {
125
+ symbol: string;
126
+ viewedAt: number;
127
+ }[];
128
+ mainnet: {
129
+ symbol: string;
130
+ viewedAt: number;
131
+ }[];
132
+ };
133
+ tradeConfigurations: {
134
+ testnet: {
135
+ [marketSymbol: string]: {
136
+ leverage?: number;
137
+ orderBookGrouping?: number;
138
+ pendingConfig?: {
139
+ amount?: string;
140
+ leverage?: number;
141
+ takeProfitPrice?: string;
142
+ stopLossPrice?: string;
143
+ limitPrice?: string;
144
+ orderType?: OrderType;
145
+ reduceOnly?: boolean;
146
+ direction?: OrderDirection;
147
+ timestamp: number;
148
+ };
149
+ };
150
+ };
151
+ mainnet: {
152
+ [marketSymbol: string]: {
153
+ leverage?: number;
154
+ orderBookGrouping?: number;
155
+ pendingConfig?: {
156
+ amount?: string;
157
+ leverage?: number;
158
+ takeProfitPrice?: string;
159
+ stopLossPrice?: string;
160
+ limitPrice?: string;
161
+ orderType?: OrderType;
162
+ reduceOnly?: boolean;
163
+ direction?: OrderDirection;
164
+ timestamp: number;
165
+ };
166
+ };
167
+ };
168
+ };
169
+ maxSlippageBps?: number;
170
+ marketFilterPreferences: {
171
+ optionId: SortOptionId;
172
+ direction: SortDirection;
173
+ };
174
+ proLayoutPreferences: ProLayoutPreferences;
175
+ orderBookPreferences: OrderBookPreferences;
176
+ selectedOrderType: OrderType;
177
+ visibleCandleCount: number;
178
+ mode: PerpsMode;
179
+ lastError: string | null;
180
+ lastUpdateTimestamp: number;
181
+ hip3ConfigVersion: number;
182
+ selectedPaymentToken: Json | null;
183
+ cachedMarketDataByProvider: Record<string, {
184
+ data: PerpsMarketData[];
185
+ timestamp: number;
186
+ sourceExpiresAt?: number;
187
+ hip3ConfigVersion?: number;
188
+ dexes?: string[];
189
+ }>;
190
+ cachedUserDataByProvider: Record<string, {
191
+ positions: Position[];
192
+ orders: Order[];
193
+ accountState: AccountState | null;
194
+ timestamp: number;
195
+ address: string;
196
+ hip3ConfigVersion?: number;
197
+ dexes?: string[];
198
+ }>;
199
+ };
200
+ /**
201
+ * Get default PerpsController state
202
+ *
203
+ * To change the active provider, modify the `activeProvider` value below:
204
+ * - 'hyperliquid': HyperLiquid provider (default, production)
205
+ * - 'aggregated': Multi-provider aggregation mode
206
+ *
207
+ * @returns The default perps controller state.
208
+ */
209
+ export declare const getDefaultPerpsControllerState: () => PerpsControllerState;
210
+ export type PerpsControllerChaseOrderMaxDistanceReachedEvent = {
211
+ type: 'PerpsController:chaseOrderMaxDistanceReached';
212
+ payload: [ChaseOrderMaxDistanceReached];
213
+ };
214
+ /** PerpsController events. */
215
+ export type PerpsControllerEvents = ControllerStateChangeEvent<'PerpsController', PerpsControllerState> | ControllerStateChangedEvent<'PerpsController', PerpsControllerState> | PerpsControllerChaseOrderMaxDistanceReachedEvent;
216
+ /**
217
+ * The action which can be used to retrieve the state of the
218
+ * {@link PerpsController}.
219
+ */
220
+ export type PerpsControllerGetStateAction = ControllerGetStateAction<'PerpsController', PerpsControllerState>;
221
+ /**
222
+ * PerpsController actions
223
+ */
224
+ export type PerpsControllerActions = PerpsControllerGetStateAction | PerpsControllerMethodActions;
225
+ /**
226
+ * PerpsController messenger constraints.
227
+ * Includes both PerpsController's own actions/events and
228
+ * allowed actions/events from external controllers.
229
+ */
230
+ export type PerpsControllerMessenger = Messenger<'PerpsController', PerpsControllerActions | PerpsControllerAllowedActions, PerpsControllerEvents | PerpsControllerAllowedEvents>;
231
+ /**
232
+ * PerpsController options
233
+ */
234
+ export type PerpsControllerOptions = {
235
+ messenger: PerpsControllerMessenger;
236
+ state?: Partial<PerpsControllerState>;
237
+ clientConfig?: PerpsControllerConfig;
238
+ /**
239
+ * Platform-specific dependencies (required)
240
+ * Provides logging, metrics, tracing, stream management, and rewards.
241
+ * Cross-controller communication uses the messenger pattern.
242
+ * Must be provided by the platform (mobile/extension) at instantiation time.
243
+ */
244
+ infrastructure: PerpsPlatformDependencies;
245
+ /**
246
+ * When true, defers the initial eligibility (geolocation) check until
247
+ * `startEligibilityMonitoring()` is called. This prevents the eager
248
+ * geolocation fetch from firing during wallet onboarding (privacy compliance).
249
+ */
250
+ deferEligibilityCheck?: boolean;
251
+ };
252
+ type BlockedRegionList = {
253
+ list: string[];
254
+ source: 'remote' | 'fallback';
255
+ };
256
+ /**
257
+ * PerpsController - Protocol-agnostic perpetuals trading controller
258
+ *
259
+ * Provides a unified interface for perpetual futures trading across multiple protocols.
260
+ * Features dual data flow architecture:
261
+ * - Trading actions use Redux for persistence and optimistic updates
262
+ * - Live data uses direct callbacks for maximum performance
263
+ */
264
+ export declare class PerpsController extends BaseController<'PerpsController', PerpsControllerState, PerpsControllerMessenger> {
265
+ #private;
266
+ protected providers: Map<PerpsProviderType, PerpsProvider>;
267
+ protected isInitialized: boolean;
268
+ protected blockedRegionList: BlockedRegionList;
269
+ /**
270
+ * Active provider instance for routing operations.
271
+ * When activeProvider is 'hyperliquid' or 'lighter': points to specific provider directly
272
+ * When activeProvider is 'aggregated': points to AggregatedPerpsProvider wrapper
273
+ */
274
+ protected activeProviderInstance: PerpsProvider | null;
275
+ constructor({ messenger, state, clientConfig, infrastructure, deferEligibilityCheck, }: PerpsControllerOptions);
276
+ /**
277
+ * Read cached market data for the currently active provider (or aggregated).
278
+ * Returns null when no valid cache exists or when cache has expired.
279
+ *
280
+ * @param options - Optional settings.
281
+ * @param options.skipTTL - When true, bypass the 5-minute TTL check.
282
+ * Used during initial render so disk-hydrated structural data (with
283
+ * placeholder prices) is returned regardless of age.
284
+ * @returns The cached market data array, or null if no valid cache.
285
+ */
286
+ getCachedMarketDataForActiveProvider(options?: {
287
+ skipTTL?: boolean;
288
+ }): PerpsMarketData[] | null;
289
+ /**
290
+ * Read cached user data for the currently active provider (or aggregated).
291
+ * Returns null when no valid cache exists, cache has expired, or address
292
+ * does not match the currently selected EVM account.
293
+ *
294
+ * @param options - Optional settings.
295
+ * @param options.skipTTL - When true, bypass the 60s staleness check.
296
+ * Used during initial render so disk-hydrated user data (positions/orders)
297
+ * is returned regardless of age, avoiding a skeleton flash.
298
+ * @returns The cached user data, or null if no valid cache.
299
+ */
300
+ getCachedUserDataForActiveProvider(options?: {
301
+ skipTTL?: boolean;
302
+ }): {
303
+ positions: Position[];
304
+ orders: Order[];
305
+ accountState: AccountState | null;
306
+ } | null;
307
+ /**
308
+ * Fetch, validate, and atomically cache a complete user-data snapshot.
309
+ * This remains callable after mount so consumers can seed their live channel
310
+ * from one coherent positions/orders/account result.
311
+ *
312
+ * @returns The accepted user-data snapshot.
313
+ */
314
+ getUserDataSnapshot(): Promise<PerpsUserDataSnapshot>;
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
+ * Registers the Lighter provider after dynamic import resolves.
341
+ *
342
+ * Extracted from the import().then() callback so it can be tested directly
343
+ * (Jest cannot resolve dynamic imports without --experimental-vm-modules).
344
+ *
345
+ * @param LighterProviderClass - Constructor class for the Lighter provider.
346
+ */
347
+ protected registerLighterProvider(LighterProviderClass: new (opts: {
348
+ isTestnet: boolean;
349
+ platformDependencies: PerpsPlatformDependencies;
350
+ messenger: PerpsControllerMessenger;
351
+ lighterAuthConfig: LighterAuthConfig;
352
+ signerBridge?: LighterSignerBridge;
353
+ }) => PerpsProvider): void;
354
+ /**
355
+ * Handles errors from the Lighter dynamic import.
356
+ *
357
+ * Module-not-found errors are expected (clients may not ship Lighter) →
358
+ * debug log. Other errors indicate constructor/config problems → Sentry.
359
+ *
360
+ * @param error - The caught error from the dynamic import or constructor.
361
+ */
362
+ protected handleLighterImportError(error: unknown): void;
363
+ /**
364
+ * Get the currently active provider.
365
+ * In aggregated mode, returns AggregatedPerpsProvider which routes to underlying providers.
366
+ * In single provider mode, returns HyperLiquidProvider directly.
367
+ *
368
+ * @returns The active provider (aggregated wrapper or direct provider based on mode)
369
+ * @throws Error if provider is not initialized or reinitializing
370
+ */
371
+ getActiveProvider(): PerpsProvider;
372
+ /**
373
+ * Get the currently active provider, returning null if not available
374
+ * Use this method when the caller can gracefully handle a missing provider
375
+ * (e.g., UI components during initialization or reconnection)
376
+ *
377
+ * @returns The active provider, or null if not initialized/reinitializing
378
+ */
379
+ getActiveProviderOrNull(): PerpsProvider | null;
380
+ /**
381
+ * Get strategy capabilities through the active provider route used by order
382
+ * placement. The query waits for in-flight initialization and reports an
383
+ * explicit unavailable status when no provider route can answer reliably.
384
+ *
385
+ * @param params - Market and optional provider route.
386
+ * @returns Provider-owned order capabilities.
387
+ */
388
+ getOrderCapabilities(params: GetOrderCapabilitiesParams): Promise<PerpsOrderCapabilities>;
389
+ /**
390
+ * Build a Scale price ladder using the active provider's venue rules.
391
+ *
392
+ * @param params - Market, ladder bounds, count, and optional explicit route.
393
+ * @returns Provider-normalized prices or a typed unavailable result.
394
+ * @throws When the provider cannot normalize the requested ladder.
395
+ */
396
+ getScalePriceLadder(params: GetScalePriceLadderParams): Promise<PerpsScalePriceLadder>;
397
+ /**
398
+ * Place a new order
399
+ * Thin delegation to TradingService
400
+ *
401
+ * @param params - The operation parameters.
402
+ * @returns The order result with order ID and status.
403
+ */
404
+ placeOrder(params: OrderParams): Promise<OrderResult>;
405
+ /**
406
+ * Edit an existing order
407
+ * Thin delegation to TradingService
408
+ *
409
+ * @param params - The operation parameters.
410
+ * @returns The updated order result with order ID and status.
411
+ */
412
+ editOrder(params: EditOrderParams): Promise<OrderResult>;
413
+ /**
414
+ * Cancel an existing order
415
+ *
416
+ * @param params - The operation parameters.
417
+ * @returns The cancellation result with status.
418
+ */
419
+ cancelOrder(params: CancelOrderParams): Promise<CancelOrderResult>;
420
+ /**
421
+ * Read venue-backed TWAP lifecycle records through the active provider.
422
+ * Providers without native TWAP history return an empty list.
423
+ *
424
+ * @returns Current and terminal TWAP schedules with slice fills.
425
+ */
426
+ getTwapOrders(): Promise<TwapOrder[]>;
427
+ /**
428
+ * Read the active provider's retained Chase lifecycle snapshots.
429
+ * Providers without an emulated Chase implementation return an empty list.
430
+ *
431
+ * @returns Current Chase session snapshots.
432
+ */
433
+ getChaseOrders(): Promise<ChaseOrder[]>;
434
+ /**
435
+ * Stop Chase repricing for app backgrounding without cancelling the current
436
+ * resting children.
437
+ *
438
+ * @returns Chase snapshots after suspension.
439
+ * @throws If an aggregated provider cannot suspend every active venue. Other
440
+ * providers may already be suspended; callers can retry to reconcile them.
441
+ */
442
+ suspendChaseOrders(): Promise<ChaseOrder[]>;
443
+ /**
444
+ * Cancel multiple orders in parallel
445
+ * Batch version of cancelOrder() that cancels multiple orders simultaneously
446
+ *
447
+ * @param params - The operation parameters.
448
+ * @returns The batch cancellation results for each order.
449
+ */
450
+ cancelOrders(params: CancelOrdersParams): Promise<CancelOrdersResult>;
451
+ /**
452
+ * Close a position (partial or full)
453
+ * Thin delegation to TradingService
454
+ *
455
+ * @param params - The operation parameters.
456
+ * @returns The order result from the close position request.
457
+ */
458
+ closePosition(params: ClosePositionParams): Promise<OrderResult>;
459
+ /**
460
+ * Close multiple positions in parallel
461
+ * Batch version of closePosition() that closes multiple positions simultaneously
462
+ *
463
+ * @param params - The operation parameters.
464
+ * @returns The batch close results for each position.
465
+ */
466
+ closePositions(params: ClosePositionsParams): Promise<ClosePositionsResult>;
467
+ /**
468
+ * Update TP/SL for an existing position
469
+ *
470
+ * @param params - The operation parameters.
471
+ * @returns The order result from the TP/SL update.
472
+ */
473
+ updatePositionTPSL(params: UpdatePositionTPSLParams): Promise<OrderResult>;
474
+ /**
475
+ * Update margin for an existing position (add or remove)
476
+ *
477
+ * @param params - The operation parameters.
478
+ * @returns The margin update result.
479
+ */
480
+ updateMargin(params: UpdateMarginParams): Promise<MarginResult>;
481
+ /**
482
+ * Flip position (reverse direction while keeping size and leverage)
483
+ *
484
+ * @param params - The operation parameters.
485
+ * @returns The order result from the position flip.
486
+ */
487
+ flipPosition(params: FlipPositionParams): Promise<OrderResult>;
488
+ /**
489
+ * Simplified deposit method that prepares transaction for confirmation screen
490
+ * No complex state tracking - just sets a loading flag
491
+ *
492
+ * @param params - Parameters for the deposit flow
493
+ * @param params.amount - Optional deposit amount
494
+ * @param params.placeOrder - If true, uses addTransaction instead of submit to avoid navigation
495
+ * @returns An object containing a promise that resolves to the transaction hash.
496
+ */
497
+ depositWithConfirmation(params?: DepositWithConfirmationParams): Promise<{
498
+ result: Promise<string>;
499
+ }>;
500
+ /**
501
+ * Same as depositWithConfirmation - prepares transaction for confirmation screen.
502
+ *
503
+ * @returns A promise that resolves to the string result.
504
+ */
505
+ depositWithOrder(): Promise<{
506
+ result: Promise<string>;
507
+ }>;
508
+ /**
509
+ * Clear the last deposit result after it has been shown to the user
510
+ */
511
+ clearDepositResult(): void;
512
+ clearWithdrawResult(): void;
513
+ /**
514
+ * Update withdrawal request status when it completes, or remove it on failure.
515
+ * This is called when a withdrawal is matched with a completed withdrawal from the API.
516
+ * When status is `failed`, the request is removed from the queue (not retained).
517
+ *
518
+ * @param withdrawalId - The withdrawal transaction ID.
519
+ * @param status - The current status.
520
+ * @param txHash - The transaction hash.
521
+ */
522
+ updateWithdrawalStatus(withdrawalId: string, status: 'completed' | 'failed', txHash?: string): void;
523
+ /**
524
+ * Complete a specific withdrawal detected via transaction history polling (FIFO queue).
525
+ * Called when a completed withdrawal appears in the transaction history matching a pending request.
526
+ *
527
+ * Uses FIFO matching: oldest pending withdrawal is matched with first completed withdrawal
528
+ * in history that happened after its submission time.
529
+ *
530
+ * @param withdrawalRequestId - The ID of the pending withdrawal request to mark as complete.
531
+ * @param completedWithdrawal - The completed withdrawal data from the history API.
532
+ * @param completedWithdrawal.txHash - The on-chain transaction hash.
533
+ * @param completedWithdrawal.amount - The withdrawal amount.
534
+ * @param completedWithdrawal.timestamp - The completion timestamp from the history API.
535
+ * @param completedWithdrawal.asset - The asset symbol (e.g. USDC).
536
+ */
537
+ completeWithdrawalFromHistory(withdrawalRequestId: string, completedWithdrawal: {
538
+ txHash: string;
539
+ amount: string;
540
+ timestamp: number;
541
+ asset?: string;
542
+ }): void;
543
+ /**
544
+ * Update withdrawal progress (persistent across navigation)
545
+ *
546
+ * @param progress - The progress indicator.
547
+ * @param activeWithdrawalId - The active withdrawal ID.
548
+ */
549
+ updateWithdrawalProgress(progress: number, activeWithdrawalId?: string | null): void;
550
+ /**
551
+ * Get current withdrawal progress
552
+ *
553
+ * @returns The withdrawal progress, last update timestamp, and active withdrawal ID.
554
+ */
555
+ getWithdrawalProgress(): {
556
+ progress: number;
557
+ lastUpdated: number;
558
+ activeWithdrawalId: string | null;
559
+ };
560
+ /**
561
+ * Withdraw funds from trading account
562
+ *
563
+ * The withdrawal process varies by provider and may involve:
564
+ * - Direct on-chain transfers
565
+ * - Bridge operations
566
+ * - Multi-step validation processes
567
+ *
568
+ * Check the specific provider documentation for detailed withdrawal flows.
569
+ *
570
+ * @param params Withdrawal parameters
571
+ * @returns WithdrawResult with withdrawal ID and tracking info
572
+ */
573
+ withdraw(params: WithdrawParams): Promise<WithdrawResult>;
574
+ /**
575
+ * Get current positions
576
+ * Thin delegation to MarketDataService
577
+ *
578
+ * For standalone mode, bypasses getActiveProvider() to allow position queries
579
+ * without full perps initialization (e.g., for showing positions on token details page)
580
+ *
581
+ * @param params - The operation parameters.
582
+ * @returns Array of open positions for the active provider.
583
+ */
584
+ getPositions(params?: GetPositionsParams): Promise<Position[]>;
585
+ /**
586
+ * Get historical user fills (trade executions)
587
+ * Thin delegation to MarketDataService
588
+ *
589
+ * @param params - The operation parameters.
590
+ * @param options - Optional call modifiers.
591
+ * @param options.forceRefresh - Bypass the request-coalesce cache
592
+ * end-to-end (user-initiated refresh).
593
+ * @returns Array of historical trade executions (fills).
594
+ */
595
+ getOrderFills(params?: GetOrderFillsParams, options?: {
596
+ forceRefresh?: boolean;
597
+ }): Promise<OrderFill[]>;
598
+ /**
599
+ * List TP/SL protection changes the active provider parked for
600
+ * explicit manual re-establishment. Providers without durable
601
+ * settlement state return an empty list.
602
+ *
603
+ * @returns Pending manual-recovery entries.
604
+ */
605
+ getPendingManualRecoveries(): Promise<PerpsPendingManualRecovery[]>;
606
+ /**
607
+ * READ-ONLY list of the active provider's recovered-dispatch outcomes
608
+ * (previously ambiguous submissions later resolved). Providers without
609
+ * durable dispatch state return an empty list.
610
+ *
611
+ * @returns Pending recovered-dispatch outcomes.
612
+ */
613
+ getRecoveredDispatches(): Promise<PerpsRecoveredDispatch[]>;
614
+ /**
615
+ * Acknowledge ONE recovered-dispatch outcome by its stable id, after
616
+ * refreshing venue state. Throws when the active provider has no
617
+ * durable dispatch state or the id no longer matches.
618
+ *
619
+ * @param recoveryId - Stable id from {@link getRecoveredDispatches}.
620
+ * @returns Resolves when the outcome is acknowledged.
621
+ */
622
+ acknowledgeRecoveredDispatch(recoveryId: string): Promise<void>;
623
+ /**
624
+ * Get historical user orders (order lifecycle)
625
+ * Thin delegation to MarketDataService
626
+ *
627
+ * @param params - The operation parameters.
628
+ * @param options - Optional call modifiers.
629
+ * @param options.forceRefresh - Bypass the request-coalesce cache
630
+ * end-to-end (user-initiated refresh).
631
+ * @returns Array of historical orders.
632
+ */
633
+ getOrders(params?: GetOrdersParams, options?: {
634
+ forceRefresh?: boolean;
635
+ }): Promise<Order[]>;
636
+ /**
637
+ * Get currently open orders (real-time status)
638
+ * Thin delegation to MarketDataService
639
+ *
640
+ * For standalone mode, bypasses getActiveProvider() to allow open order queries
641
+ * without full perps initialization (e.g., for background preloading)
642
+ *
643
+ * @param params - The operation parameters.
644
+ * @returns A promise that resolves to the result.
645
+ */
646
+ getOpenOrders(params?: GetOrdersParams): Promise<Order[]>;
647
+ /**
648
+ * Get historical user funding history (funding payments)
649
+ * Thin delegation to MarketDataService
650
+ *
651
+ * @param params - The operation parameters.
652
+ * @param options - Optional call modifiers.
653
+ * @param options.forceRefresh - Bypass the request-coalesce cache
654
+ * end-to-end (user-initiated refresh).
655
+ * @returns Array of historical funding payments.
656
+ */
657
+ getFunding(params?: GetFundingParams, options?: {
658
+ forceRefresh?: boolean;
659
+ }): Promise<Funding[]>;
660
+ /**
661
+ * Get account state (balances, etc.)
662
+ * Thin delegation to MarketDataService
663
+ *
664
+ * For standalone mode, bypasses getActiveProvider() to allow account state queries
665
+ * without full perps initialization (e.g., for checking if user has perps funds)
666
+ *
667
+ * @param params - The operation parameters.
668
+ * @returns A promise that resolves to the result.
669
+ */
670
+ getAccountState(params?: GetAccountStateParams): Promise<AccountState>;
671
+ /**
672
+ * Get historical portfolio data
673
+ * Thin delegation to MarketDataService
674
+ *
675
+ * @param params - The operation parameters.
676
+ * @returns The historical portfolio data points.
677
+ */
678
+ getHistoricalPortfolio(params?: GetHistoricalPortfolioParams): Promise<HistoricalPortfolioResult>;
679
+ /**
680
+ * Get available markets with optional filtering
681
+ * Thin delegation to MarketDataService
682
+ *
683
+ * For standalone mode, bypasses getActiveProvider() to allow market discovery
684
+ * without full perps initialization (e.g., for discovery banners on spot screens)
685
+ *
686
+ * @param params - The operation parameters.
687
+ * @returns Array of available markets matching the filter criteria.
688
+ */
689
+ getMarkets(params?: GetMarketsParams): Promise<MarketInfo[]>;
690
+ /**
691
+ * Get market data with prices (includes price, volume, 24h change).
692
+ * Optionally filter by category, sort, and limit the results.
693
+ *
694
+ * For standalone mode, bypasses getActiveProvider() to allow market data queries
695
+ * without full perps initialization (e.g., for background preloading on app start)
696
+ *
697
+ * @param params - The operation parameters.
698
+ * @param params.standalone - Whether to use standalone mode.
699
+ * @param params.categories - Filter to markets matching any of these categories.
700
+ * @param params.sortBy - Sort results by this field.
701
+ * @param params.direction - Sort direction (default: desc).
702
+ * @param params.limit - Maximum number of results to return.
703
+ * @returns A promise that resolves to the market data.
704
+ */
705
+ getMarketDataWithPrices(params?: GetMarketDataWithPricesParams): Promise<PerpsMarketData[]>;
706
+ /**
707
+ * Start background market data preloading.
708
+ * Fetches market data immediately and refreshes every 5 minutes.
709
+ * Watches for isTestnet and hip3ConfigVersion changes to re-preload.
710
+ */
711
+ startMarketDataPreload(): void;
712
+ /**
713
+ * Stop background market data preloading.
714
+ */
715
+ stopMarketDataPreload(): void;
716
+ /**
717
+ * Get list of available HIP-3 builder-deployed DEXs
718
+ *
719
+ * @param params - Optional parameters for filtering
720
+ * @returns Array of DEX names
721
+ */
722
+ getAvailableDexs(params?: GetAvailableDexsParams): Promise<string[]>;
723
+ /**
724
+ * Fetch historical candle data
725
+ * Thin delegation to MarketDataService
726
+ *
727
+ * @param options - The configuration options.
728
+ * @param options.symbol - The trading pair symbol.
729
+ * @param options.interval - The candle interval period.
730
+ * @param options.limit - Maximum number of items to fetch.
731
+ * @param options.endTime - End timestamp in milliseconds.
732
+ * @returns The historical candle data for the requested symbol and interval.
733
+ */
734
+ fetchHistoricalCandles(options: {
735
+ symbol: string;
736
+ interval: CandlePeriod;
737
+ limit?: number;
738
+ endTime?: number;
739
+ }): Promise<CandleData>;
740
+ /**
741
+ * Calculate liquidation price for a position
742
+ * Uses provider-specific formulas based on protocol rules
743
+ *
744
+ * @param params - The operation parameters.
745
+ * @returns A promise that resolves to the string result.
746
+ */
747
+ calculateLiquidationPrice(params: LiquidationPriceParams): Promise<string>;
748
+ /**
749
+ * Project the isolated position that would remain after a proposed order.
750
+ * Margin and liquidation availability are independent: a missing liquidation
751
+ * does not hide a valid margin projection. Cross-margin returns unsupported.
752
+ *
753
+ * @param params - Live position plus the proposed order.
754
+ * @returns Discriminated preview of the resulting position.
755
+ */
756
+ previewPositionModify(params: PositionModifyPreviewParams): Promise<PositionModifyPreviewResult>;
757
+ /**
758
+ * Calculate maintenance margin for a specific asset
759
+ * Returns a percentage (e.g., 0.0125 for 1.25%)
760
+ *
761
+ * @param params - The operation parameters.
762
+ * @returns A promise that resolves to the numeric result.
763
+ */
764
+ calculateMaintenanceMargin(params: MaintenanceMarginParams): Promise<number>;
765
+ /**
766
+ * Get maximum leverage allowed for an asset
767
+ *
768
+ * @param asset - The asset identifier.
769
+ * @param providerId - Optional provider route for aggregated markets.
770
+ * @returns A promise that resolves to the numeric result.
771
+ */
772
+ getMaxLeverage(asset: string, providerId?: PerpsProviderType): Promise<number>;
773
+ /**
774
+ * Validate order parameters according to protocol-specific rules
775
+ *
776
+ * @param params - The operation parameters.
777
+ * @returns True if the condition is met.
778
+ */
779
+ validateOrder(params: OrderParams): Promise<{
780
+ isValid: boolean;
781
+ error?: string;
782
+ }>;
783
+ /**
784
+ * Validate close position parameters according to protocol-specific rules
785
+ *
786
+ * @param params - The operation parameters.
787
+ * @returns A promise that resolves to the result.
788
+ */
789
+ validateClosePosition(params: ClosePositionParams): Promise<{
790
+ isValid: boolean;
791
+ error?: string;
792
+ }>;
793
+ /**
794
+ * Validate withdrawal parameters according to protocol-specific rules
795
+ *
796
+ * @param params - The operation parameters.
797
+ * @returns True if the condition is met.
798
+ */
799
+ validateWithdrawal(params: WithdrawParams): Promise<{
800
+ isValid: boolean;
801
+ error?: string;
802
+ }>;
803
+ /**
804
+ * Get supported withdrawal routes - returns complete asset and routing information
805
+ *
806
+ * @returns Array of supported asset routes for withdrawals.
807
+ */
808
+ getWithdrawalRoutes(): AssetRoute[];
809
+ /**
810
+ * Set the transient UTM / discovery attribution context.
811
+ * Replaces any previously set context. Held in-memory only — not persisted.
812
+ *
813
+ * @param context - The attribution context (UTM fields) to store.
814
+ */
815
+ setAttributionContext(context: PerpsAttributionContext): void;
816
+ /**
817
+ * Get a copy of the current attribution context.
818
+ *
819
+ * @returns A shallow copy of the stored attribution context.
820
+ */
821
+ getAttributionContext(): PerpsAttributionContext;
822
+ /**
823
+ * Clear the stored attribution context.
824
+ */
825
+ clearAttributionContext(): void;
826
+ /**
827
+ * Merge the stored UTM attribution context into a set of analytics event
828
+ * properties. Only defined UTM fields are added, mapped
829
+ * to their canonical PERPS_EVENT_PROPERTY keys. Provided properties take
830
+ * precedence and are never overwritten.
831
+ *
832
+ * @param properties - Base event properties to merge attribution into.
833
+ * @returns A new properties object including any defined UTM keys.
834
+ */
835
+ mergeAttributionContext(properties?: PerpsAnalyticsProperties): PerpsAnalyticsProperties;
836
+ /**
837
+ * Toggle between testnet and mainnet
838
+ *
839
+ * @returns The toggle result with success status and current network mode.
840
+ */
841
+ toggleTestnet(): Promise<ToggleTestnetResult>;
842
+ /**
843
+ * Switch to a different provider
844
+ * Uses a full reinit approach: disconnect() → update state → init()
845
+ * This ensures complete state reset including WebSocket connections and caches.
846
+ *
847
+ * @param providerId - The provider identifier.
848
+ * @returns The switch result with success status and active provider.
849
+ */
850
+ switchProvider(providerId: PerpsActiveProviderMode): Promise<SwitchProviderResult>;
851
+ /**
852
+ * Get current network (mainnet/testnet)
853
+ *
854
+ * @returns Either 'mainnet' or 'testnet' based on the current configuration.
855
+ */
856
+ getCurrentNetwork(): 'mainnet' | 'testnet';
857
+ /**
858
+ * Get the ordered list of all market categories for HIP-3 markets.
859
+ * Returns a stable, explicitly ordered array so the UI can render
860
+ * category filter tabs without deriving order from config insertion.
861
+ *
862
+ * @returns Ordered array of {@link MarketTypeFilter} values. Does not include the 'all' or 'new' sentinels — those are separate UI controls.
863
+ */
864
+ getMarketCategories(): MarketTypeFilter[];
865
+ /**
866
+ * Get the current WebSocket connection state from the active provider.
867
+ * Used by the UI to monitor connection health and show notifications.
868
+ *
869
+ * @returns The current WebSocket connection state, or DISCONNECTED if not supported
870
+ */
871
+ getWebSocketConnectionState(): WebSocketConnectionState;
872
+ /**
873
+ * Subscribe to WebSocket connection state changes from the active provider.
874
+ * The listener will be called immediately with the current state and whenever the state changes.
875
+ *
876
+ * @param listener - Callback function that receives the new connection state and reconnection attempt
877
+ * @returns Unsubscribe function to remove the listener, or no-op if not supported
878
+ */
879
+ subscribeToConnectionState(listener: (state: WebSocketConnectionState, reconnectionAttempt: number) => void): () => void;
880
+ /**
881
+ * Manually trigger a WebSocket reconnection attempt.
882
+ * Used by the UI retry button when connection is lost.
883
+ */
884
+ reconnect(): Promise<void>;
885
+ /**
886
+ * Subscribe to live price updates
887
+ *
888
+ * @param params - The operation parameters.
889
+ * @returns A cleanup function to remove the subscription.
890
+ */
891
+ subscribeToPrices(params: SubscribePricesParams): () => void;
892
+ /**
893
+ * Subscribe to live position updates
894
+ *
895
+ * @param params - The operation parameters.
896
+ * @returns A cleanup function to remove the subscription.
897
+ */
898
+ subscribeToPositions(params: SubscribePositionsParams): () => void;
899
+ /**
900
+ * Subscribe to live order fill updates
901
+ *
902
+ * @param params - The operation parameters.
903
+ * @returns A cleanup function to remove the subscription.
904
+ */
905
+ subscribeToOrderFills(params: SubscribeOrderFillsParams): () => void;
906
+ /**
907
+ * Stream TWAP lifecycle updates through the active provider.
908
+ *
909
+ * Providers without a native TWAP push channel do not implement this; the
910
+ * returned no-op cleanup lets a client fall back to polling `getTwapOrders`
911
+ * without branching on provider identity.
912
+ *
913
+ * @param params - Subscription parameters including callback and account ID.
914
+ * @returns A cleanup function to remove the subscription.
915
+ */
916
+ subscribeToTwapOrders(params: SubscribeTwapOrdersParams): () => void;
917
+ /**
918
+ * Subscribe to live order updates
919
+ *
920
+ * @param params - The operation parameters.
921
+ * @returns A cleanup function to remove the subscription.
922
+ */
923
+ subscribeToOrders(params: SubscribeOrdersParams): () => void;
924
+ /**
925
+ * Subscribe to live account updates.
926
+ * Updates controller state (Redux) when new account data arrives so consumers
927
+ * like usePerpsBalanceTokenFilter (PayWithModal) see the latest balance.
928
+ *
929
+ * @param params - The operation parameters.
930
+ * @returns A cleanup function to remove the subscription.
931
+ */
932
+ subscribeToAccount(params: SubscribeAccountParams): () => void;
933
+ /**
934
+ * Subscribe to full order book updates with multiple depth levels
935
+ * Creates a dedicated L2Book subscription for real-time order book data
936
+ *
937
+ * @param params - The operation parameters.
938
+ * @returns A cleanup function to remove the subscription.
939
+ */
940
+ subscribeToOrderBook(params: SubscribeOrderBookParams): () => void;
941
+ /**
942
+ * Subscribe to live candle updates
943
+ *
944
+ * @param params - The operation parameters.
945
+ * @returns A cleanup function to remove the subscription.
946
+ */
947
+ subscribeToCandles(params: SubscribeCandlesParams): () => void;
948
+ /**
949
+ * Subscribe to open interest cap updates
950
+ * Zero additional network overhead - data comes from existing webData3 subscription
951
+ *
952
+ * @param params - The operation parameters.
953
+ * @returns A cleanup function to remove the subscription.
954
+ */
955
+ subscribeToOICaps(params: SubscribeOICapsParams): () => void;
956
+ /**
957
+ * Configure live data throttling
958
+ *
959
+ * @param config - The configuration object.
960
+ */
961
+ setLiveDataConfig(config: Partial<LiveDataConfig>): void;
962
+ /**
963
+ * Calculate trading fees through the active provider route.
964
+ * Each provider owns its fee policy. An explicit provider route overrides
965
+ * the active/default provider used by placement.
966
+ *
967
+ * @param params - The operation parameters.
968
+ * @returns The fee calculation result for the trade.
969
+ */
970
+ calculateFees(params: FeeCalculationParams): Promise<FeeCalculationResult>;
971
+ /**
972
+ * Approve the dedicated subscription builder outside order submission.
973
+ * Until this succeeds, subscription waivers fall back to the ordinary
974
+ * builder at the standard fee.
975
+ *
976
+ * @returns Whether the subscription builder is approved.
977
+ */
978
+ approveSubscriptionBuilderFee(): Promise<boolean>;
979
+ /**
980
+ * Drop the cached subscription benefits snapshot.
981
+ *
982
+ * Call this when the identity behind the benefits changes — sign-out, or a
983
+ * profile switch. The snapshot carries no profile identity of its own, so
984
+ * without this it keeps answering for the previous profile until the next
985
+ * successful refresh. The next fee resolution reports the waiver as
986
+ * unavailable, so it is withheld until preview or lifecycle hydration.
987
+ */
988
+ invalidateSubscriptionBenefits(): void;
989
+ /**
990
+ * Disconnect provider and cleanup subscriptions
991
+ * Call this when navigating away from Perps screens to prevent battery drain
992
+ */
993
+ disconnect(): Promise<void>;
994
+ /**
995
+ * Eligibility (Geo-Blocking)
996
+ */
997
+ /**
998
+ * Fetch geo location
999
+ *
1000
+ * Returned in Country or Country-Region format
1001
+ * Example: FR, DE, US-MI, CA-ON
1002
+ */
1003
+ /**
1004
+ * Refresh eligibility status
1005
+ */
1006
+ /**
1007
+ * Resume eligibility monitoring after onboarding completes.
1008
+ * Clears the deferred flag and triggers an immediate eligibility check
1009
+ * using the current remote feature flag state.
1010
+ */
1011
+ startEligibilityMonitoring(): void;
1012
+ /**
1013
+ * Stops geo-blocking eligibility monitoring.
1014
+ * Call this when the user disables basic functionality (e.g. useExternalServices becomes false).
1015
+ * Prevents geolocation calls until startEligibilityMonitoring() is called again.
1016
+ * Safe to call multiple times.
1017
+ */
1018
+ stopEligibilityMonitoring(): void;
1019
+ refreshEligibility(): Promise<void>;
1020
+ /**
1021
+ * Get block explorer URL for an address or just the base URL
1022
+ *
1023
+ * @param address - Optional address to append to the base URL
1024
+ * @returns Block explorer URL
1025
+ */
1026
+ getBlockExplorerUrl(address?: string): string;
1027
+ /**
1028
+ * Check if user is first-time for the current network
1029
+ *
1030
+ * @returns True if the condition is met.
1031
+ */
1032
+ isFirstTimeUserOnCurrentNetwork(): boolean;
1033
+ /**
1034
+ * Mark that the user has completed the tutorial/onboarding
1035
+ * This prevents the tutorial from showing again
1036
+ */
1037
+ markTutorialCompleted(): void;
1038
+ markFirstOrderCompleted(): void;
1039
+ /**
1040
+ * Reset first-time user state for both networks
1041
+ * This is useful for testing the tutorial flow
1042
+ * Called by Reset Account feature in settings
1043
+ */
1044
+ resetFirstTimeUserState(): void;
1045
+ /**
1046
+ * Clear pending/bridging withdrawal and deposit requests
1047
+ * This is useful when users want to clear stuck pending indicators
1048
+ * Called by Reset Account feature in settings
1049
+ */
1050
+ clearPendingTransactionRequests(): void;
1051
+ /**
1052
+ * Get saved trade configuration for a market
1053
+ *
1054
+ * @param symbol - The trading pair symbol.
1055
+ * @returns The resulting string value.
1056
+ */
1057
+ getTradeConfiguration(symbol: string): {
1058
+ leverage?: number;
1059
+ } | undefined;
1060
+ /**
1061
+ * Save trade configuration for a market
1062
+ *
1063
+ * @param symbol - Market symbol
1064
+ * @param leverage - Leverage value
1065
+ */
1066
+ saveTradeConfiguration(symbol: string, leverage: number): void;
1067
+ /**
1068
+ * Save pending trade configuration for a market
1069
+ * This is a temporary configuration that expires after 30 seconds.
1070
+ *
1071
+ * @param symbol - Market symbol
1072
+ * @param config - Pending trade configuration (includes optional selected payment token from Pay row)
1073
+ * @param config.amount - The amount value.
1074
+ * @param config.leverage - The leverage multiplier.
1075
+ * @param config.takeProfitPrice - The take profit price.
1076
+ * @param config.stopLossPrice - The stop loss price.
1077
+ * @param config.limitPrice - The limit price.
1078
+ * @param config.orderType - The order type.
1079
+ * @param config.reduceOnly - Whether the order may only reduce a position.
1080
+ * @param config.direction - Long or short.
1081
+ * @param config.selectedPaymentToken - The selected payment token.
1082
+ */
1083
+ savePendingTradeConfiguration(symbol: string, config: {
1084
+ amount?: string;
1085
+ leverage?: number;
1086
+ takeProfitPrice?: string;
1087
+ stopLossPrice?: string;
1088
+ limitPrice?: string;
1089
+ orderType?: OrderType;
1090
+ reduceOnly?: boolean;
1091
+ direction?: OrderDirection;
1092
+ /** When user used pay-with-token in PerpsPayRow: minimal token shape to restore selection */
1093
+ selectedPaymentToken?: PerpsSelectedPaymentToken | null;
1094
+ }): void;
1095
+ /**
1096
+ * Get pending trade configuration for a market
1097
+ * Returns undefined if config doesn't exist or has expired.
1098
+ *
1099
+ * @param symbol - Market symbol
1100
+ * @returns Pending trade configuration or undefined
1101
+ */
1102
+ getPendingTradeConfiguration(symbol: string): {
1103
+ amount?: string;
1104
+ leverage?: number;
1105
+ takeProfitPrice?: string;
1106
+ stopLossPrice?: string;
1107
+ limitPrice?: string;
1108
+ orderType?: OrderType;
1109
+ reduceOnly?: boolean;
1110
+ direction?: OrderDirection;
1111
+ selectedPaymentToken?: PerpsSelectedPaymentToken | null;
1112
+ } | undefined;
1113
+ /**
1114
+ * Clear pending trade configuration for a market
1115
+ *
1116
+ * @param symbol - Market symbol
1117
+ */
1118
+ clearPendingTradeConfiguration(symbol: string): void;
1119
+ /**
1120
+ * Get saved market filter preferences
1121
+ * Handles backward compatibility with legacy string format
1122
+ *
1123
+ * @returns The saved sort option ID and direction.
1124
+ */
1125
+ getMarketFilterPreferences(): {
1126
+ optionId: SortOptionId;
1127
+ direction: SortDirection;
1128
+ };
1129
+ /**
1130
+ * Save market filter preferences
1131
+ *
1132
+ * @param optionId - Sort/filter option ID
1133
+ * @param direction - Sort direction ('asc' or 'desc')
1134
+ */
1135
+ saveMarketFilterPreferences(optionId: SortOptionId, direction: SortDirection): void;
1136
+ /**
1137
+ * Get the user's max slippage tolerance in basis points.
1138
+ *
1139
+ * @returns The configured max slippage bps, or undefined if never set (callers should default to 300 bps / 3%).
1140
+ */
1141
+ getMaxSlippage(): number | undefined;
1142
+ /**
1143
+ * Set the user's max slippage tolerance in basis points.
1144
+ *
1145
+ * @param bps - Max slippage in basis points (e.g. 300 = 3%). Clamped to 10–1000, snapped to step of 10.
1146
+ */
1147
+ setMaxSlippage(bps: number): void;
1148
+ /**
1149
+ * Get market-agnostic Pro order-book display preferences.
1150
+ *
1151
+ * @returns The current order-book display preferences.
1152
+ */
1153
+ getOrderBookPreferences(): OrderBookPreferences;
1154
+ /**
1155
+ * Update market-agnostic Pro order-book display preferences.
1156
+ *
1157
+ * @param patch - Partial order-book preferences to update.
1158
+ */
1159
+ setOrderBookPreferences(patch: Partial<OrderBookPreferences>): void;
1160
+ /**
1161
+ * Get the selected order type shared by every market.
1162
+ *
1163
+ * @returns The selected order type.
1164
+ */
1165
+ getSelectedOrderType(): OrderType;
1166
+ /**
1167
+ * Set the selected order type shared by every market.
1168
+ *
1169
+ * @param orderType - The selected order type.
1170
+ */
1171
+ setSelectedOrderType(orderType: OrderType): void;
1172
+ /**
1173
+ * Get the number of candles shown in Lite and Pro chart viewports.
1174
+ *
1175
+ * @returns The visible candle count.
1176
+ */
1177
+ getVisibleCandleCount(): number;
1178
+ /**
1179
+ * Set the number of candles shown in Lite and Pro chart viewports.
1180
+ *
1181
+ * @param count - Requested visible candle count.
1182
+ */
1183
+ setVisibleCandleCount(count: number): void;
1184
+ /**
1185
+ * Get the user's pro-mode layout preferences (network-independent).
1186
+ *
1187
+ * @returns The current pro-mode layout preferences.
1188
+ */
1189
+ getProLayoutPreferences(): ProLayoutPreferences;
1190
+ /**
1191
+ * Update the user's pro-mode layout preferences.
1192
+ *
1193
+ * Patch-style setter: only the provided fields are updated, the rest are
1194
+ * preserved. This keeps the signature stable as new layout fields are added.
1195
+ *
1196
+ * @param patch - Partial set of pro-mode layout preferences to update.
1197
+ */
1198
+ setProLayoutPreferences(patch: Partial<ProLayoutPreferences>): void;
1199
+ /**
1200
+ * Set the Perps interface mode (lite/pro).
1201
+ *
1202
+ * @param mode - The mode to switch to.
1203
+ */
1204
+ setPerpsMode(mode: PerpsMode): void;
1205
+ /**
1206
+ * Set the selected payment token for the Perps order/deposit flow.
1207
+ * Pass null or a token with description PERPS_CONSTANTS.PerpsBalanceTokenDescription to select Perps balance.
1208
+ * Only required fields (address, chainId) are stored in state; description and symbol are optional.
1209
+ *
1210
+ * @param token - The token identifier.
1211
+ */
1212
+ setSelectedPaymentToken(token: PerpsSelectedPaymentToken | null): void;
1213
+ /**
1214
+ * Reset the selected payment token to Perps balance (null).
1215
+ * Call when leaving the Perps order view so the next visit defaults to Perps balance.
1216
+ */
1217
+ resetSelectedPaymentToken(): void;
1218
+ /**
1219
+ * Get saved order book grouping for a market
1220
+ *
1221
+ * @param symbol - Market symbol
1222
+ * @returns The saved grouping value or undefined if not set
1223
+ */
1224
+ getOrderBookGrouping(symbol: string): number | undefined;
1225
+ /**
1226
+ * Save order book grouping for a market
1227
+ *
1228
+ * @param symbol - Market symbol
1229
+ * @param grouping - Price grouping value
1230
+ */
1231
+ saveOrderBookGrouping(symbol: string, grouping: number): void;
1232
+ /**
1233
+ * Toggle watchlist status for a market.
1234
+ *
1235
+ * Updates local state immediately (optimistic UI) and then syncs the new
1236
+ * watchlist to AuthenticatedUserStorageService. If the remote write fails,
1237
+ * the local state is reverted so it stays consistent with AUS.
1238
+ *
1239
+ * When the user is unauthenticated, or the active provider is not yet
1240
+ * supported by the AUS schema, the controller continues operating with
1241
+ * local-persisted state only — no error is surfaced to the caller.
1242
+ *
1243
+ * Watchlist markets are stored per network (testnet/mainnet).
1244
+ *
1245
+ * @param symbol - The trading pair symbol.
1246
+ */
1247
+ toggleWatchlistMarket(symbol: string): Promise<void>;
1248
+ /**
1249
+ * Check if a market is in the watchlist on the current network
1250
+ *
1251
+ * @param symbol - The trading pair symbol.
1252
+ * @returns True if the condition is met.
1253
+ */
1254
+ isWatchlistMarket(symbol: string): boolean;
1255
+ /**
1256
+ * Get all watchlist markets for the current network
1257
+ *
1258
+ * @returns The resulting string value.
1259
+ */
1260
+ getWatchlistMarkets(): string[];
1261
+ /**
1262
+ * Record that the user viewed a market.
1263
+ *
1264
+ * The symbol is prepended to the per-network recently-viewed list (newest-first).
1265
+ * Any existing entry for the same symbol is removed first so there are no
1266
+ * duplicates. The list is then capped at PERPS_CONSTANTS.RecentlyViewedMarketsLimit.
1267
+ *
1268
+ * @param symbol - The trading pair symbol (e.g. 'BTC', 'ETH', 'xyz:TSLA').
1269
+ */
1270
+ recordMarketViewed(symbol: string): void;
1271
+ /**
1272
+ * Get recently viewed markets for the current network.
1273
+ *
1274
+ * Returns up to PERPS_CONSTANTS.RecentlyViewedMarketsLimit symbols, ordered
1275
+ * newest-first, filtered to entries within the last
1276
+ * PERPS_CONSTANTS.RecentlyViewedMarketsTtlMs (24 hours). Returns an empty
1277
+ * array when no qualifying entries exist.
1278
+ *
1279
+ * @returns Ordered array of market symbols.
1280
+ */
1281
+ getRecentlyViewedMarkets(): string[];
1282
+ /**
1283
+ * Report order events to data lake API with retry (non-blocking)
1284
+ * Thin delegation to DataLakeService
1285
+ *
1286
+ * @param params - The operation parameters.
1287
+ * @param params.action - The order action.
1288
+ * @param params.symbol - The trading pair symbol.
1289
+ * @param params.slPrice - The stop loss price.
1290
+ * @param params.tpPrice - The take profit price.
1291
+ * @param params.retryCount - Internal retry counter.
1292
+ * @param params._traceId - Internal trace ID.
1293
+ * @returns Whether the report was sent successfully, with an optional error message.
1294
+ */
1295
+ protected reportOrderToDataLake(params: {
1296
+ action: 'open' | 'close';
1297
+ symbol: string;
1298
+ slPrice?: number;
1299
+ tpPrice?: number;
1300
+ retryCount?: number;
1301
+ _traceId?: string;
1302
+ }): Promise<{
1303
+ success: boolean;
1304
+ error?: string;
1305
+ }>;
1306
+ /**
1307
+ * Check if the controller is currently reinitializing
1308
+ *
1309
+ * @returns true if providers are being reinitialized
1310
+ */
1311
+ isCurrentlyReinitializing(): boolean;
1312
+ }
1313
+ //# sourceMappingURL=PerpsController.d.ts.map