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

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 +0 -9
  2. package/dist/PerpsController.cjs +183 -488
  3. package/dist/PerpsController.cjs.map +1 -1
  4. package/dist/PerpsController.d.cts +131 -91
  5. package/dist/PerpsController.d.cts.map +1 -1
  6. package/dist/PerpsController.d.mts +131 -91
  7. package/dist/PerpsController.d.mts.map +1 -1
  8. package/dist/PerpsController.mjs +182 -485
  9. package/dist/PerpsController.mjs.map +1 -1
  10. package/dist/constants/eventNames.cjs +0 -26
  11. package/dist/constants/eventNames.cjs.map +1 -1
  12. package/dist/constants/eventNames.d.cts +0 -19
  13. package/dist/constants/eventNames.d.cts.map +1 -1
  14. package/dist/constants/eventNames.d.mts +0 -19
  15. package/dist/constants/eventNames.d.mts.map +1 -1
  16. package/dist/constants/eventNames.mjs +0 -26
  17. package/dist/constants/eventNames.mjs.map +1 -1
  18. package/dist/constants/hyperLiquidConfig.cjs +4 -24
  19. package/dist/constants/hyperLiquidConfig.cjs.map +1 -1
  20. package/dist/constants/hyperLiquidConfig.d.cts +3 -8
  21. package/dist/constants/hyperLiquidConfig.d.cts.map +1 -1
  22. package/dist/constants/hyperLiquidConfig.d.mts +3 -8
  23. package/dist/constants/hyperLiquidConfig.d.mts.map +1 -1
  24. package/dist/constants/hyperLiquidConfig.mjs +3 -23
  25. package/dist/constants/hyperLiquidConfig.mjs.map +1 -1
  26. package/dist/constants/myxConfig.cjs +51 -75
  27. package/dist/constants/myxConfig.cjs.map +1 -1
  28. package/dist/constants/myxConfig.d.cts +19 -58
  29. package/dist/constants/myxConfig.d.cts.map +1 -1
  30. package/dist/constants/myxConfig.d.mts +19 -58
  31. package/dist/constants/myxConfig.d.mts.map +1 -1
  32. package/dist/constants/myxConfig.mjs +50 -74
  33. package/dist/constants/myxConfig.mjs.map +1 -1
  34. package/dist/constants/perpsConfig.cjs +2 -6
  35. package/dist/constants/perpsConfig.cjs.map +1 -1
  36. package/dist/constants/perpsConfig.d.cts +1 -5
  37. package/dist/constants/perpsConfig.d.cts.map +1 -1
  38. package/dist/constants/perpsConfig.d.mts +1 -5
  39. package/dist/constants/perpsConfig.d.mts.map +1 -1
  40. package/dist/constants/perpsConfig.mjs +1 -5
  41. package/dist/constants/perpsConfig.mjs.map +1 -1
  42. package/dist/index.cjs +25 -243
  43. package/dist/index.cjs.map +1 -1
  44. package/dist/index.d.cts +5 -48
  45. package/dist/index.d.cts.map +1 -1
  46. package/dist/index.d.mts +5 -48
  47. package/dist/index.d.mts.map +1 -1
  48. package/dist/index.mjs +10 -36
  49. package/dist/index.mjs.map +1 -1
  50. package/dist/providers/AggregatedPerpsProvider.cjs +0 -24
  51. package/dist/providers/AggregatedPerpsProvider.cjs.map +1 -1
  52. package/dist/providers/AggregatedPerpsProvider.d.cts +0 -4
  53. package/dist/providers/AggregatedPerpsProvider.d.cts.map +1 -1
  54. package/dist/providers/AggregatedPerpsProvider.d.mts +0 -4
  55. package/dist/providers/AggregatedPerpsProvider.d.mts.map +1 -1
  56. package/dist/providers/AggregatedPerpsProvider.mjs +0 -24
  57. package/dist/providers/AggregatedPerpsProvider.mjs.map +1 -1
  58. package/dist/providers/HyperLiquidProvider.cjs +154 -470
  59. package/dist/providers/HyperLiquidProvider.cjs.map +1 -1
  60. package/dist/providers/HyperLiquidProvider.d.cts +2 -11
  61. package/dist/providers/HyperLiquidProvider.d.cts.map +1 -1
  62. package/dist/providers/HyperLiquidProvider.d.mts +2 -11
  63. package/dist/providers/HyperLiquidProvider.d.mts.map +1 -1
  64. package/dist/providers/HyperLiquidProvider.mjs +155 -471
  65. package/dist/providers/HyperLiquidProvider.mjs.map +1 -1
  66. package/dist/selectors.cjs +1 -1
  67. package/dist/selectors.cjs.map +1 -1
  68. package/dist/selectors.mjs +1 -1
  69. package/dist/selectors.mjs.map +1 -1
  70. package/dist/services/AccountService.cjs +1 -1
  71. package/dist/services/AccountService.cjs.map +1 -1
  72. package/dist/services/AccountService.d.cts.map +1 -1
  73. package/dist/services/AccountService.d.mts.map +1 -1
  74. package/dist/services/AccountService.mjs +2 -2
  75. package/dist/services/AccountService.mjs.map +1 -1
  76. package/dist/services/DepositService.cjs +1 -2
  77. package/dist/services/DepositService.cjs.map +1 -1
  78. package/dist/services/DepositService.d.cts.map +1 -1
  79. package/dist/services/DepositService.d.mts.map +1 -1
  80. package/dist/services/DepositService.mjs +1 -2
  81. package/dist/services/DepositService.mjs.map +1 -1
  82. package/dist/services/EligibilityService.cjs +103 -8
  83. package/dist/services/EligibilityService.cjs.map +1 -1
  84. package/dist/services/EligibilityService.d.cts +15 -4
  85. package/dist/services/EligibilityService.d.cts.map +1 -1
  86. package/dist/services/EligibilityService.d.mts +15 -4
  87. package/dist/services/EligibilityService.d.mts.map +1 -1
  88. package/dist/services/EligibilityService.mjs +103 -8
  89. package/dist/services/EligibilityService.mjs.map +1 -1
  90. package/dist/services/HyperLiquidSubscriptionService.cjs +46 -252
  91. package/dist/services/HyperLiquidSubscriptionService.cjs.map +1 -1
  92. package/dist/services/HyperLiquidSubscriptionService.d.cts +0 -1
  93. package/dist/services/HyperLiquidSubscriptionService.d.cts.map +1 -1
  94. package/dist/services/HyperLiquidSubscriptionService.d.mts +0 -1
  95. package/dist/services/HyperLiquidSubscriptionService.d.mts.map +1 -1
  96. package/dist/services/HyperLiquidSubscriptionService.mjs +46 -252
  97. package/dist/services/HyperLiquidSubscriptionService.mjs.map +1 -1
  98. package/dist/services/MarketDataService.cjs +4 -2
  99. package/dist/services/MarketDataService.cjs.map +1 -1
  100. package/dist/services/MarketDataService.d.cts.map +1 -1
  101. package/dist/services/MarketDataService.d.mts.map +1 -1
  102. package/dist/services/MarketDataService.mjs +4 -2
  103. package/dist/services/MarketDataService.mjs.map +1 -1
  104. package/dist/services/TradingService.cjs +6 -72
  105. package/dist/services/TradingService.cjs.map +1 -1
  106. package/dist/services/TradingService.d.cts.map +1 -1
  107. package/dist/services/TradingService.d.mts.map +1 -1
  108. package/dist/services/TradingService.mjs +6 -72
  109. package/dist/services/TradingService.mjs.map +1 -1
  110. package/dist/types/index.cjs.map +1 -1
  111. package/dist/types/index.d.cts +3 -51
  112. package/dist/types/index.d.cts.map +1 -1
  113. package/dist/types/index.d.mts +3 -51
  114. package/dist/types/index.d.mts.map +1 -1
  115. package/dist/types/index.mjs.map +1 -1
  116. package/dist/types/messenger.cjs.map +1 -1
  117. package/dist/types/messenger.d.cts +1 -2
  118. package/dist/types/messenger.d.cts.map +1 -1
  119. package/dist/types/messenger.d.mts +1 -2
  120. package/dist/types/messenger.d.mts.map +1 -1
  121. package/dist/types/messenger.mjs.map +1 -1
  122. package/dist/types/myx-types.cjs +3 -19
  123. package/dist/types/myx-types.cjs.map +1 -1
  124. package/dist/types/myx-types.d.cts +2 -33
  125. package/dist/types/myx-types.d.cts.map +1 -1
  126. package/dist/types/myx-types.d.mts +2 -33
  127. package/dist/types/myx-types.d.mts.map +1 -1
  128. package/dist/types/myx-types.mjs +2 -6
  129. package/dist/types/myx-types.mjs.map +1 -1
  130. package/dist/types/perps-types.cjs +0 -3
  131. package/dist/types/perps-types.cjs.map +1 -1
  132. package/dist/types/perps-types.d.cts +3 -3
  133. package/dist/types/perps-types.d.cts.map +1 -1
  134. package/dist/types/perps-types.d.mts +3 -3
  135. package/dist/types/perps-types.d.mts.map +1 -1
  136. package/dist/types/perps-types.mjs +0 -3
  137. package/dist/types/perps-types.mjs.map +1 -1
  138. package/dist/utils/accountUtils.cjs.map +1 -1
  139. package/dist/utils/accountUtils.d.cts.map +1 -1
  140. package/dist/utils/accountUtils.d.mts.map +1 -1
  141. package/dist/utils/accountUtils.mjs.map +1 -1
  142. package/dist/utils/myxAdapter.cjs +15 -360
  143. package/dist/utils/myxAdapter.cjs.map +1 -1
  144. package/dist/utils/myxAdapter.d.cts +7 -94
  145. package/dist/utils/myxAdapter.d.cts.map +1 -1
  146. package/dist/utils/myxAdapter.d.mts +7 -94
  147. package/dist/utils/myxAdapter.d.mts.map +1 -1
  148. package/dist/utils/myxAdapter.mjs +16 -351
  149. package/dist/utils/myxAdapter.mjs.map +1 -1
  150. package/package.json +2 -4
  151. package/dist/PerpsController-method-action-types.cjs +0 -3
  152. package/dist/PerpsController-method-action-types.cjs.map +0 -1
  153. package/dist/PerpsController-method-action-types.d.cts +0 -147
  154. package/dist/PerpsController-method-action-types.d.cts.map +0 -1
  155. package/dist/PerpsController-method-action-types.d.mts +0 -147
  156. package/dist/PerpsController-method-action-types.d.mts.map +0 -1
  157. package/dist/PerpsController-method-action-types.mjs +0 -2
  158. package/dist/PerpsController-method-action-types.mjs.map +0 -1
