906.0.0
@metamask/perps-controller 3.0.0
Added
- Export
PerpsControllerGetStateActiontype (#8352) - Expose missing public
PerpsControllermethods through its messenger (#8352)- The following actions are now available:
PerpsController:calculateLiquidationPricePerpsController:calculateMaintenanceMarginPerpsController:clearDepositResultPerpsController:clearWithdrawResultPerpsController:completeWithdrawalFromHistoryPerpsController:depositWithConfirmationPerpsController:depositWithOrderPerpsController:fetchHistoricalCandlesPerpsController:flipPositionPerpsController:getActiveProviderPerpsController:getActiveProviderOrNullPerpsController:getAvailableDexsPerpsController:getBlockExplorerUrlPerpsController:getCachedMarketDataForActiveProviderPerpsController:getCachedUserDataForActiveProviderPerpsController:getCurrentNetworkPerpsController:getMarketDataWithPricesPerpsController:getMaxLeveragePerpsController:getWatchlistMarketsPerpsController:getWebSocketConnectionStatePerpsController:getWithdrawalProgressPerpsController:getWithdrawalRoutesPerpsController:initPerpsController:isCurrentlyReinitializingPerpsController:isFirstTimeUserOnCurrentNetworkPerpsController:isWatchlistMarketPerpsController:reconnectPerpsController:setLiveDataConfigPerpsController:startMarketDataPreloadPerpsController:stopMarketDataPreloadPerpsController:subscribeToAccountPerpsController:subscribeToCandlesPerpsController:subscribeToConnectionStatePerpsController:subscribeToOICapsPerpsController:subscribeToOrderBookPerpsController:subscribeToOrderFillsPerpsController:subscribeToOrdersPerpsController:subscribeToPositionsPerpsController:subscribeToPricesPerpsController:switchProviderPerpsController:toggleWatchlistMarketPerpsController:updateMarginPerpsController:updatePositionTPSLPerpsController:updateWithdrawalProgressPerpsController:updateWithdrawalStatusPerpsController:validateClosePositionPerpsController:validateOrderPerpsController:validateWithdrawal
- Corresponding action types are available as well.
- The following actions are now available:
- Add
completeWithdrawalFromHistorymethod for FIFO-based withdrawal completion matching (#8333) - Add
lastCompletedWithdrawalTimestampandlastCompletedWithdrawalTxHashesstate fields (#8333)
Changed
-
Refactor pending withdraw/deposit tracking to FIFO queue design (#8333)
-
Centralize Arbitrum network check in deposit hooks to prevent missing network errors (#8333)
-
Provider credentials, builder fee injection, and env var centralization (#8333)
-
Reduce max order amount by 0.5% buffer to avoid insufficient margin rejections (#8333)
-
Bump
@metamask/account-tree-controllerfrom^6.0.0to^7.0.0(#8325) -
Bump
@metamask/profile-sync-controllerfrom^28.0.1to^28.0.2(#8325) -
Bump
@metamask/controller-utilsfrom^11.19.0to^11.20.0(#8344) -
Bump
@metamask/messengerfrom^1.0.0to^1.1.1(#8364, #8373) -
Move
@myx-trade/sdkfromdependenciestooptionalDependenciesso consumers (extension, mobile) do not install it automatically (#8398)- Combined with the MYX adapter export removal below, this prevents
@myx-trade/sdkfrom entering the consumer's static webpack/metro import graph MYXProvidercontinues to load@myx-trade/sdkvia dynamicimport()whenMM_PERPS_MYX_PROVIDER_ENABLED=true
- Combined with the MYX adapter export removal below, this prevents
-
Add
/* webpackIgnore: true */magic comment to theMYXProviderdynamic import so webpack (extension) skips static resolution of the intentionally-unshipped module (#8398)
Removed
- BREAKING: Remove
adaptMarketFromMYX,adaptPriceFromMYX,adaptMarketDataFromMYX,filterMYXExclusiveMarkets,isOverlappingMarket,buildPoolSymbolMap,buildSymbolPoolsMap, andextractSymbolFromPoolIdfrom the public package exports to prevent@myx-trade/sdkfrom being included in the static webpack bundle (#8398)- These functions are still used internally by
MYXProvider, which is loaded via dynamic import - Consumers that imported these utilities directly should instead import from
@metamask/perps-controller/src/utils/myxAdapteror duplicate the logic locally
- These functions are still used internally by
Fixed
- Preserve
/* webpackIgnore: true */magic comment in built dist files by using a variable for the MYXProvider dynamic import path, preventing ts-bridge from rewriting the AST node and stripping the comment (#8424) - Fix incorrect fee estimate when flipping a position (#8333)
- Fix incorrect PnL and order size displayed after SL execution (#8333)
- Fix stop loss not showing up in recent activity (#8333)
- Fix incorrect market categories (#8333)
- Fix TP/SL decimal precision for PUMP (#8333)
- Fix missing decimal on price input when using preset on limit price (#8333)