@metamask-previews/perps-controller 2.0.0-preview-16512b784 → 2.0.0-preview-4014adf

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.
@@ -1,7 +1,3 @@
1
1
  "use strict";
2
- /**
3
- * This file is auto generated.
4
- * Do not edit manually.
5
- */
6
2
  Object.defineProperty(exports, "__esModule", { value: true });
7
3
  //# sourceMappingURL=PerpsController-method-action-types.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"PerpsController-method-action-types.cjs","sourceRoot":"","sources":["../src/PerpsController-method-action-types.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/**\n * This file is auto generated.\n * Do not edit manually.\n */\n\nimport type { PerpsController } from './PerpsController';\n\n/**\n * Place a new order\n * Thin delegation to TradingService\n *\n * @param params - The operation parameters.\n * @returns The order result with order ID and status.\n */\nexport type PerpsControllerPlaceOrderAction = {\n type: `PerpsController:placeOrder`;\n handler: PerpsController['placeOrder'];\n};\n\n/**\n * Edit an existing order\n * Thin delegation to TradingService\n *\n * @param params - The operation parameters.\n * @returns The updated order result with order ID and status.\n */\nexport type PerpsControllerEditOrderAction = {\n type: `PerpsController:editOrder`;\n handler: PerpsController['editOrder'];\n};\n\n/**\n * Cancel an existing order\n *\n * @param params - The operation parameters.\n * @returns The cancellation result with status.\n */\nexport type PerpsControllerCancelOrderAction = {\n type: `PerpsController:cancelOrder`;\n handler: PerpsController['cancelOrder'];\n};\n\n/**\n * Cancel multiple orders in parallel\n * Batch version of cancelOrder() that cancels multiple orders simultaneously\n *\n * @param params - The operation parameters.\n * @returns The batch cancellation results for each order.\n */\nexport type PerpsControllerCancelOrdersAction = {\n type: `PerpsController:cancelOrders`;\n handler: PerpsController['cancelOrders'];\n};\n\n/**\n * Close a position (partial or full)\n * Thin delegation to TradingService\n *\n * @param params - The operation parameters.\n * @returns The order result from the close position request.\n */\nexport type PerpsControllerClosePositionAction = {\n type: `PerpsController:closePosition`;\n handler: PerpsController['closePosition'];\n};\n\n/**\n * Close multiple positions in parallel\n * Batch version of closePosition() that closes multiple positions simultaneously\n *\n * @param params - The operation parameters.\n * @returns The batch close results for each position.\n */\nexport type PerpsControllerClosePositionsAction = {\n type: `PerpsController:closePositions`;\n handler: PerpsController['closePositions'];\n};\n\n/**\n * Withdraw funds from trading account\n *\n * The withdrawal process varies by provider and may involve:\n * - Direct on-chain transfers\n * - Bridge operations\n * - Multi-step validation processes\n *\n * Check the specific provider documentation for detailed withdrawal flows.\n *\n * @param params Withdrawal parameters\n * @returns WithdrawResult with withdrawal ID and tracking info\n */\nexport type PerpsControllerWithdrawAction = {\n type: `PerpsController:withdraw`;\n handler: PerpsController['withdraw'];\n};\n\n/**\n * Get current positions\n * Thin delegation to MarketDataService\n *\n * For standalone mode, bypasses getActiveProvider() to allow position queries\n * without full perps initialization (e.g., for showing positions on token details page)\n *\n * @param params - The operation parameters.\n * @returns Array of open positions for the active provider.\n */\nexport type PerpsControllerGetPositionsAction = {\n type: `PerpsController:getPositions`;\n handler: PerpsController['getPositions'];\n};\n\n/**\n * Get historical user fills (trade executions)\n * Thin delegation to MarketDataService\n *\n * @param params - The operation parameters.\n * @returns Array of historical trade executions (fills).\n */\nexport type PerpsControllerGetOrderFillsAction = {\n type: `PerpsController:getOrderFills`;\n handler: PerpsController['getOrderFills'];\n};\n\n/**\n * Get historical user orders (order lifecycle)\n * Thin delegation to MarketDataService\n *\n * @param params - The operation parameters.\n * @returns Array of historical orders.\n */\nexport type PerpsControllerGetOrdersAction = {\n type: `PerpsController:getOrders`;\n handler: PerpsController['getOrders'];\n};\n\n/**\n * Get currently open orders (real-time status)\n * Thin delegation to MarketDataService\n *\n * For standalone mode, bypasses getActiveProvider() to allow open order queries\n * without full perps initialization (e.g., for background preloading)\n *\n * @param params - The operation parameters.\n * @returns A promise that resolves to the result.\n */\nexport type PerpsControllerGetOpenOrdersAction = {\n type: `PerpsController:getOpenOrders`;\n handler: PerpsController['getOpenOrders'];\n};\n\n/**\n * Get historical user funding history (funding payments)\n * Thin delegation to MarketDataService\n *\n * @param params - The operation parameters.\n * @returns Array of historical funding payments.\n */\nexport type PerpsControllerGetFundingAction = {\n type: `PerpsController:getFunding`;\n handler: PerpsController['getFunding'];\n};\n\n/**\n * Get account state (balances, etc.)\n * Thin delegation to MarketDataService\n *\n * For standalone mode, bypasses getActiveProvider() to allow account state queries\n * without full perps initialization (e.g., for checking if user has perps funds)\n *\n * @param params - The operation parameters.\n * @returns A promise that resolves to the result.\n */\nexport type PerpsControllerGetAccountStateAction = {\n type: `PerpsController:getAccountState`;\n handler: PerpsController['getAccountState'];\n};\n\n/**\n * Get historical portfolio data\n * Thin delegation to MarketDataService\n *\n * @param params - The operation parameters.\n * @returns The historical portfolio data points.\n */\nexport type PerpsControllerGetHistoricalPortfolioAction = {\n type: `PerpsController:getHistoricalPortfolio`;\n handler: PerpsController['getHistoricalPortfolio'];\n};\n\n/**\n * Get available markets with optional filtering\n * Thin delegation to MarketDataService\n *\n * For standalone mode, bypasses getActiveProvider() to allow market discovery\n * without full perps initialization (e.g., for discovery banners on spot screens)\n *\n * @param params - The operation parameters.\n * @returns Array of available markets matching the filter criteria.\n */\nexport type PerpsControllerGetMarketsAction = {\n type: `PerpsController:getMarkets`;\n handler: PerpsController['getMarkets'];\n};\n\n/**\n * Toggle between testnet and mainnet\n *\n * @returns The toggle result with success status and current network mode.\n */\nexport type PerpsControllerToggleTestnetAction = {\n type: `PerpsController:toggleTestnet`;\n handler: PerpsController['toggleTestnet'];\n};\n\n/**\n * Calculate trading fees for the active provider\n * Each provider implements its own fee structure\n *\n * @param params - The operation parameters.\n * @returns The fee calculation result for the trade.\n */\nexport type PerpsControllerCalculateFeesAction = {\n type: `PerpsController:calculateFees`;\n handler: PerpsController['calculateFees'];\n};\n\n/**\n * Disconnect provider and cleanup subscriptions\n * Call this when navigating away from Perps screens to prevent battery drain\n */\nexport type PerpsControllerDisconnectAction = {\n type: `PerpsController:disconnect`;\n handler: PerpsController['disconnect'];\n};\n\n/**\n * Resume eligibility monitoring after onboarding completes.\n * Clears the deferred flag and triggers an immediate eligibility check\n * using the current remote feature flag state.\n */\nexport type PerpsControllerStartEligibilityMonitoringAction = {\n type: `PerpsController:startEligibilityMonitoring`;\n handler: PerpsController['startEligibilityMonitoring'];\n};\n\n/**\n * Stops geo-blocking eligibility monitoring.\n * Call this when the user disables basic functionality (e.g. useExternalServices becomes false).\n * Prevents geolocation calls until startEligibilityMonitoring() is called again.\n * Safe to call multiple times.\n */\nexport type PerpsControllerStopEligibilityMonitoringAction = {\n type: `PerpsController:stopEligibilityMonitoring`;\n handler: PerpsController['stopEligibilityMonitoring'];\n};\n\nexport type PerpsControllerRefreshEligibilityAction = {\n type: `PerpsController:refreshEligibility`;\n handler: PerpsController['refreshEligibility'];\n};\n\n/**\n * Mark that the user has completed the tutorial/onboarding\n * This prevents the tutorial from showing again\n */\nexport type PerpsControllerMarkTutorialCompletedAction = {\n type: `PerpsController:markTutorialCompleted`;\n handler: PerpsController['markTutorialCompleted'];\n};\n\nexport type PerpsControllerMarkFirstOrderCompletedAction = {\n type: `PerpsController:markFirstOrderCompleted`;\n handler: PerpsController['markFirstOrderCompleted'];\n};\n\n/**\n * Reset first-time user state for both networks\n * This is useful for testing the tutorial flow\n * Called by Reset Account feature in settings\n */\nexport type PerpsControllerResetFirstTimeUserStateAction = {\n type: `PerpsController:resetFirstTimeUserState`;\n handler: PerpsController['resetFirstTimeUserState'];\n};\n\n/**\n * Clear pending/bridging withdrawal and deposit requests\n * This is useful when users want to clear stuck pending indicators\n * Called by Reset Account feature in settings\n */\nexport type PerpsControllerClearPendingTransactionRequestsAction = {\n type: `PerpsController:clearPendingTransactionRequests`;\n handler: PerpsController['clearPendingTransactionRequests'];\n};\n\n/**\n * Get saved trade configuration for a market\n *\n * @param symbol - The trading pair symbol.\n * @returns The resulting string value.\n */\nexport type PerpsControllerGetTradeConfigurationAction = {\n type: `PerpsController:getTradeConfiguration`;\n handler: PerpsController['getTradeConfiguration'];\n};\n\n/**\n * Save trade configuration for a market\n *\n * @param symbol - Market symbol\n * @param leverage - Leverage value\n */\nexport type PerpsControllerSaveTradeConfigurationAction = {\n type: `PerpsController:saveTradeConfiguration`;\n handler: PerpsController['saveTradeConfiguration'];\n};\n\n/**\n * Save pending trade configuration for a market\n * This is a temporary configuration that expires after 5 minutes\n *\n * @param symbol - Market symbol\n * @param config - Pending trade configuration (includes optional selected payment token from Pay row)\n * @param config.amount - The amount value.\n * @param config.leverage - The leverage multiplier.\n * @param config.takeProfitPrice - The take profit price.\n * @param config.stopLossPrice - The stop loss price.\n * @param config.limitPrice - The limit price.\n * @param config.orderType - The order type.\n * @param config.selectedPaymentToken - The selected payment token.\n */\nexport type PerpsControllerSavePendingTradeConfigurationAction = {\n type: `PerpsController:savePendingTradeConfiguration`;\n handler: PerpsController['savePendingTradeConfiguration'];\n};\n\n/**\n * Get pending trade configuration for a market\n * Returns undefined if config doesn't exist or has expired (more than 5 minutes old)\n *\n * @param symbol - Market symbol\n * @returns Pending trade configuration or undefined\n */\nexport type PerpsControllerGetPendingTradeConfigurationAction = {\n type: `PerpsController:getPendingTradeConfiguration`;\n handler: PerpsController['getPendingTradeConfiguration'];\n};\n\n/**\n * Clear pending trade configuration for a market\n *\n * @param symbol - Market symbol\n */\nexport type PerpsControllerClearPendingTradeConfigurationAction = {\n type: `PerpsController:clearPendingTradeConfiguration`;\n handler: PerpsController['clearPendingTradeConfiguration'];\n};\n\n/**\n * Get saved market filter preferences\n * Handles backward compatibility with legacy string format\n *\n * @returns The saved sort option ID and direction.\n */\nexport type PerpsControllerGetMarketFilterPreferencesAction = {\n type: `PerpsController:getMarketFilterPreferences`;\n handler: PerpsController['getMarketFilterPreferences'];\n};\n\n/**\n * Save market filter preferences\n *\n * @param optionId - Sort/filter option ID\n * @param direction - Sort direction ('asc' or 'desc')\n */\nexport type PerpsControllerSaveMarketFilterPreferencesAction = {\n type: `PerpsController:saveMarketFilterPreferences`;\n handler: PerpsController['saveMarketFilterPreferences'];\n};\n\n/**\n * Set the selected payment token for the Perps order/deposit flow.\n * Pass null or a token with description PERPS_CONSTANTS.PerpsBalanceTokenDescription to select Perps balance.\n * Only required fields (address, chainId) are stored in state; description and symbol are optional.\n *\n * @param token - The token identifier.\n */\nexport type PerpsControllerSetSelectedPaymentTokenAction = {\n type: `PerpsController:setSelectedPaymentToken`;\n handler: PerpsController['setSelectedPaymentToken'];\n};\n\n/**\n * Reset the selected payment token to Perps balance (null).\n * Call when leaving the Perps order view so the next visit defaults to Perps balance.\n */\nexport type PerpsControllerResetSelectedPaymentTokenAction = {\n type: `PerpsController:resetSelectedPaymentToken`;\n handler: PerpsController['resetSelectedPaymentToken'];\n};\n\n/**\n * Get saved order book grouping for a market\n *\n * @param symbol - Market symbol\n * @returns The saved grouping value or undefined if not set\n */\nexport type PerpsControllerGetOrderBookGroupingAction = {\n type: `PerpsController:getOrderBookGrouping`;\n handler: PerpsController['getOrderBookGrouping'];\n};\n\n/**\n * Save order book grouping for a market\n *\n * @param symbol - Market symbol\n * @param grouping - Price grouping value\n */\nexport type PerpsControllerSaveOrderBookGroupingAction = {\n type: `PerpsController:saveOrderBookGrouping`;\n handler: PerpsController['saveOrderBookGrouping'];\n};\n\n/**\n * Union of all PerpsController action types.\n */\nexport type PerpsControllerMethodActions =\n | PerpsControllerPlaceOrderAction\n | PerpsControllerEditOrderAction\n | PerpsControllerCancelOrderAction\n | PerpsControllerCancelOrdersAction\n | PerpsControllerClosePositionAction\n | PerpsControllerClosePositionsAction\n | PerpsControllerWithdrawAction\n | PerpsControllerGetPositionsAction\n | PerpsControllerGetOrderFillsAction\n | PerpsControllerGetOrdersAction\n | PerpsControllerGetOpenOrdersAction\n | PerpsControllerGetFundingAction\n | PerpsControllerGetAccountStateAction\n | PerpsControllerGetHistoricalPortfolioAction\n | PerpsControllerGetMarketsAction\n | PerpsControllerToggleTestnetAction\n | PerpsControllerCalculateFeesAction\n | PerpsControllerDisconnectAction\n | PerpsControllerStartEligibilityMonitoringAction\n | PerpsControllerStopEligibilityMonitoringAction\n | PerpsControllerRefreshEligibilityAction\n | PerpsControllerMarkTutorialCompletedAction\n | PerpsControllerMarkFirstOrderCompletedAction\n | PerpsControllerResetFirstTimeUserStateAction\n | PerpsControllerClearPendingTransactionRequestsAction\n | PerpsControllerGetTradeConfigurationAction\n | PerpsControllerSaveTradeConfigurationAction\n | PerpsControllerSavePendingTradeConfigurationAction\n | PerpsControllerGetPendingTradeConfigurationAction\n | PerpsControllerClearPendingTradeConfigurationAction\n | PerpsControllerGetMarketFilterPreferencesAction\n | PerpsControllerSaveMarketFilterPreferencesAction\n | PerpsControllerSetSelectedPaymentTokenAction\n | PerpsControllerResetSelectedPaymentTokenAction\n | PerpsControllerGetOrderBookGroupingAction\n | PerpsControllerSaveOrderBookGroupingAction;\n"]}
