@metamask-previews/perps-controller 1.3.0-preview-3ce0062c4 → 1.3.0-preview-dbd93752f

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 (158) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/dist/PerpsController-method-action-types.cjs +3 -0
  3. package/dist/PerpsController-method-action-types.cjs.map +1 -0
  4. package/dist/PerpsController-method-action-types.d.cts +147 -0
  5. package/dist/PerpsController-method-action-types.d.cts.map +1 -0
  6. package/dist/PerpsController-method-action-types.d.mts +147 -0
  7. package/dist/PerpsController-method-action-types.d.mts.map +1 -0
  8. package/dist/PerpsController-method-action-types.mjs +2 -0
  9. package/dist/PerpsController-method-action-types.mjs.map +1 -0
  10. package/dist/PerpsController.cjs +488 -183
  11. package/dist/PerpsController.cjs.map +1 -1
  12. package/dist/PerpsController.d.cts +91 -131
  13. package/dist/PerpsController.d.cts.map +1 -1
  14. package/dist/PerpsController.d.mts +91 -131
  15. package/dist/PerpsController.d.mts.map +1 -1
  16. package/dist/PerpsController.mjs +485 -182
  17. package/dist/PerpsController.mjs.map +1 -1
  18. package/dist/constants/eventNames.cjs +26 -0
  19. package/dist/constants/eventNames.cjs.map +1 -1
  20. package/dist/constants/eventNames.d.cts +19 -0
  21. package/dist/constants/eventNames.d.cts.map +1 -1
  22. package/dist/constants/eventNames.d.mts +19 -0
  23. package/dist/constants/eventNames.d.mts.map +1 -1
  24. package/dist/constants/eventNames.mjs +26 -0
  25. package/dist/constants/eventNames.mjs.map +1 -1
  26. package/dist/constants/hyperLiquidConfig.cjs +24 -4
  27. package/dist/constants/hyperLiquidConfig.cjs.map +1 -1
  28. package/dist/constants/hyperLiquidConfig.d.cts +8 -3
  29. package/dist/constants/hyperLiquidConfig.d.cts.map +1 -1
  30. package/dist/constants/hyperLiquidConfig.d.mts +8 -3
  31. package/dist/constants/hyperLiquidConfig.d.mts.map +1 -1
  32. package/dist/constants/hyperLiquidConfig.mjs +23 -3
  33. package/dist/constants/hyperLiquidConfig.mjs.map +1 -1
  34. package/dist/constants/myxConfig.cjs +75 -51
  35. package/dist/constants/myxConfig.cjs.map +1 -1
  36. package/dist/constants/myxConfig.d.cts +58 -19
  37. package/dist/constants/myxConfig.d.cts.map +1 -1
  38. package/dist/constants/myxConfig.d.mts +58 -19
  39. package/dist/constants/myxConfig.d.mts.map +1 -1
  40. package/dist/constants/myxConfig.mjs +74 -50
  41. package/dist/constants/myxConfig.mjs.map +1 -1
  42. package/dist/constants/perpsConfig.cjs +6 -2
  43. package/dist/constants/perpsConfig.cjs.map +1 -1
  44. package/dist/constants/perpsConfig.d.cts +5 -1
  45. package/dist/constants/perpsConfig.d.cts.map +1 -1
  46. package/dist/constants/perpsConfig.d.mts +5 -1
  47. package/dist/constants/perpsConfig.d.mts.map +1 -1
  48. package/dist/constants/perpsConfig.mjs +5 -1
  49. package/dist/constants/perpsConfig.mjs.map +1 -1
  50. package/dist/index.cjs +243 -25
  51. package/dist/index.cjs.map +1 -1
  52. package/dist/index.d.cts +48 -5
  53. package/dist/index.d.cts.map +1 -1
  54. package/dist/index.d.mts +48 -5
  55. package/dist/index.d.mts.map +1 -1
  56. package/dist/index.mjs +36 -10
  57. package/dist/index.mjs.map +1 -1
  58. package/dist/providers/AggregatedPerpsProvider.cjs +24 -0
  59. package/dist/providers/AggregatedPerpsProvider.cjs.map +1 -1
  60. package/dist/providers/AggregatedPerpsProvider.d.cts +4 -0
  61. package/dist/providers/AggregatedPerpsProvider.d.cts.map +1 -1
  62. package/dist/providers/AggregatedPerpsProvider.d.mts +4 -0
  63. package/dist/providers/AggregatedPerpsProvider.d.mts.map +1 -1
  64. package/dist/providers/AggregatedPerpsProvider.mjs +24 -0
  65. package/dist/providers/AggregatedPerpsProvider.mjs.map +1 -1
  66. package/dist/providers/HyperLiquidProvider.cjs +470 -154
  67. package/dist/providers/HyperLiquidProvider.cjs.map +1 -1
  68. package/dist/providers/HyperLiquidProvider.d.cts +11 -2
  69. package/dist/providers/HyperLiquidProvider.d.cts.map +1 -1
  70. package/dist/providers/HyperLiquidProvider.d.mts +11 -2
  71. package/dist/providers/HyperLiquidProvider.d.mts.map +1 -1
  72. package/dist/providers/HyperLiquidProvider.mjs +471 -155
  73. package/dist/providers/HyperLiquidProvider.mjs.map +1 -1
  74. package/dist/selectors.cjs +1 -1
  75. package/dist/selectors.cjs.map +1 -1
  76. package/dist/selectors.mjs +1 -1
  77. package/dist/selectors.mjs.map +1 -1
  78. package/dist/services/AccountService.cjs +1 -1
  79. package/dist/services/AccountService.cjs.map +1 -1
  80. package/dist/services/AccountService.d.cts.map +1 -1
  81. package/dist/services/AccountService.d.mts.map +1 -1
  82. package/dist/services/AccountService.mjs +2 -2
  83. package/dist/services/AccountService.mjs.map +1 -1
  84. package/dist/services/DepositService.cjs +2 -1
  85. package/dist/services/DepositService.cjs.map +1 -1
  86. package/dist/services/DepositService.d.cts.map +1 -1
  87. package/dist/services/DepositService.d.mts.map +1 -1
  88. package/dist/services/DepositService.mjs +2 -1
  89. package/dist/services/DepositService.mjs.map +1 -1
  90. package/dist/services/EligibilityService.cjs +8 -103
  91. package/dist/services/EligibilityService.cjs.map +1 -1
  92. package/dist/services/EligibilityService.d.cts +4 -15
  93. package/dist/services/EligibilityService.d.cts.map +1 -1
  94. package/dist/services/EligibilityService.d.mts +4 -15
  95. package/dist/services/EligibilityService.d.mts.map +1 -1
  96. package/dist/services/EligibilityService.mjs +8 -103
  97. package/dist/services/EligibilityService.mjs.map +1 -1
  98. package/dist/services/HyperLiquidSubscriptionService.cjs +252 -46
  99. package/dist/services/HyperLiquidSubscriptionService.cjs.map +1 -1
  100. package/dist/services/HyperLiquidSubscriptionService.d.cts +1 -0
  101. package/dist/services/HyperLiquidSubscriptionService.d.cts.map +1 -1
  102. package/dist/services/HyperLiquidSubscriptionService.d.mts +1 -0
  103. package/dist/services/HyperLiquidSubscriptionService.d.mts.map +1 -1
  104. package/dist/services/HyperLiquidSubscriptionService.mjs +252 -46
  105. package/dist/services/HyperLiquidSubscriptionService.mjs.map +1 -1
  106. package/dist/services/MarketDataService.cjs +2 -4
  107. package/dist/services/MarketDataService.cjs.map +1 -1
  108. package/dist/services/MarketDataService.d.cts.map +1 -1
  109. package/dist/services/MarketDataService.d.mts.map +1 -1
  110. package/dist/services/MarketDataService.mjs +2 -4
  111. package/dist/services/MarketDataService.mjs.map +1 -1
  112. package/dist/services/TradingService.cjs +72 -6
  113. package/dist/services/TradingService.cjs.map +1 -1
  114. package/dist/services/TradingService.d.cts.map +1 -1
  115. package/dist/services/TradingService.d.mts.map +1 -1
  116. package/dist/services/TradingService.mjs +72 -6
  117. package/dist/services/TradingService.mjs.map +1 -1
  118. package/dist/types/index.cjs.map +1 -1
  119. package/dist/types/index.d.cts +51 -3
  120. package/dist/types/index.d.cts.map +1 -1
  121. package/dist/types/index.d.mts +51 -3
  122. package/dist/types/index.d.mts.map +1 -1
  123. package/dist/types/index.mjs.map +1 -1
  124. package/dist/types/messenger.cjs.map +1 -1
  125. package/dist/types/messenger.d.cts +2 -1
  126. package/dist/types/messenger.d.cts.map +1 -1
  127. package/dist/types/messenger.d.mts +2 -1
  128. package/dist/types/messenger.d.mts.map +1 -1
  129. package/dist/types/messenger.mjs.map +1 -1
  130. package/dist/types/myx-types.cjs +19 -3
  131. package/dist/types/myx-types.cjs.map +1 -1
  132. package/dist/types/myx-types.d.cts +33 -2
  133. package/dist/types/myx-types.d.cts.map +1 -1
  134. package/dist/types/myx-types.d.mts +33 -2
  135. package/dist/types/myx-types.d.mts.map +1 -1
  136. package/dist/types/myx-types.mjs +6 -2
  137. package/dist/types/myx-types.mjs.map +1 -1
  138. package/dist/types/perps-types.cjs +3 -0
  139. package/dist/types/perps-types.cjs.map +1 -1
  140. package/dist/types/perps-types.d.cts +3 -3
  141. package/dist/types/perps-types.d.cts.map +1 -1
  142. package/dist/types/perps-types.d.mts +3 -3
  143. package/dist/types/perps-types.d.mts.map +1 -1
  144. package/dist/types/perps-types.mjs +3 -0
  145. package/dist/types/perps-types.mjs.map +1 -1
  146. package/dist/utils/accountUtils.cjs.map +1 -1
  147. package/dist/utils/accountUtils.d.cts.map +1 -1
  148. package/dist/utils/accountUtils.d.mts.map +1 -1
  149. package/dist/utils/accountUtils.mjs.map +1 -1
  150. package/dist/utils/myxAdapter.cjs +360 -15
  151. package/dist/utils/myxAdapter.cjs.map +1 -1
  152. package/dist/utils/myxAdapter.d.cts +94 -7
  153. package/dist/utils/myxAdapter.d.cts.map +1 -1
  154. package/dist/utils/myxAdapter.d.mts +94 -7
  155. package/dist/utils/myxAdapter.d.mts.map +1 -1
  156. package/dist/utils/myxAdapter.mjs +351 -16
  157. package/dist/utils/myxAdapter.mjs.map +1 -1
  158. package/package.json +5 -3