@@ -3,34 +3,12 @@ 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";
7
6
  import { WebSocketConnectionState } 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";
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";
9
8
  import type { PerpsControllerAllowedActions, PerpsControllerAllowedEvents } from "./types/messenger.cjs";
10
9
  import type { CandleData } from "./types/perps-types.cjs";
11
10
  import { LastTransactionResult, TransactionStatus } from "./types/transactionTypes.cjs";
12
11
  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
- };
34
12
  /**
35
13
  * Minimal payment token stored in PerpsController state.
36
14
  * Only required fields for identification, Perps balance detection, and analytics.
@@ -162,17 +140,13 @@ export type PerpsControllerState = {
162
140
  lastUpdateTimestamp: number;
163
141
  hip3ConfigVersion: number;
164
142
  selectedPaymentToken: Json | 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
- }>;
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;
176
150
  };
177
151
  /**
178
152
  * Get default PerpsController state
@@ -192,7 +166,115 @@ export type PerpsControllerEvents = ControllerStateChangeEvent<'PerpsController'
192
166
  /**
193
167
  * PerpsController actions
194
168
  */
195
- export type PerpsControllerActions = ControllerGetStateAction<'PerpsController', PerpsControllerState> | PerpsControllerMethodActions;
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
+ };
196
278
  /**
197
279
  * PerpsController messenger constraints.
198
280
  * Includes both PerpsController's own actions/events and
@@ -214,9 +296,10 @@ export type PerpsControllerOptions = {
214
296
  */