1
+ {"version":3,"file":"PerpsController-method-action-types.cjs","sourceRoot":"","sources":["../src/PerpsController-method-action-types.ts"],"names":[],"mappings":"","sourcesContent":["import type { PerpsController } from './PerpsController';\n\nexport type PerpsControllerPlaceOrderAction = {\n type: 'PerpsController:placeOrder';\n handler: PerpsController['placeOrder'];\n};\n\nexport type PerpsControllerEditOrderAction = {\n type: 'PerpsController:editOrder';\n handler: PerpsController['editOrder'];\n};\n\nexport type PerpsControllerCancelOrderAction = {\n type: 'PerpsController:cancelOrder';\n handler: PerpsController['cancelOrder'];\n};\n\nexport type PerpsControllerCancelOrdersAction = {\n type: 'PerpsController:cancelOrders';\n handler: PerpsController['cancelOrders'];\n};\n\nexport type PerpsControllerClosePositionAction = {\n type: 'PerpsController:closePosition';\n handler: PerpsController['closePosition'];\n};\n\nexport type PerpsControllerClosePositionsAction = {\n type: 'PerpsController:closePositions';\n handler: PerpsController['closePositions'];\n};\n\nexport type PerpsControllerWithdrawAction = {\n type: 'PerpsController:withdraw';\n handler: PerpsController['withdraw'];\n};\n\nexport type PerpsControllerGetPositionsAction = {\n type: 'PerpsController:getPositions';\n handler: PerpsController['getPositions'];\n};\n\nexport type PerpsControllerGetOrderFillsAction = {\n type: 'PerpsController:getOrderFills';\n handler: PerpsController['getOrderFills'];\n};\n\nexport type PerpsControllerGetOrdersAction = {\n type: 'PerpsController:getOrders';\n handler: PerpsController['getOrders'];\n};\n\nexport type PerpsControllerGetOpenOrdersAction = {\n type: 'PerpsController:getOpenOrders';\n handler: PerpsController['getOpenOrders'];\n};\n\nexport type PerpsControllerGetFundingAction = {\n type: 'PerpsController:getFunding';\n handler: PerpsController['getFunding'];\n};\n\nexport type PerpsControllerGetAccountStateAction = {\n type: 'PerpsController:getAccountState';\n handler: PerpsController['getAccountState'];\n};\n\nexport type PerpsControllerGetMarketsAction = {\n type: 'PerpsController:getMarkets';\n handler: PerpsController['getMarkets'];\n};\n\nexport type PerpsControllerRefreshEligibilityAction = {\n type: 'PerpsController:refreshEligibility';\n handler: PerpsController['refreshEligibility'];\n};\n\nexport type PerpsControllerToggleTestnetAction = {\n type: 'PerpsController:toggleTestnet';\n handler: PerpsController['toggleTestnet'];\n};\n\nexport type PerpsControllerDisconnectAction = {\n type: 'PerpsController:disconnect';\n handler: PerpsController['disconnect'];\n};\n\nexport type PerpsControllerCalculateFeesAction = {\n type: 'PerpsController:calculateFees';\n handler: PerpsController['calculateFees'];\n};\n\nexport type PerpsControllerMarkTutorialCompletedAction = {\n type: 'PerpsController:markTutorialCompleted';\n handler: PerpsController['markTutorialCompleted'];\n};\n\nexport type PerpsControllerMarkFirstOrderCompletedAction = {\n type: 'PerpsController:markFirstOrderCompleted';\n handler: PerpsController['markFirstOrderCompleted'];\n};\n\nexport type PerpsControllerGetHistoricalPortfolioAction = {\n type: 'PerpsController:getHistoricalPortfolio';\n handler: PerpsController['getHistoricalPortfolio'];\n};\n\nexport type PerpsControllerResetFirstTimeUserStateAction = {\n type: 'PerpsController:resetFirstTimeUserState';\n handler: PerpsController['resetFirstTimeUserState'];\n};\n\nexport type PerpsControllerClearPendingTransactionRequestsAction = {\n type: 'PerpsController:clearPendingTransactionRequests';\n handler: PerpsController['clearPendingTransactionRequests'];\n};\n\nexport type PerpsControllerSaveTradeConfigurationAction = {\n type: 'PerpsController:saveTradeConfiguration';\n handler: PerpsController['saveTradeConfiguration'];\n};\n\nexport type PerpsControllerGetTradeConfigurationAction = {\n type: 'PerpsController:getTradeConfiguration';\n handler: PerpsController['getTradeConfiguration'];\n};\n\nexport type PerpsControllerSaveMarketFilterPreferencesAction = {\n type: 'PerpsController:saveMarketFilterPreferences';\n handler: PerpsController['saveMarketFilterPreferences'];\n};\n\nexport type PerpsControllerGetMarketFilterPreferencesAction = {\n type: 'PerpsController:getMarketFilterPreferences';\n handler: PerpsController['getMarketFilterPreferences'];\n};\n\nexport type PerpsControllerSavePendingTradeConfigurationAction = {\n type: 'PerpsController:savePendingTradeConfiguration';\n handler: PerpsController['savePendingTradeConfiguration'];\n};\n\nexport type PerpsControllerGetPendingTradeConfigurationAction = {\n type: 'PerpsController:getPendingTradeConfiguration';\n handler: PerpsController['getPendingTradeConfiguration'];\n};\n\nexport type PerpsControllerClearPendingTradeConfigurationAction = {\n type: 'PerpsController:clearPendingTradeConfiguration';\n handler: PerpsController['clearPendingTradeConfiguration'];\n};\n\nexport type PerpsControllerGetOrderBookGroupingAction = {\n type: 'PerpsController:getOrderBookGrouping';\n handler: PerpsController['getOrderBookGrouping'];\n};\n\nexport type PerpsControllerSaveOrderBookGroupingAction = {\n type: 'PerpsController:saveOrderBookGrouping';\n handler: PerpsController['saveOrderBookGrouping'];\n};\n\nexport type PerpsControllerSetSelectedPaymentTokenAction = {\n type: 'PerpsController:setSelectedPaymentToken';\n handler: PerpsController['setSelectedPaymentToken'];\n};\n\nexport type PerpsControllerResetSelectedPaymentTokenAction = {\n type: 'PerpsController:resetSelectedPaymentToken';\n handler: PerpsController['resetSelectedPaymentToken'];\n};\n\nexport type PerpsControllerStartEligibilityMonitoringAction = {\n type: 'PerpsController:startEligibilityMonitoring';\n handler: PerpsController['startEligibilityMonitoring'];\n};\n\nexport type PerpsControllerStopEligibilityMonitoringAction = {\n type: 'PerpsController:stopEligibilityMonitoring';\n handler: PerpsController['stopEligibilityMonitoring'];\n};\n\nexport type PerpsControllerMethodActions =\n | PerpsControllerPlaceOrderAction\n | PerpsControllerEditOrderAction\n | PerpsControllerCancelOrderAction\n | PerpsControllerCancelOrdersAction\n | PerpsControllerClosePositionAction\n | PerpsControllerClosePositionsAction\n | PerpsControllerWithdrawAction\n | PerpsControllerGetPositionsAction\n | PerpsControllerGetOrderFillsAction\n | PerpsControllerGetOrdersAction\n | PerpsControllerGetOpenOrdersAction\n | PerpsControllerGetFundingAction\n | PerpsControllerGetAccountStateAction\n | PerpsControllerGetMarketsAction\n | PerpsControllerRefreshEligibilityAction\n | PerpsControllerToggleTestnetAction\n | PerpsControllerDisconnectAction\n | PerpsControllerCalculateFeesAction\n | PerpsControllerMarkTutorialCompletedAction\n | PerpsControllerMarkFirstOrderCompletedAction\n | PerpsControllerGetHistoricalPortfolioAction\n | PerpsControllerResetFirstTimeUserStateAction\n | PerpsControllerClearPendingTransactionRequestsAction\n | PerpsControllerSaveTradeConfigurationAction\n | PerpsControllerGetTradeConfigurationAction\n | PerpsControllerSaveMarketFilterPreferencesAction\n | PerpsControllerGetMarketFilterPreferencesAction\n | PerpsControllerSavePendingTradeConfigurationAction\n | PerpsControllerGetPendingTradeConfigurationAction\n | PerpsControllerClearPendingTradeConfigurationAction\n | PerpsControllerGetOrderBookGroupingAction\n | PerpsControllerSaveOrderBookGroupingAction\n | PerpsControllerSetSelectedPaymentTokenAction\n | PerpsControllerResetSelectedPaymentTokenAction\n | PerpsControllerStartEligibilityMonitoringAction\n | PerpsControllerStopEligibilityMonitoringAction;\n"]}
@@ -1,390 +1,147 @@
1
- /**
2
- * This file is auto generated.
3
- * Do not edit manually.
4
- */
5
1
  import type { PerpsController } from "./PerpsController.cjs";