@@ -3,12 +3,34 @@ import type { Messenger } from "@metamask/messenger";
3
3
  import type { Json } from "@metamask/utils";
4
4
  import { CandlePeriod } from "./constants/chartConfig.cjs";
5
5
  import type { SortOptionId } from "./constants/perpsConfig.cjs";
6
+ import type { PerpsControllerMethodActions } from "./PerpsController-method-action-types.cjs";
6
7
  import { WebSocketConnectionState } from "./types/index.cjs";
7
- import type { AccountState, AssetRoute, CancelOrderParams, CancelOrderResult, CancelOrdersParams, CancelOrdersResult, ClosePositionParams, ClosePositionsParams, ClosePositionsResult, DepositWithConfirmationParams, EditOrderParams, FeeCalculationParams, FeeCalculationResult, FlipPositionParams, Funding, GetAccountStateParams, GetAvailableDexsParams, GetFundingParams, GetMarketsParams, GetOrderFillsParams, GetOrdersParams, GetPositionsParams, PerpsProvider, LiquidationPriceParams, LiveDataConfig, MaintenanceMarginParams, MarginResult, MarketInfo, Order, OrderFill, OrderParams, OrderResult, PerpsControllerConfig, PerpsMarketData, Position, SubscribeAccountParams, SubscribeCandlesParams, SubscribeOICapsParams, SubscribeOrderBookParams, SubscribeOrderFillsParams, SubscribeOrdersParams, SubscribePositionsParams, SubscribePricesParams, SwitchProviderResult, ToggleTestnetResult, UpdateMarginParams, UpdatePositionTPSLParams, WithdrawParams, WithdrawResult, GetHistoricalPortfolioParams, HistoricalPortfolioResult, OrderType, PerpsPlatformDependencies, PerpsActiveProviderMode, PerpsProviderType, PerpsSelectedPaymentToken, PerpsRemoteFeatureFlagState } from "./types/index.cjs";
8
+ import type { AccountState, AssetRoute, CancelOrderParams, CancelOrderResult, CancelOrdersParams, CancelOrdersResult, ClosePositionParams, ClosePositionsParams, ClosePositionsResult, DepositWithConfirmationParams, EditOrderParams, FeeCalculationParams, FeeCalculationResult, FlipPositionParams, Funding, GetAccountStateParams, GetAvailableDexsParams, GetFundingParams, GetMarketsParams, GetOrderFillsParams, GetOrdersParams, GetPositionsParams, PerpsProvider, LiquidationPriceParams, LiveDataConfig, MaintenanceMarginParams, MarginResult, MarketInfo, Order, OrderFill, OrderParams, OrderResult, PerpsControllerConfig, PerpsMarketData, Position, SubscribeAccountParams, SubscribeCandlesParams, SubscribeOICapsParams, SubscribeOrderBookParams, SubscribeOrderFillsParams, SubscribeOrdersParams, SubscribePositionsParams, SubscribePricesParams, SwitchProviderResult, ToggleTestnetResult, UpdateMarginParams, UpdatePositionTPSLParams, WithdrawParams, WithdrawResult, GetHistoricalPortfolioParams, HistoricalPortfolioResult, OrderType, PerpsPlatformDependencies, PerpsActiveProviderMode, PerpsProviderType, PerpsSelectedPaymentToken, PerpsRemoteFeatureFlagState, MYXCredentials } from "./types/index.cjs";
8
9
  import type { PerpsControllerAllowedActions, PerpsControllerAllowedEvents } from "./types/messenger.cjs";