215
297
  infrastructure: PerpsPlatformDependencies;
216
298
  /**
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).
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.
220
303
  */
221
304
  deferEligibilityCheck?: boolean;
222
305
  };
@@ -244,25 +327,6 @@ export declare class PerpsController extends BaseController<'PerpsController', P
244
327
  */
245
328
  protected activeProviderInstance: PerpsProvider | null;
246
329
  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;
266
330
  /**
267
331
  * Test-observable accessor for whether a standalone provider is cached.
268
332
  *
@@ -287,29 +351,6 @@ export declare class PerpsController extends BaseController<'PerpsController', P
287
351
  * @returns A promise that resolves when the operation completes.
288
352
  */
289
353
  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;
313
354
  /**
314
355
  * Get the currently active provider.
315
356
  * In aggregated mode, returns AggregatedPerpsProvider which routes to underlying providers.
@@ -766,18 +807,14 @@ export declare class PerpsController extends BaseController<'PerpsController', P
766
807
  * Eligibility (Geo-Blocking)
767
808
  */
768
809
  /**
769
- * Fetch geo location
810
+ * Activates geo-blocking eligibility monitoring.
811
+ * Call this after onboarding is complete when the controller was constructed
812
+ * with `deferEligibilityCheck: true`.
770
813
  *
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.
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.
781
818
  */