6
- /**
7
- * Place a new order
8
- * Thin delegation to TradingService
9
- *
10
- * @param params - The operation parameters.
11
- * @returns The order result with order ID and status.
12
- */
13
2
  export type PerpsControllerPlaceOrderAction = {
14
- type: `PerpsController:placeOrder`;
3
+ type: 'PerpsController:placeOrder';
15
4
  handler: PerpsController['placeOrder'];
16
5
  };
17
- /**
18
- * Edit an existing order
19
- * Thin delegation to TradingService
20
- *
21
- * @param params - The operation parameters.
22
- * @returns The updated order result with order ID and status.
23
- */
24
6
  export type PerpsControllerEditOrderAction = {
25
- type: `PerpsController:editOrder`;
7
+ type: 'PerpsController:editOrder';
26
8
  handler: PerpsController['editOrder'];
27
9
  };
28
- /**
29
- * Cancel an existing order
30
- *
31
- * @param params - The operation parameters.
32
- * @returns The cancellation result with status.
33
- */
34
10
  export type PerpsControllerCancelOrderAction = {
35
- type: `PerpsController:cancelOrder`;
11
+ type: 'PerpsController:cancelOrder';
36
12
  handler: PerpsController['cancelOrder'];
37
13
  };
38
- /**
39
- * Cancel multiple orders in parallel
40
- * Batch version of cancelOrder() that cancels multiple orders simultaneously
41
- *
42
- * @param params - The operation parameters.
43
- * @returns The batch cancellation results for each order.
44
- */
45
14
  export type PerpsControllerCancelOrdersAction = {
46
- type: `PerpsController:cancelOrders`;
15
+ type: 'PerpsController:cancelOrders';
47
16
  handler: PerpsController['cancelOrders'];
48
17
  };
49
- /**
50
- * Close a position (partial or full)
51
- * Thin delegation to TradingService
52
- *
53
- * @param params - The operation parameters.
54
- * @returns The order result from the close position request.
55
- */
56
18
  export type PerpsControllerClosePositionAction = {
57
- type: `PerpsController:closePosition`;
19
+ type: 'PerpsController:closePosition';
58
20
  handler: PerpsController['closePosition'];
59
21
  };
60
- /**
61
- * Close multiple positions in parallel
62
- * Batch version of closePosition() that closes multiple positions simultaneously
63
- *
64
- * @param params - The operation parameters.
65
- * @returns The batch close results for each position.
66
- */
67
22
  export type PerpsControllerClosePositionsAction = {
68
- type: `PerpsController:closePositions`;
23
+ type: 'PerpsController:closePositions';
69
24
  handler: PerpsController['closePositions'];
70
25
  };
71
- /**
72
- * Withdraw funds from trading account
73
- *
74
- * The withdrawal process varies by provider and may involve:
75
- * - Direct on-chain transfers
76
- * - Bridge operations
77
- * - Multi-step validation processes
78
- *
79
- * Check the specific provider documentation for detailed withdrawal flows.
80
- *
81
- * @param params Withdrawal parameters
82
- * @returns WithdrawResult with withdrawal ID and tracking info
83
- */
84
26
  export type PerpsControllerWithdrawAction = {
85
- type: `PerpsController:withdraw`;
27
+ type: 'PerpsController:withdraw';
86
28
  handler: PerpsController['withdraw'];
87
29
  };
88
- /**
89
- * Get current positions
90
- * Thin delegation to MarketDataService
91
- *
92
- * For standalone mode, bypasses getActiveProvider() to allow position queries
93
- * without full perps initialization (e.g., for showing positions on token details page)
94
- *
95
- * @param params - The operation parameters.
96
- * @returns Array of open positions for the active provider.
97
- */
98
30
  export type PerpsControllerGetPositionsAction = {
99
- type: `PerpsController:getPositions`;
31
+ type: 'PerpsController:getPositions';
100
32
  handler: PerpsController['getPositions'];
101
33
  };
102
- /**
103
- * Get historical user fills (trade executions)
104
- * Thin delegation to MarketDataService
105
- *
106
- * @param params - The operation parameters.
107
- * @returns Array of historical trade executions (fills).
108
- */
109
34
  export type PerpsControllerGetOrderFillsAction = {
110
- type: `PerpsController:getOrderFills`;
35
+ type: 'PerpsController:getOrderFills';
111
36
  handler: PerpsController['getOrderFills'];
112
37
  };
113
- /**
114
- * Get historical user orders (order lifecycle)
115
- * Thin delegation to MarketDataService
116
- *
117
- * @param params - The operation parameters.
118
- * @returns Array of historical orders.
119
- */
120
38
  export type PerpsControllerGetOrdersAction = {
121
- type: `PerpsController:getOrders`;
39
+ type: 'PerpsController:getOrders';
122
40
  handler: PerpsController['getOrders'];
123
41
  };
124
- /**
125
- * Get currently open orders (real-time status)
126
- * Thin delegation to MarketDataService
127
- *
128
- * For standalone mode, bypasses getActiveProvider() to allow open order queries
129
- * without full perps initialization (e.g., for background preloading)
130
- *
131
- * @param params - The operation parameters.
132
- * @returns A promise that resolves to the result.
133
- */
134
42
  export type PerpsControllerGetOpenOrdersAction = {
135
- type: `PerpsController:getOpenOrders`;
43
+ type: 'PerpsController:getOpenOrders';
136
44
  handler: PerpsController['getOpenOrders'];
137
45
  };
138
- /**
139
- * Get historical user funding history (funding payments)
140
- * Thin delegation to MarketDataService
141
- *
142
- * @param params - The operation parameters.
143
- * @returns Array of historical funding payments.
144
- */
145
46
  export type PerpsControllerGetFundingAction = {
146
- type: `PerpsController:getFunding`;
47
+ type: 'PerpsController:getFunding';
147
48
  handler: PerpsController['getFunding'];
148
49
  };
149
- /**
150
- * Get account state (balances, etc.)
151
- * Thin delegation to MarketDataService
152
- *
153
- * For standalone mode, bypasses getActiveProvider() to allow account state queries
154
- * without full perps initialization (e.g., for checking if user has perps funds)
155
- *
156
- * @param params - The operation parameters.
157
- * @returns A promise that resolves to the result.
158
- */
159
50
  export type PerpsControllerGetAccountStateAction = {
160
- type: `PerpsController:getAccountState`;
51
+ type: 'PerpsController:getAccountState';
161
52
  handler: PerpsController['getAccountState'];
162
53
  };
163
- /**
164
- * Get historical portfolio data
165
- * Thin delegation to MarketDataService
166
- *
167
- * @param params - The operation parameters.
168
- * @returns The historical portfolio data points.
169
- */
170
- export type PerpsControllerGetHistoricalPortfolioAction = {
171
- type: `PerpsController:getHistoricalPortfolio`;
172
- handler: PerpsController['getHistoricalPortfolio'];
173
- };
174
- /**
175
- * Get available markets with optional filtering
176
- * Thin delegation to MarketDataService
177
- *
178
- * For standalone mode, bypasses getActiveProvider() to allow market discovery
179
- * without full perps initialization (e.g., for discovery banners on spot screens)
180
- *
181
- * @param params - The operation parameters.
182
- * @returns Array of available markets matching the filter criteria.
183
- */
184
54
  export type PerpsControllerGetMarketsAction = {
185
- type: `PerpsController:getMarkets`;
55
+ type: 'PerpsController:getMarkets';
186
56
  handler: PerpsController['getMarkets'];
187
57
  };
188
- /**
189
- * Toggle between testnet and mainnet
190
- *
191
- * @returns The toggle result with success status and current network mode.
192
- */
58
+ export type PerpsControllerRefreshEligibilityAction = {
59
+ type: 'PerpsController:refreshEligibility';
60
+ handler: PerpsController['refreshEligibility'];
61
+ };
193
62
  export type PerpsControllerToggleTestnetAction = {
194
- type: `PerpsController:toggleTestnet`;
63
+ type: 'PerpsController:toggleTestnet';
195
64
  handler: PerpsController['toggleTestnet'];
196
65
  };
197
- /**
198
- * Calculate trading fees for the active provider
199
- * Each provider implements its own fee structure
200
- *
201
- * @param params - The operation parameters.
202
- * @returns The fee calculation result for the trade.
203
- */
204
- export type PerpsControllerCalculateFeesAction = {
205
- type: `PerpsController:calculateFees`;
206
- handler: PerpsController['calculateFees'];
207
- };
208
- /**
209
- * Disconnect provider and cleanup subscriptions
210
- * Call this when navigating away from Perps screens to prevent battery drain
211
- */
212
66
  export type PerpsControllerDisconnectAction = {
213
- type: `PerpsController:disconnect`;
67
+ type: 'PerpsController:disconnect';
214
68
  handler: PerpsController['disconnect'];
215
69
  };