9
10
  import type { CandleData } from "./types/perps-types.cjs";
10
11
  import { LastTransactionResult, TransactionStatus } from "./types/transactionTypes.cjs";
11
12
  import type { SortDirection } from "./utils/sortMarkets.cjs";
13
+ /**
14
+ * Returns the first non-empty string from the given values.
15
+ * Env vars default to '' (not null/undefined), so ?? wouldn't fall through.
16
+ *
17
+ * @param vals - String values to check in order.
18
+ * @returns The first non-empty string, or '' if all are empty/undefined.
19
+ */
20
+ export declare function firstNonEmpty(...vals: (string | undefined)[]): string;
21
+ /**
22
+ * Resolves MYX auth config from provider credentials, handling
23
+ * testnet/mainnet fallback logic.
24
+ *
25
+ * @param myx - MYX provider credentials.
26
+ * @param isTestnet - Whether the controller is in testnet mode.
27
+ * @returns Resolved appId, apiSecret, and brokerAddress.
28
+ */
29
+ export declare function resolveMyxAuthConfig(myx: MYXCredentials, isTestnet: boolean): {
30
+ appId: string;
31
+ apiSecret: string;
32
+ brokerAddress: string;
33
+ };
12
34
  /**
13
35
  * Minimal payment token stored in PerpsController state.
14
36
  * Only required fields for identification, Perps balance detection, and analytics.
@@ -140,13 +162,17 @@ export type PerpsControllerState = {
140
162
  lastUpdateTimestamp: number;
141
163
  hip3ConfigVersion: number;
142
164
  selectedPaymentToken: Json | null;
143
- cachedMarketData: PerpsMarketData[] | null;
144
- cachedMarketDataTimestamp: number;
145
- cachedPositions: Position[] | null;
146
- cachedOrders: Order[] | null;
147
- cachedAccountState: AccountState | null;
148
- cachedUserDataTimestamp: number;
149
- cachedUserDataAddress: string | null;
165
+ cachedMarketDataByProvider: Record<string, {
166
+ data: PerpsMarketData[];
167
+ timestamp: number;
168
+ }>;
169
+ cachedUserDataByProvider: Record<string, {
170
+ positions: Position[];
171
+ orders: Order[];
172
+ accountState: AccountState | null;
173
+ timestamp: number;
174
+ address: string;
175
+ }>;
150
176
  };
151
177
  /**
152
178
  * Get default PerpsController state
@@ -166,115 +192,7 @@ export type PerpsControllerEvents = ControllerStateChangeEvent<'PerpsController'
166
192
  /**
167
193
  * PerpsController actions
168
194
  */
