@metamask-previews/perps-controller 2.0.0-preview-ce9be8b82 → 2.0.0-preview-373edc9
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.
- package/dist/PerpsController-method-action-types.cjs +4 -0
- package/dist/PerpsController-method-action-types.cjs.map +1 -1
- package/dist/PerpsController-method-action-types.d.cts +304 -61
- package/dist/PerpsController-method-action-types.d.cts.map +1 -1
- package/dist/PerpsController-method-action-types.d.mts +304 -61
- package/dist/PerpsController-method-action-types.d.mts.map +1 -1
- package/dist/PerpsController-method-action-types.mjs +4 -0
- package/dist/PerpsController-method-action-types.mjs.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
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
|
+
{"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,147 +1,390 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is auto generated.
|
|
3
|
+
* Do not edit manually.
|
|
4
|
+
*/
|
|
1
5
|
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
|
+
*/
|
|
2
13
|
export type PerpsControllerPlaceOrderAction = {
|
|
3
|
-
type:
|
|
14
|
+
type: `PerpsController:placeOrder`;
|
|
4
15
|
handler: PerpsController['placeOrder'];
|
|
5
16
|
};
|
|
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
|
+
*/
|
|
6
24
|
export type PerpsControllerEditOrderAction = {
|
|
7
|
-
type:
|
|
25
|
+
type: `PerpsController:editOrder`;
|
|
8
26
|
handler: PerpsController['editOrder'];
|
|
9
27
|
};
|
|
28
|
+
/**
|
|
29
|
+
* Cancel an existing order
|
|
30
|
+
*
|
|
31
|
+
* @param params - The operation parameters.
|
|
32
|
+
* @returns The cancellation result with status.
|
|
33
|
+
*/
|
|
10
34
|
export type PerpsControllerCancelOrderAction = {
|
|
11
|
-
type:
|
|
35
|
+
type: `PerpsController:cancelOrder`;
|
|
12
36
|
handler: PerpsController['cancelOrder'];
|
|
13
37
|
};
|
|
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
|
+
*/
|
|
14
45
|
export type PerpsControllerCancelOrdersAction = {
|
|
15
|
-
type:
|
|
46
|
+
type: `PerpsController:cancelOrders`;
|
|
16
47
|
handler: PerpsController['cancelOrders'];
|
|
17
48
|
};
|
|
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
|
+
*/
|
|
18
56
|
export type PerpsControllerClosePositionAction = {
|
|
19
|
-
type:
|
|
57
|
+
type: `PerpsController:closePosition`;
|
|
20
58
|
handler: PerpsController['closePosition'];
|
|
21
59
|
};
|
|
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
|
+
*/
|
|
22
67
|
export type PerpsControllerClosePositionsAction = {
|
|
23
|
-
type:
|
|
68
|
+
type: `PerpsController:closePositions`;
|
|
24
69
|
handler: PerpsController['closePositions'];
|
|
25
70
|
};
|
|
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
|
+
*/
|
|
26
84
|
export type PerpsControllerWithdrawAction = {
|
|
27
|
-
type:
|
|
85
|
+
type: `PerpsController:withdraw`;
|
|
28
86
|
handler: PerpsController['withdraw'];
|
|
29
87
|
};
|
|
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
|
+
*/
|
|
30
98
|
export type PerpsControllerGetPositionsAction = {
|
|
31
|
-
type:
|
|
99
|
+
type: `PerpsController:getPositions`;
|
|
32
100
|
handler: PerpsController['getPositions'];
|
|
33
101
|
};
|
|
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
|
+
*/
|
|
34
109
|
export type PerpsControllerGetOrderFillsAction = {
|
|
35
|
-
type:
|
|
110
|
+
type: `PerpsController:getOrderFills`;
|
|
36
111
|
handler: PerpsController['getOrderFills'];
|
|
37
112
|
};
|
|
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
|
+
*/
|
|
38
120
|
export type PerpsControllerGetOrdersAction = {
|
|
39
|
-
type:
|
|
121
|
+
type: `PerpsController:getOrders`;
|
|
40
122
|
handler: PerpsController['getOrders'];
|
|
41
123
|
};
|
|
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
|
+
*/
|
|
42
134
|
export type PerpsControllerGetOpenOrdersAction = {
|
|
43
|
-
type:
|
|
135
|
+
type: `PerpsController:getOpenOrders`;
|
|
44
136
|
handler: PerpsController['getOpenOrders'];
|
|
45
137
|
};
|
|
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
|
+
*/
|
|
46
145
|
export type PerpsControllerGetFundingAction = {
|
|
47
|
-
type:
|
|
146
|
+
type: `PerpsController:getFunding`;
|
|
48
147
|
handler: PerpsController['getFunding'];
|
|
49
148
|
};
|
|
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
|
+
*/
|
|
50
159
|
export type PerpsControllerGetAccountStateAction = {
|
|
51
|
-
type:
|
|
160
|
+
type: `PerpsController:getAccountState`;
|
|
52
161
|
handler: PerpsController['getAccountState'];
|
|
53
162
|
};
|
|
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
|
+
*/
|
|
54
184
|
export type PerpsControllerGetMarketsAction = {
|
|
55
|
-
type:
|
|
185
|
+
type: `PerpsController:getMarkets`;
|
|
56
186
|
handler: PerpsController['getMarkets'];
|
|
57
187
|
};
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
188
|
+
/**
|
|
189
|
+
* Toggle between testnet and mainnet
|
|
190
|
+
*
|
|
191
|
+
* @returns The toggle result with success status and current network mode.
|
|
192
|
+
*/
|
|
62
193
|
export type PerpsControllerToggleTestnetAction = {
|
|
63
|
-
type:
|
|
194
|
+
type: `PerpsController:toggleTestnet`;
|
|
64
195
|
handler: PerpsController['toggleTestnet'];
|
|
65
196
|
};
|
|
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
|
+
*/
|
|
66
212
|
export type PerpsControllerDisconnectAction = {
|
|
67
|
-
type:
|
|
213
|
+
type: `PerpsController:disconnect`;
|
|
68
214
|
handler: PerpsController['disconnect'];
|
|
69
215
|
};
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
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'];
|
|
73
238
|
};
|
|
239
|
+
/**
|
|
240
|
+
* Mark that the user has completed the tutorial/onboarding
|
|
241
|
+
* This prevents the tutorial from showing again
|
|
242
|
+
*/
|
|
74
243
|
export type PerpsControllerMarkTutorialCompletedAction = {
|
|
75
|
-
type:
|
|
244
|
+
type: `PerpsController:markTutorialCompleted`;
|
|
76
245
|
handler: PerpsController['markTutorialCompleted'];
|
|
77
246
|
};
|
|
78
247
|
export type PerpsControllerMarkFirstOrderCompletedAction = {
|
|
79
|
-
type:
|
|
248
|
+
type: `PerpsController:markFirstOrderCompleted`;
|
|
80
249
|
handler: PerpsController['markFirstOrderCompleted'];
|
|
81
250
|
};
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
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
|
+
*/
|
|
86
256
|
export type PerpsControllerResetFirstTimeUserStateAction = {
|
|
87
|
-
type:
|
|
257
|
+
type: `PerpsController:resetFirstTimeUserState`;
|
|
88
258
|
handler: PerpsController['resetFirstTimeUserState'];
|
|
89
259
|
};
|
|
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
|
+
*/
|
|
90
265
|
export type PerpsControllerClearPendingTransactionRequestsAction = {
|
|
91
|
-
type:
|
|
266
|
+
type: `PerpsController:clearPendingTransactionRequests`;
|
|
92
267
|
handler: PerpsController['clearPendingTransactionRequests'];
|
|
93
268
|
};
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
269
|
+
/**
|
|
270
|
+
* Get saved trade configuration for a market
|
|
271
|
+
*
|
|
272
|
+
* @param symbol - The trading pair symbol.
|
|
273
|
+
* @returns The resulting string value.
|
|
274
|
+
*/
|
|
98
275
|
export type PerpsControllerGetTradeConfigurationAction = {
|
|
99
|
-
type:
|
|
276
|
+
type: `PerpsController:getTradeConfiguration`;
|
|
100
277
|
handler: PerpsController['getTradeConfiguration'];
|
|
101
278
|
};
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
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'];
|
|
109
288
|
};
|
|
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
|
+
*/
|
|
110
303
|
export type PerpsControllerSavePendingTradeConfigurationAction = {
|
|
111
|
-
type:
|
|
304
|
+
type: `PerpsController:savePendingTradeConfiguration`;
|
|
112
305
|
handler: PerpsController['savePendingTradeConfiguration'];
|
|
113
306
|
};
|
|
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
|
+
*/
|
|
114
314
|
export type PerpsControllerGetPendingTradeConfigurationAction = {
|
|
115
|
-
type:
|
|
315
|
+
type: `PerpsController:getPendingTradeConfiguration`;
|
|
116
316
|
handler: PerpsController['getPendingTradeConfiguration'];
|
|
117
317
|
};
|
|
318
|
+
/**
|
|
319
|
+
* Clear pending trade configuration for a market
|
|
320
|
+
*
|
|
321
|
+
* @param symbol - Market symbol
|
|
322
|
+
*/
|
|
118
323
|
export type PerpsControllerClearPendingTradeConfigurationAction = {
|
|
119
|
-
type:
|
|
324
|
+
type: `PerpsController:clearPendingTradeConfiguration`;
|
|
120
325
|
handler: PerpsController['clearPendingTradeConfiguration'];
|
|
121
326
|
};
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
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'];
|
|
125
336
|
};
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
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'];
|
|
129
346
|
};
|
|
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
|
+
*/
|
|
130
354
|
export type PerpsControllerSetSelectedPaymentTokenAction = {
|
|
131
|
-
type:
|
|
355
|
+
type: `PerpsController:setSelectedPaymentToken`;
|
|
132
356
|
handler: PerpsController['setSelectedPaymentToken'];
|
|
133
357
|
};
|
|
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
|
+
*/
|
|
134
362
|
export type PerpsControllerResetSelectedPaymentTokenAction = {
|
|
135
|
-
type:
|
|
363
|
+
type: `PerpsController:resetSelectedPaymentToken`;
|
|
136
364
|
handler: PerpsController['resetSelectedPaymentToken'];
|
|
137
365
|
};
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
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'];
|
|
141
375
|
};
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
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'];
|
|
145
385
|
};
|
|
146
|
-
|
|
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;
|
|
147
390
|
//# 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,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,CAAC;IACpC,OAAO,EAAE,eAAe,CAAC,aAAa,CAAC,CAAC;CACzC,CAAC;AAEF,MAAM,MAAM,iCAAiC,GAAG;IAC9C,IAAI,EAAE,8BAA8B,CAAC;IACrC,OAAO,EAAE,eAAe,CAAC,cAAc,CAAC,CAAC;CAC1C,CAAC;AAEF,MAAM,MAAM,kCAAkC,GAAG;IAC/C,IAAI,EAAE,+BAA+B,CAAC;IACtC,OAAO,EAAE,eAAe,CAAC,eAAe,CAAC,CAAC;CAC3C,CAAC;AAEF,MAAM,MAAM,mCAAmC,GAAG;IAChD,IAAI,EAAE,gCAAgC,CAAC;IACvC,OAAO,EAAE,eAAe,CAAC,gBAAgB,CAAC,CAAC;CAC5C,CAAC;AAEF,MAAM,MAAM,6BAA6B,GAAG;IAC1C,IAAI,EAAE,0BAA0B,CAAC;IACjC,OAAO,EAAE,eAAe,CAAC,UAAU,CAAC,CAAC;CACtC,CAAC;AAEF,MAAM,MAAM,iCAAiC,GAAG;IAC9C,IAAI,EAAE,8BAA8B,CAAC;IACrC,OAAO,EAAE,eAAe,CAAC,cAAc,CAAC,CAAC;CAC1C,CAAC;AAEF,MAAM,MAAM,kCAAkC,GAAG;IAC/C,IAAI,EAAE,+BAA+B,CAAC;IACtC,OAAO,EAAE,eAAe,CAAC,eAAe,CAAC,CAAC;CAC3C,CAAC;AAEF,MAAM,MAAM,8BAA8B,GAAG;IAC3C,IAAI,EAAE,2BAA2B,CAAC;IAClC,OAAO,EAAE,eAAe,CAAC,WAAW,CAAC,CAAC;CACvC,CAAC;AAEF,MAAM,MAAM,kCAAkC,GAAG;IAC/C,IAAI,EAAE,+BAA+B,CAAC;IACtC,OAAO,EAAE,eAAe,CAAC,eAAe,CAAC,CAAC;CAC3C,CAAC;AAEF,MAAM,MAAM,+BAA+B,GAAG;IAC5C,IAAI,EAAE,4BAA4B,CAAC;IACnC,OAAO,EAAE,eAAe,CAAC,YAAY,CAAC,CAAC;CACxC,CAAC;AAEF,MAAM,MAAM,oCAAoC,GAAG;IACjD,IAAI,EAAE,iCAAiC,CAAC;IACxC,OAAO,EAAE,eAAe,CAAC,iBAAiB,CAAC,CAAC;CAC7C,CAAC;AAEF,MAAM,MAAM,+BAA+B,GAAG;IAC5C,IAAI,EAAE,4BAA4B,CAAC;IACnC,OAAO,EAAE,eAAe,CAAC,YAAY,CAAC,CAAC;CACxC,CAAC;AAEF,MAAM,MAAM,
|
|
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,GAAG;IAC5C,IAAI,EAAE,4BAA4B,CAAC;IACnC,OAAO,EAAE,eAAe,CAAC,YAAY,CAAC,CAAC;CACxC,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,8BAA8B,GAAG;IAC3C,IAAI,EAAE,2BAA2B,CAAC;IAClC,OAAO,EAAE,eAAe,CAAC,WAAW,CAAC,CA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M,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,147 +1,390 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is auto generated.
|
|
3
|
+
* Do not edit manually.
|
|
4
|
+
*/
|
|
1
5
|
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
|
+
*/
|
|
2
13
|
export type PerpsControllerPlaceOrderAction = {
|
|
3
|
-
type:
|
|
14
|
+
type: `PerpsController:placeOrder`;
|
|
4
15
|
handler: PerpsController['placeOrder'];
|
|
5
16
|
};
|
|
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
|
+
*/
|
|
6
24
|
export type PerpsControllerEditOrderAction = {
|
|
7
|
-
type:
|
|
25
|
+
type: `PerpsController:editOrder`;
|
|
8
26
|
handler: PerpsController['editOrder'];
|
|
9
27
|
};
|
|
28
|
+
/**
|
|
29
|
+
* Cancel an existing order
|
|
30
|
+
*
|
|
31
|
+
* @param params - The operation parameters.
|
|
32
|
+
* @returns The cancellation result with status.
|
|
33
|
+
*/
|
|
10
34
|
export type PerpsControllerCancelOrderAction = {
|
|
11
|
-
type:
|
|
35
|
+
type: `PerpsController:cancelOrder`;
|
|
12
36
|
handler: PerpsController['cancelOrder'];
|
|
13
37
|
};
|
|
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
|
+
*/
|
|
14
45
|
export type PerpsControllerCancelOrdersAction = {
|
|
15
|
-
type:
|
|
46
|
+
type: `PerpsController:cancelOrders`;
|
|
16
47
|
handler: PerpsController['cancelOrders'];
|
|
17
48
|
};
|
|
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
|
+
*/
|
|
18
56
|
export type PerpsControllerClosePositionAction = {
|
|
19
|
-
type:
|
|
57
|
+
type: `PerpsController:closePosition`;
|
|
20
58
|
handler: PerpsController['closePosition'];
|
|
21
59
|
};
|
|
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
|
+
*/
|
|
22
67
|
export type PerpsControllerClosePositionsAction = {
|
|
23
|
-
type:
|
|
68
|
+
type: `PerpsController:closePositions`;
|
|
24
69
|
handler: PerpsController['closePositions'];
|
|
25
70
|
};
|
|
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
|
+
*/
|
|
26
84
|
export type PerpsControllerWithdrawAction = {
|
|
27
|
-
type:
|
|
85
|
+
type: `PerpsController:withdraw`;
|
|
28
86
|
handler: PerpsController['withdraw'];
|
|
29
87
|
};
|
|
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
|
+
*/
|
|
30
98
|
export type PerpsControllerGetPositionsAction = {
|
|
31
|
-
type:
|
|
99
|
+
type: `PerpsController:getPositions`;
|
|
32
100
|
handler: PerpsController['getPositions'];
|
|
33
101
|
};
|
|
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
|
+
*/
|
|
34
109
|
export type PerpsControllerGetOrderFillsAction = {
|
|
35
|
-
type:
|
|
110
|
+
type: `PerpsController:getOrderFills`;
|
|
36
111
|
handler: PerpsController['getOrderFills'];
|
|
37
112
|
};
|
|
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
|
+
*/
|
|
38
120
|
export type PerpsControllerGetOrdersAction = {
|
|
39
|
-
type:
|
|
121
|
+
type: `PerpsController:getOrders`;
|
|
40
122
|
handler: PerpsController['getOrders'];
|
|
41
123
|
};
|
|
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
|
+
*/
|
|
42
134
|
export type PerpsControllerGetOpenOrdersAction = {
|
|
43
|
-
type:
|
|
135
|
+
type: `PerpsController:getOpenOrders`;
|
|
44
136
|
handler: PerpsController['getOpenOrders'];
|
|
45
137
|
};
|
|
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
|
+
*/
|
|
46
145
|
export type PerpsControllerGetFundingAction = {
|
|
47
|
-
type:
|
|
146
|
+
type: `PerpsController:getFunding`;
|
|
48
147
|
handler: PerpsController['getFunding'];
|
|
49
148
|
};
|
|
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
|
+
*/
|
|
50
159
|
export type PerpsControllerGetAccountStateAction = {
|
|
51
|
-
type:
|
|
160
|
+
type: `PerpsController:getAccountState`;
|
|
52
161
|
handler: PerpsController['getAccountState'];
|
|
53
162
|
};
|
|
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
|
+
*/
|
|
54
184
|
export type PerpsControllerGetMarketsAction = {
|
|
55
|
-
type:
|
|
185
|
+
type: `PerpsController:getMarkets`;
|
|
56
186
|
handler: PerpsController['getMarkets'];
|
|
57
187
|
};
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
188
|
+
/**
|
|
189
|
+
* Toggle between testnet and mainnet
|
|
190
|
+
*
|
|
191
|
+
* @returns The toggle result with success status and current network mode.
|
|
192
|
+
*/
|
|
62
193
|
export type PerpsControllerToggleTestnetAction = {
|
|
63
|
-
type:
|
|
194
|
+
type: `PerpsController:toggleTestnet`;
|
|
64
195
|
handler: PerpsController['toggleTestnet'];
|
|
65
196
|
};
|
|
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
|
+
*/
|
|
66
212
|
export type PerpsControllerDisconnectAction = {
|
|
67
|
-
type:
|
|
213
|
+
type: `PerpsController:disconnect`;
|
|
68
214
|
handler: PerpsController['disconnect'];
|
|
69
215
|
};
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
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'];
|
|
73
238
|
};
|
|
239
|
+
/**
|
|
240
|
+
* Mark that the user has completed the tutorial/onboarding
|
|
241
|
+
* This prevents the tutorial from showing again
|
|
242
|
+
*/
|
|
74
243
|
export type PerpsControllerMarkTutorialCompletedAction = {
|
|
75
|
-
type:
|
|
244
|
+
type: `PerpsController:markTutorialCompleted`;
|
|
76
245
|
handler: PerpsController['markTutorialCompleted'];
|
|
77
246
|
};
|
|
78
247
|
export type PerpsControllerMarkFirstOrderCompletedAction = {
|
|
79
|
-
type:
|
|
248
|
+
type: `PerpsController:markFirstOrderCompleted`;
|
|
80
249
|
handler: PerpsController['markFirstOrderCompleted'];
|
|
81
250
|
};
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
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
|
+
*/
|
|
86
256
|
export type PerpsControllerResetFirstTimeUserStateAction = {
|
|
87
|
-
type:
|
|
257
|
+
type: `PerpsController:resetFirstTimeUserState`;
|
|
88
258
|
handler: PerpsController['resetFirstTimeUserState'];
|
|
89
259
|
};
|
|
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
|
+
*/
|
|
90
265
|
export type PerpsControllerClearPendingTransactionRequestsAction = {
|
|
91
|
-
type:
|
|
266
|
+
type: `PerpsController:clearPendingTransactionRequests`;
|
|
92
267
|
handler: PerpsController['clearPendingTransactionRequests'];
|
|
93
268
|
};
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
269
|
+
/**
|
|
270
|
+
* Get saved trade configuration for a market
|
|
271
|
+
*
|
|
272
|
+
* @param symbol - The trading pair symbol.
|
|
273
|
+
* @returns The resulting string value.
|
|
274
|
+
*/
|
|
98
275
|
export type PerpsControllerGetTradeConfigurationAction = {
|
|
99
|
-
type:
|
|
276
|
+
type: `PerpsController:getTradeConfiguration`;
|
|
100
277
|
handler: PerpsController['getTradeConfiguration'];
|
|
101
278
|
};
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
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'];
|
|
109
288
|
};
|
|
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
|
+
*/
|
|
110
303
|
export type PerpsControllerSavePendingTradeConfigurationAction = {
|
|
111
|
-
type:
|
|
304
|
+
type: `PerpsController:savePendingTradeConfiguration`;
|
|
112
305
|
handler: PerpsController['savePendingTradeConfiguration'];
|
|
113
306
|
};
|
|
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
|
+
*/
|
|
114
314
|
export type PerpsControllerGetPendingTradeConfigurationAction = {
|
|
115
|
-
type:
|
|
315
|
+
type: `PerpsController:getPendingTradeConfiguration`;
|
|
116
316
|
handler: PerpsController['getPendingTradeConfiguration'];
|
|
117
317
|
};
|
|
318
|
+
/**
|
|
319
|
+
* Clear pending trade configuration for a market
|
|
320
|
+
*
|
|
321
|
+
* @param symbol - Market symbol
|
|
322
|
+
*/
|
|
118
323
|
export type PerpsControllerClearPendingTradeConfigurationAction = {
|
|
119
|
-
type:
|
|
324
|
+
type: `PerpsController:clearPendingTradeConfiguration`;
|
|
120
325
|
handler: PerpsController['clearPendingTradeConfiguration'];
|
|
121
326
|
};
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
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'];
|
|
125
336
|
};
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
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'];
|
|
129
346
|
};
|
|
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
|
+
*/
|
|
130
354
|
export type PerpsControllerSetSelectedPaymentTokenAction = {
|
|
131
|
-
type:
|
|
355
|
+
type: `PerpsController:setSelectedPaymentToken`;
|
|
132
356
|
handler: PerpsController['setSelectedPaymentToken'];
|
|
133
357
|
};
|
|
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
|
+
*/
|
|
134
362
|
export type PerpsControllerResetSelectedPaymentTokenAction = {
|
|
135
|
-
type:
|
|
363
|
+
type: `PerpsController:resetSelectedPaymentToken`;
|
|
136
364
|
handler: PerpsController['resetSelectedPaymentToken'];
|
|
137
365
|
};
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
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'];
|
|
141
375
|
};
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
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'];
|
|
145
385
|
};
|
|
146
|
-
|
|
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;
|
|
147
390
|
//# sourceMappingURL=PerpsController-method-action-types.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
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,2BAA2B,CAAC;IAClC,OAAO,EAAE,eAAe,CAAC,WAAW,CAAC,CAAC;CACvC,CAAC;AAEF,MAAM,MAAM,gCAAgC,GAAG;IAC7C,IAAI,EAAE,6BAA6B,CAAC;IACpC,OAAO,EAAE,eAAe,CAAC,aAAa,CAAC,CAAC;CACzC,CAAC;AAEF,MAAM,MAAM,iC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C,CAAC;CAC7C,CAAC;AAEF,MAAM,MAAM,+BAA+B,GAAG;IAC5C,IAAI,EAAE,4BAA4B,CAAC;IACnC,OAAO,EAAE,eAAe,CAAC,YAAY,CAAC,CAAC;CACxC,CAAC;AAEF,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"PerpsController-method-action-types.d.mts","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,GAAG;IAC5C,IAAI,EAAE,4BAA4B,CAAC;IACnC,OAAO,EAAE,eAAe,CAAC,YAAY,CAAC,CAAC;CACxC,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,8BAA8B,GAAG;IAC3C,IAAI,EAAE,2BAA2B,CAAC;IAClC,OAAO,EAAE,eAAe,CAAC,WAAW,CAAC,CAAC;CACvC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,gCAAgC,GAAG;IAC7C,IAAI,EAAE,6BAA6B,CAAC;IACpC,OAAO,EAAE,eAAe,CAAC,aAAa,CAAC,CAAC;CACzC,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,iCAAiC,GAAG;IAC9C,IAAI,EAAE,8BAA8B,CAAC;IACrC,OAAO,EAAE,eAAe,CAAC,cAAc,CAAC,CAAC;CAC1C,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,kCAAkC,GAAG;IAC/C,IAAI,EAAE,+BAA+B,CAAC;IACtC,OAAO,EAAE,eAAe,CAAC,eAAe,CAAC,CAAC;CAC3C,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,mCAAmC,GAAG;IAChD,IAAI,EAAE,gCAAgC,CAAC;IACvC,OAAO,EAAE,eAAe,CAAC,gBAAgB,CAAC,CAAC;CAC5C,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,6BA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ources":["../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
|
+
{"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"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@metamask-previews/perps-controller",
|
|
3
|
-
"version": "2.0.0-preview-
|
|
3
|
+
"version": "2.0.0-preview-373edc9",
|
|
4
4
|
"description": "Controller for perpetual trading functionality in MetaMask",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"MetaMask",
|
|
@@ -65,12 +65,12 @@
|
|
|
65
65
|
"@metamask/account-tree-controller": "^7.0.0",
|
|
66
66
|
"@metamask/auto-changelog": "^3.4.4",
|
|
67
67
|
"@metamask/geolocation-controller": "^0.1.2",
|
|
68
|
-
"@metamask/keyring-controller": "^25.
|
|
68
|
+
"@metamask/keyring-controller": "^25.2.0",
|
|
69
69
|
"@metamask/keyring-internal-api": "^10.0.0",
|
|
70
70
|
"@metamask/network-controller": "^30.0.1",
|
|
71
71
|
"@metamask/profile-sync-controller": "^28.0.2",
|
|
72
72
|
"@metamask/remote-feature-flag-controller": "^4.2.0",
|
|
73
|
-
"@metamask/transaction-controller": "^
|
|
73
|
+
"@metamask/transaction-controller": "^64.0.0",
|
|
74
74
|
"@ts-bridge/cli": "^0.6.4",
|
|
75
75
|
"@types/jest": "^29.5.14",
|
|
76
76
|
"@types/uuid": "^8.3.0",
|