216
- /**
217
- * Resume eligibility monitoring after onboarding completes.
218
- * Clears the deferred flag and triggers an immediate eligibility check
219
- * using the current remote feature flag state.
220
- */
221
- export type PerpsControllerStartEligibilityMonitoringAction = {
222
- type: `PerpsController:startEligibilityMonitoring`;
223
- handler: PerpsController['startEligibilityMonitoring'];
224
- };
225
- /**
226
- * Stops geo-blocking eligibility monitoring.
227
- * Call this when the user disables basic functionality (e.g. useExternalServices becomes false).
228
- * Prevents geolocation calls until startEligibilityMonitoring() is called again.
229
- * Safe to call multiple times.
230
- */
231
- export type PerpsControllerStopEligibilityMonitoringAction = {
232
- type: `PerpsController:stopEligibilityMonitoring`;
233
- handler: PerpsController['stopEligibilityMonitoring'];
234
- };
235
- export type PerpsControllerRefreshEligibilityAction = {
236
- type: `PerpsController:refreshEligibility`;
237
- handler: PerpsController['refreshEligibility'];
70
+ export type PerpsControllerCalculateFeesAction = {
71
+ type: 'PerpsController:calculateFees';
72
+ handler: PerpsController['calculateFees'];
238
73
  };
239
- /**
240
- * Mark that the user has completed the tutorial/onboarding
241
- * This prevents the tutorial from showing again
242
- */
243
74
  export type PerpsControllerMarkTutorialCompletedAction = {
244
- type: `PerpsController:markTutorialCompleted`;
75
+ type: 'PerpsController:markTutorialCompleted';
245
76
  handler: PerpsController['markTutorialCompleted'];
246
77
  };
247
78
  export type PerpsControllerMarkFirstOrderCompletedAction = {
248
- type: `PerpsController:markFirstOrderCompleted`;
79
+ type: 'PerpsController:markFirstOrderCompleted';
249
80
  handler: PerpsController['markFirstOrderCompleted'];
250
81
  };
251
- /**
252
- * Reset first-time user state for both networks
253
- * This is useful for testing the tutorial flow
254
- * Called by Reset Account feature in settings
255
- */
82
+ export type PerpsControllerGetHistoricalPortfolioAction = {
83
+ type: 'PerpsController:getHistoricalPortfolio';
84
+ handler: PerpsController['getHistoricalPortfolio'];
85
+ };
256
86
  export type PerpsControllerResetFirstTimeUserStateAction = {
257
- type: `PerpsController:resetFirstTimeUserState`;
87
+ type: 'PerpsController:resetFirstTimeUserState';
258
88
  handler: PerpsController['resetFirstTimeUserState'];
259
89
  };
260
- /**
261
- * Clear pending/bridging withdrawal and deposit requests
262
- * This is useful when users want to clear stuck pending indicators
263
- * Called by Reset Account feature in settings
264
- */
265
90
  export type PerpsControllerClearPendingTransactionRequestsAction = {
266
- type: `PerpsController:clearPendingTransactionRequests`;
91
+ type: 'PerpsController:clearPendingTransactionRequests';
267
92
  handler: PerpsController['clearPendingTransactionRequests'];
268
93
  };
269
- /**
270
- * Get saved trade configuration for a market
271
- *
272
- * @param symbol - The trading pair symbol.
273
- * @returns The resulting string value.
274
- */
94
+ export type PerpsControllerSaveTradeConfigurationAction = {
95
+ type: 'PerpsController:saveTradeConfiguration';
96
+ handler: PerpsController['saveTradeConfiguration'];
97
+ };
275
98
  export type PerpsControllerGetTradeConfigurationAction = {
276
- type: `PerpsController:getTradeConfiguration`;
99
+ type: 'PerpsController:getTradeConfiguration';
277
100
  handler: PerpsController['getTradeConfiguration'];
278
101
  };
279
- /**
280
- * Save trade configuration for a market
281
- *
282
- * @param symbol - Market symbol
283
- * @param leverage - Leverage value
284
- */
285
- export type PerpsControllerSaveTradeConfigurationAction = {
286
- type: `PerpsController:saveTradeConfiguration`;
287
- handler: PerpsController['saveTradeConfiguration'];
102
+ export type PerpsControllerSaveMarketFilterPreferencesAction = {
103
+ type: 'PerpsController:saveMarketFilterPreferences';
104
+ handler: PerpsController['saveMarketFilterPreferences'];
105
+ };
106
+ export type PerpsControllerGetMarketFilterPreferencesAction = {
107
+ type: 'PerpsController:getMarketFilterPreferences';
108
+ handler: PerpsController['getMarketFilterPreferences'];
288
109
  };
289
- /**
290
- * Save pending trade configuration for a market
291
- * This is a temporary configuration that expires after 5 minutes
292
- *
293
- * @param symbol - Market symbol
294
- * @param config - Pending trade configuration (includes optional selected payment token from Pay row)
295
- * @param config.amount - The amount value.
296
- * @param config.leverage - The leverage multiplier.
297
- * @param config.takeProfitPrice - The take profit price.
298
- * @param config.stopLossPrice - The stop loss price.
299
- * @param config.limitPrice - The limit price.
300
- * @param config.orderType - The order type.
301
- * @param config.selectedPaymentToken - The selected payment token.
302
- */
303
110
  export type PerpsControllerSavePendingTradeConfigurationAction = {
304
- type: `PerpsController:savePendingTradeConfiguration`;
111
+ type: 'PerpsController:savePendingTradeConfiguration';
305
112
  handler: PerpsController['savePendingTradeConfiguration'];
306
113
  };
307
- /**
308
- * Get pending trade configuration for a market
309
- * Returns undefined if config doesn't exist or has expired (more than 5 minutes old)
310
- *
311
- * @param symbol - Market symbol
312
- * @returns Pending trade configuration or undefined
313
- */
314
114
  export type PerpsControllerGetPendingTradeConfigurationAction = {
315
- type: `PerpsController:getPendingTradeConfiguration`;
115
+ type: 'PerpsController:getPendingTradeConfiguration';
316
116
  handler: PerpsController['getPendingTradeConfiguration'];
317
117
  };
318
- /**
319
- * Clear pending trade configuration for a market
320
- *
321
- * @param symbol - Market symbol
322
- */
323
118
  export type PerpsControllerClearPendingTradeConfigurationAction = {
324
- type: `PerpsController:clearPendingTradeConfiguration`;
119
+ type: 'PerpsController:clearPendingTradeConfiguration';
325
120
  handler: PerpsController['clearPendingTradeConfiguration'];
326
121
  };
327
- /**
328
- * Get saved market filter preferences
329
- * Handles backward compatibility with legacy string format
330
- *
331
- * @returns The saved sort option ID and direction.
332
- */
333
- export type PerpsControllerGetMarketFilterPreferencesAction = {
334
- type: `PerpsController:getMarketFilterPreferences`;
335
- handler: PerpsController['getMarketFilterPreferences'];
122
+ export type PerpsControllerGetOrderBookGroupingAction = {
123
+ type: 'PerpsController:getOrderBookGrouping';
124
+ handler: PerpsController['getOrderBookGrouping'];
336
125
  };
337
- /**
338
- * Save market filter preferences
339
- *
340
- * @param optionId - Sort/filter option ID
341
- * @param direction - Sort direction ('asc' or 'desc')
342
- */
343
- export type PerpsControllerSaveMarketFilterPreferencesAction = {
344
- type: `PerpsController:saveMarketFilterPreferences`;
345
- handler: PerpsController['saveMarketFilterPreferences'];
126
+ export type PerpsControllerSaveOrderBookGroupingAction = {
127
+ type: 'PerpsController:saveOrderBookGrouping';
128
+ handler: PerpsController['saveOrderBookGrouping'];
346
129
  };
347
- /**
348
- * Set the selected payment token for the Perps order/deposit flow.
349
- * Pass null or a token with description PERPS_CONSTANTS.PerpsBalanceTokenDescription to select Perps balance.
350
- * Only required fields (address, chainId) are stored in state; description and symbol are optional.
351
- *
352
- * @param token - The token identifier.
353
- */
354
130
  export type PerpsControllerSetSelectedPaymentTokenAction = {
355
- type: `PerpsController:setSelectedPaymentToken`;
131
+ type: 'PerpsController:setSelectedPaymentToken';
356
132
  handler: PerpsController['setSelectedPaymentToken'];
357
133
  };
358
- /**
359
- * Reset the selected payment token to Perps balance (null).
360
- * Call when leaving the Perps order view so the next visit defaults to Perps balance.
361
- */
362
134
  export type PerpsControllerResetSelectedPaymentTokenAction = {
363
- type: `PerpsController:resetSelectedPaymentToken`;
135
+ type: 'PerpsController:resetSelectedPaymentToken';
364
136
  handler: PerpsController['resetSelectedPaymentToken'];
365
137
  };
366
- /**
367
- * Get saved order book grouping for a market
368
- *
369
- * @param symbol - Market symbol
370
- * @returns The saved grouping value or undefined if not set
371
- */
372
- export type PerpsControllerGetOrderBookGroupingAction = {
373
- type: `PerpsController:getOrderBookGrouping`;
374
- handler: PerpsController['getOrderBookGrouping'];
138
+ export type PerpsControllerStartEligibilityMonitoringAction = {
139
+ type: 'PerpsController:startEligibilityMonitoring';
140
+ handler: PerpsController['startEligibilityMonitoring'];
375
141
  };
376
- /**
377
- * Save order book grouping for a market
378
- *
379
- * @param symbol - Market symbol
380
- * @param grouping - Price grouping value
381
- */
382
- export type PerpsControllerSaveOrderBookGroupingAction = {
383
- type: `PerpsController:saveOrderBookGrouping`;
384
- handler: PerpsController['saveOrderBookGrouping'];
142
+ export type PerpsControllerStopEligibilityMonitoringAction = {
143
+ type: 'PerpsController:stopEligibilityMonitoring';
144
+ handler: PerpsController['stopEligibilityMonitoring'];
385
145
  };
386
- /**
387
- * Union of all PerpsController action types.
388
- */
389
- export type PerpsControllerMethodActions = PerpsControllerPlaceOrderAction | PerpsControllerEditOrderAction | PerpsControllerCancelOrderAction | PerpsControllerCancelOrdersAction | PerpsControllerClosePositionAction | PerpsControllerClosePositionsAction | PerpsControllerWithdrawAction | PerpsControllerGetPositionsAction | PerpsControllerGetOrderFillsAction | PerpsControllerGetOrdersAction | PerpsControllerGetOpenOrdersAction | PerpsControllerGetFundingAction | PerpsControllerGetAccountStateAction | PerpsControllerGetHistoricalPortfolioAction | PerpsControllerGetMarketsAction | PerpsControllerToggleTestnetAction | PerpsControllerCalculateFeesAction | PerpsControllerDisconnectAction | PerpsControllerStartEligibilityMonitoringAction | PerpsControllerStopEligibilityMonitoringAction | PerpsControllerRefreshEligibilityAction | PerpsControllerMarkTutorialCompletedAction | PerpsControllerMarkFirstOrderCompletedAction | PerpsControllerResetFirstTimeUserStateAction | PerpsControllerClearPendingTransactionRequestsAction | PerpsControllerGetTradeConfigurationAction | PerpsControllerSaveTradeConfigurationAction | PerpsControllerSavePendingTradeConfigurationAction | PerpsControllerGetPendingTradeConfigurationAction | PerpsControllerClearPendingTradeConfigurationAction | PerpsControllerGetMarketFilterPreferencesAction | PerpsControllerSaveMarketFilterPreferencesAction | PerpsControllerSetSelectedPaymentTokenAction | PerpsControllerResetSelectedPaymentTokenAction | PerpsControllerGetOrderBookGroupingAction | PerpsControllerSaveOrderBookGroupingAction;
146
+ export type PerpsControllerMethodActions = PerpsControllerPlaceOrderAction | PerpsControllerEditOrderAction | PerpsControllerCancelOrderAction | PerpsControllerCancelOrdersAction | PerpsControllerClosePositionAction | PerpsControllerClosePositionsAction | PerpsControllerWithdrawAction | PerpsControllerGetPositionsAction | PerpsControllerGetOrderFillsAction | PerpsControllerGetOrdersAction | PerpsControllerGetOpenOrdersAction | PerpsControllerGetFundingAction | PerpsControllerGetAccountStateAction | PerpsControllerGetMarketsAction | PerpsControllerRefreshEligibilityAction | PerpsControllerToggleTestnetAction | PerpsControllerDisconnectAction | PerpsControllerCalculateFeesAction | PerpsControllerMarkTutorialCompletedAction | PerpsControllerMarkFirstOrderCompletedAction | PerpsControllerGetHistoricalPortfolioAction | PerpsControllerResetFirstTimeUserStateAction | PerpsControllerClearPendingTransactionRequestsAction | PerpsControllerSaveTradeConfigurationAction | PerpsControllerGetTradeConfigurationAction | PerpsControllerSaveMarketFilterPreferencesAction | PerpsControllerGetMarketFilterPreferencesAction | PerpsControllerSavePendingTradeConfigurationAction | PerpsControllerGetPendingTradeConfigurationAction | PerpsControllerClearPendingTradeConfigurationAction | PerpsControllerGetOrderBookGroupingAction | PerpsControllerSaveOrderBookGroupingAction | PerpsControllerSetSelectedPaymentTokenAction | PerpsControllerResetSelectedPaymentTokenAction | PerpsControllerStartEligibilityMonitoringAction | PerpsControllerStopEligibilityMonitoringAction;
390
147
  //# sourceMappingURL=PerpsController-method-action-types.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"PerpsController-method-action-types.d.cts","sourceRoot":"","sources":["../src/PerpsController-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,8BAA0B;AAEzD;;;;;;GAMG;AACH,MAAM,MAAM,+BAA+B,GAA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,EAAE,eAAe,CAAC,sBAAsB,CAAC,CAAC;CAClD,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,0CAA0C,GAAG;IACvD,IAAI,EAAE,uCAAuC,CAAC;IAC9C,OAAO,EAAE,eAAe,CAAC,uBAAuB,CAAC,CAAC;CACnD,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,4BAA4B,GACpC,+BAA+B,GAC/B,8BAA8B,GAC9B,gCAAgC,GAChC,iCAAiC,GACjC,kCAAkC,GAClC,mCAAmC,GACnC,6BAA6B,GAC7B,iCAAiC,GACjC,kCAAkC,GAClC,8BAA8B,GAC9B,kCAAkC,GAClC,+BAA+B,GAC/B,oCAAoC,GACpC,2CAA2C,GAC3C,+BAA+B,GAC/B,kCAAkC,GAClC,kCAAkC,GAClC,+BAA+B,GAC/B,+CAA+C,GAC/C,8CAA8C,GAC9C,uCAAuC,GACvC,0CAA0C,GAC1C,4CAA4C,GAC5C,4CAA4C,GAC5C,oDAAoD,GACpD,0CAA0C,GAC1C,2CAA2C,GAC3C,kDAAkD,GAClD,iDAAiD,GACjD,mDAAmD,GACnD,+CAA+C,GAC/C,gDAAgD,GAChD,4CAA4C,GAC5C,8CAA8C,GAC9C,yCAAyC,GACzC,0CAA0C,CAAC"}
1
+ {"version":3,"file":"PerpsController-method-action-types.d.cts","sourceRoot":"","sources":["../src/PerpsController-method-action-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,8BAA0B;AAEzD,MAAM,MAAM,+BAA+B,GAAG;IAC5C,IAAI,EAAE,4BAA4B,CAAC;IACnC,OAAO,EAAE,eAAe,CAAC,YAAY,CAAC,CAAC;CACxC,CAAC;AAEF,MAAM,MAAM,8BAA8B,GAAG;IAC3C,IAAI,EAAE,2BAA2B,CAAC;IAClC,OAAO,EAAE,eAAe,CAAC,WAAW,CAAC,CAAC;CACvC,CAAC;AAEF,MAAM,MAAM,gCAAgC,GAAG;IAC7C,IAAI,EAAE,6BAA6B,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
- */
5
1
  import type { PerpsController } from "./PerpsController.mjs";
6
- /**
7
- * Place a new order
8
- * Thin delegation to TradingService
9
- *
10
- * @param params - The operation parameters.
11
- * @returns The order result with order ID and status.
12
- */
13
2
  export type PerpsControllerPlaceOrderAction = {
14
- type: `PerpsController:placeOrder`;
3
+ type: 'PerpsController:placeOrder';
15
4
  handler: PerpsController['placeOrder'];
16
5
  };
17
- /**
18
- * Edit an existing order
19
- * Thin delegation to TradingService
20
- *
21
- * @param params - The operation parameters.
22
- * @returns The updated order result with order ID and status.
23
- */
24
6
  export type PerpsControllerEditOrderAction = {
25
- type: `PerpsController:editOrder`;
7
+ type: 'PerpsController:editOrder';
26
8
  handler: PerpsController['editOrder'];
27
9
  };
28
- /**
29
- * Cancel an existing order
30
- *
31
- * @param params - The operation parameters.
32
- * @returns The cancellation result with status.
33
- */
34
10
  export type PerpsControllerCancelOrderAction = {
35
- type: `PerpsController:cancelOrder`;
11
+ type: 'PerpsController:cancelOrder';
36
12
  handler: PerpsController['cancelOrder'];
37
13
  };
38
- /**
39
- * Cancel multiple orders in parallel
40
- * Batch version of cancelOrder() that cancels multiple orders simultaneously
41
- *
42
- * @param params - The operation parameters.
43
- * @returns The batch cancellation results for each order.
44
- */
45
14
  export type PerpsControllerCancelOrdersAction = {
46
- type: `PerpsController:cancelOrders`;
15
+ type: 'PerpsController:cancelOrders';
47
16
  handler: PerpsController['cancelOrders'];
48
17
  };
49
- /**
50
- * Close a position (partial or full)
51
- * Thin delegation to TradingService
52
- *
53
- * @param params - The operation parameters.
54
- * @returns The order result from the close position request.
55
- */
56
18
  export type PerpsControllerClosePositionAction = {
57
- type: `PerpsController:closePosition`;
19
+ type: 'PerpsController:closePosition';
58
20
  handler: PerpsController['closePosition'];
59
21
  };
60
- /**
61
- * Close multiple positions in parallel
62
- * Batch version of closePosition() that closes multiple positions simultaneously
63
- *
64
- * @param params - The operation parameters.
65
- * @returns The batch close results for each position.
66
- */
67
22
  export type PerpsControllerClosePositionsAction = {
68
- type: `PerpsController:closePositions`;
23
+ type: 'PerpsController:closePositions';
69
24
  handler: PerpsController['closePositions'];
70
25
  };
71
- /**
72
- * Withdraw funds from trading account
73
- *
74
- * The withdrawal process varies by provider and may involve:
75
- * - Direct on-chain transfers
76
- * - Bridge operations
77
- * - Multi-step validation processes
78
- *
79
- * Check the specific provider documentation for detailed withdrawal flows.
80
- *
81
- * @param params Withdrawal parameters
82
- * @returns WithdrawResult with withdrawal ID and tracking info
83
- */
84
26
  export type PerpsControllerWithdrawAction = {
85
- type: `PerpsController:withdraw`;
27
+ type: 'PerpsController:withdraw';
86
28
  handler: PerpsController['withdraw'];
87
29
  };
88
- /**
89
- * Get current positions
90
- * Thin delegation to MarketDataService
91
- *
92
- * For standalone mode, bypasses getActiveProvider() to allow position queries
93
- * without full perps initialization (e.g., for showing positions on token details page)
94
- *
95
- * @param params - The operation parameters.
96
- * @returns Array of open positions for the active provider.
97
- */
98
30
  export type PerpsControllerGetPositionsAction = {
99
- type: `PerpsController:getPositions`;
31
+ type: 'PerpsController:getPositions';
100
32
  handler: PerpsController['getPositions'];
101
33
  };
102
- /**
103
- * Get historical user fills (trade executions)
104
- * Thin delegation to MarketDataService
105
- *
106
- * @param params - The operation parameters.
107
- * @returns Array of historical trade executions (fills).
108
- */
109
34
  export type PerpsControllerGetOrderFillsAction = {
110
- type: `PerpsController:getOrderFills`;
35
+ type: 'PerpsController:getOrderFills';
111
36
  handler: PerpsController['getOrderFills'];
112
37
  };
113
- /**
114
- * Get historical user orders (order lifecycle)
115
- * Thin delegation to MarketDataService
116
- *
117
- * @param params - The operation parameters.
118
- * @returns Array of historical orders.
119
- */
120
38
  export type PerpsControllerGetOrdersAction = {
121
- type: `PerpsController:getOrders`;
39
+ type: 'PerpsController:getOrders';
122
40
  handler: PerpsController['getOrders'];
123
41
  };
124
- /**
125
- * Get currently open orders (real-time status)
126
- * Thin delegation to MarketDataService
127
- *
128
- * For standalone mode, bypasses getActiveProvider() to allow open order queries
129
- * without full perps initialization (e.g., for background preloading)
130
- *
131
- * @param params - The operation parameters.
132
- * @returns A promise that resolves to the result.
133
- */
134
42
  export type PerpsControllerGetOpenOrdersAction = {
135
- type: `PerpsController:getOpenOrders`;
43
+ type: 'PerpsController:getOpenOrders';
136
44
  handler: PerpsController['getOpenOrders'];
137
45
  };
138
- /**
139
- * Get historical user funding history (funding payments)
140
- * Thin delegation to MarketDataService
141
- *
142
- * @param params - The operation parameters.
143
- * @returns Array of historical funding payments.
144
- */
145
46
  export type PerpsControllerGetFundingAction = {
146
- type: `PerpsController:getFunding`;
47
+ type: 'PerpsController:getFunding';
147
48
  handler: PerpsController['getFunding'];
148
49
  };
149
- /**
150
- * Get account state (balances, etc.)
151
- * Thin delegation to MarketDataService
152
- *
153
- * For standalone mode, bypasses getActiveProvider() to allow account state queries
154
- * without full perps initialization (e.g., for checking if user has perps funds)
155
- *
156
- * @param params - The operation parameters.
157
- * @returns A promise that resolves to the result.
158
- */
159
50
  export type PerpsControllerGetAccountStateAction = {
160
- type: `PerpsController:getAccountState`;
51
+ type: 'PerpsController:getAccountState';
161
52
  handler: PerpsController['getAccountState'];
162
53
  };
163
- /**
164
- * Get historical portfolio data
165
- * Thin delegation to MarketDataService
166
- *
167
- * @param params - The operation parameters.
168
- * @returns The historical portfolio data points.
169
- */
170
- export type PerpsControllerGetHistoricalPortfolioAction = {
171
- type: `PerpsController:getHistoricalPortfolio`;
172
- handler: PerpsController['getHistoricalPortfolio'];
173
- };
174
- /**
175
- * Get available markets with optional filtering
176
- * Thin delegation to MarketDataService
177
- *
178
- * For standalone mode, bypasses getActiveProvider() to allow market discovery
179
- * without full perps initialization (e.g., for discovery banners on spot screens)
180
- *
181
- * @param params - The operation parameters.
182
- * @returns Array of available markets matching the filter criteria.
183
- */
184
54
  export type PerpsControllerGetMarketsAction = {
185
- type: `PerpsController:getMarkets`;
55
+ type: 'PerpsController:getMarkets';
186
56
  handler: PerpsController['getMarkets'];
187
57
  };
188
- /**
189
- * Toggle between testnet and mainnet
190
- *
191
- * @returns The toggle result with success status and current network mode.
192
- */
58
+ export type PerpsControllerRefreshEligibilityAction = {
59
+ type: 'PerpsController:refreshEligibility';
60
+ handler: PerpsController['refreshEligibility'];
61
+ };
193
62
  export type PerpsControllerToggleTestnetAction = {
194
- type: `PerpsController:toggleTestnet`;
63
+ type: 'PerpsController:toggleTestnet';
195
64
  handler: PerpsController['toggleTestnet'];
196
65
  };
197
- /**
198
- * Calculate trading fees for the active provider
199
- * Each provider implements its own fee structure
200
- *
201
- * @param params - The operation parameters.
202
- * @returns The fee calculation result for the trade.
203
- */
204
- export type PerpsControllerCalculateFeesAction = {
205
- type: `PerpsController:calculateFees`;
206
- handler: PerpsController['calculateFees'];
207
- };
208
- /**
209
- * Disconnect provider and cleanup subscriptions
210
- * Call this when navigating away from Perps screens to prevent battery drain
211
- */
212
66
  export type PerpsControllerDisconnectAction = {
213
- type: `PerpsController:disconnect`;
67
+ type: 'PerpsController:disconnect';
214
68
  handler: PerpsController['disconnect'];
215
69
  };
216
- /**
217
- * Resume eligibility monitoring after onboarding completes.
218
- * Clears the deferred flag and triggers an immediate eligibility check
219
- * using the current remote feature flag state.
220
- */
221
- export type PerpsControllerStartEligibilityMonitoringAction = {
222
- type: `PerpsController:startEligibilityMonitoring`;
223
- handler: PerpsController['startEligibilityMonitoring'];
224
- };
225
- /**
226
- * Stops geo-blocking eligibility monitoring.
227
- * Call this when the user disables basic functionality (e.g. useExternalServices becomes false).
228
- * Prevents geolocation calls until startEligibilityMonitoring() is called again.
229
- * Safe to call multiple times.
230
- */
231
- export type PerpsControllerStopEligibilityMonitoringAction = {
232
- type: `PerpsController:stopEligibilityMonitoring`;
233
- handler: PerpsController['stopEligibilityMonitoring'];
234
- };
235
- export type PerpsControllerRefreshEligibilityAction = {
236
- type: `PerpsController:refreshEligibility`;
237
- handler: PerpsController['refreshEligibility'];
70
+ export type PerpsControllerCalculateFeesAction = {
71
+ type: 'PerpsController:calculateFees';
72
+ handler: PerpsController['calculateFees'];
238
73
  };
239
- /**
240
- * Mark that the user has completed the tutorial/onboarding
241
- * This prevents the tutorial from showing again
242
- */
243
74
  export type PerpsControllerMarkTutorialCompletedAction = {
244
- type: `PerpsController:markTutorialCompleted`;
75
+ type: 'PerpsController:markTutorialCompleted';
245
76
  handler: PerpsController['markTutorialCompleted'];
246
77
  };
247
78
  export type PerpsControllerMarkFirstOrderCompletedAction = {
248
- type: `PerpsController:markFirstOrderCompleted`;
79
+ type: 'PerpsController:markFirstOrderCompleted';
249
80
  handler: PerpsController['markFirstOrderCompleted'];
250
81
  };
251
- /**
252
- * Reset first-time user state for both networks
253
- * This is useful for testing the tutorial flow
254
- * Called by Reset Account feature in settings
255
- */
82
+ export type PerpsControllerGetHistoricalPortfolioAction = {
83
+ type: 'PerpsController:getHistoricalPortfolio';
84
+ handler: PerpsController['getHistoricalPortfolio'];
85
+ };
256
86
  export type PerpsControllerResetFirstTimeUserStateAction = {
257
- type: `PerpsController:resetFirstTimeUserState`;
87
+ type: 'PerpsController:resetFirstTimeUserState';
258
88
  handler: PerpsController['resetFirstTimeUserState'];
259
89
  };
260
- /**
261
- * Clear pending/bridging withdrawal and deposit requests
262
- * This is useful when users want to clear stuck pending indicators
263
- * Called by Reset Account feature in settings
264
- */
265
90
  export type PerpsControllerClearPendingTransactionRequestsAction = {
266
- type: `PerpsController:clearPendingTransactionRequests`;
91
+ type: 'PerpsController:clearPendingTransactionRequests';
267
92
  handler: PerpsController['clearPendingTransactionRequests'];
268
93
  };
269
- /**
270
- * Get saved trade configuration for a market
271
- *
272
- * @param symbol - The trading pair symbol.
273
- * @returns The resulting string value.
274
- */
94
+ export type PerpsControllerSaveTradeConfigurationAction = {
95
+ type: 'PerpsController:saveTradeConfiguration';
96
+ handler: PerpsController['saveTradeConfiguration'];
97
+ };
275
98
  export type PerpsControllerGetTradeConfigurationAction = {
276
- type: `PerpsController:getTradeConfiguration`;
99
+ type: 'PerpsController:getTradeConfiguration';
277
100
  handler: PerpsController['getTradeConfiguration'];
278
101
  };
279
- /**
280
- * Save trade configuration for a market
281
- *
282
- * @param symbol - Market symbol
283
- * @param leverage - Leverage value
284
- */
285
- export type PerpsControllerSaveTradeConfigurationAction = {
286
- type: `PerpsController:saveTradeConfiguration`;
287
- handler: PerpsController['saveTradeConfiguration'];
102
+ export type PerpsControllerSaveMarketFilterPreferencesAction = {
103
+ type: 'PerpsController:saveMarketFilterPreferences';
104
+ handler: PerpsController['saveMarketFilterPreferences'];
105
+ };
106
+ export type PerpsControllerGetMarketFilterPreferencesAction = {
107
+ type: 'PerpsController:getMarketFilterPreferences';
108
+ handler: PerpsController['getMarketFilterPreferences'];
288
109
  };
289
- /**
290
- * Save pending trade configuration for a market
291
- * This is a temporary configuration that expires after 5 minutes
292
- *
293
- * @param symbol - Market symbol
294
- * @param config - Pending trade configuration (includes optional selected payment token from Pay row)
295
- * @param config.amount - The amount value.
296
- * @param config.leverage - The leverage multiplier.
297
- * @param config.takeProfitPrice - The take profit price.
298
- * @param config.stopLossPrice - The stop loss price.
299
- * @param config.limitPrice - The limit price.
300
- * @param config.orderType - The order type.
301
- * @param config.selectedPaymentToken - The selected payment token.
302
- */
303
110
  export type PerpsControllerSavePendingTradeConfigurationAction = {
304
- type: `PerpsController:savePendingTradeConfiguration`;
111
+ type: 'PerpsController:savePendingTradeConfiguration';
305
112
  handler: PerpsController['savePendingTradeConfiguration'];
306
113
  };
307
- /**
308
- * Get pending trade configuration for a market
309
- * Returns undefined if config doesn't exist or has expired (more than 5 minutes old)
310
- *
311
- * @param symbol - Market symbol
312
- * @returns Pending trade configuration or undefined
313
- */
314
114
  export type PerpsControllerGetPendingTradeConfigurationAction = {
315
- type: `PerpsController:getPendingTradeConfiguration`;
115
+ type: 'PerpsController:getPendingTradeConfiguration';
316
116
  handler: PerpsController['getPendingTradeConfiguration'];
317
117
  };
318
- /**
319
- * Clear pending trade configuration for a market
320
- *
321
- * @param symbol - Market symbol
322
- */
323
118
  export type PerpsControllerClearPendingTradeConfigurationAction = {
324
- type: `PerpsController:clearPendingTradeConfiguration`;
119
+ type: 'PerpsController:clearPendingTradeConfiguration';
325
120
  handler: PerpsController['clearPendingTradeConfiguration'];
326
121
  };
327
- /**
328
- * Get saved market filter preferences
329
- * Handles backward compatibility with legacy string format
330
- *
331
- * @returns The saved sort option ID and direction.
332
- */
333
- export type PerpsControllerGetMarketFilterPreferencesAction = {
334
- type: `PerpsController:getMarketFilterPreferences`;
335
- handler: PerpsController['getMarketFilterPreferences'];
122
+ export type PerpsControllerGetOrderBookGroupingAction = {
123
+ type: 'PerpsController:getOrderBookGrouping';
124
+ handler: PerpsController['getOrderBookGrouping'];
336
125
  };
337
- /**
338
- * Save market filter preferences
339
- *
340
- * @param optionId - Sort/filter option ID
341
- * @param direction - Sort direction ('asc' or 'desc')
342
- */
343
- export type PerpsControllerSaveMarketFilterPreferencesAction = {
344
- type: `PerpsController:saveMarketFilterPreferences`;
345
- handler: PerpsController['saveMarketFilterPreferences'];
126
+ export type PerpsControllerSaveOrderBookGroupingAction = {
127
+ type: 'PerpsController:saveOrderBookGrouping';
128
+ handler: PerpsController['saveOrderBookGrouping'];
346
129
  };
347
- /**
348
- * Set the selected payment token for the Perps order/deposit flow.
349
- * Pass null or a token with description PERPS_CONSTANTS.PerpsBalanceTokenDescription to select Perps balance.
350
- * Only required fields (address, chainId) are stored in state; description and symbol are optional.
351
- *
352
- * @param token - The token identifier.
353
- */
354
130
  export type PerpsControllerSetSelectedPaymentTokenAction = {
355
- type: `PerpsController:setSelectedPaymentToken`;
131
+ type: 'PerpsController:setSelectedPaymentToken';
356
132
  handler: PerpsController['setSelectedPaymentToken'];
357
133
  };
358
- /**
359
- * Reset the selected payment token to Perps balance (null).
360
- * Call when leaving the Perps order view so the next visit defaults to Perps balance.
361
- */
362
134
  export type PerpsControllerResetSelectedPaymentTokenAction = {
363
- type: `PerpsController:resetSelectedPaymentToken`;
135
+ type: 'PerpsController:resetSelectedPaymentToken';
364
136
  handler: PerpsController['resetSelectedPaymentToken'];
365
137
  };
366
- /**
367
- * Get saved order book grouping for a market
368
- *
369
- * @param symbol - Market symbol
370
- * @returns The saved grouping value or undefined if not set
371
- */
372
- export type PerpsControllerGetOrderBookGroupingAction = {
373
- type: `PerpsController:getOrderBookGrouping`;
374
- handler: PerpsController['getOrderBookGrouping'];
138
+ export type PerpsControllerStartEligibilityMonitoringAction = {
139
+ type: 'PerpsController:startEligibilityMonitoring';
140
+ handler: PerpsController['startEligibilityMonitoring'];
375
141
  };
376
- /**
377
- * Save order book grouping for a market
378
- *
379
- * @param symbol - Market symbol
380
- * @param grouping - Price grouping value
381
- */
382
- export type PerpsControllerSaveOrderBookGroupingAction = {
383
- type: `PerpsController:saveOrderBookGrouping`;
384
- handler: PerpsController['saveOrderBookGrouping'];
142
+ export type PerpsControllerStopEligibilityMonitoringAction = {
143
+ type: 'PerpsController:stopEligibilityMonitoring';
144
+ handler: PerpsController['stopEligibilityMonitoring'];
385
145
  };
386
- /**
387
- * Union of all PerpsController action types.
388
- */
389
- export type PerpsControllerMethodActions = PerpsControllerPlaceOrderAction | PerpsControllerEditOrderAction | PerpsControllerCancelOrderAction | PerpsControllerCancelOrdersAction | PerpsControllerClosePositionAction | PerpsControllerClosePositionsAction | PerpsControllerWithdrawAction | PerpsControllerGetPositionsAction | PerpsControllerGetOrderFillsAction | PerpsControllerGetOrdersAction | PerpsControllerGetOpenOrdersAction | PerpsControllerGetFundingAction | PerpsControllerGetAccountStateAction | PerpsControllerGetHistoricalPortfolioAction | PerpsControllerGetMarketsAction | PerpsControllerToggleTestnetAction | PerpsControllerCalculateFeesAction | PerpsControllerDisconnectAction | PerpsControllerStartEligibilityMonitoringAction | PerpsControllerStopEligibilityMonitoringAction | PerpsControllerRefreshEligibilityAction | PerpsControllerMarkTutorialCompletedAction | PerpsControllerMarkFirstOrderCompletedAction | PerpsControllerResetFirstTimeUserStateAction | PerpsControllerClearPendingTransactionRequestsAction | PerpsControllerGetTradeConfigurationAction | PerpsControllerSaveTradeConfigurationAction | PerpsControllerSavePendingTradeConfigurationAction | PerpsControllerGetPendingTradeConfigurationAction | PerpsControllerClearPendingTradeConfigurationAction | PerpsControllerGetMarketFilterPreferencesAction | PerpsControllerSaveMarketFilterPreferencesAction | PerpsControllerSetSelectedPaymentTokenAction | PerpsControllerResetSelectedPaymentTokenAction | PerpsControllerGetOrderBookGroupingAction | PerpsControllerSaveOrderBookGroupingAction;
146
+ export type PerpsControllerMethodActions = PerpsControllerPlaceOrderAction | PerpsControllerEditOrderAction | PerpsControllerCancelOrderAction | PerpsControllerCancelOrdersAction | PerpsControllerClosePositionAction | PerpsControllerClosePositionsAction | PerpsControllerWithdrawAction | PerpsControllerGetPositionsAction | PerpsControllerGetOrderFillsAction | PerpsControllerGetOrdersAction | PerpsControllerGetOpenOrdersAction | PerpsControllerGetFundingAction | PerpsControllerGetAccountStateAction | PerpsControllerGetMarketsAction | PerpsControllerRefreshEligibilityAction | PerpsControllerToggleTestnetAction | PerpsControllerDisconnectAction | PerpsControllerCalculateFeesAction | PerpsControllerMarkTutorialCompletedAction | PerpsControllerMarkFirstOrderCompletedAction | PerpsControllerGetHistoricalPortfolioAction | PerpsControllerResetFirstTimeUserStateAction | PerpsControllerClearPendingTransactionRequestsAction | PerpsControllerSaveTradeConfigurationAction | PerpsControllerGetTradeConfigurationAction | PerpsControllerSaveMarketFilterPreferencesAction | PerpsControllerGetMarketFilterPreferencesAction | PerpsControllerSavePendingTradeConfigurationAction | PerpsControllerGetPendingTradeConfigurationAction | PerpsControllerClearPendingTradeConfigurationAction | PerpsControllerGetOrderBookGroupingAction | PerpsControllerSaveOrderBookGroupingAction | PerpsControllerSetSelectedPaymentTokenAction | PerpsControllerResetSelectedPaymentTokenAction | PerpsControllerStartEligibilityMonitoringAction | PerpsControllerStopEligibilityMonitoringAction;
390
147
  //# sourceMappingURL=PerpsController-method-action-types.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"PerpsController-method-action-types.d.mts","sourceRoot":"","sources":["../src/Perps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Ae,CAAC,2BAA2B,CAAC,CAAC;CACvD,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,yCAAyC,GAAG;IACtD,IAAI,EAAE,sCAAsC,CAAC;IAC7C,OAAO,EAAE,eAAe,CAAC,sBAAsB,CAAC,CAAC;CAClD,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,0CAA0C,GAAG;IACvD,IAAI,EAAE,uCAAuC,CAAC;IAC9C,OAAO,EAAE,eAAe,CAAC,uBAAuB,CAAC,CAAC;CACnD,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,4BAA4B,GACpC,+BAA+B,GAC/B,8BAA8B,GAC9B,gCAAgC,GAChC,iCAAiC,GACjC,kCAAkC,GAClC,mCAAmC,GACnC,6BAA6B,GAC7B,iCAAiC,GACjC,kCAAkC,GAClC,8BAA8B,GAC9B,kCAAkC,GAClC,+BAA+B,GAC/B,oCAAoC,GACpC,2CAA2C,GAC3C,+BAA+B,GAC/B,kCAAkC,GAClC,kCAAkC,GAClC,+BAA+B,GAC/B,+CAA+C,GAC/C,8CAA8C,GAC9C,uCAAuC,GACvC,0CAA0C,GAC1C,4CAA4C,GAC5C,4CAA4C,GAC5C,oDAAoD,GACpD,0CAA0C,GAC1C,2CAA2C,GAC3C,kDAAkD,GAClD,iDAAiD,GACjD,mDAAmD,GACnD,+CAA+C,GAC/C,gDAAgD,GAChD,4CAA4C,GAC5C,8CAA8C,GAC9C,yCAAyC,GACzC,0CAA0C,CAAC"}
1
+ {"version":3,"file":"PerpsController-method-action-types.d.mts","sourceRoot":"","sources":["../src/PerpsController-method-action-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,8BAA0B;AAEzD,MAAM,MAAM,+BAA+B,GAAG;IAC5C,IAAI,EAAE,4BAA4B,CAAC;IACnC,OAAO,EAAE,eAAe,CAAC,YAAY,CAAC,CAAC;CACxC,CAAC;AAEF,MAAM,MAAM,8BAA8B,GAAG;IAC3C,IAAI,EAAE,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A0C,GAC1C,4CAA4C,GAC5C,8CAA8C,GAC9C,+CAA+C,GAC/C,8CAA8C,CAAC"}
@@ -1,6 +1,2 @@
1
- /**
2
- * This file is auto generated.
3
- * Do not edit manually.
4
- */
5
1
  export {};
6
2
  //# sourceMappingURL=PerpsController-method-action-types.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"PerpsController-method-action-types.mjs","sourceRoot":"","sources":["../src/PerpsController-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/**\n * This file is auto generated.\n * Do not edit manually.\n */\n\nimport type { PerpsController } from './PerpsController';\n\n/**\n * Place a new order\n * Thin delegation to TradingService\n *\n * @param params - The operation parameters.\n * @returns The order result with order ID and status.\n */\nexport type PerpsControllerPlaceOrderAction = {\n type: `PerpsController:placeOrder`;\n handler: PerpsController['placeOrder'];\n};\n\n/**\n * Edit an existing order\n * Thin delegation to TradingService\n *\n * @param params - The operation parameters.\n * @returns The updated order result with order ID and status.\n */\nexport type PerpsControllerEditOrderAction = {\n type: `PerpsController:editOrder`;\n handler: PerpsController['editOrder'];\n};\n\n/**\n * Cancel an existing order\n *\n * @param params - The operation parameters.\n * @returns The cancellation result with status.\n */\nexport type PerpsControllerCancelOrderAction = {\n type: `PerpsController:cancelOrder`;\n handler: PerpsController['cancelOrder'];\n};\n\n/**\n * Cancel multiple orders in parallel\n * Batch version of cancelOrder() that cancels multiple orders simultaneously\n *\n * @param params - The operation parameters.\n * @returns The batch cancellation results for each order.\n */\nexport type PerpsControllerCancelOrdersAction = {\n type: `PerpsController:cancelOrders`;\n handler: PerpsController['cancelOrders'];\n};\n\n/**\n * Close a position (partial or full)\n * Thin delegation to TradingService\n *\n * @param params - The operation parameters.\n * @returns The order result from the close position request.\n */\nexport type PerpsControllerClosePositionAction = {\n type: `PerpsController:closePosition`;\n handler: PerpsController['closePosition'];\n};\n\n/**\n * Close multiple positions in parallel\n * Batch version of closePosition() that closes multiple positions simultaneously\n *\n * @param params - The operation parameters.\n * @returns The batch close results for each position.\n */\nexport type PerpsControllerClosePositionsAction = {\n type: `PerpsController:closePositions`;\n handler: PerpsController['closePositions'];\n};\n\n/**\n * Withdraw funds from trading account\n *\n * The withdrawal process varies by provider and may involve:\n * - Direct on-chain transfers\n * - Bridge operations\n * - Multi-step validation processes\n *\n * Check the specific provider documentation for detailed withdrawal flows.\n *\n * @param params Withdrawal parameters\n * @returns WithdrawResult with withdrawal ID and tracking info\n */\nexport type PerpsControllerWithdrawAction = {\n type: `PerpsController:withdraw`;\n handler: PerpsController['withdraw'];\n};\n\n/**\n * Get current positions\n * Thin delegation to MarketDataService\n *\n * For standalone mode, bypasses getActiveProvider() to allow position queries\n * without full perps initialization (e.g., for showing positions on token details page)\n *\n * @param params - The operation parameters.\n * @returns Array of open positions for the active provider.\n */\nexport type PerpsControllerGetPositionsAction = {\n type: `PerpsController:getPositions`;\n handler: PerpsController['getPositions'];\n};\n\n/**\n * Get historical user fills (trade executions)\n * Thin delegation to MarketDataService\n *\n * @param params - The operation parameters.\n * @returns Array of historical trade executions (fills).\n */\nexport type PerpsControllerGetOrderFillsAction = {\n type: `PerpsController:getOrderFills`;\n handler: PerpsController['getOrderFills'];\n};\n\n/**\n * Get historical user orders (order lifecycle)\n * Thin delegation to MarketDataService\n *\n * @param params - The operation parameters.\n * @returns Array of historical orders.\n */\nexport type PerpsControllerGetOrdersAction = {\n type: `PerpsController:getOrders`;\n handler: PerpsController['getOrders'];\n};\n\n/**\n * Get currently open orders (real-time status)\n * Thin delegation to MarketDataService\n *\n * For standalone mode, bypasses getActiveProvider() to allow open order queries\n * without full perps initialization (e.g., for background preloading)\n *\n * @param params - The operation parameters.\n * @returns A promise that resolves to the result.\n */\nexport type PerpsControllerGetOpenOrdersAction = {\n type: `PerpsController:getOpenOrders`;\n handler: PerpsController['getOpenOrders'];\n};\n\n/**\n * Get historical user funding history (funding payments)\n * Thin delegation to MarketDataService\n *\n * @param params - The operation parameters.\n * @returns Array of historical funding payments.\n */\nexport type PerpsControllerGetFundingAction = {\n type: `PerpsController:getFunding`;\n handler: PerpsController['getFunding'];\n};\n\n/**\n * Get account state (balances, etc.)\n * Thin delegation to MarketDataService\n *\n * For standalone mode, bypasses getActiveProvider() to allow account state queries\n * without full perps initialization (e.g., for checking if user has perps funds)\n *\n * @param params - The operation parameters.\n * @returns A promise that resolves to the result.\n */\nexport type PerpsControllerGetAccountStateAction = {\n type: `PerpsController:getAccountState`;\n handler: PerpsController['getAccountState'];\n};\n\n/**\n * Get historical portfolio data\n * Thin delegation to MarketDataService\n *\n * @param params - The operation parameters.\n * @returns The historical portfolio data points.\n */\nexport type PerpsControllerGetHistoricalPortfolioAction = {\n type: `PerpsController:getHistoricalPortfolio`;\n handler: PerpsController['getHistoricalPortfolio'];\n};\n\n/**\n * Get available markets with optional filtering\n * Thin delegation to MarketDataService\n *\n * For standalone mode, bypasses getActiveProvider() to allow market discovery\n * without full perps initialization (e.g., for discovery banners on spot screens)\n *\n * @param params - The operation parameters.\n * @returns Array of available markets matching the filter criteria.\n */\nexport type PerpsControllerGetMarketsAction = {\n type: `PerpsController:getMarkets`;\n handler: PerpsController['getMarkets'];\n};\n\n/**\n * Toggle between testnet and mainnet\n *\n * @returns The toggle result with success status and current network mode.\n */\nexport type PerpsControllerToggleTestnetAction = {\n type: `PerpsController:toggleTestnet`;\n handler: PerpsController['toggleTestnet'];\n};\n\n/**\n * Calculate trading fees for the active provider\n * Each provider implements its own fee structure\n *\n * @param params - The operation parameters.\n * @returns The fee calculation result for the trade.\n */\nexport type PerpsControllerCalculateFeesAction = {\n type: `PerpsController:calculateFees`;\n handler: PerpsController['calculateFees'];\n};\n\n/**\n * Disconnect provider and cleanup subscriptions\n * Call this when navigating away from Perps screens to prevent battery drain\n */\nexport type PerpsControllerDisconnectAction = {\n type: `PerpsController:disconnect`;\n handler: PerpsController['disconnect'];\n};\n\n/**\n * Resume eligibility monitoring after onboarding completes.\n * Clears the deferred flag and triggers an immediate eligibility check\n * using the current remote feature flag state.\n */\nexport type PerpsControllerStartEligibilityMonitoringAction = {\n type: `PerpsController:startEligibilityMonitoring`;\n handler: PerpsController['startEligibilityMonitoring'];\n};\n\n/**\n * Stops geo-blocking eligibility monitoring.\n * Call this when the user disables basic functionality (e.g. useExternalServices becomes false).\n * Prevents geolocation calls until startEligibilityMonitoring() is called again.\n * Safe to call multiple times.\n */\nexport type PerpsControllerStopEligibilityMonitoringAction = {\n type: `PerpsController:stopEligibilityMonitoring`;\n handler: PerpsController['stopEligibilityMonitoring'];\n};\n\nexport type PerpsControllerRefreshEligibilityAction = {\n type: `PerpsController:refreshEligibility`;\n handler: PerpsController['refreshEligibility'];\n};\n\n/**\n * Mark that the user has completed the tutorial/onboarding\n * This prevents the tutorial from showing again\n */\nexport type PerpsControllerMarkTutorialCompletedAction = {\n type: `PerpsController:markTutorialCompleted`;\n handler: PerpsController['markTutorialCompleted'];\n};\n\nexport type PerpsControllerMarkFirstOrderCompletedAction = {\n type: `PerpsController:markFirstOrderCompleted`;\n handler: PerpsController['markFirstOrderCompleted'];\n};\n\n/**\n * Reset first-time user state for both networks\n * This is useful for testing the tutorial flow\n * Called by Reset Account feature in settings\n */\nexport type PerpsControllerResetFirstTimeUserStateAction = {\n type: `PerpsController:resetFirstTimeUserState`;\n handler: PerpsController['resetFirstTimeUserState'];\n};\n\n/**\n * Clear pending/bridging withdrawal and deposit requests\n * This is useful when users want to clear stuck pending indicators\n * Called by Reset Account feature in settings\n */\nexport type PerpsControllerClearPendingTransactionRequestsAction = {\n type: `PerpsController:clearPendingTransactionRequests`;\n handler: PerpsController['clearPendingTransactionRequests'];\n};\n\n/**\n * Get saved trade configuration for a market\n *\n * @param symbol - The trading pair symbol.\n * @returns The resulting string value.\n */\nexport type PerpsControllerGetTradeConfigurationAction = {\n type: `PerpsController:getTradeConfiguration`;\n handler: PerpsController['getTradeConfiguration'];\n};\n\n/**\n * Save trade configuration for a market\n *\n * @param symbol - Market symbol\n * @param leverage - Leverage value\n */\nexport type PerpsControllerSaveTradeConfigurationAction = {\n type: `PerpsController:saveTradeConfiguration`;\n handler: PerpsController['saveTradeConfiguration'];\n};\n\n/**\n * Save pending trade configuration for a market\n * This is a temporary configuration that expires after 5 minutes\n *\n * @param symbol - Market symbol\n * @param config - Pending trade configuration (includes optional selected payment token from Pay row)\n * @param config.amount - The amount value.\n * @param config.leverage - The leverage multiplier.\n * @param config.takeProfitPrice - The take profit price.\n * @param config.stopLossPrice - The stop loss price.\n * @param config.limitPrice - The limit price.\n * @param config.orderType - The order type.\n * @param config.selectedPaymentToken - The selected payment token.\n */\nexport type PerpsControllerSavePendingTradeConfigurationAction = {\n type: `PerpsController:savePendingTradeConfiguration`;\n handler: PerpsController['savePendingTradeConfiguration'];\n};\n\n/**\n * Get pending trade configuration for a market\n * Returns undefined if config doesn't exist or has expired (more than 5 minutes old)\n *\n * @param symbol - Market symbol\n * @returns Pending trade configuration or undefined\n */\nexport type PerpsControllerGetPendingTradeConfigurationAction = {\n type: `PerpsController:getPendingTradeConfiguration`;\n handler: PerpsController['getPendingTradeConfiguration'];\n};\n\n/**\n * Clear pending trade configuration for a market\n *\n * @param symbol - Market symbol\n */\nexport type PerpsControllerClearPendingTradeConfigurationAction = {\n type: `PerpsController:clearPendingTradeConfiguration`;\n handler: PerpsController['clearPendingTradeConfiguration'];\n};\n\n/**\n * Get saved market filter preferences\n * Handles backward compatibility with legacy string format\n *\n * @returns The saved sort option ID and direction.\n */\nexport type PerpsControllerGetMarketFilterPreferencesAction = {\n type: `PerpsController:getMarketFilterPreferences`;\n handler: PerpsController['getMarketFilterPreferences'];\n};\n\n/**\n * Save market filter preferences\n *\n * @param optionId - Sort/filter option ID\n * @param direction - Sort direction ('asc' or 'desc')\n */\nexport type PerpsControllerSaveMarketFilterPreferencesAction = {\n type: `PerpsController:saveMarketFilterPreferences`;\n handler: PerpsController['saveMarketFilterPreferences'];\n};\n\n/**\n * Set the selected payment token for the Perps order/deposit flow.\n * Pass null or a token with description PERPS_CONSTANTS.PerpsBalanceTokenDescription to select Perps balance.\n * Only required fields (address, chainId) are stored in state; description and symbol are optional.\n *\n * @param token - The token identifier.\n */\nexport type PerpsControllerSetSelectedPaymentTokenAction = {\n type: `PerpsController:setSelectedPaymentToken`;\n handler: PerpsController['setSelectedPaymentToken'];\n};\n\n/**\n * Reset the selected payment token to Perps balance (null).\n * Call when leaving the Perps order view so the next visit defaults to Perps balance.\n */\nexport type PerpsControllerResetSelectedPaymentTokenAction = {\n type: `PerpsController:resetSelectedPaymentToken`;\n handler: PerpsController['resetSelectedPaymentToken'];\n};\n\n/**\n * Get saved order book grouping for a market\n *\n * @param symbol - Market symbol\n * @returns The saved grouping value or undefined if not set\n */\nexport type PerpsControllerGetOrderBookGroupingAction = {\n type: `PerpsController:getOrderBookGrouping`;\n handler: PerpsController['getOrderBookGrouping'];\n};\n\n/**\n * Save order book grouping for a market\n *\n * @param symbol - Market symbol\n * @param grouping - Price grouping value\n */\nexport type PerpsControllerSaveOrderBookGroupingAction = {\n type: `PerpsController:saveOrderBookGrouping`;\n handler: PerpsController['saveOrderBookGrouping'];\n};\n\n/**\n * Union of all PerpsController action types.\n */\nexport type PerpsControllerMethodActions =\n | PerpsControllerPlaceOrderAction\n | PerpsControllerEditOrderAction\n | PerpsControllerCancelOrderAction\n | PerpsControllerCancelOrdersAction\n | PerpsControllerClosePositionAction\n | PerpsControllerClosePositionsAction\n | PerpsControllerWithdrawAction\n | PerpsControllerGetPositionsAction\n | PerpsControllerGetOrderFillsAction\n | PerpsControllerGetOrdersAction\n | PerpsControllerGetOpenOrdersAction\n | PerpsControllerGetFundingAction\n | PerpsControllerGetAccountStateAction\n | PerpsControllerGetHistoricalPortfolioAction\n | PerpsControllerGetMarketsAction\n | PerpsControllerToggleTestnetAction\n | PerpsControllerCalculateFeesAction\n | PerpsControllerDisconnectAction\n | PerpsControllerStartEligibilityMonitoringAction\n | PerpsControllerStopEligibilityMonitoringAction\n | PerpsControllerRefreshEligibilityAction\n | PerpsControllerMarkTutorialCompletedAction\n | PerpsControllerMarkFirstOrderCompletedAction\n | PerpsControllerResetFirstTimeUserStateAction\n | PerpsControllerClearPendingTransactionRequestsAction\n | PerpsControllerGetTradeConfigurationAction\n | PerpsControllerSaveTradeConfigurationAction\n | PerpsControllerSavePendingTradeConfigurationAction\n | PerpsControllerGetPendingTradeConfigurationAction\n | PerpsControllerClearPendingTradeConfigurationAction\n | PerpsControllerGetMarketFilterPreferencesAction\n | PerpsControllerSaveMarketFilterPreferencesAction\n | PerpsControllerSetSelectedPaymentTokenAction\n | PerpsControllerResetSelectedPaymentTokenAction\n | PerpsControllerGetOrderBookGroupingAction\n | PerpsControllerSaveOrderBookGroupingAction;\n"]}
1
+ {"version":3,"file":"PerpsController-method-action-types.mjs","sourceRoot":"","sources":["../src/PerpsController-method-action-types.ts"],"names":[],"mappings":"","sourcesContent":["import type { PerpsController } from './PerpsController';\n\nexport type PerpsControllerPlaceOrderAction = {\n type: 'PerpsController:placeOrder';\n handler: PerpsController['placeOrder'];\n};\n\nexport type PerpsControllerEditOrderAction = {\n type: 'PerpsController:editOrder';\n handler: PerpsController['editOrder'];\n};\n\nexport type PerpsControllerCancelOrderAction = {\n type: 'PerpsController:cancelOrder';\n handler: PerpsController['cancelOrder'];\n};\n\nexport type PerpsControllerCancelOrdersAction = {\n type: 'PerpsController:cancelOrders';\n handler: PerpsController['cancelOrders'];\n};\n\nexport type PerpsControllerClosePositionAction = {\n type: 'PerpsController:closePosition';\n handler: PerpsController['closePosition'];\n};\n\nexport type PerpsControllerClosePositionsAction = {\n type: 'PerpsController:closePositions';\n handler: PerpsController['closePositions'];\n};\n\nexport type PerpsControllerWithdrawAction = {\n type: 'PerpsController:withdraw';\n handler: PerpsController['withdraw'];\n};\n\nexport type PerpsControllerGetPositionsAction = {\n type: 'PerpsController:getPositions';\n handler: PerpsController['getPositions'];\n};\n\nexport type PerpsControllerGetOrderFillsAction = {\n type: 'PerpsController:getOrderFills';\n handler: PerpsController['getOrderFills'];\n};\n\nexport type PerpsControllerGetOrdersAction = {\n type: 'PerpsController:getOrders';\n handler: PerpsController['getOrders'];\n};\n\nexport type PerpsControllerGetOpenOrdersAction = {\n type: 'PerpsController:getOpenOrders';\n handler: PerpsController['getOpenOrders'];\n};\n\nexport type PerpsControllerGetFundingAction = {\n type: 'PerpsController:getFunding';\n handler: PerpsController['getFunding'];\n};\n\nexport type PerpsControllerGetAccountStateAction = {\n type: 'PerpsController:getAccountState';\n handler: PerpsController['getAccountState'];\n};\n\nexport type PerpsControllerGetMarketsAction = {\n type: 'PerpsController:getMarkets';\n handler: PerpsController['getMarkets'];\n};\n\nexport type PerpsControllerRefreshEligibilityAction = {\n type: 'PerpsController:refreshEligibility';\n handler: PerpsController['refreshEligibility'];\n};\n\nexport type PerpsControllerToggleTestnetAction = {\n type: 'PerpsController:toggleTestnet';\n handler: PerpsController['toggleTestnet'];\n};\n\nexport type PerpsControllerDisconnectAction = {\n type: 'PerpsController:disconnect';\n handler: PerpsController['disconnect'];\n};\n\nexport type PerpsControllerCalculateFeesAction = {\n type: 'PerpsController:calculateFees';\n handler: PerpsController['calculateFees'];\n};\n\nexport type PerpsControllerMarkTutorialCompletedAction = {\n type: 'PerpsController:markTutorialCompleted';\n handler: PerpsController['markTutorialCompleted'];\n};\n\nexport type PerpsControllerMarkFirstOrderCompletedAction = {\n type: 'PerpsController:markFirstOrderCompleted';\n handler: PerpsController['markFirstOrderCompleted'];\n};\n\nexport type PerpsControllerGetHistoricalPortfolioAction = {\n type: 'PerpsController:getHistoricalPortfolio';\n handler: PerpsController['getHistoricalPortfolio'];\n};\n\nexport type PerpsControllerResetFirstTimeUserStateAction = {\n type: 'PerpsController:resetFirstTimeUserState';\n handler: PerpsController['resetFirstTimeUserState'];\n};\n\nexport type PerpsControllerClearPendingTransactionRequestsAction = {\n type: 'PerpsController:clearPendingTransactionRequests';\n handler: PerpsController['clearPendingTransactionRequests'];\n};\n\nexport type PerpsControllerSaveTradeConfigurationAction = {\n type: 'PerpsController:saveTradeConfiguration';\n handler: PerpsController['saveTradeConfiguration'];\n};\n\nexport type PerpsControllerGetTradeConfigurationAction = {\n type: 'PerpsController:getTradeConfiguration';\n handler: PerpsController['getTradeConfiguration'];\n};\n\nexport type PerpsControllerSaveMarketFilterPreferencesAction = {\n type: 'PerpsController:saveMarketFilterPreferences';\n handler: PerpsController['saveMarketFilterPreferences'];\n};\n\nexport type PerpsControllerGetMarketFilterPreferencesAction = {\n type: 'PerpsController:getMarketFilterPreferences';\n handler: PerpsController['getMarketFilterPreferences'];\n};\n\nexport type PerpsControllerSavePendingTradeConfigurationAction = {\n type: 'PerpsController:savePendingTradeConfiguration';\n handler: PerpsController['savePendingTradeConfiguration'];\n};\n\nexport type PerpsControllerGetPendingTradeConfigurationAction = {\n type: 'PerpsController:getPendingTradeConfiguration';\n handler: PerpsController['getPendingTradeConfiguration'];\n};\n\nexport type PerpsControllerClearPendingTradeConfigurationAction = {\n type: 'PerpsController:clearPendingTradeConfiguration';\n handler: PerpsController['clearPendingTradeConfiguration'];\n};\n\nexport type PerpsControllerGetOrderBookGroupingAction = {\n type: 'PerpsController:getOrderBookGrouping';\n handler: PerpsController['getOrderBookGrouping'];\n};\n\nexport type PerpsControllerSaveOrderBookGroupingAction = {\n type: 'PerpsController:saveOrderBookGrouping';\n handler: PerpsController['saveOrderBookGrouping'];\n};\n\nexport type PerpsControllerSetSelectedPaymentTokenAction = {\n type: 'PerpsController:setSelectedPaymentToken';\n handler: PerpsController['setSelectedPaymentToken'];\n};\n\nexport type PerpsControllerResetSelectedPaymentTokenAction = {\n type: 'PerpsController:resetSelectedPaymentToken';\n handler: PerpsController['resetSelectedPaymentToken'];\n};\n\nexport type PerpsControllerStartEligibilityMonitoringAction = {\n type: 'PerpsController:startEligibilityMonitoring';\n handler: PerpsController['startEligibilityMonitoring'];\n};\n\nexport type PerpsControllerStopEligibilityMonitoringAction = {\n type: 'PerpsController:stopEligibilityMonitoring';\n handler: PerpsController['stopEligibilityMonitoring'];\n};\n\nexport type PerpsControllerMethodActions =\n | PerpsControllerPlaceOrderAction\n | PerpsControllerEditOrderAction\n | PerpsControllerCancelOrderAction\n | PerpsControllerCancelOrdersAction\n | PerpsControllerClosePositionAction\n | PerpsControllerClosePositionsAction\n | PerpsControllerWithdrawAction\n | PerpsControllerGetPositionsAction\n | PerpsControllerGetOrderFillsAction\n | PerpsControllerGetOrdersAction\n | PerpsControllerGetOpenOrdersAction\n | PerpsControllerGetFundingAction\n | PerpsControllerGetAccountStateAction\n | PerpsControllerGetMarketsAction\n | PerpsControllerRefreshEligibilityAction\n | PerpsControllerToggleTestnetAction\n | PerpsControllerDisconnectAction\n | PerpsControllerCalculateFeesAction\n | PerpsControllerMarkTutorialCompletedAction\n | PerpsControllerMarkFirstOrderCompletedAction\n | PerpsControllerGetHistoricalPortfolioAction\n | PerpsControllerResetFirstTimeUserStateAction\n | PerpsControllerClearPendingTransactionRequestsAction\n | PerpsControllerSaveTradeConfigurationAction\n | PerpsControllerGetTradeConfigurationAction\n | PerpsControllerSaveMarketFilterPreferencesAction\n | PerpsControllerGetMarketFilterPreferencesAction\n | PerpsControllerSavePendingTradeConfigurationAction\n | PerpsControllerGetPendingTradeConfigurationAction\n | PerpsControllerClearPendingTradeConfigurationAction\n | PerpsControllerGetOrderBookGroupingAction\n | PerpsControllerSaveOrderBookGroupingAction\n | PerpsControllerSetSelectedPaymentTokenAction\n | PerpsControllerResetSelectedPaymentTokenAction\n | PerpsControllerStartEligibilityMonitoringAction\n | PerpsControllerStopEligibilityMonitoringAction;\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metamask-previews/perps-controller",
3
- "version": "2.0.0-preview-16512b784",
3
+ "version": "2.0.0-preview-4014adf",
4
4
  "description": "Controller for perpetual trading functionality in MetaMask",
5
5
  "keywords": [
6
6
  "MetaMask",