169
- export type PerpsControllerActions = ControllerGetStateAction<'PerpsController', PerpsControllerState> | {
170
- type: 'PerpsController:placeOrder';
171
- handler: PerpsController['placeOrder'];
172
- } | {
173
- type: 'PerpsController:editOrder';
174
- handler: PerpsController['editOrder'];
175
- } | {
176
- type: 'PerpsController:cancelOrder';
177
- handler: PerpsController['cancelOrder'];
178
- } | {
179
- type: 'PerpsController:cancelOrders';
180
- handler: PerpsController['cancelOrders'];
181
- } | {
182
- type: 'PerpsController:closePosition';
183
- handler: PerpsController['closePosition'];
184
- } | {
185
- type: 'PerpsController:closePositions';
186
- handler: PerpsController['closePositions'];
187
- } | {
188
- type: 'PerpsController:withdraw';
189
- handler: PerpsController['withdraw'];
190
- } | {
191
- type: 'PerpsController:getPositions';
192
- handler: PerpsController['getPositions'];
193
- } | {
194
- type: 'PerpsController:getOrderFills';
195
- handler: PerpsController['getOrderFills'];
196
- } | {
197
- type: 'PerpsController:getOrders';
198
- handler: PerpsController['getOrders'];
199
- } | {
200
- type: 'PerpsController:getOpenOrders';
201
- handler: PerpsController['getOpenOrders'];
202
- } | {
203
- type: 'PerpsController:getFunding';
204
- handler: PerpsController['getFunding'];
205
- } | {
206
- type: 'PerpsController:getAccountState';
207
- handler: PerpsController['getAccountState'];
208
- } | {
209
- type: 'PerpsController:getMarkets';
210
- handler: PerpsController['getMarkets'];
211
- } | {
212
- type: 'PerpsController:refreshEligibility';
213
- handler: PerpsController['refreshEligibility'];
214
- } | {
215
- type: 'PerpsController:toggleTestnet';
216
- handler: PerpsController['toggleTestnet'];
217
- } | {
218
- type: 'PerpsController:disconnect';
219
- handler: PerpsController['disconnect'];
220
- } | {
221
- type: 'PerpsController:calculateFees';
222
- handler: PerpsController['calculateFees'];
223
- } | {
224
- type: 'PerpsController:markTutorialCompleted';
225
- handler: PerpsController['markTutorialCompleted'];
226
- } | {
227
- type: 'PerpsController:markFirstOrderCompleted';
228
- handler: PerpsController['markFirstOrderCompleted'];
229
- } | {
230
- type: 'PerpsController:getHistoricalPortfolio';
231
- handler: PerpsController['getHistoricalPortfolio'];
232
- } | {
233
- type: 'PerpsController:resetFirstTimeUserState';
234
- handler: PerpsController['resetFirstTimeUserState'];
235
- } | {
236
- type: 'PerpsController:clearPendingTransactionRequests';
237
- handler: PerpsController['clearPendingTransactionRequests'];
238
- } | {
239
- type: 'PerpsController:saveTradeConfiguration';
240
- handler: PerpsController['saveTradeConfiguration'];
241
- } | {
242
- type: 'PerpsController:getTradeConfiguration';
243
- handler: PerpsController['getTradeConfiguration'];
244
- } | {
245
- type: 'PerpsController:saveMarketFilterPreferences';
246
- handler: PerpsController['saveMarketFilterPreferences'];
247
- } | {
248
- type: 'PerpsController:getMarketFilterPreferences';
249
- handler: PerpsController['getMarketFilterPreferences'];
250
- } | {
251
- type: 'PerpsController:savePendingTradeConfiguration';
252
- handler: PerpsController['savePendingTradeConfiguration'];
253
- } | {
254
- type: 'PerpsController:getPendingTradeConfiguration';
255
- handler: PerpsController['getPendingTradeConfiguration'];
256
- } | {
257
- type: 'PerpsController:clearPendingTradeConfiguration';
258
- handler: PerpsController['clearPendingTradeConfiguration'];
259
- } | {
260
- type: 'PerpsController:getOrderBookGrouping';
261
- handler: PerpsController['getOrderBookGrouping'];
262
- } | {
263
- type: 'PerpsController:saveOrderBookGrouping';
264
- handler: PerpsController['saveOrderBookGrouping'];
265
- } | {
266
- type: 'PerpsController:setSelectedPaymentToken';
267
- handler: PerpsController['setSelectedPaymentToken'];
268
- } | {
269
- type: 'PerpsController:resetSelectedPaymentToken';
270
- handler: PerpsController['resetSelectedPaymentToken'];
271
- } | {
272
- type: 'PerpsController:startEligibilityMonitoring';
273
- handler: PerpsController['startEligibilityMonitoring'];
274
- } | {
275
- type: 'PerpsController:stopEligibilityMonitoring';
276
- handler: PerpsController['stopEligibilityMonitoring'];
277
- };
195
+ export type PerpsControllerActions = ControllerGetStateAction<'PerpsController', PerpsControllerState> | PerpsControllerMethodActions;
278
196
  /**
279
197
  * PerpsController messenger constraints.
280
198
  * Includes both PerpsController's own actions/events and
@@ -296,10 +214,9 @@ export type PerpsControllerOptions = {
296
214
  */
297
215
  infrastructure: PerpsPlatformDependencies;
298
216
  /**
299
- * When true, defers geo-blocking eligibility checks until
300
- * {@link PerpsController.startEligibilityMonitoring} is called.
301
- * Use this during wallet onboarding to prevent the geolocation fetch
302
- * from firing before onboarding is complete.
217
+ * When true, defers the initial eligibility (geolocation) check until
218
+ * `startEligibilityMonitoring()` is called. This prevents the eager
219
+ * geolocation fetch from firing during wallet onboarding (privacy compliance).
303
220
  */
304
221
  deferEligibilityCheck?: boolean;
305
222
  };
@@ -327,6 +244,25 @@ export declare class PerpsController extends BaseController<'PerpsController', P
327
244
  */
328
245
  protected activeProviderInstance: PerpsProvider | null;
329
246
  constructor({ messenger, state, clientConfig, infrastructure, deferEligibilityCheck, }: PerpsControllerOptions);