782
819
  startEligibilityMonitoring(): void;
783
820
  /**
@@ -787,6 +824,9 @@ export declare class PerpsController extends BaseController<'PerpsController', P
787
824
  * Safe to call multiple times.
788
825
  */
789
826
  stopEligibilityMonitoring(): void;
827
+ /**
828
+ * Refresh eligibility status
829
+ */
790
830
  refreshEligibility(): Promise<void>;
791
831
  /**
792
832
  * 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;AAY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H,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"}
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,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,E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KAC1B;IAqCD;;;;;OAKG;IACH,2BAA2B,CACzB,QAAQ,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,34 +3,12 @@ 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";
7
6
  import { WebSocketConnectionState } 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";
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";
9
8
  import type { PerpsControllerAllowedActions, PerpsControllerAllowedEvents } from "./types/messenger.mjs";
10
9
  import type { CandleData } from "./types/perps-types.mjs";
11
10
  import { LastTransactionResult, TransactionStatus } from "./types/transactionTypes.mjs";
12
11
  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
- };
34
12
  /**
35
13
  * Minimal payment token stored in PerpsController state.
36
14
  * Only required fields for identification, Perps balance detection, and analytics.
@@ -162,17 +140,13 @@ export type PerpsControllerState = {
162
140
  lastUpdateTimestamp: number;
163
141
  hip3ConfigVersion: number;
164
142
  selectedPaymentToken: Json | 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
- }>;
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;
176
150
  };
177
151
  /**
178
152
  * Get default PerpsController state
@@ -192,7 +166,115 @@ export type PerpsControllerEvents = ControllerStateChangeEvent<'PerpsController'
192
166
  /**
193
167
  * PerpsController actions
194
168
  */
195
- export type PerpsControllerActions = ControllerGetStateAction<'PerpsController', PerpsControllerState> | PerpsControllerMethodActions;
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
+ };
196
278
  /**
197
279
  * PerpsController messenger constraints.
198
280
  * Includes both PerpsController's own actions/events and
@@ -214,9 +296,10 @@ export type PerpsControllerOptions = {
214
296
  */
215
297
  infrastructure: PerpsPlatformDependencies;
216
298
  /**
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).
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.
220
303
  */
221
304
  deferEligibilityCheck?: boolean;
222
305
  };
@@ -244,25 +327,6 @@ export declare class PerpsController extends BaseController<'PerpsController', P
244
327
  */
245
328
  protected activeProviderInstance: PerpsProvider | null;
246
329
  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;
266
330
  /**
267
331
  * Test-observable accessor for whether a standalone provider is cached.
268
332
  *
@@ -287,29 +351,6 @@ export declare class PerpsController extends BaseController<'PerpsController', P
287
351
  * @returns A promise that resolves when the operation completes.
288
352
  */
289
353
  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;
313
354
  /**
314
355
  * Get the currently active provider.
315
356
  * In aggregated mode, returns AggregatedPerpsProvider which routes to underlying providers.
@@ -766,18 +807,14 @@ export declare class PerpsController extends BaseController<'PerpsController', P
766
807
  * Eligibility (Geo-Blocking)
767
808
  */
768
809
  /**
769
- * Fetch geo location
810
+ * Activates geo-blocking eligibility monitoring.
811
+ * Call this after onboarding is complete when the controller was constructed
812
+ * with `deferEligibilityCheck: true`.
770
813
  *
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.
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.
781
818
  */
782
819
  startEligibilityMonitoring(): void;
783
820
  /**
@@ -787,6 +824,9 @@ export declare class PerpsController extends BaseController<'PerpsController', P
787
824
  * Safe to call multiple times.
788
825
  */
789
826
  stopEligibilityMonitoring(): void;
827
+ /**
828
+ * Refresh eligibility status
829
+ */
790
830
  refreshEligibility(): Promise<void>;
791
831
  /**
792
832
  * Get block explorer URL for an address or just the base URL