247
+ /**
248
+ * Read cached market data for the currently active provider (or aggregated).
249
+ * Returns null when no valid cache exists or when cache has expired.
250
+ *
251
+ * @returns The cached market data array, or null if no valid cache.
252
+ */
253
+ getCachedMarketDataForActiveProvider(): PerpsMarketData[] | null;
254
+ /**
255
+ * Read cached user data for the currently active provider (or aggregated).
256
+ * Returns null when no valid cache exists, cache has expired, or address
257
+ * does not match the currently selected EVM account.
258
+ *
259
+ * @returns The cached user data, or null if no valid cache.
260
+ */
261
+ getCachedUserDataForActiveProvider(): {
262
+ positions: Position[];
263
+ orders: Order[];
264
+ accountState: AccountState | null;
265
+ } | null;
330
266
  /**
331
267
  * Test-observable accessor for whether a standalone provider is cached.
332
268
  *
@@ -351,6 +287,29 @@ export declare class PerpsController extends BaseController<'PerpsController', P
351
287
  * @returns A promise that resolves when the operation completes.
352
288
  */
353
289
  init(): Promise<void>;
290
+ /**
291
+ * Registers the MYX provider after dynamic import resolves.
292
+ *
293
+ * Extracted from the import().then() callback so it can be tested directly
294
+ * (Jest cannot resolve dynamic imports without --experimental-vm-modules).
295
+ *
296
+ * @param MYXProvider - Constructor class for the MYX provider.
297
+ */
298
+ protected registerMYXProvider(MYXProvider: new (opts: {
299
+ isTestnet: boolean;
300
+ platformDependencies: PerpsPlatformDependencies;
301
+ messenger: PerpsControllerMessenger;
302
+ myxAuthConfig: ReturnType<typeof resolveMyxAuthConfig>;
303
+ }) => PerpsProvider): void;
304
+ /**
305
+ * Handles errors from the MYX dynamic import.
306
+ *
307
+ * Module-not-found errors are expected (extension doesn't ship MYX) → debug log.
308
+ * Other errors indicate constructor/config problems → Sentry via logError.
309
+ *
310
+ * @param error - The caught error from the dynamic import or constructor.
311
+ */
312
+ protected handleMYXImportError(error: unknown): void;
354
313
  /**
355
314
  * Get the currently active provider.
356
315
  * In aggregated mode, returns AggregatedPerpsProvider which routes to underlying providers.
@@ -807,14 +766,18 @@ export declare class PerpsController extends BaseController<'PerpsController', P
807
766
  * Eligibility (Geo-Blocking)
808
767
  */
809
768
  /**
810
- * Activates geo-blocking eligibility monitoring.
811
- * Call this after onboarding is complete when the controller was constructed
812
- * with `deferEligibilityCheck: true`.
769
+ * Fetch geo location
813
770
  *
814
- * Reads the current RemoteFeatureFlagController state, performs the initial
815
- * eligibility check, and unblocks the existing stateChange subscription so
816
- * future feature-flag updates flow through normally.
817
- * Safe to call multiple times; subsequent calls simply re-check eligibility.
771
+ * Returned in Country or Country-Region format
772
+ * Example: FR, DE, US-MI, CA-ON
773
+ */
774
+ /**
775
+ * Refresh eligibility status
776
+ */
777
+ /**
778
+ * Resume eligibility monitoring after onboarding completes.
779
+ * Clears the deferred flag and triggers an immediate eligibility check
780
+ * using the current remote feature flag state.
818
781
  */
819
782
  startEligibilityMonitoring(): void;
820
783
  /**
@@ -824,9 +787,6 @@ export declare class PerpsController extends BaseController<'PerpsController', P
824
787
  * Safe to call multiple times.
825
788
  */
826
789
  stopEligibilityMonitoring(): void;
827
- /**
828
- * Refresh eligibility status
829
- */
830
790
  refreshEligibility(): Promise<void>;
831
791
  /**
832
792
  * Get block explorer URL for an address or just the base URL
@@ -1 +1 @@
1
- {"version":3,"file":"PerpsController.d.cts","sourceRoot":"","sources":["../src/PerpsController.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,wBAAwB,EACxB,0BAA0B,EAE3B,kCAAkC;AAGnC,OAAO,KAAK,EAAE,SAAS,EAAE,4BAA4B;AACrD,OAAO,KAAK,EAAE,IAAI,EAAE,wBAAwB;AAG5C,OAAO,EAAE,YAAY,EAAE,oCAAgC;AAYvD,OAAO,KAAK,EAAE,YAAY,EAAE,oCAAgC;AAc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,CAAC;QACjB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAajD;;;;OAIG;IACI,yBAAyB,IAAI,OAAO;CAG5C"}
1
+ {"version":3,"file":"PerpsController.d.cts","sourceRoot":"","sources":["../src/PerpsController.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,wBAAwB,EACxB,0BAA0B,EAE3B,kCAAkC;AAGnC,OAAO,KAAK,EAAE,SAAS,EAAE,4BAA4B;AACrD,OAAO,KAAK,EAAE,IAAI,EAAE,wBAAwB;AAG5C,OAAO,EAAE,YAAY,EAAE,oCAAgC;AAYvD,OAAO,KAAK,EAAE,YAAY,EAAE,oCAAgC;AAC5D,OAAO,KAAK,EAAE,4BAA4B,EAAE,kDAA8C;AAc1F,OAAO,EACL,wBAAwB,EAMzB,0BAAgB;AACjB,OAAO,KAAK,EACV,YAAY,EACZ,UAAU,EACV,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,EACpB,6BAA6B,EAC7B,eAAe,EACf,oBAAoB,EACpB,oBAAoB,EACpB,kBAAkB,EAClB,OAAO,EACP,qBAAqB,EACrB,sBAAsB,EACtB,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,EACnB,eAAe,EACf,kBAAkB,EAClB,aAAa,EACb,sBAAsB,EACtB,cAAc,EACd,uBAAuB,EACvB,YAAY,EACZ,UAAU,EACV,KAAK,EACL,SAAS,EACT,WAAW,EACX,WAAW,EACX,qBAAqB,EACrB,eAAe,EACf,QAAQ,EACR,sBAAsB,EACtB,sBAAsB,EACtB,qBAAqB,EACrB,wBAAwB,EACxB,yBAAyB,EACzB,qBAAqB,EACrB,wBAAwB,EACxB,qBAAqB,EACr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AAQ,EAAE,YAAY,EACtB,SAAS,EAAE,aAAa,GACvB,IAAI;IAYP;;;;;;OAMG;IACH,uBAAuB,CAAC,KAAK,EAAE,yBAAyB,GAAG,IAAI,GAAG,IAAI;IAmDtE;;;OAGG;IACH,yBAAyB,IAAI,IAAI;IAMjC;;;;;OAKG;IACH,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAgBxD;;;;;OAKG;IACH,qBAAqB,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI;IAuB7D;;;;;OAKG;IACH,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAyB3C;;;;;OAKG;IACH,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO;IAK1C;;;;OAIG;IACH,mBAAmB,IAAI,MAAM,EAAE;IAK/B;;;;;;;;;;;;OAYG;cACa,qBAAqB,CAAC,MAAM,EAAE;QAC5C,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC;QACzB,MAAM,EAAE,MAAM,CAAC;QACf,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAajD;;;;OAIG;IACI,yBAAyB,IAAI,OAAO;CAG5C"}
@@ -3,12 +3,34 @@ import type { Messenger } from "@metamask/messenger";
3
3
  import type { Json } from "@metamask/utils";
4
4
  import { CandlePeriod } from "./constants/chartConfig.mjs";
5
5
  import type { SortOptionId } from "./constants/perpsConfig.mjs";
6
+ import type { PerpsControllerMethodActions } from "./PerpsController-method-action-types.mjs";
6
7
  import { WebSocketConnectionState } from "./types/index.mjs";
7
- import type { AccountState, AssetRoute, CancelOrderParams, CancelOrderResult, CancelOrdersParams, CancelOrdersResult, ClosePositionParams, ClosePositionsParams, ClosePositionsResult, DepositWithConfirmationParams, EditOrderParams, FeeCalculationParams, FeeCalculationResult, FlipPositionParams, Funding, GetAccountStateParams, GetAvailableDexsParams, GetFundingParams, GetMarketsParams, GetOrderFillsParams, GetOrdersParams, GetPositionsParams, PerpsProvider, LiquidationPriceParams, LiveDataConfig, MaintenanceMarginParams, MarginResult, MarketInfo, Order, OrderFill, OrderParams, OrderResult, PerpsControllerConfig, PerpsMarketData, Position, SubscribeAccountParams, SubscribeCandlesParams, SubscribeOICapsParams, SubscribeOrderBookParams, SubscribeOrderFillsParams, SubscribeOrdersParams, SubscribePositionsParams, SubscribePricesParams, SwitchProviderResult, ToggleTestnetResult, UpdateMarginParams, UpdatePositionTPSLParams, WithdrawParams, WithdrawResult, GetHistoricalPortfolioParams, HistoricalPortfolioResult, OrderType, PerpsPlatformDependencies, PerpsActiveProviderMode, PerpsProviderType, PerpsSelectedPaymentToken, PerpsRemoteFeatureFlagState } from "./types/index.mjs";
8
+ import type { AccountState, AssetRoute, CancelOrderParams, CancelOrderResult, CancelOrdersParams, CancelOrdersResult, ClosePositionParams, ClosePositionsParams, ClosePositionsResult, DepositWithConfirmationParams, EditOrderParams, FeeCalculationParams, FeeCalculationResult, FlipPositionParams, Funding, GetAccountStateParams, GetAvailableDexsParams, GetFundingParams, GetMarketsParams, GetOrderFillsParams, GetOrdersParams, GetPositionsParams, PerpsProvider, LiquidationPriceParams, LiveDataConfig, MaintenanceMarginParams, MarginResult, MarketInfo, Order, OrderFill, OrderParams, OrderResult, PerpsControllerConfig, PerpsMarketData, Position, SubscribeAccountParams, SubscribeCandlesParams, SubscribeOICapsParams, SubscribeOrderBookParams, SubscribeOrderFillsParams, SubscribeOrdersParams, SubscribePositionsParams, SubscribePricesParams, SwitchProviderResult, ToggleTestnetResult, UpdateMarginParams, UpdatePositionTPSLParams, WithdrawParams, WithdrawResult, GetHistoricalPortfolioParams, HistoricalPortfolioResult, OrderType, PerpsPlatformDependencies, PerpsActiveProviderMode, PerpsProviderType, PerpsSelectedPaymentToken, PerpsRemoteFeatureFlagState, MYXCredentials } from "./types/index.mjs";
8
9
  import type { PerpsControllerAllowedActions, PerpsControllerAllowedEvents } from "./types/messenger.mjs";
9
10
  import type { CandleData } from "./types/perps-types.mjs";
10
11
  import { LastTransactionResult, TransactionStatus } from "./types/transactionTypes.mjs";
11
12
  import type { SortDirection } from "./utils/sortMarkets.mjs";
13
+ /**
14
+ * Returns the first non-empty string from the given values.
15
+ * Env vars default to '' (not null/undefined), so ?? wouldn't fall through.
16
+ *
17
+ * @param vals - String values to check in order.
18
+ * @returns The first non-empty string, or '' if all are empty/undefined.
19
+ */
20
+ export declare function firstNonEmpty(...vals: (string | undefined)[]): string;
21
+ /**
22
+ * Resolves MYX auth config from provider credentials, handling
23
+ * testnet/mainnet fallback logic.
24
+ *
25
+ * @param myx - MYX provider credentials.
26
+ * @param isTestnet - Whether the controller is in testnet mode.
27
+ * @returns Resolved appId, apiSecret, and brokerAddress.
28
+ */
29
+ export declare function resolveMyxAuthConfig(myx: MYXCredentials, isTestnet: boolean): {
30
+ appId: string;
31
+ apiSecret: string;
32
+ brokerAddress: string;
33
+ };
12
34
  /**
13
35
  * Minimal payment token stored in PerpsController state.
14
36
  * Only required fields for identification, Perps balance detection, and analytics.
@@ -140,13 +162,17 @@ export type PerpsControllerState = {
140
162
  lastUpdateTimestamp: number;
141
163
  hip3ConfigVersion: number;
142
164
  selectedPaymentToken: Json | null;
143
- cachedMarketData: PerpsMarketData[] | null;
144
- cachedMarketDataTimestamp: number;
145
- cachedPositions: Position[] | null;
146
- cachedOrders: Order[] | null;
147
- cachedAccountState: AccountState | null;
148
- cachedUserDataTimestamp: number;
149
- cachedUserDataAddress: string | null;
165
+ cachedMarketDataByProvider: Record<string, {
166
+ data: PerpsMarketData[];
167
+ timestamp: number;
168
+ }>;
169
+ cachedUserDataByProvider: Record<string, {
170
+ positions: Position[];
171
+ orders: Order[];
172
+ accountState: AccountState | null;
173
+ timestamp: number;
174
+ address: string;
175
+ }>;
150
176
  };
151
177
  /**
152
178
  * Get default PerpsController state
@@ -166,115 +192,7 @@ export type PerpsControllerEvents = ControllerStateChangeEvent<'PerpsController'
166
192
  /**
167
193
  * PerpsController actions
168
194
  */
169
- export type PerpsControllerActions = ControllerGetStateAction<'PerpsController', PerpsControllerState> | {
170
- type: 'PerpsController:placeOrder';
171
- handler: PerpsController['placeOrder'];
172
- } | {
173
- type: 'PerpsController:editOrder';
174
- handler: PerpsController['editOrder'];
175
- } | {
176
- type: 'PerpsController:cancelOrder';
177
- handler: PerpsController['cancelOrder'];
178
- } | {
179
- type: 'PerpsController:cancelOrders';
180
- handler: PerpsController['cancelOrders'];
181
- } | {
182
- type: 'PerpsController:closePosition';
183
- handler: PerpsController['closePosition'];
184
- } | {
185
- type: 'PerpsController:closePositions';
186
- handler: PerpsController['closePositions'];
187
- } | {
188
- type: 'PerpsController:withdraw';
189
- handler: PerpsController['withdraw'];
190
- } | {
191
- type: 'PerpsController:getPositions';
192
- handler: PerpsController['getPositions'];
193
- } | {
194
- type: 'PerpsController:getOrderFills';
195
- handler: PerpsController['getOrderFills'];
196
- } | {
197
- type: 'PerpsController:getOrders';
198
- handler: PerpsController['getOrders'];
199
- } | {
200
- type: 'PerpsController:getOpenOrders';
201
- handler: PerpsController['getOpenOrders'];
202
- } | {
203
- type: 'PerpsController:getFunding';
204
- handler: PerpsController['getFunding'];
205
- } | {
206
- type: 'PerpsController:getAccountState';
207
- handler: PerpsController['getAccountState'];
208
- } | {
209
- type: 'PerpsController:getMarkets';
210
- handler: PerpsController['getMarkets'];
211
- } | {
212
- type: 'PerpsController:refreshEligibility';
213
- handler: PerpsController['refreshEligibility'];
214
- } | {
215
- type: 'PerpsController:toggleTestnet';
216
- handler: PerpsController['toggleTestnet'];
217
- } | {
218
- type: 'PerpsController:disconnect';
219
- handler: PerpsController['disconnect'];
220
- } | {
221
- type: 'PerpsController:calculateFees';
222
- handler: PerpsController['calculateFees'];
223
- } | {
224
- type: 'PerpsController:markTutorialCompleted';
225
- handler: PerpsController['markTutorialCompleted'];
226
- } | {
227
- type: 'PerpsController:markFirstOrderCompleted';
228
- handler: PerpsController['markFirstOrderCompleted'];
229
- } | {
230
- type: 'PerpsController:getHistoricalPortfolio';
231
- handler: PerpsController['getHistoricalPortfolio'];
232
- } | {
233
- type: 'PerpsController:resetFirstTimeUserState';
234
- handler: PerpsController['resetFirstTimeUserState'];
235
- } | {
236
- type: 'PerpsController:clearPendingTransactionRequests';
237
- handler: PerpsController['clearPendingTransactionRequests'];
238
- } | {
239
- type: 'PerpsController:saveTradeConfiguration';
240
- handler: PerpsController['saveTradeConfiguration'];
241
- } | {
242
- type: 'PerpsController:getTradeConfiguration';
243
- handler: PerpsController['getTradeConfiguration'];
244
- } | {
245
- type: 'PerpsController:saveMarketFilterPreferences';
246
- handler: PerpsController['saveMarketFilterPreferences'];
247
- } | {
248
- type: 'PerpsController:getMarketFilterPreferences';
249
- handler: PerpsController['getMarketFilterPreferences'];
250
- } | {
251
- type: 'PerpsController:savePendingTradeConfiguration';
252
- handler: PerpsController['savePendingTradeConfiguration'];
253
- } | {
254
- type: 'PerpsController:getPendingTradeConfiguration';
255
- handler: PerpsController['getPendingTradeConfiguration'];
256
- } | {
257
- type: 'PerpsController:clearPendingTradeConfiguration';
258
- handler: PerpsController['clearPendingTradeConfiguration'];
259
- } | {
260
- type: 'PerpsController:getOrderBookGrouping';
261
- handler: PerpsController['getOrderBookGrouping'];
262
- } | {
263
- type: 'PerpsController:saveOrderBookGrouping';
264
- handler: PerpsController['saveOrderBookGrouping'];
265
- } | {
266
- type: 'PerpsController:setSelectedPaymentToken';
267
- handler: PerpsController['setSelectedPaymentToken'];
268
- } | {
269
- type: 'PerpsController:resetSelectedPaymentToken';
270
- handler: PerpsController['resetSelectedPaymentToken'];
271
- } | {
272
- type: 'PerpsController:startEligibilityMonitoring';
273
- handler: PerpsController['startEligibilityMonitoring'];
274
- } | {
275
- type: 'PerpsController:stopEligibilityMonitoring';
276
- handler: PerpsController['stopEligibilityMonitoring'];
277
- };
195
+ export type PerpsControllerActions = ControllerGetStateAction<'PerpsController', PerpsControllerState> | PerpsControllerMethodActions;
278
196
  /**
279
197
  * PerpsController messenger constraints.
280
198
  * Includes both PerpsController's own actions/events and
@@ -296,10 +214,9 @@ export type PerpsControllerOptions = {
296
214
  */
297
215
  infrastructure: PerpsPlatformDependencies;
298
216
  /**
299
- * When true, defers geo-blocking eligibility checks until
300
- * {@link PerpsController.startEligibilityMonitoring} is called.
301
- * Use this during wallet onboarding to prevent the geolocation fetch
302
- * from firing before onboarding is complete.
217
+ * When true, defers the initial eligibility (geolocation) check until
218
+ * `startEligibilityMonitoring()` is called. This prevents the eager
219
+ * geolocation fetch from firing during wallet onboarding (privacy compliance).
303
220
  */
304
221
  deferEligibilityCheck?: boolean;
305
222
  };
@@ -327,6 +244,25 @@ export declare class PerpsController extends BaseController<'PerpsController', P
327
244
  */
328
245
  protected activeProviderInstance: PerpsProvider | null;
329
246
  constructor({ messenger, state, clientConfig, infrastructure, deferEligibilityCheck, }: PerpsControllerOptions);
247
+ /**
248
+ * Read cached market data for the currently active provider (or aggregated).
249
+ * Returns null when no valid cache exists or when cache has expired.
250
+ *
251
+ * @returns The cached market data array, or null if no valid cache.
252
+ */
253
+ getCachedMarketDataForActiveProvider(): PerpsMarketData[] | null;
254
+ /**
255
+ * Read cached user data for the currently active provider (or aggregated).
256
+ * Returns null when no valid cache exists, cache has expired, or address
257
+ * does not match the currently selected EVM account.
258
+ *
259
+ * @returns The cached user data, or null if no valid cache.
260
+ */
261
+ getCachedUserDataForActiveProvider(): {
262
+ positions: Position[];
263
+ orders: Order[];
264
+ accountState: AccountState | null;
265
+ } | null;
330
266
  /**
331
267
  * Test-observable accessor for whether a standalone provider is cached.
332
268
  *
@@ -351,6 +287,29 @@ export declare class PerpsController extends BaseController<'PerpsController', P
351
287
  * @returns A promise that resolves when the operation completes.
352
288
  */
353
289
  init(): Promise<void>;
290
+ /**
291
+ * Registers the MYX provider after dynamic import resolves.
292
+ *
293
+ * Extracted from the import().then() callback so it can be tested directly
294
+ * (Jest cannot resolve dynamic imports without --experimental-vm-modules).
295
+ *
296
+ * @param MYXProvider - Constructor class for the MYX provider.
297
+ */
298
+ protected registerMYXProvider(MYXProvider: new (opts: {
299
+ isTestnet: boolean;
300
+ platformDependencies: PerpsPlatformDependencies;
301
+ messenger: PerpsControllerMessenger;
302
+ myxAuthConfig: ReturnType<typeof resolveMyxAuthConfig>;
303
+ }) => PerpsProvider): void;
304
+ /**
305
+ * Handles errors from the MYX dynamic import.
306
+ *
307
+ * Module-not-found errors are expected (extension doesn't ship MYX) → debug log.
308
+ * Other errors indicate constructor/config problems → Sentry via logError.
309
+ *
310
+ * @param error - The caught error from the dynamic import or constructor.
311
+ */
312
+ protected handleMYXImportError(error: unknown): void;
354
313
  /**
355
314
  * Get the currently active provider.
356
315
  * In aggregated mode, returns AggregatedPerpsProvider which routes to underlying providers.
@@ -807,14 +766,18 @@ export declare class PerpsController extends BaseController<'PerpsController', P
807
766
  * Eligibility (Geo-Blocking)
808
767
  */
809
768
  /**
810
- * Activates geo-blocking eligibility monitoring.
811
- * Call this after onboarding is complete when the controller was constructed
812
- * with `deferEligibilityCheck: true`.
769
+ * Fetch geo location
813
770
  *
814
- * Reads the current RemoteFeatureFlagController state, performs the initial
815
- * eligibility check, and unblocks the existing stateChange subscription so
816
- * future feature-flag updates flow through normally.
817
- * Safe to call multiple times; subsequent calls simply re-check eligibility.
771
+ * Returned in Country or Country-Region format
772
+ * Example: FR, DE, US-MI, CA-ON
773
+ */
774
+ /**
775
+ * Refresh eligibility status
776
+ */
777
+ /**
778
+ * Resume eligibility monitoring after onboarding completes.
779
+ * Clears the deferred flag and triggers an immediate eligibility check
780
+ * using the current remote feature flag state.
818
781
  */
819
782
  startEligibilityMonitoring(): void;
820
783
  /**
@@ -824,9 +787,6 @@ export declare class PerpsController extends BaseController<'PerpsController', P
824
787
  * Safe to call multiple times.
825
788
  */
826
789
  stopEligibilityMonitoring(): void;
827
- /**
828
- * Refresh eligibility status
829
- */
830
790
  refreshEligibility(): Promise<void>;
831
791
  /**
832
792
  * Get block explorer URL for an address or just the base URL