All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- When
isHomepageSectionsV1Enabledis true,AccountTrackerControllernow uses all popular EVM networks (viaNetworkEnablementController:listPopularEvmNetworks) for balance refresh on account change and keyring unlock, instead of only the enabled networks fromNetworkEnablementControllerstate (#8117)
- Gate
TokenListControllerpolling on controller initialization to avoid duplicate token list API requests during startup races (#8113)
- Export
MAP_CAIP_CURRENCIESfrom the package (and fromMultichainAssetsRatesController) so consumers can resolve selected currency to the same CAIP currency string used by MultichainAssetsRatesController (#8076) - Add
includeTokenSecurityDataoption tosearchTokensandgetTrendingTokensto request token security data from the API (#8106) - Add
fetchTokenAssetsfunction to fetch token metadata by CAIP-19 asset IDs from the/assetsendpoint (#8106)- Supports optional flags:
includeAggregators,includeCoingeckoId,includeLabels,includeMarketData,includeOccurrences,includeTokenSecurityData,includeRwaData
- Supports optional flags:
- Export new types
TokenAsset,TokenSecurityData,TokenSecurityFeature,TokenSecurityHolder,TokenSecurityMarket,TokenSecurityFees,TokenSecurityFinancialStats, andTokenSecurityMetadata(#8106)
- Bump
@metamask/network-enablement-controllerfrom^4.1.2to^4.2.0(#8107) - Bump
@metamask/transaction-controllerfrom^62.18.0to^62.20.0(#8031 #8104)
- Fix
AccountsApiBalanceFetcherto apply stricter conditions when zeroing out token balances (#8044) - Fix
AccountsApiBalanceFetcherERC-20 zeroing to only apply to accounts included in the current request, preventing stale-account entries from being incorrectly reset to zero (#8095)
- Bump
@metamask/transaction-controllerfrom^62.17.1to^62.18.0(#8005)
- Fix token search API parameter to use
firstinstead oflimitfor pagination (#8019)- Clamp limit to a maximum of 50 results for regular queries
- Allow up to 500 results for Ondo token queries; limits exceeding 500 are clamped to 50
- Blockaid token filtering in
MultichainAssetsControllernow only removes tokens flagged asMalicious(#8003)Spam,Warning, andBenigntokens are no longer filtered out
- Bump
@metamask/accounts-controllerfrom^36.0.0to^36.0.1(#7996) - Bump
@metamask/network-controllerfrom^29.0.0to^30.0.0(#7996) - Bump
@metamask/network-enablement-controllerfrom^4.1.1to^4.1.2(#7996) - Bump
@metamask/polling-controllerfrom^16.0.2to^16.0.3(#7996) - Bump
@metamask/transaction-controllerfrom^62.17.0to^62.17.1(#7996)
- BREAKING:
MultichainAssetsControllerMessengernow requires thePhishingController:bulkScanTokensaction to be allowed (#7923)- Consumers constructing the messenger must include this action in the allowed actions list
- Add Blockaid token security scanning to
MultichainAssetsControllerto filter out spam, malicious, and warning tokens during automatic asset detection (#7923)- Tokens with
assetNamespaceof "token" (e.g. SPL tokens) are scanned via thePhishingController:bulkScanTokensmessenger action - Only tokens with a
Benignresult are kept; native assets (e.g.slip44) are not scanned - The filter fails open: if the scan is unreachable or returns an error, all tokens are kept
- Filtering applies to account-added and asset-list-updated events;
addAssets(curated list) is not filtered - Token addresses are batched into groups of 100 to stay within the
bulkScanTokensper-request limit
- Tokens with
- Bump
@metamask/phishing-controllerfrom^16.2.0to^16.3.0(#7979) - Bump
@metamask/network-enablement-controllerfrom^4.1.0to^4.1.1(#7984) - Bump
@metamask/core-backendfrom^5.0.0to^6.0.0(#7993) - Change MegaETH mainnet occurences filtering for getTokensURL (#7994)
- Bump
@metamask/controller-utilsfrom^11.18.0to^11.19.0(#7995)
CodefiTokenPricesServiceV2now supports fetching prices of ETH on Ink Mainnet (chain0xdef1) (#7688)- Added Chiliz Chain native token (#7939)
- Changed Plasma native token (#7939)
searchTokensnow returns an optionalerrorfield when requests fail, allowing consumers to detect and handle search failures instead of silently receiving empty results (#7938)
- Bump
@metamask/accounts-controllerfrom^35.0.2to^36.0.0(#7897) - Bump
@metamask/keyring-apifrom^21.0.0to^21.5.0(#7857) - Bump
@metamask/account-tree-controllerfrom^4.0.0to^4.1.1(#7869), (#7897) - Bump
@metamask/multichain-account-servicefrom^5.1.0to^7.0.0(#7869), (#7897) - Bump
@metamask/transaction-controllerfrom^62.15.0to^62.17.0(#7872), (#7897) - Bump
@metamask/phishing-controllerfrom^16.1.0to^16.2.0(#7883) - Optimize Price API performance by deduplicating concurrent API calls (#7811)
- Add in-flight promise caching for
fetchSupportedNetworks()to prevent duplicate concurrent requests - Update
fetchTokenPrices()andfetchExchangeRates()to only refresh supported networks/currencies when no cached value exists
- Add in-flight promise caching for
- Remove
Tempo Testnetmulticall address (#7858).
- Add optional
rwaDatasupport when adding tokens inTokensController(#7804).
- Lock
@metamask/core-backendto5.0.0(#7852) - Bump
@metamask/profile-sync-controllerfrom^27.0.0to^27.1.0(#7849) - Fix trending tokens showing incorrect market cap values by adding
usePriceApiDataparameter (defaults totrue) to use price API data for accurate market data (#7829) - Bump
@metamask/transaction-controllerfrom^62.13.0to^62.15.0(#7832, #7854)
- Ensure TokenBalancesController zeroes out ERC tokens that are not returned from Accounts API (#7861)
- The Accounts API does not return tokens that are empty/have zero balance, but we need to make sure that the API service can return zero balance, so we can correctly update the TokenBalancesController state and prevent stale values (e.g. when a user swaps/sends all their balance for a given ERC-20 token - we need to update the state for that token to zero and not show the old value)
- Add
HYPEREVMsupport (#7790)- Add
HYPEREVMinSupportedTokenDetectionNetworks - Add
HYPEREVMinSUPPORTED_NETWORKS_ACCOUNTS_API_V4
- Add
- Simplify TokenListController initialization (#7740)
- Bump
@metamask/storage-servicefrom^0.0.1to^1.0.0(#7797) - Bump
@metamask/transaction-controllerfrom^62.11.0to^62.13.0(#7775, #7802) - Bump
@metamask/preferences-controllerfrom^22.0.0to^22.1.0(#7802)
- Removed token-search-discovery-controller package (#7789)
- Add multicall address for the chain:
Tempo Testnet(#7753)
- Bump
@metamask/transaction-controllerfrom^62.10.0to^62.11.0(#7760)
- Bump
@metamask/transaction-controllerfrom^62.9.2to^62.10.0(#7737) - Expand NFT auto-detection to include BSC, Polygon, Avalanche, and Base chains in addition to existing supported chains (#7730)
- BREAKING: Remove
clearingTokenListData()method fromTokenListController(#7743)- Token list cache is now persistent across network changes and should not be cleared
- BREAKING: Remove
preventPollingOnNetworkRestartstate property fromTokenListController(#7743)- Constructor parameter
preventPollingOnNetworkRestartis no longer accepted - Method
updatePreventPollingOnNetworkRestart()has been removed - State no longer includes
preventPollingOnNetworkRestartfield
- Constructor parameter
- Remove
StorageServiceRemoveItemActionfromTokenListControllerallowed actions (#7743)- No longer needed as cache clearing functionality has been removed
- BREAKING:
TokenListControllernow persiststokensChainsCacheviaStorageServiceand requires clients to callinitialize()after construction (#7413)- Each chain's token cache is stored in a separate file, reducing write amplification
- All chains are loaded in parallel at startup to maintain compatibility with TokenDetectionController
tokensChainsCachestate metadata now haspersist: falseto prevent duplicate persistence- Clients must call
await controller.initialize()before using the controller - State changes are automatically persisted via debounced subscription
- Add dynamic fetching of supported networks from
/v2/supportedNetworksAPI endpoint with fallback to hardcoded list (#7716)- Add
fetchSupportedNetworks(),getSupportedNetworks(), andresetSupportedNetworksCache()exports from token-prices-service - Add
setNativeAssetIdentifiers()method toCodefiTokenPricesServiceV2for CAIP-19 native token lookups - Add
updateSupportedNetworks()method toCodefiTokenPricesServiceV2 - Add
NativeAssetIdentifiersMaptype export from token-prices-service
- Add
- BREAKING: Integrate
TokenRatesControllerwithNetworkEnablementControllerto use native asset identifiers for token price lookups (#7716) - Bump
@metamask/keyring-controllerfrom^25.0.0to^25.1.0(#7713) - Add
@metamask/network-enablement-controlleras a dependency (#7716)
- BREAKING: Remove swaps token fetching functionality from TokenSearchDiscoveryDataController (#7712)
- Remove
swapsTokenAddressesByChainIdfrom controller state - Remove
swapsSupportedChainIds,fetchTokens, andfetchSwapsTokensThresholdMsconstructor parameters - Remove
fetchSwapsTokensmethod
- Remove
- Add dynamic fetching of supported currencies from
/v1/supportedVsCurrenciesAPI endpoint with fallback to hardcoded list (#7699)
- Removed call to NFT collections endpoint (#7687)
- Bump
@metamask/multichain-account-servicefrom^5.0.0to^5.1.0(#7678) - Set zero address for native token of Henesys/MSU (#7666)
- BREAKING: Remove unused deprecated
getNFTContractInfofunction from NftController (#7703)
- Fix crash in
selectAllMultichainAssetsselector when asset metadata is missingunitsproperty (#7702)
- Add BOB (0xed88) mapping to eip155:60808/erc20:0x0000000000000000000000000000000000000000 (#7635)
- Bump
@metamask/accounts-controllerfrom^35.0.1to^35.0.2(#7642) - Bump
@metamask/network-controllerfrom^28.0.0to^29.0.0(#7642) - Bump
@metamask/polling-controllerfrom^16.0.1to^16.0.2(#7642) - Bump
@metamask/transaction-controllerfrom^62.9.1to^62.9.2(#7642)
- Fix native token fiat calculation for chains without market data by using currency rate fallback (#7636)
- Add RWA data to asset fetching endpoints (#7548)
- Add Rootstock (0x1e) mapping to eip155:30/erc20:0x542fda317318ebf1d3deaf76e0b632741a7e677d for RBTC (#7601)
- Bump
@metamask/transaction-controllerfrom^62.8.0to^62.9.0(#7602) - Bump
@metamask/transaction-controllerfrom^62.8.0to^62.9.1(#7602, #7604) - Bump
@metamask/network-controllerfrom^27.2.0to^28.0.0(#7604) - Bump
@metamask/accounts-controllerfrom^35.0.0to^35.0.1(#7604) - Bump
@metamask/polling-controllerfrom^16.0.0to^16.0.1(#7604) - Update Plasma (0x2611) mapping to eip155:9745/erc20:0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee for XPL (#7601)
TokensController.watchAssetnow supports optional origin/page metadata and safely falls back for empty origins to avoid rejected approvals (#7612)- Refactor
CurrencyRateControllerexchange rate fetching with improved fallback logic (#7606)- Improved partial success handling: when some currencies succeed via the Price API and others fail, only failed currencies trigger the fallback mechanism
- Extracted helper methods for better code organization and testability
- Add RWA (Real World Assets) data support for token metadata endpoint (#7595)
- Update token service to include RWA data in API requests by appending
includeRwaData=trueparameter to token list API calls TokenListControllernow includesrwaDataoptional field inTokenListTokentype to support RWA data in token list retrieval- Reduced
TokenListControllercache time from 24hrs to 4hrs.
- Update token service to include RWA data in API requests by appending
- Bump
@metamask/multichain-account-servicefrom^4.1.0to^5.0.0(#7594) - Bump
@metamask/transaction-controllerfrom^62.7.0to^62.8.0(#7596) AccountTrackerControllernow triggers an immediate balance refresh when the keyring is unlocked, instead of waiting for the next polling cycle (#7585)
- Add missing native coin non-zero address for networks: Gnosis and MSU (#7592)
- Add RWA (Real World Assets) data support to token service (#7560)
- Add
includeRwaDataoptional parameter togetTrendingTokensfunction to include RWA data in results - Add
TokenRwaDatatype for RWA token metadata (market hours, pause times, ticker, instrument type) - Add
TokenSearchItemtype with optionalrwaDatafield for token search results - Add
rwaDataoptional field toTrendingAssettype
- Add
- Update spot-prices endpoint list of supported chains and assets (#7543)
- Export
selectAllAssets(#7496) - Add multicall address for
MSU (MapleStory Universe)(#7453) - Add MSU (MapleStory Universe) and Etherlink in Spot Prices support (#7453)
- Set MSU native token address to
eip155:68414/erc20:0xf2b51cc1850fed939658317a22d73d3482767591instead ofeip155:68414/erc20:0x0000000000000000000000000000000000000000- particular case where the native token doesn't have the zero address (#7578)
- Bump
@metamask/snaps-controllersfrom^14.0.1to^17.2.0(#7550) - Bump
@metamask/snaps-sdkfrom^9.0.0to^10.3.0(#7550) - Bump
@metamask/snaps-utilsfrom^11.0.0to^11.7.0(#7550) - Upgrade
@metamask/utilsfrom^11.8.1to^11.9.0(#7511) - Bump
@metamask/permission-controllerfrom^12.1.1to^12.2.0(#7559) - BREAKING:
AccountTrackerControllernow requiresKeyringController:getStateaction andKeyringController:lockevent in addition to existing allowed actions and events (#7492)- Added
#isLockedproperty to track keyring lock state, initialized fromKeyringController:getState - Added
isActivegetter that returnstruewhen keyring is unlocked and user is onboarded - Balance updates are now skipped when controller is not active (locked or not onboarded)
KeyringController:unlockevent now only updates lock state without triggering immediate refreshKeyringController:lockevent sets controller to inactive state
- Added
AccountTrackerControllernow only refreshes balances for the newly added network onNetworkController:networkAddedevent instead of all networks (#7492)- Bump
@metamask/transaction-controllerfrom^62.5.0to^62.7.0(#7494) - Bump
@metamask/multichain-account-servicefrom^4.0.1to^4.1.0(#7515 - Bump
@metamask/controller-utilsfrom^11.16.0to^11.18.0(#7534, #7583) - Bump
@metamask/network-controllerfrom^27.0.0to^27.2.0(#7534, #7583)
- Add
excludeLabelsparameter togetTrendingTokensto filter out tokens by labels (e.g., 'stable_coin', 'blue_chip') (#7466) - Add support for spot prices on multiple new chains: Apechain, Lens, Plume, Flow EVM, Berachain, xrpl-evm, Fraxtal, Lukso, xdc-network, and Plasma (#7465)
- Add
apetoSUPPORTED_CURRENCIESfor ApeCoin/Apechain native token (#7465) - Add
isOnboardedconstructor option toTokenBalancesControllerandAccountTrackerController(#7469)- When
isOnboarded()returnsfalse, balance updates are skipped to prevent unnecessary API calls during onboarding TokenBalancesController.isActivenow also checksisOnboarded()in addition toisUnlockedAccountTrackerController.#refreshAccountsnow checksisOnboarded()before fetching balances
- When
- Fix
TokenBalancesControllerto evaluateallowExternalServicesdynamically instead of only at constructor time (#7469)- Previously, the
#balanceFetchersarray was built once in the constructor, so changes toallowExternalServices()after initialization were not reflected - Now
allowExternalServices()is stored as a function and evaluated dynamically in the fetcher'ssupportsmethod
- Previously, the
- Fix
TokenDetectionControllermethodsaddDetectedTokensViaPollingandaddDetectedTokensViaWsto refresh token metadata cache before use (#7469)- Previously, these methods used a potentially stale/empty
#tokensChainsCachefrom construction time - Now they fetch the latest
tokensChainsCachefromTokenListController:getStatebefore looking up token metadata
- Previously, these methods used a potentially stale/empty
- Fix
AccountTrackerController.syncBalanceWithAddressesto also checkisOnboarded()before fetching balances (#7469)- Previously, only
#refreshAccountscheckedisOnboarded(), butsyncBalanceWithAddresseswould still make RPC calls during onboarding - Now
syncBalanceWithAddressesreturns an empty object whenisOnboarded()returnsfalse
- Previously, only
- Add
firstPageOnlyandsignaloptions toNftDetectionController.detectNfts()method to allow fetching only the first page of NFTs and aborting detection operations (#7436) - Support for Monad in NFT assets-controllers, #7254
- Bump
@metamask/transaction-controllerfrom^62.4.0to^62.5.0(#7325) - BREAKING: Replace Account API v2 with Account API v4 for token auto-detection (#7408)
TokenDetectionControllernow delegates token detection for Account API v4 supported chains toTokenBalancesController- RPC-based detection continues to be used for chains not supported by Account API v4
- Added
forceRpcparameter toTokenDetectionController.detectTokens()to force RPC-based detection TokenDetectionController:detectTokensaction is now registered for cross-controller communication
TokenBalancesControllernow triggers RPC-based token detection as fallback when Account API v4 fails or returns unprocessed chains (#7408)- Calls
TokenDetectionController:detectTokenswithforceRpc: truewhen fetcher fails - Calls
TokenDetectionController:detectTokenswithforceRpc: truefor any unprocessed chain IDs returned by the API
- Calls
- Refactored
TokenBalancesControllerfor improved code organization and maintainability (#7408) - Remove warning logs for failed chain balance fetches in RPC balance fetcher (#7429)
- Reduce severity of ERC721 metadata interface log from
console.errortoconsole.warn(#7412)- Fixes #24988
- Bump
@metamask/transaction-controllerfrom^62.4.0to^62.6.0(#7325, #7430) - Bump
@metamask/multichain-account-servicefrom^4.0.0to^4.0.1(#7437
- Fix stale
accountsAssetsreference inMultichainAssetsRatesControllercausing incorrect conversion rates for non-EVM chains when currency is changed (#7424)MultichainAssetsRatesControllernow dynamically fetches fresh state instead of caching a reference that becomes stale due to Immer's immutable updates
- BREAKING:
NftDetectionControllernow calls a new functionNftController:addNftsthat reduces API calls to bulk-scan to batch multiple NFTs URLs (#7411) - Added decimal precision (default 9dp) for
CurrencyRateControllerconversionRateandconversionRateproperties. (#7324)- This fixes any BigNumber conversion errors due to exceeding the 15 significant digit limit
- Add multicall address for Chains:
MegaETH Testnet V2,MegaETH Mainnet(#7287)
- Fix trending tokens API request to use correct
sortquery parameter instead ofsortBy(#7310)
- BREAKING:
TokenBalancesControllernow subscribes toAccountsController:selectedEvmAccountChangeevent to trigger immediate balance updates when users switch accounts (#7279)
- Bump
@metamask/network-controllerfrom^26.0.0to^27.0.0(#7258) - Bump
@metamask/transaction-controllerfrom^62.3.0to^62.4.0(#7257, #7289) AccountTrackerControllernow normalizes addresses to lowercase internally before calling balance fetchers to matchTokenBalancesControllerand enable HTTP request caching (#7279)
- Fix 2dp value in
CurrencyRateController(#7276) - Fix token search API to use correct
networksquery parameter instead ofchainIds(#7261)
- Support for optionally fetching market data when calling searchTokens (#7226)
- BREAKING: Add optional JWT token authentication to multi-chain accounts API calls (#7165)
fetchMultiChainBalancesandfetchMultiChainBalancesV4now accept an optionaljwtTokenparameterTokenDetectionControllerfetches and passes JWT token fromAuthenticationControllerwhen using Accounts APITokenBalancesControllerfetches and passes JWT token through balance fetcher chain- JWT token is included in
Authorization: Bearer <token>header when provided - Backward compatible: token parameter is optional and APIs work without authentication
- Move peer dependencies for controller and service packages to direct dependencies (#7209, #7220, #7236)
- The dependencies moved are:
@metamask/account-tree-controller(^4.0.0)@metamask/accounts-controller(^35.0.0)@metamask/approval-controller(^8.0.0)@metamask/core-backend(^5.0.0)@metamask/keyring-controller(^25.0.0)@metamask/multichain-account-service(^4.0.0)@metamask/network-controller(^26.0.0)@metamask/permission-controller(^12.1.1)@metamask/phishing-controller(^16.1.0)@metamask/preferences-controller(^22.0.0)@metamask/profile-sync-controller(^27.0.0)@metamask/snaps-controllers(^14.0.1)@metamask/transaction-controller(^62.3.0)
- In clients, it is now possible for multiple versions of these packages to exist in the dependency tree.
- For example, this scenario would be valid: a client relies on
@metamask/controller-a1.0.0 and@metamask/controller-b1.0.0, and@metamask/controller-bdepends on@metamask/controller-a1.1.0.
- For example, this scenario would be valid: a client relies on
- Note, however, that the versions specified in the client's
package.jsonalways "win", and you are expected to keep them up to date so as not to break controller and service intercommunication.
- The dependencies moved are:
- Fix
TokenBalancesControllerstate that store both lowercase and checksum account addresses (#7217) TokenBalancesController: state inconsistency by ensuring all account addresses are stored in lowercase format (#7216)- Add MON (Monad) to supported currencies list in token prices service (#7250)
- BREAKING: Update
spot-pricesendpoint to use Price API v3 (#7119)- Update
AbstractTokenPricesService.fetchTokenPricesarguments and return type - Update
CodefiTokenPricesServiceV2list of supported currencies - Update
TokenRatesControllerto fetch prices by native currency instead of by chain - Remove legacy polling code and unused events from
TokenRatesController
- Update
- Added optional filtering of Tron staking tokens (energy, bandwidth) in asset selectors
selectAssetsBySelectedAccountGroup(defaults totrue) (#7198)
- Bump
@metamask/polling-controllerfrom^15.0.0to^16.0.0(#7202) - Bump
@metamask/controller-utilsfrom^11.15.0to^11.16.0(#7202) - BREAKING: Bump
@metamask/transaction-controllerfrom^61.0.0to^62.0.0(#7202) - BREAKING: Bump
@metamask/preferences-controllerfrom^21.0.0to^22.0.0(#7202) - BREAKING: Bump
@metamask/phishing-controllerfrom^15.0.0to^16.0.0(#7202) - BREAKING: Bump
@metamask/network-controllerfrom^25.0.0to^26.0.0(#7202) - BREAKING: Bump
@metamask/keyring-controllerfrom^24.0.0to^25.0.0(#7202) - BREAKING: Bump
@metamask/core-backendfrom^4.1.0to^5.0.0(#7202) - BREAKING: Bump
@metamask/accounts-controllerfrom^34.0.0to^35.0.0(#7202) - BREAKING: Bump
@metamask/account-tree-controllerfrom^3.0.0to^4.0.0(#7202)
- Fix duplicate native token address in
CurrencyRateControllerspot price fallback API requests (#7181)
- BREAKING: Remove fallback to CryptoCompare on
CurrencyRatesControllerandTokenRatesController(#7167) - Bump
@metamask/core-backendfrom^4.0.0to^4.1.0
- Enable RPC fallback when Accounts API fails or times out in
TokenBalancesController(#7155)- Add 30-second timeout protection for Accounts API balance fetching requests
- Propagate API errors to
TokenBalancesControllerto trigger automatic RPC fallback - Remove error catching that prevented RPC fetcher from processing failed chains
- Ensures native and staked balances are always fetched via RPC when API is unavailable
- Add 30-second timeout protection for Accounts API calls in
TokenDetectionControllerto prevent hanging requests (#7106)- Prevents token detection from hanging indefinitely on slow or unresponsive API requests
- Automatically falls back to RPC-based token detection when API call times out or fails
- Includes error logging for debugging timeout and failure events
- Handle
unprocessedNetworksfrom Accounts API responses to ensure complete token detection coverage (#7106)- When Accounts API returns networks it cannot process, those networks are automatically added to RPC detection
- Applies to both
TokenDetectionControllerandTokenBalancesController - Ensures all requested networks are processed even if API has partial support
- BREAKING: Bump
@metamask/account-tree-controllerfrom^2.0.0to^3.0.0(#7100) - BREAKING: Bump
@metamask/multichain-account-servicefrom^2.0.0to^3.0.0(#7100)
- Remove early return for empty
chainIdsinsearchTokensfunction to allow API to handle empty chain IDs (#7083)
- Importing a non-evm asset with positive balance sets balance to 0 after import (#7094)
- Added
getTrendingTokensfunction to fetch trending tokens for specific chains ([#7054]) (#7054) - Added new types
SortTrendingByandTrendingAsset([#7054]) (#7054)
- Add
AssetsByAccountGroupto list of exported types (#6983) - Added
addAssetsto allow adding multiple assets for non-EVM chains (#7016)
isNativeis inferred astruefor all non-evm assets with slip44 as its asset namespace (#6983)- BREAKING: Modify DeFi position fetching behaviour (#6944)
- The fetch request to the API times out after 8 seconds and attempts a single retry
- Refresh only updates the selected evm address
KeyringController:unlockno longer starts pollingAccountsController:accountAddedno longer updates DeFi positionsAccountTreeController:selectedAccountGroupChangeupdates DeFi positions for the selected addressTransactionController:transactionConfirmedonly updates DeFi positions if the transaction is for the selected address
- Fixed token is not removed from ignored tokens list when added back due to case insensiteivity (#7016)
- BREAKING: Modify AccountTrackerController events and actions (#6938)
AccountsController:selectedAccountChangeis no longer part of the list of allowed eventsNetworkController:getStaterefetches balancesTransactionController:unapprovedTransactionAddedrefetches balancesTransactionController:unapprovedTransactionAdded'refetches balances for the transaction from address and networkTransactionController:transactionConfirmedrefetches balances for the transaction from address and network
- Add optional
fetchingEnabledcallback toAccountTrackerControllerconstructor to stop it from fetching balances (#6938)
-
BREAKING: Added constructor argument
tokenPricesServiceincurrencyRateController(#6863) -
Added
fetchExchangeRatesfunction to fetch exchange rates from price-api (#6863) -
Added
ignoreAssetsto allow ignoring assets for non-EVM chains (#6981) -
Added
searchTokensfunction to search for tokens across multiple networks using CAIP format chain IDs (#7004)
- Bump
@metamask/controller-utilsfrom^11.14.1to^11.15.0(#7003) CurrencyRateControllernow fetches exchange rates from price-api and fallback to cryptoCompare (#6863)
- Add export for
CurrencyRateMessenger(#6444)
- BREAKING: Migrate controllers to new
Messengerfrom@metamask/messenger(#6444, #6386, #6745)- Previously, the controllers accepted a
RestrictedMessengerinstance from@metamask/base-controller.
- Previously, the controllers accepted a
- BREAKING: Bump
@metamask/account-tree-controllerfrom^1.0.0to^2.0.0(#6962) - BREAKING: Bump
@metamask/accounts-controllerfrom^33.0.0to^34.0.0(#6962) - BREAKING: Bump
@metamask/approval-controllerfrom^7.0.0to^8.0.0(#6962) - BREAKING: Bump
@metamask/core-backendfrom^3.0.0to^4.0.0(#6962) - BREAKING: Bump
@metamask/keyring-controllerfrom^23.0.0to^24.0.0(#6962) - BREAKING: Bump
@metamask/network-controllerfrom^24.0.0to^25.0.0(#6962) - BREAKING: Bump
@metamask/permission-controllerfrom^11.0.0to^12.0.0(#6962) - BREAKING: Bump
@metamask/phishing-controllerfrom^14.0.0to^15.0.0(#6962) - BREAKING: Bump
@metamask/preferences-controllerfrom^20.0.0to^21.0.0(#6962) - BREAKING: Bump
@metamask/transaction-controllerfrom^60.0.0to^61.0.0(#6962) - Bump
@metamask/polling-controllerfrom^14.0.1to^15.0.0(#6940, #6962) - Bump
@metamask/base-controllerfrom^8.4.2to^9.0.0(#6962)
- Add
Monad MainnetintoSUPPORTED_NETWORKS_ACCOUNTS_API_V4
- Fix incorrect balance scan contract address for
Monad Mainnet- Remove
Monad MainnetinSINGLE_CALL_BALANCES_ADDRESS_BY_CHAINID(#6929)
- Remove
- BREAKING: Bump peer dependency
@metamask/core-backendfrom^2.0.0to^3.0.0(#6923) - Bump
@metamask/base-controllerfrom^8.4.1to^8.4.2(#6917)
- Downgrade
multiformatsto^9.9.0to avoid ESM-only dependency (#6920)
- BREAKING: Add new event listeners to refresh balances on
TransactionControllerUnapprovedTransactionAddedEventandTransactionControllerTransactionConfirmedEvent(#6903) - Add multicall addresses in
MULTICALL_CONTRACT_BY_CHAINID(#6896)- Add multicall address for Chains:
Injective,Hemi,Plasma,Nonmia,XRPL,Soneium,Genesys,EDU,Abstract,Berachain,MegaETH Testnet,Apechain,Matchain,Monad Testnet,Monad,Katana,Lens,Plume,XDC
- Add multicall address for Chains:
- Batch
OnAssetConversionandOnAssetsMarketDatarequests to non-EVM account Snaps (#6886)
- Fix filter for staked Ethereum balances in
AccountTrackerController(#6846)
- BREAKING: Bump peer dependency
@metamask/core-backendfrom^1.0.1to^2.0.0(#6834)
- Fix address casing in WebSocket-based token balance updates to ensure consistency (#6819)
- Add real-time balance updates via WebSocket integration with
AccountActivityServicetoTokenBalancesController(#6784)- Add
@metamask/core-backendas a dependency and peer dependency (#6784) - Controller now subscribes to
AccountActivityService:balanceUpdatedevents for instant balance updates- Add support for real-time balance updates for both ERC20 tokens and native tokens
- Add
TokenDetectionController:addDetectedTokensViaWsaction handler for adding tokens detected via WebSocket
- Controller now subscribes to
AccountActivityService:statusChangedevents to dynamically adjust polling intervals- When WebSocket service is "up", polling interval increases to backup interval (5 minutes)
- When WebSocket service is "down", polling interval restores to default interval (30 seconds)
- Status changes are debounced (5 seconds) and jittered to prevent thundering herd
- Add fallback to polling when balance updates contain errors or unsupported asset types
- Add
- BREAKING:
TokenBalancesControllermessenger must now allowAccountActivityService:balanceUpdatedandAccountActivityService:statusChangedevents (#6784) - BREAKING:
TokenBalancesControllermessenger must now allowTokenDetectionController:addDetectedTokensViaWsaction (#6784) - BREAKING: Change
TokenBalancesControllerdefault polling interval to 30 seconds (was 180 seconds) (#6784)- With real-time WebSocket updates, the default interval only applies when WebSocket is disconnected
- When WebSocket is connected, polling automatically adjusts to 5 minutes as a backup
- Performance Optimization: Remove collection API calls from NFT detection process (#6762)
- Reduce NFT detection API calls by 83% (from 6 calls to 1 call per 100 tokens) by eliminating collection endpoint requests
- Remove unused collection metadata fields:
contractDeployedAt,creator, andtopBid
- Fix address format compatibility between
TokenBalancesControllerandAccountTrackerControllerinAccountsApiBalanceFetcher(#6812)
- Bump
@metamask/base-controllerfrom^8.4.0to^8.4.1(#6807) - Bump
@metamask/controller-utilsfrom^11.14.0to^11.14.1(#6807) - Bump
@metamask/polling-controllerfrom^14.0.0to^14.0.1(#6807)
- BREAKING: Change name of token-selector field from
typetoaccountTypeto avoid conflicts with existing types. (#6804)
- Bump
@metamask/multichain-account-servicefrom^1.5.0to^1.6.0(#6786)
- Fix duplicate native token entries in
AccountsApiBalanceFetcherby ensuring consistent address checksumming (#6794)
- add
platformproperty toTokenBalancesControllerto send better analytics for which platform is hitting out APIs (#6768)
- BREAKING: Change
accountsApiChainIdsparameter fromChainIdHex[]to() => ChainIdHex[]in bothAccountTrackerControllerandTokenBalancesController(#6776)- Enables dynamic configuration of chains that should use Accounts API strategy
- Allows runtime determination of supported chain IDs instead of static array
- Fix staked balance update on the
TokenBalancesController, it's now filtered by supported chains (#6776)
- Bump
@metamask/multichain-account-servicefrom^1.2.0to^1.3.0(#6748)
- Fix token balance updates not respecting account selection parameter (#6738)
- Bump
@metamask/utilsfrom^11.8.0to^11.8.1(#6708)
- Fix unnecessary balance updates in
TokenBalancesControllerby skipping updates when values haven't changed (#6743)- Prevents unnecessary state mutations for token balances when values are identical
- Improves performance by reducing redundant processing and re-renders
- BREAKING: Rename
openSeaEnabledtodisplayNftMediainNftController(#4774)- Ensure compatibility for extension preferences controller state
- BREAKING: Remove
setApiKeyfunction andopenSeaApiKeyfromNftControllersince opensea is not used anymore for NFT data (#4774) - Bump
@metamask/phishing-controllerfrom^13.1.0to^14.0.0(#6716, #6629) - Bump
@metamask/preferences-controllerfrom^19.0.0to^20.0.0(#6716, #6629)
- Add generic number formatter (#6664)
- The new formatter is available as the
formatNumberproperty on the return value ofcreateFormatters.
- The new formatter is available as the
- BREAKING: Bump peer dependency
@metamask/account-tree-controllerfrom^0.7.0to^1.0.0(#6652, #6676)
- Add
Monad Mainnetsupport (#6618)- Add
Monad Mainnetbalance scan contract address inSINGLE_CALL_BALANCES_ADDRESS_BY_CHAINID - Add
Monad MainnetinSupportedTokenDetectionNetworks - Add
Monad MainnetinSUPPORTED_CHAIN_IDS
- Add
- Bump
@metamask/controller-utilsfrom^11.13.0to^11.14.0(#6629) - Bump
@metamask/base-controllerfrom^8.3.0to^8.4.0(#6632)
- Fix
TokenBalancesControllerselective session stopping to prevent old polling sessions from interfering with new ones when chain configurations change (#6635)
- Shared fiat currency and token formatters (#6577)
- Add
queryAllAccountsparameter support toAccountTrackerController.refresh(),AccountTrackerController._executePoll(), andTokenBalancesController.updateBalances()for flexible account selection during balance updates (#6600) - Bump
@metamask/utilsfrom^11.4.2to^11.8.0(#6588) - Bump
@metamask/controller-utilsfrom^11.12.0to^11.13.0(#6620)
- Add two new controller state metadata properties:
includeInStateLogsandusedInUi(#6472)
- BREAKING: Replace
useAccountAPIboolean withaccountsApiChainIdsarray inTokenBalancesControllerfor granular per-chain Accounts API configuration (#6487) - Bump
@metamask/keyring-apifrom^20.1.0to^21.0.0(#6560)
- Enhance
TokenBalancesControllerwith internal dynamic polling per chain support, enabling configurable polling intervals for different networks with automatic interval grouping for improved performance (transparent to existing API) (#6357) - Bump
@metamask/base-controllerfrom^8.2.0to^8.3.0(#6465)
- Refactor
AccountTrackerControllerto eliminate duplicate code by replacing customAccountTrackerRpcBalanceFetcherwith existingRpcBalanceFetcher(#6425)
-
Fix values returned from multicall fetcher to use the correct BN type, not BigNumber (#6411)
-
Ensure every access to the state of
AccountTrackerControlleris done with a checksumed address (#6411) -
Ensure the balance passed to update
AccountTrackerController:updateNativeBalancesis of typeHex(#6411)
- Add native and staked balances to assets calculations (#6399)
- Add
rawBalanceto the result ofselectAssetsBySelectedAccountGroup(#6398)
- Improve balance fetching performance and resilience by parallelizing multi-chain operations and moving timeout handling to fetchers (#6390)
- Replace sequential
forloops withPromise.allSettledinRpcBalanceFetcherandAccountTrackerControllerfor parallel chain processing - Move timeout handling from controller-level
Promise.raceto fetcher-levelsafelyExecuteWithTimeoutfor better error isolation - Add
safelyExecuteWithTimeoutto bothRpcBalanceFetcherandAccountsApiBalanceFetcherto prevent individual chain timeouts from blocking other chains - Remove redundant timeout wrappers from
TokenBalancesControllerandAccountTrackerController - Improve test coverage for timeout and error handling scenarios in all balance fetchers
- Replace sequential
- Enable
AccountTrackerControllerto fetch native balances using AccountsAPI whenallowExternalServicesis enabled (#6369)- Implement native balance fetching via AccountsAPI when
useAccountsAPIandallowExternalServicesare both true - Add fallback to RPC balance fetching when external services are disabled
- Add comprehensive test coverage for both AccountsAPI and RPC balance fetching scenarios
- Implement native balance fetching via AccountsAPI when
-
Bump
@metamask/base-controllerfrom^8.1.0to^8.2.0(#6355) -
Add new
accountIdfield to theAssettype (#6358)
-
Uses
InternalAccount['type']for theAsset['type']property (#6358) -
Ensure that the evm addresses used to fetch balances from AccountTrackerController state is lowercase, in order to account for discrepancies between clients (#6358)
-
Prevents mutation of memoized fields used inside selectors (#6358)
-
Fix duplicate token balance entries caused by case-sensitive address comparison in
TokenBalancesController.updateBalances(#6354)- Normalize token addresses to proper EIP-55 checksum format before using as object keys to prevent the same token from appearing multiple times with different cases
- Add comprehensive unit tests for token address normalization scenarios
-
Fix TokenBalancesController timeout handling by replacing
safelyExecuteWithTimeoutwith properPromise.raceimplementation (#6365)- Replace
safelyExecuteWithTimeoutwhich was silently swallowing timeout errors with directPromise.racethat properly throws - Reduce RPC timeout from 3 minutes to 15 seconds for better responsiveness and batch size
- Enable proper fallback between API and RPC balance fetchers when timeouts occur
- Replace
- Added a token selector that returns list of tokens and balances for evm and multichain assets based on the selected account group (#6226)
- BREAKING: Bump peer dependency
@metamask/accounts-controllerfrom^32.0.0to^33.0.0(#6345) - BREAKING: Bump peer dependency
@metamask/keyring-controllerfrom^22.0.0to^23.0.0(#6345) - BREAKING: Bump peer dependency
@metamask/preferences-controllerfrom^18.0.0to^19.0.0(#6345) - BREAKING: Bump peer dependency
@metamask/transaction-controllerfrom^59.0.0to^60.0.0(#6345)
- Bump accounts related packages (#6309)
- Bump
@metamask/keyring-apifrom^20.0.0to^20.1.0 - Bump
@metamask/keyring-internal-apifrom^8.0.0to^8.1.0
- Bump
- Fix precision loss in AccountsApiBalanceFetcher causing incorrect token balance conversion (#6330)
- Replaced floating-point arithmetic with string-based precision conversion to avoid JavaScript precision limitations
- Implement balance change calculator and network filtering (#6285)
- Add core balance change calculators with period support (1d/7d/30d), network filtering, and group-level computation
- Add new utility functions for efficient balance fetching using Multicall3 (#6212)
- Added
aggregate3function for direct access to Multicall3's aggregate3 method with individual failure handling - Added
getTokenBalancesForMultipleAddressesfunction to efficiently batch ERC20 and native token balance queries for multiple addresses - Supports up to 300 calls per batch with automatic fallback to individual calls on unsupported chains
- Returns organized balance data as nested maps for easy consumption by client applications
- Added
- BREAKING: Improved
TokenBalancesControllerperformance with two-tier balance fetching strategy (#6232)- Implements Accounts API as primary fetching method for supported networks (faster, more efficient)
- Falls back to RPC calls using Multicall3's
aggregate3for unsupported networks or API failures - Significantly reduces RPC calls from N individual requests to batched calls of up to 300 operations
- Provides comprehensive network coverage with graceful degradation when services are unavailable
- Bump
@metamask/base-controllerfrom^8.0.1to^8.1.0(#6284) - Bump
@metamask/controller-utilsfrom^11.11.0to^11.12.0(#6303) - Bump
@metamask/transaction-controllerfrom^59.1.0to^59.2.0(#6291) - Bump
@metamask/account-tree-controllerfrom^0.7.0to^0.8.0(#6273) - Bump
@metamask/accounts-controllerfrom^32.0.1to^32.0.2(#6273) - Bump
@metamask/keyring-controllerfrom^22.1.0to^22.1.1(#6273) - Bump
@metamask/multichain-account-servicefrom^0.3.0to^0.4.0(#6273)
- Comprehensive balance selectors for multichain account groups and wallets (#6235)
- Bump
@metamask/keyring-apifrom^19.0.0to^20.0.0(#6248)
- Correct the polling rate for the DeFiPositionsController from 1 minute to 10 minutes. (#6242)
- Fix
AccountTrackerControllerto force block number update to avoid stale cached native balances (#6250)
- Use a narrow selector when listening to
CurrencyRateController:stateChange(#6217) - Fixed an issue where attempting to fetch asset conversions for accounts without assets would crash the snap (#6207)
- Improved
AccountTrackerControllerRPC performance by batching addresses using a multicall contract (#6099)- Fallbacks to single address RPC calls on chains that do not have a multicall contract.
- Improved
AssetsContractControllerRPC performance by batching addresses using a multicall contract (#6099)- Fallbacks to single address RPC calls on chains that do not have a multicall contract.
- Fix
TokenBalancesControllerto force block number update to avoid stale cached balances (#6197)
- BREAKING: Bump peer dependency
@metamask/accounts-controllerto^32.0.0(#6171) - BREAKING: Bump peer dependency
@metamask/transaction-controllerto^59.0.0(#6171) - Improved
TokenDetectionControllertoken handling flow (#6012)- Detected tokens are now implicitly added directly to
allTokensinstead of being added toallDetectedTokensfirst - This simplifies the token import flow and improves performance by eliminating the manual UI import step
- Enhanced
TokenDetectionControllerto use direct RPC calls when basic functionality is disabled (#6012) - Token detection now falls back to direct RPC calls instead of API-based detection when basic functionality is turned off
- Detected tokens are now implicitly added directly to
- Bump
@metamask/keyring-apifrom^18.0.0to^19.0.0(#6146)
- Fix
TokenDetectionControllerto respect the detection toggle setting (#6012)- Token detection will no longer run when the detection toggle is disabled, even during user refresh operations
- Improved
CurrencyRateControllerbehavior when basic functionality is disabled (#6012)- Disabled requests to CryptoCompare when basic functionality is turned off to avoid unnecessary API calls
- Improve error handling in
MultichainAssetsRatesControllerfor Snap request failures (#6104)- Enhanced
#handleSnapRequestmethod with detailed error logging and graceful failure recovery - Added null safety checks to prevent crashes when Snap requests return null
- Controller now continues operation when individual Snap requests fail instead of crashing
- Added comprehensive unit tests covering various error scenarios including JSON-RPC errors and network failures
- Enhanced
- Update
NftControllerto use properly exportedPhishingControllerBulkScanUrlsActiontype from@metamask/phishing-controller(#6105) - Bump dev dependency
@metamask/phishing-controllerto^13.1.0(#6120)
- BREAKING: Bump peer dependency
@metamask/phishing-controllerto^13.0.0(#6098)
- Bump
@metamask/controller-utilsfrom^11.10.0to^11.11.0(#6069)- This upgrade includes performance improvements to checksum hex address normalization
- Bump
@metamask/utilsfrom^11.2.0to^11.4.2(#6054)
- BREAKING: Bump peer dependency
@metamask/snaps-controllersfrom^12.0.0to^14.0.0(#6035) - Update
MultichainAssetsRatesControllerto use the newonAssetsMarketDatahandler in addition ofonAssetsConversionto get marketData (#6035)- This change improves the handler interface for fetching asset market data from Snaps
- Bump
@metamask/snaps-sdkfrom^7.1.0to^9.0.0(#6035) - Bump
@metamask/snaps-utilsfrom^9.4.0to^11.0.0(#6035)
- BREAKING: Bump peer dependency
@metamask/accounts-controllerto^31.0.0(#5999) - BREAKING: Bump peer dependency
@metamask/network-controllerto^24.0.0(#5999) - BREAKING: Bump peer dependency
@metamask/transaction-controllerto^58.0.0(#5999) - Bump
@metamask/polling-controllerto^14.0.0(#5999)
- Added
getErc20Balancesfunction withinTokenBalancesControllerto support fetching ERC-20 token balances for a given address and token list (#5925)- This modular service simplifies balance retrieval logic and can be reused across different parts of the controller
- Bump
@metamask/transaction-controllerto^57.3.0(#5954)
- Prevented
AccountTrackerControllerfrom updating state with empty or unchanged account balance data during refresh (#5942)- Added guards to skip state updates when fetched balances are empty or identical to existing state
- Reduces unnecessary
stateChangeemissions and preserves previously-cached balances under network failure scenarios
- Prevented
TokenBalancesControllerfrom updating account balance to 0 while multicall contract failed (#5975)
- Added Base Network for networks to track in
TokenDetectionController(#5902)- Network changes were added in
@metamask/controller-utils
- Network changes were added in
- Added Metamask pooled staking token for Ethereum Hoodi testnet (#5855)
- Bump
@metamask/controller-utilsto^11.10.0(#5935)
- BREAKING: Update
NftControllerandNftDetectionControllerto eliminate the dependency on the current chain (#5622)- All functions that previously accepted networkClientId as an optional parameter now require it as a mandatory parameter.
- BREAKING: Add
NetworkController:findNetworkClientIdByChainIdto allowed actions inNftController(#5622) - BREAKING: Add
NetworkController:findNetworkClientIdByChainIdto allowed actions inNftDetectionController(#5622)
- BREAKING: Bump
@metamask/accounts-controllerpeer dependency to^30.0.0(#5888) - BREAKING: Bump
@metamask/transaction-controllerpeer dependency to^57.0.0(#5888) - BREAKING: Bump
@metamask/providerspeer dependency from^21.0.0to^22.0.0(#5871) - BREAKING: Bump
@metamask/snaps-controllerspeer dependency from^11.0.0to^12.0.0(#5871) - Remove
seifrom constantsSUPPORTED_CURRENCIES(#5883)
- Add optional parameter to track DeFi metrics when positions are being fetched (#5868)
- Add phishing protection for NFT metadata URLs in
NftController(#5598)- NFT metadata URLs are now scanned for malicious content using the
PhishingController - Malicious URLs in NFT metadata fields (image, externalLink, etc.) are automatically sanitized
- NFT metadata URLs are now scanned for malicious content using the
- BREAKING: Add peer dependency on
@metamask/phishing-controller^12.5.0 (#5598)
- BREAKING: Add event listener for
TransactionController:transactionConfirmedonTokenDetectionControllerto trigger token detection (#5859)
- BREAKING: Add event listener for
KeyringController:accountRemovedinstead ofAccountsController:accountRemovedinTokenBalancesControllerandTokensController(#5859)
-
BREAKING: Add event listener for
AccountsController:accountRemovedonTokenBalancesControllerto remove token balances for the removed account (#5726) -
BREAKING: Add event listener for
AccountsController:accountRemovedonTokensControllerto remove tokens for the removed account (#5726) -
BREAKING: Add
listAccountsaction toTokensController(#5726) -
BREAKING: Add
listAccountsaction toTokenBalancesController(#5726)
- TokenBalancesController will now check if balances has changed before updating the state (#5726)
- Added optional
accountparameter tofetchHistoricalPricesForAssetmethod inMultichainAssetsRatesController(#5833) - Updated
TokenListControllerfetchTokenListmethod to bail if cache is valid (#5804)- also cleaned up internal state update logic
- Bump
@metamask/controller-utilsto^11.9.0(#5812)
- BREAKING: bump
@metamask/keyring-controllerpeer dependency to^22.0.0(#5802) - BREAKING: bump
@metamask/accounts-controllerpeer dependency to^29.0.0(#5802) - BREAKING: bump
@metamask/preferences-controllerpeer dependency to^18.0.0(#5802) - BREAKING: bump
@metamask/transaction-controllerpeer dependency to^56.0.0(#5802)
- Add event
MultichainAssetsController:accountAssetListUpdatedin MultichainAssetsController to notify when new assets are detected for an account (#5761)
- BREAKING: Removed subscription to
MultichainAssetsController:stateChangeinMultichainAssetsRatesControllerand add subscription toMultichainAssetsController:accountAssetListUpdated(#5761) - BREAKING: Removed subscription to
MultichainAssetsController:stateChangeinMultichainBalancesControllerand add subscription toMultichainAssetsController:accountAssetListUpdated(#5761)
- Bump
@metamask/controller-utilsto^11.8.0(#5765) - Update
DEFI_POSITIONS_API_URLto use the production endpoint (#5769)
- BREAKING: Bump
@metamask/accounts-controllerpeer dependency to^28.0.0(#5763) - BREAKING: Bump
@metamask/transaction-controllerpeer dependency to^55.0.0(#5763) - Bump
@metamask/base-controllerfrom^8.0.0to^8.0.1(#5722)
- Add support for 'Sonic Mainnet' chainId in the list of SUPPORTED_CHAIN_IDS. (#5711)
- Refactor
TokensControllerto remove reliance on a single selected network (#5659)TokensControllermethods now requirenetworkClientIdas an explicit parameter.- Token management logic is fully parameterized by
chainId, allowing multi-chain token handling and improving reliability across network changes. - Internal state updates and token metadata fetching are scoped to the corresponding
chainId
- BREAKING: Remove deprecated
chainIdinstance property fromTokensController(#5659)- All chain context is now derived from
networkClientIdat the method level.
- All chain context is now derived from
- Add
SEInetwork support (#5610)- Add token detection support
- Add NFT detection support
- Refactor
TokenRatesControllerto support processing multiple chains simultaneously (#5645)- The controller now supports an array of chain IDs rather than a single value, simplifying the polling process by allowing iteration over all chains in a single loop
- Refactor
AccountTrackerControllerto support processing multiple chains simultaneously (#5680)- The controller now accepts an array of chain IDs instead of a single value, streamlining the polling process by iterating over all chains in one loop
- BREAKING: Eliminate legacy network dependency handling in
TokenRatesController(#5645)- We're no longer relying on the currently selected network.
- BREAKING: Eliminate legacy network dependency handling in
AccountTrackerController(#5680)- We're no longer relying on the currently selected network.
- Added
includeMarketDatato the params of theOnAssetsConversionhandler (#5639) - Added
fetchHistoricalPricesForAssetmethod toMultichainAssetsRatesController(#5639) - Added
getSelectedMultichainAccountaction tomultichainAssetsRatesController(#5639) - Added new state field
historicalPricestoMultichainAssetsRatesController(#5639)
- BREAKING: Bump
@metamask/snaps-controllerspeer dependency from ^9.19.0 to ^11.0.0 (#5639) - BREAKING: Bump
@metamask/providerspeer dependency from ^18.1.0 to ^21.0.0 (#5639) - Bump
@metamask/snaps-utilsfrom ^8.10.0 to ^9.2.0 (#5639)
- Add a new
DeFiPositionsControllerthat maintains an updated list of DeFi positions for EVM accounts (#5400)- Export
DeFiPositionsController - Export the following types
DeFiPositionsControllerStateDeFiPositionsControllerActionsDeFiPositionsControllerEventsDeFiPositionsControllerGetStateActionDeFiPositionsControllerStateChangeEventDeFiPositionsControllerMessengerGroupedDeFiPositions
- Export
- BREAKING Add
@metamask/transaction-controlleras a peer dependency at^54.0.0(#5400)
- Update
TokensController,TokenListController, andAccountTrackerControllerto use per-chain state variants (#5310) - Bump
@metamask/keyring-apito^17.4.0(#5565) - Bump
@metamask/controller-utilsto^11.7.0(#5583)- Via this upgrade,
updateExchangeRatesnow supports the MegaETH testnet
- Via this upgrade,
- BREAKING: Remove deprecated state fields scoped to the current chain (#5310)
- This change removes the following state fields from the following controllers:
TokensControllerStatedetectedTokens(replaced byallDetectedTokens)ignoredTokens(replaced byallIgnoredTokens)tokens(replaced byallTokens)
TokenListControllerStatetokenList(replaced bytokensChainsCache)
AccountTrackerControllerStateaccounts(replaced byaccountsByChainId)
- This will require a migration in the clients to remove them from state in order to prevent unnecessary Sentry errors when updating controller state.
- This change removes the following state fields from the following controllers:
- Update token rate request key to handle when new tokens are detected inside the
TokenRatesController(#5531)) - Update
CurrencyRateControllerto prevent undefined or empty currencies from being queried (#5458))
- Add an optional chainId argument to
addNftContractfunction in NftController (#5508)
- BREAKING: Bump peer dependency
@metamask/accounts-controllerto^27.0.0(#5507) - BREAKING: Bump peer dependency
@metamask/network-controllerto^23.0.0(#5507) - Bump
@metamask/polling-controllerto^13.0.0(#5507)
- BREAKING: The
detectNftsmethod in theNftDetectionControllernow accepts chain IDs directly instead of networkClientId, enabling NFT detection across multiple chains simultaneously (#5448)
- Fixed token address conversion in the
TokenRatesControllerto correctly preserve the checksum address format without unnecessary hex conversion (#5490)
- Check if
KeyringControlleris unlocked before processing account events inMultichainBalancesController(#5473)- This is needed since some Snaps might decrypt their state which needs the
KeyringControllerto be unlocked.
- This is needed since some Snaps might decrypt their state which needs the
- Fix runtime error in NFT detection when metadata is
null(#5455)
- Add token display data controller for search & discovery (#5307)
- Add
getAssetMetadataaction toMultichainAssetsController(#5430)
- BREAKING: Bump
@metamask/keyring-controllerpeer dependency to^21.0.0(#5439) - BREAKING: Bump
@metamask/accounts-controllerpeer dependency to^26.0.0(#5439) - BREAKING: Bump
@metamask/keyring-internal-apifrom^5.0.0to^6.0.0(#5347) - BREAKING: Bump
@ethereumjs/utilfrom^8.1.0to^9.1.0(#5347)
- BREAKING: Bump
@metamask/keyring-controllerpeer dependency to^20.0.0(#5426) - BREAKING: Bump
@metamask/accounts-controllerpeer dependency to^25.0.0(#5426) - BREAKING: Bump
@metamask/preferences-controllerpeer dependency to^16.0.0(#5426) - Bump
@metamask/keyring-internal-apifrom^4.0.3to^5.0.0(#5405)
- Fixed conversion rates for MANTLE (#5402)
MultichainAssetsRatesControllernow skips unnecessary Snap calls when the assets list is empty (#5370)
- Bump
@metamask/keyring-api"from^17.0.0to^17.2.0(#5366)
- BREAKING: Rename
MultiChainAssetsRatesControllertoMultichainAssetsRatesController(#5354) - Bump
@metamask/utilsfrom^11.1.0to^11.2.0(#5301)
- Resolved an issue where rate polling would only begin after the default 3-minute interval by manually triggering a rate update upon initialization, ensuring an immediate refresh for a better user experience (#5364)
- BREAKING: Bump
@metamask/accounts-controllerpeer dependency from^23.0.1to^24.0.0(#5318) - Removed legacy poll function to prevent redundant polling (#5321)
- Ensure that the polling is not triggered on the constructor with the initialisation of the controller (#5321)
- Add new
MultiChainTokensRatesController(#5175)- A controller that manages multi‑chain token conversion rates within MetaMask. Its primary goal is to periodically poll for updated conversion rates of tokens associated with non‑EVM accounts (those using Snap metadata), ensuring that the conversion data remains up‑to‑date across supported chains.
- Add
updateBalanceto MultichainBalancesController (#5295)
- BREAKING: MultichainBalancesController messenger must now allow
MultichainAssetsController:getStateaction andMultichainAssetsController:stateChangeevent (#5295) - Update
MultichainBalancesControllerto get the full list of assets fromMultichainAssetsControllerstate instead of only requesting the native token (#5295) - Bump
@metamask/base-controllerfrom^7.1.1to^8.0.0(#5305) - Bump
@metamask/polling-controllerfrom^12.0.2to^12.0.3(#5305)
- BREAKING:
NETWORK_ASSETS_MAP,MultichainNetworks, andMultichainNativeAssetsare no longer exported (#5295)
- Add
MultichainAssetsControllerfor non-EVM assets (#5138)
- BREAKING: Bump
@metamask/accounts-controllerpeer dependency from^22.0.0to^23.0.0(#5292) - Bump
@metamask/keyring-api"from^16.1.0to^17.0.0(#5280) - Bump
@metamask/snaps-utilsfrom^8.9.0to^8.10.0(#5265) - Bump
@metamask/utilsfrom^11.0.1to^11.1.0(#5223) - Removed polling mechanism in the
MultichainBalancesControllerand now relies on the newAccountsController:accountBalancesUpdatedevent (#5221)
- The tokens state is now updated only when the
tokenChainIdmatches the currently selected chain ID. (#5257)
- Add
onBreakandonDegradedmethods toCodefiTokenPricesServiceV2(#5109)- These serve the same purpose as the
onBreakandonDegradedconstructor options, but align more closely with the Cockatiel policy API.
- These serve the same purpose as the
- BREAKING: Bump
@metamask/accounts-controllerpeer dependency from^21.0.0to^22.0.0(#5218) - Deprecate
ClientConfigApiServiceconstructor optionsonBreakandonDegradedin favor of methods (#5109) - Add
@metamask/controller-utils@^11.4.5as a dependency (#5109)cockatielshould still be in the dependency tree because it's now a dependency of@metamask/controller-utils
- Re-introduce
@metamask/keyring-apias a runtime dependency (#5206)- This was required since the introduction of the
MultichainBalancesController.
- This was required since the introduction of the
- Bump
@metamask/keyring-apifrom^14.0.0to^16.1.0(#5190), (#5208) - Bump
@metamask/keyring-internal-apifrom^2.0.1to^4.0.1(#5190), (#5208) - Bump
@metamask/keyring-snap-clientfrom^3.0.0to^3.0.3(#5190), (#5208)
- Bump
@metamask/keyring-apifrom^13.0.0to^14.0.0(#5177) - Bump
@metamask/keyring-internal-apifrom^2.0.0to^2.0.1(#5177) - Bump
@metamask/keyring-snap-clientfrom^2.0.0to^3.0.0(#5177)
- Fix type issue in
ERC721Standard.getDetails(#4985)- The image variable now returns a string instead of a promise when the token image uses the 'ipfs://' protocol.
- Relax NFTs metadata RPC calls (#5134)
- We now check the number of NFTs to update against a threshold value (500) to avoid sending an excessive amount of RPC calls to fetch NFTs metadata.
- Add new
MultichainBalancesController(#4965)- This controller has been migrated from the MetaMask extension codebase.
- Added utility function
getKeyByValue(#5099)
- BREAKING: Bump
@metamask/accounts-controllerpeer dependency from^20.0.0to^21.0.0(#5140) - Bump
@metamask/base-controllerfrom^7.0.0to^7.1.1(#5079), (#5135) - Bump
@metamask/keyring-apifrom^12.0.0to^13.0.0(#5066) - Bump
@metamask/utilsto^11.0.1(#5080) - Bump
@metamask/rpc-errorsto^7.0.2(#5080)
- Fix Mantle price when calling
fetchMultiExchangeRate(#5099) - Fix multicall revert in
TokenBalancesController(#5083)TokenBalancesControllerwas fixed to fetch erc20 token balances even if there's an invalid token in state whose address does not point to a smart contract.
- Fix state changes for
ignoreTokensfor non-selected networks (#5014)
- Remove use of
@metamask/keyring-api(#4695)@metamask/providersandwebextension-polyfillpeer dependencies are no longer required.
- Use new
@metamask/keyring-internal-api@^1.0.0(#4695)- This package has been split out from the Keyring API. Its types are compatible with the
@metamask/keyring-apipackage used previously.
- This package has been split out from the Keyring API. Its types are compatible with the
- Bump
@metamask/controller-utilsfrom^11.3.0to^11.4.4(#5012) - Bump
@metamask/polling-controllerfrom^12.0.1to^12.0.2(#5012)
- Make implicit peer dependencies explicit (#4974)
- Add the following packages as peer dependencies of this package to satisfy peer dependency requirements from other dependencies:
@metamask/providers^18.1.0(required by@metamask/keyring-api)webextension-polyfill^0.10.0 || ^0.11.0 || ^0.12.0(required by@metamask/providers)
- These dependencies really should be present in projects that consume this package (e.g. MetaMask clients), and this change ensures that they now are.
- Furthermore, we are assuming that clients already use these dependencies, since otherwise it would be impossible to consume this package in its entirety or even create a working build. Hence, the addition of these peer dependencies is really a formality and should not be breaking.
- Add the following packages as peer dependencies of this package to satisfy peer dependency requirements from other dependencies:
- Fix
TokensController.ignoreTokensso that if a network is provided,allIgnoredTokens,allTokens, andallDetectedTokensfor that network no longer get corrupted with tokens from the globally selected network (#4967) - Correct ESM-compatible build so that imports of the following packages that re-export other modules via
export *are no longer corrupted: (#5011)@metamask/abi-utils@metamask/contract-metadata@metamask/eth-query@ethereumjs/utilbn.jscockatiellodashsingle-call-balance-checker-abi
chainIdToNativeTokenAddressto record chains with unique (non-zero) addresses (#4952)getNativeTokenAddress()exported function to return the correct native token address for native assets (#4952)- add support for all added networks when switching account for Token Detection (#4957)
- Update price API calls to use the native token by chain instead of relying on the zero address. (#4952)
- Update
TokenRatesControllermarket data mapping to usegetNativeTokenAddressinstead of the zero address for native tokens. (#4952)
- BREAKING: Bump
@metamask/keyring-controllerpeer dependency from^18.0.0to^19.0.0(#4195) - BREAKING: Bump
@metamask/accounts-controllerpeer dependency from^19.0.0to^20.0.0(#4195) - BREAKING: Bump
@metamask/preferences-controllerpeer dependency from^14.0.0to^15.0.0(#4195)
- An argument
networkClientIdis added toTokensController.ignoreTokens, allowing tokens to be ignored on specific chains. (#4949)
-
Fixes an issue where the token detection was unnecessarily falling back to an RPC approach, causing redundant detections. (#4928)
-
Fixes an issue where
TokensController.addTokenswas not respecting the network client id passed to it. (#4940)
-
BREAKING: The
TokenBalancesControllerstate is now across all chains and accounts under the fieldtokenBalances, as a mapping from account address -> chain id -> token address -> balance. (#4782) -
BREAKING: The
TokenBalancesControllernow extendsStaticIntervalPollingController, and the new polling APIstartPollingmust be used to initiate polling (startPolling,stopPollingByPollingToken). (#4782) -
BREAKING:
TokenBalancesControllernow requires subscriptions to thePreferencesController:stateChangeandNetworkController:stateChangeevents. And access to theNetworkController:getNetworkClientById,NetworkController:getState,TokensController:getState, andPreferencesController:getStateactions. (#4782) -
BREAKING:
TokensControllerrequires a subscription to theNetworkController:stateChangeevent. It now now removes state for chain IDs when their network is removed. (#4782) -
TokenRatesControllernow removes state for chain IDs when their network is removed. (#4782)
- Fix a bug in
TokensController.addTokenswhere tokens could be added from the wrong chain. (#4924)
- Add Solana to the polled exchange rates (#4914)
AccountTrackerControllernow tracks balances of staked ETH for each account, under the state propertystakedBalance. (#4879)
- BREAKING: The polling input for
TokenListControlleris now{chainId: Hex}instead of{networkClientId: NetworkClientId}. (#4878) - BREAKING: The polling input for
TokenDetectionControlleris now{ chainIds: Hex[]; address: string; }instead of{ networkClientId: NetworkClientId; address: string; }. (#4894) - BREAKING: Bump
@metamask/keyring-controllerpeer dependency from^17.0.0to^18.0.0(#4195) - BREAKING: Bump
@metamask/preferences-controllerpeer dependency from^13.2.0to^14.0.0(#4909, #4915) - BREAKING: Bump
@metamask/accounts-controllerpeer dependency from^18.0.0to^19.0.0(#4915) - Bump
@metamask/controller-utilsfrom^11.4.2to^11.4.3(#4195)
- Add
resetStatemethod toNftController,TokensController,TokenBalancesControllerandTokenRatesControllerto reset the controller's state back to their default state (#4880)
- BREAKING: A
platformargument must now be passed to theTokenDetectionControllerconstructor, indicating whether the platform is extension or mobile. (#4877) - BREAKING: The
TokenRatesControllernow accepts{chainId: Hex}as its polling input tostartPolling()instead of{networkClientId: NetworkClientId}(#4887) - When the
TokenRatesController's subscription toTokensController:stateChangeis fired, token prices are now updated across all chain IDs whose tokens changed, instead of just the current chain. (#4866) - The
TokenDetectionControllernow passes ax-metamask-clientproductheader when calling the account API. (#4877)
- BREAKING: The polling input accepted by
CurrencyRateControlleris now an object with anativeCurrenciesproperty that is defined as astringarray type (#4852)- The
inputparameters of the controller's_executePoll,_startPolling,onPollingCompletemethods now only accept this new polling input type. - The
nativeCurrencyproperty (stringtype) has been removed.
- The
- BREAKING:
RatesControllernow types theconversionRateandusdConversionRatein its state asnumberinstead ofstring, to match what it was actually storing. (#4852) - Bump
@metamask/base-controllerfrom^7.0.1to^7.0.2(#4862) - Bump
@metamask/controller-utilsfrom^11.4.0to^11.4.1(#4862) - Bump dev dependency
@metamask/approval-controllerfrom^7.1.0to^7.1.1(#4862)
- BREAKING: The CurrencyRateController polling input is now
{ nativeCurrency: string }instead of a network client ID (#4839) - BREAKING: Bump
@metamask/network-controllerpeer dependency to^22.0.0(#4841) - Bump
@metamask/controller-utilsto^11.4.0(#4834) - Bump
@metamask/rpc-errorsto^7.0.1(#4831) - Bump
@metamask/utilsto^10.0.0(#4831)
- Update TokenRatesController to not reset market data just after network switch but before loading new market data (#4832)
- BREAKING:
AccountTrackerController,CurrencyRateController,TokenDetectionController,TokenListController, andTokenRatesControllernow use a new polling interface that accepts the generic parameterPollingInput(#4752) - BREAKING: The inherited
AbstractPollingControllermethodstartPollingByNetworkClientIdhas been renamed tostartPolling(#4752) - BREAKING: The inherited
AbstractPollingControllermethodonPollingCompletenow returns the entire input object of typePollingInput, instead of a network client id (#4752)
- The
includeDuplicateSymbolAssetsparam is removed from our api call to TokenApi (#4768)
- The
TokenRatesControllernow fetches token rates for all accounts, instead of just the selected account (#4759)
- Parallelization of detected tokens with balance (#4697)
- Bump accounts related packages (#4713), (#4728)
- Those packages are now built slightly differently and are part of the accounts monorepo.
- Bump
@metamask/keyring-apifrom^8.1.0to^8.1.4
- Produce and export ESM-compatible TypeScript type declaration files in addition to CommonJS-compatible declaration files (#4648)
- Previously, this package shipped with only one variant of type declaration
files, and these files were only CommonJS-compatible, and the
exportsfield inpackage.jsonlinked to these files. This is an anti-pattern and was rightfully flagged by the "Are the Types Wrong?" tool as "masquerading as CJS". All of the ATTW checks now pass.
- Previously, this package shipped with only one variant of type declaration
files, and these files were only CommonJS-compatible, and the
- Remove chunk files (#4648).
- Previously, the build tool we used to generate JavaScript files extracted common code to "chunk" files. While this was intended to make this package more tree-shakeable, it also made debugging more difficult for our development teams. These chunk files are no longer present.
- Don't update currency rates on transient errors (#4662)
- In
CurrencyRateControllerif unexpected errors occur during requests to crypto compare, the conversion rate in state will remain unchanged instead of being set to null.
- In
- Fix fallback conversion rate for token market data (#4615)
- On networks where the native currency is not ETH, token market data is now correctly priced in the native currency.
- Export
MarketDataDetailstype (#4622)
- BREAKING: Narrow
TokensControllerconstructor optionproviderby removingundefinedfrom its type signature (#4567) - BREAKING: Bump devDependency and peerDependency
@metamask/network-controllerfrom^20.0.0to^21.0.0(#4618, #4651) - Bump
@metamask/base-controllerfrom^6.0.2to^7.0.0(#4625, #4643) - Bump
@metamask/controller-utilsfrom^11.0.2to^11.2.0(#4639, #4651) - Bump
@metamask/polling-controllerfrom^9.0.1to^10.0.0(#4651) - Bump
@metamask/keyring-apito version8.1.0(#4594) - Bump
typescriptfrom~5.0.4to~5.2.2(#4576, #4584)
- Fix
RatesControllersetCryptocurrencyListmethod, which was not using the correct field when updating internal state (#4572) - Fetch correct price for the $OMNI native currency (#4570)
- Add public
nameproperty toAssetsContractController(#4564)
- Add elements to the
AssetsContractControllerclass: (#4397)- Add class field
messagingSystem. - Add getters for
ipfsGatewayandchainId. As corresponding setters have not been defined, these properties are not externally mutable.
- Add class field
- Add and export the
AssetsContractControllerMessengertype (#4397)AssetsContractControllerMessengermust allow the external actionsNetworkController:getNetworkClientById,NetworkController:getNetworkConfigurationByNetworkClientId,NetworkController:getSelectedNetworkClient,NetworkController:getState.AssetsContractControllerMessengermust allow the external eventsPreferencesController:stateChange,NetworkController:networkDidChange.
- Add and export new types:
AssetsContractControllerActions,AssetsContractControllerEvents,AssetsContractControllerGetERC20StandardAction,AssetsContractControllerGetERC721StandardAction,AssetsContractControllerGetERC1155StandardAction,AssetsContractControllerGetERC20BalanceOfAction,AssetsContractControllerGetERC20TokenDecimalsAction,AssetsContractControllerGetERC20TokenNameAction,AssetsContractControllerGetERC721NftTokenIdAction,AssetsContractControllerGetERC721TokenURIAction,AssetsContractControllerGetERC721AssetNameAction,AssetsContractControllerGetERC721AssetSymbolAction,AssetsContractControllerGetERC721OwnerOfAction,AssetsContractControllerGetERC1155TokenURIAction,AssetsContractControllerGetERC1155BalanceOfAction,AssetsContractControllerTransferSingleERC1155Action,AssetsContractControllerGetTokenStandardAndDetailsAction,AssetsContractControllerGetBalancesInSingleCallAction(#4397) - Add a new
setProvidermethod toAssetsContractController(#4397)- Replaces the removed
providersetter method, and widens theproviderfunction parameter type fromProvidertoProvider | undefined.
- Replaces the removed
- Export
TokenBalancesControllerStatetype (#4535)- This was defined but not exported in v34.0.0.
- Add
getNFTContractInfomethod to theNFTControllerfor fetching NFT Collection Metadata from the NFT API (#4524)
- BREAKING: Add required constructor option
messengerto theAssetsContractControllerclass (#4397) - BREAKING:
TokenBalancesControllerMessengermust allow theAssetsContractController:getERC20BalanceOfaction in addition to its previous allowed actions (#4397) - BREAKING:
NftControllerMessengermust allow the following actions in addition to its previous allowed actions:AssetsContractController:getERC721AssetName,AssetsContractController:getERC721AssetSymbol,AssetsContractController:getERC721TokenURI,AssetsContractController:getERC721OwnerOf,AssetsContractController:getERC1155BalanceOf,AssetsContractController:getERC1155TokenURI(#4397) - BREAKING: The type of
SINGLE_CALL_BALANCES_ADDRESS_BY_CHAINIDis narrowed fromRecord<Hex, string>to the const-asserted literal properties of theSINGLE_CALL_BALANCES_ADDRESS_BY_CHAINIDobject (#4397)- The index signature is restricted to the union of the enum keys of
SupportedTokenDetectionNetworks. - The property value type is restricted to the type union of the addresses defined in the object.
- The object type is constrained by
Record<Hex, string>using thesatisfieskeyword.
- The index signature is restricted to the union of the enum keys of
- BREAKING: Convert the
BalanceMaptype from aninterfaceinto a type alias (#4397)- Type aliases have an index signature of
stringby default, and are compatible with theStateConstrainttype defined in the@metamask/base-controllerpackage.
- Type aliases have an index signature of
- BREAKING:
getIpfsCIDv1AndPath,getFormattedIpfsUrlare now async functions (#3645) - BREAKING: Bump peerDependency
@metamask/accounts-controllerfrom^17.0.0to^18.0.0(#4548) - Remove
@metamask/accounts-controller,@metamask/approval-controller,@metamask/keyring-controller, and@metamask/preferences-controllerdependencies #4556- These were listed under
peerDependenciesalready, so they were redundant as dependencies.
- These were listed under
- Add
immer^9.0.6as a new dependency (#3645) - Bump
@metamask/abi-utilsfrom^2.0.2to^2.0.3(#3645) - Bump
@metamask/base-controllerfrom^6.0.0to^6.0.2(#4517, #4544) - Bump
@metamask/controller-utilsfrom^11.0.1to^11.0.2(#4544) - Bump
@metamask/utilsfrom^9.0.0to^9.1.0(#4529) - Bump
multiformatsfrom^9.5.2to^13.1.0(#3645) - Bump
@metamask/polling-controllerfrom^9.0.0to^9.0.1(#4548)
- BREAKING: Remove elements from the
AssetsContractControllerclass: (#4397)- BREAKING:
AssetsContractControllerno longer inherits fromBaseControllerV1. - BREAKING: Remove constructor option callbacks
onPreferencesStateChange,onNetworkDidChange,getNetworkClientById, and replace with corresponding messenger actions and events. - BREAKING: Remove class fields:
name,config(along with its propertiesprovider,ipfsGateway,chainId). - BREAKING: Remove methods:
getProvider,getChainId.- Use the getters
providerandchainIdinstead.
- Use the getters
- BREAKING: Remove the
providersetter method.- Use the
setProvidermethod instead.
- Use the
- BREAKING:
- BREAKING: Remove the
getERC20BalanceOfconstructor option callback from theTokenBalancesControllerOptionstype and theTokenBalancesControllerconstructor (#4397)- The messenger is expected to allow
AssetsContractController:getERC20BalanceOfmessenger action so that it can be used instead.
- The messenger is expected to allow
- BREAKING: Remove
NftControllerconstructor option callbacks:getERC721AssetName,getERC721AssetSymbol,getERC721TokenURI,getERC721OwnerOf,getERC1155BalanceOf,getERC1155TokenURI(#4397)- These are accessed through the messenger instead.
- BREAKING: Remove the
AssetsContractConfigtype (#4397) - BREAKING: Remove export for
MISSING_PROVIDER_ERROR(#4397)
- BREAKING: Convert the
getERC721NftTokenIdmethod of theAssetsContractControllerinto an async function. (#4397)
- Add optional
topBidproperty to theNftMetadatatype. This property must be of typeTopBid. (#4522) - Add optional
floorAskproperty to theTokenCollectiontype. This property must be of typeFloorAskCollection. (#4522) - Add linea mainnet support to nft detection supported networks (#4515)
- The
Collectiontype is expanded to include the following 'string'-type optional properties:contractDeployedAt,creator,ownerCount, and an optional propertytopBidof the typeTopBid & { sourceDomain?: string; }. (#4443)
- Fetch NFT collections data from the NFT-API
Get Collectionsendpoint when calling thedetectNftsmethod ofNftDetectionController, and theupdateNftMetadataandwatchNftmethods ofNftController. (#4443) - Bump
@metamask/utilsto^9.0.0(#4516) - Bump
@metamask/rpc-errorsto^6.3.1(#4516)
- BREAKING: The
attributesproperty of theNftMetadatatype must be of typeAttributes[](#4522)- The
attributesproperty was added and typed asAttributesonv28.0.0.
- The
- BREAKING: Bump peerDependency
@metamask/network-controllerto^20.0.0(#4508) - Bump
@metamask/polling-controllerto^9.0.0(#4508) - Bump
@metamask/accounts-controllerto^17.2.0(#4498)
- Add support for tokenURI encoded images to
NftControllermethodsaddNft,watchNftandupdateNftMetadata(#4482)
- Add
AccountTrackerControllerGetStateAction,AccountTrackerControllerActions,AccountTrackerControllerStateChangeEvent, andAccountTrackerControllerEventstypes (#4407) - Add
setIntervalLengthandgetIntervalLengthmethods toAccountTrackerController(#4407)setIntervalLengthreplaces updating the polling interval viaconfigure.
- BREAKING
TokenBalancesControllermessenger must allow the actionAccountsController:getSelectedAccountand removePreferencesController:getState. (#4219) - BREAKING
TokenDetectionControllermessenger must allow the actionAccountsController:getAccount. (#4219) - BREAKING
TokenDetectionControllermessenger must allow the eventAccountsController:selectedEvmAccountChangeand removeAccountsController:selectedAccountChange. (#4219) - BREAKING
TokenRatesControllermessenger must allow the actionAccountsController:getAccount,AccountsController:getSelectedAccountand removePreferencesController:getState. (#4219) - BREAKING
TokenRatesControllermessenger must allow the eventAccountsController:selectedEvmAccountChangeand removePreferencesController:stateChange. (#4219) - BREAKING
TokensControllermessenger must allow the actionAccountsController:getAccount,AccountsController:getSelectedAccount. - BREAKING
TokensControllermessenger must allow the eventAccountsController:selectedEvmAccountChange. (#4219) - Upgrade AccountTrackerController to BaseControllerV2 (#4407)
- BREAKING: Convert
AccountInformationfrom interface to type (#4407) - BREAKING: Rename
AccountTrackerStatetoAccountTrackerControllerStateand convert from interface to type (#4407) - BREAKING:
AccountTrackerControllernow inherits fromStaticIntervalPollingControllerinstead ofStaticIntervalPollingControllerV1(#4407)- The constructor now takes a single options object rather than three arguments. Some options have been removed; see later entries.
- BREAKING: The
AccountTrackerControllermessenger must now allow the actionsPreferencesController:getState,NetworkController:getState, andNetworkController:getNetworkClientById(#4407) - BREAKING: The
refreshmethod is no longer pre-bound to the controller (#4407)- You may now need to pre-bind it e.g.
accountTrackerController.refresh.bind(accountTrackerController).
- You may now need to pre-bind it e.g.
- Bump
@metamask/accounts-controllerto^17.1.0(#4460)
- BREAKING
TokensControllerremovesselectedAddressconstructor argument. (#4219) - BREAKING
TokenDetectionControllerremovesselectedAddressconstructor argument. (#4219) - BREAKING: Remove
AccountTrackerConfigtype (#4407)- Some of these properties have been merged into the options that the
AccountTrackerControllerconstructor takes.
- Some of these properties have been merged into the options that the
- BREAKING: Remove
configproperty andconfiguremethod fromAccountTrackerController(#4407)- The controller now takes a single options object which can be used for configuration, and configuration is now kept internally.
- BREAKING: Remove
notify,subscribe, andunsubscribemethods fromAccountTrackerController(#4407)- Use the controller messenger for subscribing to and publishing events instead.
- BREAKING: Remove
provider,getMultiAccountBalancesEnabled,getCurrentChainId, andgetNetworkClientByIdfrom configuration options forAccountTrackerController(#4407)- The provider is now obtained directly from the network controller on demand.
- The messenger is now used in place of the callbacks.
- BREAKING: Add
messengeras a constructor option forAccountTrackerController(#4225) - BREAKING: Add
messengeroption toTokenRatesController(#4314)- This messenger must allow the actions
TokensController:getState,NetworkController:getNetworkClientById,NetworkController:getState, andPreferencesController:getStateand allow the eventsPreferencesController:stateChange,TokensController:stateChange, andNetworkController:stateChange.
- This messenger must allow the actions
- Add types
TokenRatesControllerGetStateAction,TokenRatesControllerActions,TokenRatesControllerStateChangeEvent,TokenRatesControllerEvents,TokenRatesControllerMessenger(#4314) - Add function
getDefaultTokenRatesControllerState(#4314) - Add
enableanddisablemethods toTokenRatesController(#4314)- These are used to stop and restart polling.
- Export
ContractExchangeRatestype (#4314)- Add
AccountTrackerControllerMessengertype
- Add
- BREAKING: The
NftControllermessenger must now allowAccountsController:getAccountandAccountsController:getSelectedAccountas messenger actions andAccountsController:selectedEvmAccountChangeas a messenger event (#4221) - BREAKING:
NftDetectionControllermessenger must now allowAccountsController:getSelectedAccountas a messenger action (#4221) - Token price API support for mantle network (#4376)
- BREAKING: Bump dependency and peer dependency
@metamask/accounts-controllerto^17.0.0(#4413) - BREAKING:
TokenRatesControllernow inherits fromStaticIntervalPollingControllerinstead ofStaticIntervalPollingControllerV1(#4314)- The constructor now takes a single options object rather than three arguments. Some options have been removed; see later entries.
- BREAKING: Rename
TokenRatesStatetoTokenRatesControllerState, and convert frominterfacetotype(#4314) - The
NftControllernow reads the selected address via theAccountsController, using theAccountsController:selectedEvmAccountChangemessenger event to stay up to date (#4221) NftDetectionControllernow reads the currently selected account fromAccountsControllerinstead ofPreferencesController(#4221)- Bump
@metamask/keyring-apito^8.0.0(#4405) - Bump
@metamask/eth-snap-keyringto^4.3.1(#4405) - Bump
@metamask/keyring-controllerto^17.1.0(#4413)
- BREAKING: Remove
nativeCurrency,chainId,selectedAddress,allTokens, andallDetectedTokensfrom configuration options forTokenRatesController(#4314)- The messenger is now used to obtain information from other controllers where this data was originally expected to come from.
- BREAKING: Remove
configproperty andconfiguremethod fromTokenRatesController(#4314)- The controller now takes a single options object which can be used for configuration, and configuration is now kept internally.
- BREAKING: Remove
notify,subscribe, andunsubscribemethods fromTokenRatesController(#4314)- Use the controller messenger for subscribing to and publishing events instead.
- BREAKING: Remove
TokenRatesConfigtype (#4314)- Some of these properties have been merged into the options that
TokenRatesControllertakes.
- Some of these properties have been merged into the options that
- BREAKING: Remove
NftControllerconstructor optionsselectedAddress. (#4221) - BREAKING: Remove
AccountTrackerControllerconstructor optionsgetIdentities,getSelectedAddressandonPreferencesStateChange(#4225) - BREAKING: Remove
valueproperty from the data for each token instate.marketData(#4364)- The
priceproperty should be used instead.
- The
- Prevent unnecessary state updates when executing the
NftController'supdateNftMetadatamethod by comparing the metadata of fetched NFTs and NFTs in state and synchronizing state updates using a mutex lock. (#4325) - Prevent the use of market data when not available for a given token (#4361)
- Fix
refreshmethod remaining locked indefinitely after it was run successfully. Now lock is released on successful as well as failed runs. (#4270) TokenRatesControlleruses checksum instead of lowercase format for token addresses (#4377)
- BREAKING: Bump minimum Node version to 18.18 (#3611)
- BREAKING: Bump dependency and peer dependency
@metamask/accounts-controllerto^16.0.0(#4352) - BREAKING: Bump dependency and peer dependency
@metamask/approval-controllerto^7.0.0(#4352) - BREAKING: Bump dependency and peer dependency
@metamask/keyring-controllerto^17.0.0(#4352) - BREAKING: Bump dependency and peer dependency
@metamask/network-controllerto^19.0.0(#4352) - BREAKING: Bump dependency and peer dependency
@metamask/preferences-controllerto^13.0.0(#4352) - Bump
@metamask/base-controllerto^6.0.0(#4352) - Bump
@metamask/controller-utilsto^11.0.0(#4352) - Bump
@metamask/polling-controllerto^8.0.0(#4352)
- BREAKING: The
NftDetectionControllernow takes amessenger, which can be used for communication (#4312)- This messenger must allow the following actions
ApprovalController:addRequest,NetworkController:getState,NetworkController:getNetworkClientById, andPreferencesController:getState, and must allow the eventsPreferencesController:stateChangeandNetworkController:stateChange
- This messenger must allow the following actions
- Add
NftDetectionControllerMessengertype (#4312) - Add
NftControllerGetStateAction,NftControllerActions,NftControllerStateChangeEvent, andNftControllerEventstypes (#4310) - Add
NftController:getStateandNftController:stateChangeas an available action and event to theNftControllermessenger (#4310)
- BREAKING: Change
TokensControllerto inherit fromBaseControllerrather thanBaseControllerV1(#4304)- The constructor now takes a single options object rather than three arguments, and all properties in
configare now part of options.
- The constructor now takes a single options object rather than three arguments, and all properties in
- BREAKING: Rename
TokensStatetype toTokensControllerState(#4304) - BREAKING: Make all
TokensControllermethods and properties starting with_private (#4304) - BREAKING: Convert
Tokenfrominterfacetotype(#4304) - BREAKING: Replace
balanceErrorproperty inTokenwithhasBalanceError; updateTokenBalancesControllerso that it no longer captures the error resulting from getting the balance of an ERC-20 token (#4304) - BREAKING: Change
NftDetectionControllerto inherit fromStaticIntervalPollingControllerrather thanStaticIntervalPollingControllerV1(#4312)- The constructor now takes a single options object rather than three arguments, and all properties in
configare now part of options.
- The constructor now takes a single options object rather than three arguments, and all properties in
- BREAKING: Convert
ApiNft,ApiNftContract,ApiNftLastSale, andApiNftCreatorfrominterfacetotype(#4312) - BREAKING: Change
NftControllerto inherit fromBaseControllerrather thanBaseControllerV1(#4310)- The constructor now takes a single options object rather than three arguments, and all properties in
configare now part of options.
- The constructor now takes a single options object rather than three arguments, and all properties in
- BREAKING: Convert
Nft,NftContract, andNftMetadatafrominterfacetotype(#4310) - BREAKING: Rename
NftStatetoNftControllerState, and convert totype(#4310) - BREAKING: Rename
getDefaultNftStatetogetDefaultNftControllerState(#4310) - BREAKING: Bump dependency and peer dependency
@metamask/accounts-controllerto^15.0.0(#4342) - BREAKING: Bump dependency and peer dependency
@metamask/approval-controllerto^6.0.2(#4342) - BREAKING: Bump dependency and peer dependency
@metamask/keyring-controllerto^16.1.0(#4342) - BREAKING: Bump dependency and peer dependency
@metamask/network-controllerto^18.1.3(#4342) - BREAKING: Bump dependency and peer dependency
@metamask/preferences-controllerto^12.0.0(#4342) - Change
NftDetectionControllermethoddetectNftsso thatuserAddressoption is optional (#4312)- This will default to the currently selected address as kept by PreferencesController.
- Bump
async-mutexto^0.5.0(#4335) - Bump
@metamask/polling-controllerto^7.0.0(#4342)
- BREAKING: Remove
configproperty andconfiguremethod fromTokensController(#4304)- The
TokensControllernow takes a single options object which can be used for configuration, and configuration is now kept internally.
- The
- BREAKING: Remove
notify,subscribe, andunsubscribemethods fromTokensController(#4304)- Use the controller messenger for subscribing to and publishing events instead.
- BREAKING: Remove
TokensConfigtype (#4304)- These properties have been merged into the options that
TokensControllertakes.
- These properties have been merged into the options that
- BREAKING: Remove
configproperty andconfiguremethod fromTokensController(#4312)TokensControllernow takes a single options object which can be used for configuration, and configuration is now kept internally.
- BREAKING: Remove
notify,subscribe, andunsubscribemethods fromNftDetectionController(#4312)- Use the controller messenger for subscribing to and publishing events instead.
- BREAKING: Remove
chainIdas aNftDetectionControllerconstructor argument (#4312)- The controller will now read the
networkClientIdfrom the NetworkController state through the messenger when needed.
- The controller will now read the
- BREAKING: Remove
getNetworkClientByIdas aNftDetectionControllerconstructor argument (#4312)- The controller will now call
NetworkController:getNetworkClientIdthrough the messenger object.
- The controller will now call
- BREAKING: Remove
onPreferencesStateChangeas aNftDetectionControllerconstructor argument (#4312)- The controller will now call
PreferencesController:stateChangethrough the messenger object.
- The controller will now call
- BREAKING: Remove
onNetworkStateChangeas aNftDetectionControllerconstructor argument (#4312)- The controller will now read the
networkClientIdfrom the NetworkController state through the messenger when needed.
- The controller will now read the
- BREAKING: Remove
getOpenSeaApiKeyas aNftDetectionControllerconstructor argument (#4312)- This was never used.
- BREAKING: Remove
getNftApias aNftDetectionControllerconstructor argument (#4312)- This was never used.
- BREAKING: Remove
NftDetectionConfigtype (#4312)- These properties have been merged into the options that
NftDetectionControllertakes.
- These properties have been merged into the options that
- BREAKING: Remove
configproperty andconfiguremethod fromNftController(#4310)NftControllernow takes a single options object which can be used for configuration, and configuration is now kept internally.
- BREAKING: Remove
notify,subscribe, andunsubscribemethods fromNftController(#4310)- Use the controller messenger for subscribing to and publishing events instead.
- BREAKING: Remove
onPreferencesStateChangeas aNftControllerconstructor argument (#4310)- The controller will now call
PreferencesController:stateChangethrough the messenger object.
- The controller will now call
- BREAKING: Remove
onNetworkStateChangeas aNftControllerconstructor argument (#4310)- The controller will now call
NetworkController:stateChangethrough the messenger object.
- The controller will now call
- BREAKING: Remove
NftConfigtype (#4310)- These properties have been merged into the options that
NftControllertakes.
- These properties have been merged into the options that
- BREAKING: Remove
configproperty andconfiguremethod fromNftController(#4310)NftControllernow takes a single options object which can be used for configuration, and configuration is now kept internally.
- BREAKING: Remove
hubproperty fromNftController(#4310)- Use the controller messenger for subscribing to and publishing events instead.
- BREAKING: Modify
TokenListControllerso that tokens fetched from the API and stored in state will no longer havestorageanderc20properties (#4235)- These properties were never officially supported, but they were present in state anyway.
- Adds a new field
marketDatato the state ofTokenRatesController(#4206) - Adds a new
RatesControllerto manage prices for non-EVM blockchains (#4242)
- BREAKING: Changed price and token API endpoints from
*.metafi.codefi.networkto*.api.cx.metamask.io(#4301) - When fetching token list for Linea Mainnet, use
occurrenceFloorparameter of 1 instead of 3, and filter tokens to those with alineaTeamaggregator or more than 3 aggregators (#4253) - BREAKING: The NftController messenger must now allow the
NetworkController:getNetworkClientByIdaction (#4305) - BREAKING: Bump dependency and peer dependency
@metamask/network-controllerto^18.1.2(#4332) - Bump
@metamask/keyring-apito^6.1.1(#4262)
- BREAKING: Removed
contractExchangeRatesandcontractExchangeRatesByChainIdfrom the state ofTokenRatesController(#4206)
- Only update NFT state when metadata actually changes (#4143)
- Add token detection on 7 more networks (#4184)
- New supported networks are: cronos, celo, gnosis, fantom, polygon_zkevm, moonbeam, and moonriver
- BREAKING Changed
NftDetectionControllerconstructoroptionsargument (#4178)- Added
options.disabledandoptions.selectedAddressproperties
- Added
- BREAKING Bump
@metamask/keyring-controllerpeer dependency to ^16.0.0 (#4234) - BREAKING Bump
@metamask/accounts-controllerpeer dependency to ^14.0.0 (#4234) - BREAKING Bump
@metamask/preferences-controllerpeer dependency to ^11.0.0 (#4234) - Bump
@metamask/keyring-apito^6.0.0(#4193) - Lower number of tokens returned by API calls (#4207)
- Limit changed from
200to50
- Limit changed from
- Bump
@metamask/base-controllerto^5.0.2(#4232) - Bump
@metamask/approval-controllerto^6.0.2(#4234) - Bump
@metamask/polling-controllerto^6.0.2(#4234)
- Add reservoir migration (#4030)
- Fix getting nft tokenURI (#4136)
- BREAKING Bump peer dependency on
@metamask/keyring-controller(#4090) - Fix token detection during account change (#4133)
- Fix update nft metadata when toggles off (#4096)
- Adds
tokenMethodIncreaseAllowance(#4069) - Fix mantle token mispriced (#4045)
-
CodefiTokenPricesServiceV2exportsSUPPORTED_CHAIN_IDS, an array of chain IDs supported by Codefi Price API V2. (#4079) -
Added
tokenURIkey tocompareNftMetadatafunction to compare nft metadata entries with. (#3856)
- Add
updateNftMetadatamethod toNftControllerto update metadata for the requested NFTs (#4008)
- Fix
typesfield inpackage.json(#4047)
- BREAKING: Add ESM build (#3998)
- It's no longer possible to import files from
./distdirectly.
- It's no longer possible to import files from
- BREAKING: Bump dependency and peer dependency on
@metamask/accounts-controllerto^12.0.0(#4039) - BREAKING: Bump dependency and peer dependency on
@metamask/approval-controllerto^6.0.0(#4039) - BREAKING: Bump
@metamask/base-controllerto^5.0.0(#4039)- This version has a number of breaking changes. See the changelog for more.
- BREAKING: Bump dependency and peer dependency on
@metamask/keyring-controllerto^14.0.0(#4039) - BREAKING: Bump dependency and peer dependency on
@metamask/network-controllerto^18.0.0(#4039) - BREAKING: Bump dependency and peer dependency on
@metamask/preferences-controllerto^9.0.0(#4039) - Relax
TokensControllerGetStateActionandTokensControllerStateChangeEventtypes so that they no longer constrain theTokensControllerstate in the action handler and event payload toRecord<string, Json>(#3949) - Bump
@metamask/controller-utilsto^9.0.0(#4039) - Bump
@metamask/polling-controllerto^6.0.0(#4039)
- BREAKING:
TokenDetectionControllernewly subscribes to thePreferencesController:stateChange,AccountsController:selectedAccountChange,KeyringController:lock, andKeyringController:unlockevents, and allows messenger actionsAccountsController:getSelectedAccount,NetworkController:getNetworkClientById,NetworkController:getNetworkConfigurationByNetworkClientId,NetworkController:getState,KeyringController:getState,PreferencesController:getState,TokenListController:getState,TokensController:getState, andTokensController:addDetectedTokens(#3775, #3923, #3938) TokensControllernow exportsTokensControllerActions,TokensControllerGetStateAction,TokensControllerAddDetectedTokensAction,TokensControllerEvents, andTokensControllerStateChangeEvent(#3690)
- BREAKING: Add
@metamask/accounts-controller^11.0.0as dependency and peer dependency (#3775, #4007) - BREAKING: Add
@metamask/keyring-controller^13.0.0as dependency and peer dependency (#3775, #4007) - BREAKING: Bump
@metamask/preferences-controllerdependency and peer dependency to^8.0.0(#4007) - BREAKING:
TokenDetectionControlleris merged withDetectTokensControllerfrom themetamask-extensionrepo (#3775, #3923), (#3938)- BREAKING:
TokenDetectionControllernow resets its polling interval to the default value of 3 minutes when token detection is triggered by external controller eventsKeyringController:unlock,TokenListController:stateChange,PreferencesController:stateChange,AccountsController:selectedAccountChange. - BREAKING:
TokenDetectionControllernow refetches tokens onNetworkController:networkDidChangeif thenetworkClientIdis changed instead ofchainId. - BREAKING:
TokenDetectionControllercannot initiate polling or token detection ifKeyringControllerstate is locked. - BREAKING: The
detectTokensmethod input optionaccountAddresshas been renamed toselectedAddress. - BREAKING: The
detectTokensmethod now excludes tokens that are already included in theTokensController'sdetectedTokenslist from the batch of incoming tokens it sends to theTokensControlleraddDetectedTokensmethod. - BREAKING: The constructor for
TokenDetectionControllerexpects a new required propertytrackMetaMetricsEvent, which defines the callback that is called in thedetectTokensmethod. - BREAKING: In Mainnet, even if the
PreferenceController'suseTokenDetectionoption is set to false, automatic token detection is performed on the legacy token list (token data from the contract-metadata repo). - BREAKING: The
TokensStatetype is now defined as a type alias rather than an interface. (#3690)- This is breaking because it could affect how this type is used with other types, such as
Json, which does not support TypeScript interfaces.
- This is breaking because it could affect how this type is used with other types, such as
- The constructor option
selectedAddressno longer defaults to''if omitted. Instead, the correct address is assigned using theAccountsController:getSelectedAccountmessenger action.
- BREAKING:
- BREAKING: Change type of
providerproperty inAssetsContractControllerfromanytoProviderfrom@metamask/network-controller(#3818) - BREAKING: Change type of
providerproperty inTokensControllerfromanytoProviderfrom@metamask/network-controller(#3818) - Bump
@metamask/approval-controllerto^5.1.3(#4007) - Bump
@metamask/controller-utilsto^8.0.4(#4007) - Bump
@metamask/ethjs-unitto^0.3.0(#3897) - Bump
@metamask/network-controllerto^17.2.1(#4007) - Bump
@metamask/polling-controllerto^5.0.1(#4007) - Bump
@metamask/rpc-errorsto^6.2.1(#3970, #3954) - Replace
ethereumjs-utilwith@ethereumjs/utilandbn.js(#3943) - Update
CodefiTokenPricesServiceV2so that requests to the price API now use theNo-CacheHTTP header (#3939)
- BREAKING:
TokenDetectionControllerconstructor no longer accepts optionsnetworkClientId,onPreferencesStateChange,getPreferencesState,getTokensState, oraddDetectedTokens(#3690, #3775, #3938) - BREAKING:
TokenDetectionControllerno longer allows theNetworkController:stateChangeevent. (#3775)- The
NetworkController:networkDidChangeevent can be used instead.
- The
- BREAKING:
TokenDetectionControllerconstructor no longer accepts optionsnetworkClientId,onPreferencesStateChange,getPreferencesState,getTokensState, oraddDetectedTokens(#3690, #3775, #3938) - BREAKING:
TokenBalancesControllerconstructor no longer accepts optionsonTokensStateChange,getSelectedAddress(#3690)
TokenDetectionController.detectTokens()now reads the chain ID keyed state properties fromTokenListControllerandTokensControllerrather than incorrectly using the globally selected state properties when a network client ID is passed (#3914)- Fix
PreferencesControllerstate listener inNftDetectionControllerso that NFT detection is not run when any preference changes, but only when NFT detection is enabled (#3917) - Fix
isTokenListSupportedForNetworkso that it returns false for chain 1337 (#3777)- When used in combination with
TokensController, this makes it possible to import an ERC-20 token on a locally run chain.
- When used in combination with
- Add Linea to price api supported chains (#3797)
- BREAKING: Convert
TokenBalancesControllertoBaseControllerV2(#3750)- The constructor parameters have changed; rather than accepting a "config" parameter for interval and tokens we now pass both values as controller options, and a "state" parameter, there is now just a single object for all constructor arguments. This object has a mandatory
messengerand an optionalstate,tokens,intervalproperties a disabled property has also been added. - State now saves tokens balances as strings and not as a BNs.
- Additional BN export has been removed as it was intended to be removed in the next major release.
- The constructor parameters have changed; rather than accepting a "config" parameter for interval and tokens we now pass both values as controller options, and a "state" parameter, there is now just a single object for all constructor arguments. This object has a mandatory
- BREAKING: Bump
@metamask/approval-controllerpeer dependency to^5.1.2(#3821) - BREAKING: Bump
@metamask/network-controllerpeer dependency to^17.2.0(#3821) - BREAKING: Bump
@metamask/preferences-controllerpeer dependency to^7.0.0(#3821) - Bump
@metamask/utilsto^8.3.0(#3769) - Bump
@metamask/base-controllerto^4.1.1(#3760, #3821) - Bump
@metamask/controller-utilsto^8.0.2(#3821) - Bump
@metamask/polling-controllerto^5.0.0(#3821)
- Add
getDefaultTokenListStatefunction toTokenListController(#3744) - Add
getDefaultNftStatefunction to theNftController(#3742) - Add
getDefaultTokensStatefunction to theTokensController(#3743)
- BREAKING: Bump
@metamask/preferences-controllerto ^6.0.0 - Price API perf improvements (#3753, #3755)
- Reduce token batch size from 100 to 30
- Sort token addresses in query params for more cache hits
- Add support to
CodefiTokenPricesServiceV2for tracking degraded service (#3691)- The constructor has two new options:
onDegradedanddegradedThreshold.onDegradedis an event handler for instances of degraded service (i.e. failed or slow requests), anddegradedThresholddetermines how slow a request has to be before we consider service to be degraded.
- The constructor has two new options:
- Add
onBreakhandler toCodefiTokenPricesServiceV2(#3677)- This allows listening for "circuit breaks", which can indicate an outage. Useful for metrics.
- Add
fetchTokenContractExchangeRatesutility method (#3657) TokenListControllernow exports aTokenListControllerMessengertype (#3609).TokenDetectionControllerexports typesTokenDetectionControllerMessenger,TokenDetectionControllerActions,TokenDetectionControllerGetStateAction,TokenDetectionControllerEvents,TokenDetectionControllerStateChangeEvent(#3609).- Add
enableanddisablemethods toTokenDetectionController, which control whether the controller is able to make polling requests or all of its network calls are blocked. (#3609).- Note that if the controller is initiated without the
disabledconstructor option set tofalse, theenablemethod will need to be called before the controller can make polling requests in response to subscribed events.
- Note that if the controller is initiated without the
- BREAKING: Bump
@metamask/approval-controllerdependency and peer dependency from^5.1.0to^5.1.1(#3695) - BREAKING: Bump
@metamask/network-controllerdependency and peer dependency from^17.0.0to^17.1.0(#3695) - BREAKING: Bump
@metamask/preferences-controllerdependency and peer dependency from^5.0.0to^5.0.1(#3695) - BREAKING: Update
OpenSeaV2Contracttype, renamingsupplytototal_supply(#3692) - BREAKING:
TokenDetectionControlleris upgraded to extendBaseControllerV2andStaticIntervalPollingController(#3609).- The constructor now expects an options object as its only argument, with required properties
messenger,networkClientId, required callbacksonPreferencesStateChange,getBalancesInSingleCall,addDetectedTokens,getTokenState,getPreferencesState, and optional propertiesdisabled,interval,selectedAddress.
- The constructor now expects an options object as its only argument, with required properties
- Bump
@metamask/base-controllerto^4.0.1(#3695) - Bump
@metamask/polling-controllerto^4.0.0(#3695) - Bump
cockatielfrom3.1.1to^3.1.2(#3682) - Bump
@metamask/controller-utilsfrom8.0.0to^8.0.1(#3695)
- Fix error caused by OpenSea API rename of
supplytototal_supply(#3692) - Fix
CodefiTokenPricesServiceV2support for Shiden (#3683) - Improve how
CodefiTokenPricesServiceV2handles token price update failures (#3687)- Previously a single failed token price update would prevent all other token prices from updating as well. With this update, we log and error and continue when we fail to update a token price, ensuring the others still get updated.
- BREAKING: OpenSea V2 API is used instead of V1 (#3654)
NftDetectionControllerconstructor now requires theNftController.getNftApifunction.- NFT controllers will no longer return
last_saleinformation for NFTs fetched after the OpenSea V2 update
- Add
CodefiTokenPricesServiceV2(#3600, #3655, #3655)- This class can be used for the new
tokenPricesServiceargument for TokenRatesController. It uses a MetaMask API to fetch prices for tokens instead of CoinGecko. - The
CodefiTokenPricesServiceV2will retry if the token price update fails- We retry each request up to 3 times using a randomized exponential backoff strategy
- If the token price update still fails 12 times consecutively (3 update attempts, each of which has 4 calls due to retries), we stop trying for 30 minutes before we try again.
- This class can be used for the new
- Add polling by
networkClientIdtoAccountTrackerController(#3586)- A new state property,
accountByChainIdhas been added for keeping track of account balances across chains AccountTrackerControllerimplementsPollingControllerand can now poll bynetworkClientIdvia the new methodsstartPollingByNetworkClientId,stopPollingByPollingToken, andstopPollingByPollingToken.AccountTrackerControlleraccepts an optionalnetworkClientIdvalue on therefreshmethodAccountTrackerControlleraccepts an optionalnetworkClientIdvalue as the last parameter of thesyncBalanceWithAddressesmethod
- A new state property,
- Support token detection on Base and zkSync (#3584)
- Support token detection on Arbitrum and Optimism (#2035)
- BREAKING:
TokenRatesControllernow takes a required argumenttokenPricesService(#3600)- This object is responsible for fetching the prices for tokens held by this controller.
- BREAKING: Update signature of
TokenRatesController.updateExchangeRatesByChainId(#3600, #3653)- Change the type of
tokenAddressesfromstring[]toHex[]
- Change the type of
- BREAKING:
AccountTrackerControllerconstructor params object requiresgetCurrentChainIdandgetNetworkClientByIdhooks (#3586)- These are needed for the new "polling by
networkClientId" feature
- These are needed for the new "polling by
- BREAKING:
AccountTrackerControllerhas a new required state property,accountByChainId(#3586)- This is needed to track balances accross chains. It was introduced for the "polling by
networkClientId" feature, but is useful on its own as well.
- This is needed to track balances accross chains. It was introduced for the "polling by
- BREAKING:
AccountTrackerControlleradds a mutex torefreshmaking it only possible for one call to be executed at time (#3586) - BREAKING:
TokensController.watchAssetnow performs on-chain validation of the asset's symbol and decimals, if they're defined in the contract (#1745)- The
TokensControllerconstructor no longer accepts agetERC20TokenNameoption. It was no longer needed due to this change. - Add new method
_getProvider, though this is intended for internal use and should not be called externally. - Additionally, if the symbol and decimals are defined in the contract, they are no longer required to be passed to
watchAsset
- The
- BREAKING: Update controllers that rely on provider to listen to
NetworkController:networkDidChangeinstead ofNetworkController:stateChange(#3610)- The
networkDidChangeevent is safer in cases where the provider is used because the provider is guaranteed to have been updated by the time that event is emitted. The same is not true of thestateChangeevent. - The following controllers now accept a
onNetworkDidChangeconstructor option instead of aonNetworkStateChangeoption:TokensControllerAssetsContractController
- The
- Update
@metamask/polling-controllerto v3 (#3636)- This update adds two new methods to each polling controller:
_startPollingByNetworkClientIdand_stopPollingByPollingTokenSetId. These methods are intended for internal use, and should not be called directly. - The affected controllers are:
AccountTrackerControllerCurrencyRateControllerNftDetectionControllerTokenDetectionControllerTokenListControllerTokenRatesController
- This update adds two new methods to each polling controller:
- Update
@metamask/controller-utilsto v7 (#3636) - Update
TokenListControllerto fetch prefiltered set of tokens from the API, reducing response data and removing the need for filtering logic (#2054) - Update
TokenRatesControllerto request token rates from the Price API in batches of 100 (#3650) - Add dependencies
cockatielandlodash(#3586, #3655)
- BREAKING: Remove
fetchExchangeRatemethod from TokenRatesController (#3600)- This method (not to be confused with
updateExchangeRate, which is still present) was only ever intended to be used internally and should not be accessed directly.
- This method (not to be confused with
- BREAKING: Remove
getChainSlugmethod from TokenRatesController (#3600)- This method was previously used in TokenRatesController to access the CoinGecko API. There is no equivalent.
- BREAKING: Remove
CoinGeckoResponseandCoinGeckoPlatformtypes (#3600)- These types were previously used in TokenRatesController to represent data returned from the CoinGecko API. There is no equivalent.
- BREAKING: The TokenRatesController now only supports updating and polling rates for tokens tracked by the TokensController (#3639)
- The
tokenAddressesoption has been removed fromstartPollingByNetworkClientId - The
tokenContractAddressesoption has been removed fromupdateExchangeRatesByChainId
- The
- BREAKING:
TokenRatesController.fetchAndMapExchangeRatesis no longer exposed publicly (#3621)
- Prevent
TokenRatesControllerfrom making redundant token rate updates when tokens change (#3647, #3663)- Previously, token rates would be re-fetched for the globally selected network on all TokensController state changes, but now token rates are always performed for a deduplicated and normalized set of addresses, and changes to this set determine whether rates should be re-fetched.
- Prevent redundant overlapping token rate updates in
TokenRatesController(#3635) - Fix
TokenRatesControllerbug where thecontractExchangeRatesstate would sometimes be stale after callingupdateExchangeRatesByChainId(#3624) - Make
TokenRatesController.updateExchangeRatesByChainIdrespectdisabledstate (#3596) - Fix error in
NftControllerwhen attempt to get NFT information from on-chain fails, and ensure metadata always contains contract address and blanknamefield (#3629)- When fetching on-chain NFT information fails, we now proceed with whatever we have (either the OpenSea metadata, or a blank metadata object)
- Previously, if we were unable to retrieve NFT metadata from on-chain or OpenSea, the returned NFT metadata would be missing a
namefield and the contract address. Now the returned metadata always has those entries, though thenameis set tonull. - This affects
watchNftandaddNftmethods
- BREAKING:
TokenRatesControllerStatenow has requiredcontractExchangeRatesByChainIdproperty which an object keyed bychainIdandnativeCurrency(#2015) - BREAKING:
TokenRatesControllerconstructor params now requiresgetNetworkClientById(#2015) - Add types
CurrencyRateControllerEventsandCurrencyRateControllerActions(#2029) - Add polling-related methods to TokenRatesController (#2015)
startPollingByNetworkClientIdstopPollingByPollingTokenstopAllPolling_executePoll
- Add
updateExchangeRatesByChainIdmethod to TokenRatesController (#2015)- This is a lower-level version of
updateExchangeRatesthat takes chain ID, native currency, and token addresses.
- This is a lower-level version of
TokenRatesControllerconstructor params now accepts optionalintervalandthreshold(#2015)TokenRatesController.fetchExchangeRate()now accepts an optionaltokenAddressesas the last parameter (#2015)TokenRatesController.getChainSlug()now accepts an optionalchainIdparameter (#2015)TokenRatesController.fetchAndMapExchangeRates()now accepts an optionaltokenAddressesas the last parameter (#2015)
- BREAKING: Bump dependency on
@metamask/base-controllerto ^4.0.0 (#2063)- This is breaking because the type of the
messengerhas backward-incompatible changes. See the changelog for this package for more.
- This is breaking because the type of the
- Bump
@metamask/approval-controllerto ^5.0.0 (#2063) - Bump
@metamask/controller-utilsto ^6.0.0 (#2063) - Bump
@metamask/network-controllerto ^17.0.0 (#2063) - Bump
@metamask/polling-controllerto ^2.0.0 (#2063) - Bump
@metamask/preferences-controllerto ^5.0.0 (#2063)
- BREAKING: Bump dependency and peer dependency on
@metamask/network-controllerto ^16.0.0 - Add optional
networkClientIdanduserAddressargs to remainingNftControllerpublic methods (#2006)watchNft,removeNft,removeAndIgnoreNft,removeNftContract,updateNftFavoriteStatus, andcheckAndUpdateAllNftsOwnershipStatusmethods onNftControllerall now accept an optional options object argument containingnetworkClientIdanduserAddressto identify where in state to mutate.- BREAKING:
addNftno longer accepts achainIdproperty in its options argument since this value can be retrieved by thenetworkClientIdproperty and is therefore redundant. - BREAKING: The third and fourth arguments on NftController's
addNftVerifyOwnershipmethod, have been replaced with an options object containing optional propertiesnetworkClientId,userAddressandsource. This method signature is more aligned with the options pattern for passingnetworkClientIdanduserAddresson this controller and elsewhere. - BREAKING:
checkAndUpdateSingleNftOwnershipStatuson NftController no longer accepts achainIdin its options argument. This is replaced with an optionalnetworkClientIdproperty which can be used to fetch chainId. *BREAKING: The fourth argument of theisNftOwnermethod onNftControlleris now an options object with an optionalnetworkClientIdproperty. This method signature is more aligned with the options pattern for passingnetworkClientIdon this controller and elsewhere. - BREAKING:
validateWatchNftmethod onNftControlleris now private. - BREAKING:
detectNftsonNftDetectionControllernow accepts a single object argument with optional propertiesnetworkClientIdanduserAddress, rather than taking these as two sequential arguments.
- Bump dependency
@metamask/eth-queryfrom ^3.0.1 to ^4.0.0 (#2028) - Bump dependency on
@metamask/polling-controllerto ^1.0.2 - Bump
@metamask/utilsfrom 8.1.0 to 8.2.0 (#1957)
- Add name and symbol to the payload returned by the
ERC1155StandardclassgetDetailsmethod forERC1155contracts (#1727)
- BREAKING:
CurrencyRateControlleris now keyed bynativeCurrency(i.e. ticker) forconversionDate,conversionRate, andusdConversionRatein thecurrencyRatesobject.nativeCurrency,pendingNativeCurrency, andpendingCurrentCurrencyhave been removed.-
export type CurrencyRateState = { currentCurrency: string; currencyRates: Record< string, // nativeCurrency { conversionDate: number | null; conversionRate: number | null; usdConversionRate: number | null; } >; };
-
- BREAKING:
CurrencyRateControllernow extendsPollingController(#1805)start()andstop()methods replaced withstartPollingByNetworkClientId(),stopPollingByPollingToken(), andstopAllPolling()
- BREAKING:
CurrencyRateControllernow sends theNetworkController:getNetworkClientByIdaction via messaging controller (#1805)
- Parallelize network requests in assets controllers for performance enhancement (#1801)
- Fix token detection on accounts when user changes account after token detection request is inflight (#1848)
- BREAKING: Bump dependency on
@metamask/polling-controllerto ^1.0.0 - Bump dependency and peer dependency on
@metamask/network-controllerto ^15.1.0
- Add way to start and stop different polling sessions for the same network client ID by providing extra scoping data (#1776)
- Add optional second argument to
stopPollingByPollingToken(formerlystopPollingByNetworkClientId) - Add optional second argument to
onPollingCompleteByNetworkClientId
- Add optional second argument to
- Add support for token detection for Linea mainnet and Linea Goerli (#1799)
- BREAKING: Bump dependency and peer dependency on
@metamask/network-controllerto ^15.0.0 - BREAKING: Make
executePollin TokenListController private (#1810) - BREAKING: Update TokenListController to rename
stopPollingByNetworkClientIdtostopPollingByPollingToken(#1810) - Add missing dependency on
@metamask/polling-controller(#1831) - Bump dependency and peer dependency on
@metamask/approval-controllerto ^4.0.1 - Bump dependency and peer dependency on
@metamask/preferences-controllerto ^4.4.3 - Fix support for NFT metadata stored outside IPFS (#1772)
- BREAKING:
NftControllernow expectsgetNetworkClientByIdin constructor options (#1698) - BREAKING:
NftController.addNftfunction signature has changed (#1698)- Previously
now:
address: string, tokenId: string, nftMetadata?: NftMetadata, accountParams?: { userAddress: string; chainId: Hex; }, source = Source.Custom,tokenAddress: string, tokenId: string, { nftMetadata?: NftMetadata; chainId?: Hex; // extracts from AccountParams userAddress?: string // extracted from AccountParams source?: Source; networkClientId?: NetworkClientId; // new },
- Previously
NftController.addNftVerifyOwnership: Now accepts optional 3rd argumentnetworkClientIdwhich is used to fetch NFT metadata and determine by which chainId the added NFT should be stored in state. Also accepts optional 4th argumentsourceused for metrics to identify the flow in which the NFT was added to the wallet. (#1698)NftController.isNftOwner: Now accepts optionalnetworkClientIdwhich is used to instantiate the provider for the correct chain and call the NFT contract to verify ownership (#1698)NftController.addNftwill use the chainId value derived fromnetworkClientIdif provided (#1698)NftController.watchNftoptions now accepts optionalnetworkClientIdwhich is used to fetch NFT metadata and determine by which chainId the added NFT should be stored in state (#1698)- Bump dependency on
@metamask/utilsto ^8.1.0 (#1639) - Bump dependency and peer dependency on
@metamask/approval-controllerto ^4.0.0 - Bump dependency on
@metamask/base-controllerto ^3.2.3 - Bump dependency on
@metamask/controller-utilsto ^5.0.2 - Bump dependency and peer dependency on
@metamask/network-controllerto ^14.0.0
- Fix bug in TokensController where batched
addTokenoverwrote each other because mutex was acquired after reading state (#1768)
- BREAKING: Remove AbortController polyfill
- This package now assumes that the AbortController global exists
- BREAKING:
TokensControllernow expectsgetNetworkClientByIdin constructor options (#1676) - BREAKING:
TokensController.addTokennow accepts a single options object (#1676){ address: string; symbol: string; decimals: number; name?: string; image?: string; interactingAddress?: string; networkClientId?: NetworkClientId; } - BREAKING: Bump peer dependency on
@metamask/network-controllerto ^13.0.0 (#1633) - CHANGED:
TokensController.addTokenwill use the chain ID value derived from state fornetworkClientIdif provided (#1676) - CHANGED:
TokensController.addTokensnow accepts an optionalnetworkClientIdas the last parameter (#1676) - CHANGED:
TokensController.addTokenswill use the chain ID value derived from state fornetworkClientIdif provided (#1676) - CHANGED:
TokensController.watchAssetoptions now accepts optionalnetworkClientIdwhich is used to get the ERC-20 token name if provided (#1676) - Bump dependency on
@metamask/controller-utilsto ^5.0.0 (#1633) - Bump dependency on
@metamask/preferences-controllerto ^4.4.1 (#1676)
- Add
AssetsContractControllermethodsgetProvider,getChainId,getERC721Standard, andgetERC1155Standard(#1638)
- BREAKING: Add
getNetworkClientByIdtoAssetsContractControllerconstructor options (#1638) - Add optional
networkClientIdparameter to variousAssetContractControllermethods (#1638) - The affected methods are:
getERC20BalanceOfgetERC20TokenDecimalsgetERC20TokenNamegetERC721NftTokenIdgetTokenStandardAndDetailsgetERC721TokenURIgetERC721AssetNamegetERC721AssetSymbolgetERC721OwnerOfgetERC1155TokenURIgetERC1155BalanceOftransferSingleERC1155getBalancesInSingleCall
- Bump dependency and peer dependency on
@metamask/approval-controllerto ^3.5.1 - Bump dependency on
@metamask/base-controllerto ^3.2.1 - Bump dependency on
@metamask/controller-utilsto ^4.3.2 - Bump dependency and peer dependency on
@metamask/network-controllerto ^12.1.2 - Bump dependency and peer dependency on
@metamask/preferences-controllerto ^4.4.0 - Update NftController to add fallback for when IPFS gateway is disabled (#1577)
- Replace
eth-query^2.1.2 with@metamask/eth-query^3.0.1 (#1546)
- Add a
stopmethod to stop polling
- BREAKING: New required constructor parameters for the
TokenRatesController(#1497, #1511)- The new required parameters are
ticker,onSelectedAddress, andonPreferencesStateChange
- The new required parameters are
- BREAKING: Remove
onCurrencyRateStateChangeconstructor parameter fromTokenRatesController(#1496) - BREAKING: Disable
TokenRatesControllerautomatic polling (#1501)- Polling must be started explicitly by calling the
startmethod - The token rates are not updated upon state changes when polling is disabled.
- Polling must be started explicitly by calling the
- BREAKING: Replace the
pollmethod withstart(#1501)- The
startmethod does not offer a way to change the interval. That must be done by calling.configureinstead
- The
- BREAKING: Remove
TokenRatecontrollersetter forchainIdandtokensproperties (#1505) - Bump @metamask/abi-utils from 1.2.0 to 2.0.1 (#1525)
- Update
@metamask/utilsto^6.2.0(#1514) - Remove unnecessary
babel-runtimedependency (#1504)
- Fix bug where token rates were incorrect after first update if initialized with a non-Ethereum selected network (#1497)
- Fix bug where token rates would be invalid if event handlers were triggered in the wrong order (#1496, #1511)
- Prevent redundant token rate updates (#1512)
- The method
getERC20TokenNamehas been added toAssetsContractController(#1127)- This method gets the token name from the token contract
- BREAKING: The tokens controller now requires
onTokenListStateChangeandgetERC20TokenNameas constructor parameters (#1127)- The
getERC20TokenNamemethod is used to get the token name for tokens added viawallet_watchAsset - The
onTokenListStateChangemethod is used to trigger a name update when the token list changes. On each change, token names are copied from the token list if they're missing from token controller state.
- The
- BREAKING: The signature of the tokens controller method
addTokenhas changed- The fourth and fifth positional parameters (
imageandinteractingAddress) have been replaced by anoptionsobject - The new options parameter includes the
imageandinteractingAddressproperties, and a newnameproperty
- The fourth and fifth positional parameters (
- The token detection controller now sets the token name when new tokens are detected (#1127)
- The
Tokentype now includes an optionalnamefield (#1127)
- Add validation that the nft standard matches the type argument of a
wallet_watchAssetrequest when type is 'ERC721' or 'ERC1155' (#1455)
- Add a fifth argument,
source, to NftController'saddNftmethod (#1417)- This argument can be used to specify whether the NFT was detected, added manually, or suggested by a dapp
- Fix
watchNftin NftController to ensure that if the network changes before the user accepts the request, the NFT is added to the chain ID and address before the request was initiated (#1417)
- BREAKING: Add required options
getSelectedAddressandgetMultiAccountBalancesEnabledto AccountTrackerController constructor and make use of them when refreshing account balances (#1146)- Previously, the controller would refresh all account balances, but these options can be used to only refresh the currently selected account
- BREAKING: Add logic to support validating and adding ERC721 and ERC1155 tokens to NFTController state via
wallet_watchAssetAPI. (#1173, #1406)- The
NFTControllernow has a newwatchNFTmethod that can be called to send a message to theApprovalControllerand prompt the user to add an NFT to their wallet state. - The
NFTControllernow requires an instance of a ControllerMessenger to be passed to its constructor. This is messenger is used to pass thewatchNFTmessage to theApprovalController.
- The
- Add dependency on
@ethersproject/address(#1173) - Replace
eth-rpc-errorswith@metamask/rpc-errors(#1173)
- Support NFT detection on Ethereum Mainnet custom RPC endpoints (#1360)
- Enable token detection for the Aurora network (#1327)
- BREAKING: Bump to Node 16 (#1262)
- BREAKING: Change format of chain ID in state to 0x-prefixed hex string (#1367)
- The functions
isTokenDetectionSupportedForNetworkandformatIconUrlWithProxynow expect a chain ID as typeHexrather than as a decimalstring - The assets contract controller now expects the
chainIdconfiguration entry and constructor parameter as typeHexrather than decimalstring - The NFT controller now expects the
chainIdconfiguration entry and constructor parameter as typeHexrather than decimalstring - The NFT controller methods
addNft,checkAndUpdateSingleNftOwnershipStatus,findNftByAddressAndTokenId,updateNft, andresetNftTransactionStatusByTransactionIdnow expect the chain ID to be typeHexrather than a decimalstring - The NFT controller state properties
allNftContractsandallNftsare now keyed by address andHexchain ID, rather than by address and decimalstringchain ID- This requires a state migration
- The NFT detection controller now expects the
chainIdconfiguration entry and constructor parameter as typeHexrather than decimalstring - The token detection controller now expects the
chainIdconfiguration entry as typeHexrather than decimalstring - The token list controller now expects the
chainIdconstructor parameter as typeHexrather than decimalstring - The token list controller state property
tokensChainsCacheis now keyed byHexchain ID rather than by decimalstringchain ID.- This requires a state migration
- The token rates controller now expects the
chainIdconfiguration entry and constructor parameter as typeHexrather than decimalstring - The token rates controller
chainIdsetter now expects the chain ID asHexrather than as a decimal string - The tokens controller now expects the
chainIdconfiguration entry and constructor parameter as typeHexrather than decimalstring - The tokens controller
addDetectedTokensmethod now accepts thechainIdproperty of thedetectionDetailsparameter to be of typeHexrather than decimalstring. - The tokens controller state properties
allTokens,allIgnoredTokens, andallDetectedTokensare now keyed by chain ID inHexformat rather than decimalstring.- This requires a state migration
- The functions
- BREAKING: Use approval controller for suggested assets (#1261, #1268)
- The actions
ApprovalController:acceptRequestandApprovalController:rejectRequestare no longer required by the token controller messenger. - The
suggestedAssetsstate has been removed, which means that suggested assets are no longer persisted in state - The return type for
watchAssethas changed. It now returns a Promise that settles after the request has been confirmed or rejected.
- The actions
- BREAKING: Initialize controllers with the current network (#1361)
- The following controllers now have a new
chainIdrequired constructor parameter:AssetsContractControllerNftControllerNftDetectionControllerTokenRatesControllerTokensController
- The following controllers now have a new
- BREAKING: The token list controller messenger requires the
NetworkController:stateChangeevent instead of theNetworkController:providerConfigChangeevent (#1329) - BREAKING: The token list controller
onNetworkStateChangeoption now has a more restrictive type (#1329)- The event handler parameter type has been changed from
NetworkState | ProviderConfigtoNetworkState
- The event handler parameter type has been changed from
- BREAKING: Update the account tracker controller
providertype (#1266)- The
providersetter and theproviderconfig entry now use ourProvidertype frometh-queryrather thanany
- The
- BREAKING: Update
@metamask/preferences-controllerdependency and add it as a peer dependency (#1393) - BREAKING: Update
@metamask/approval-controllerand@metamask/network-controllerdependencies and peer dependencies - Bump @metamask/abi-utils from 1.1.0 to 1.2.0 (#1287)
- Bump @metamask/utils from 5.0.1 to 5.0.2 (#1271)
- BREAKING: Remove the
networkTypeconfiguration option from the NFT detection controller, NFT controller, and tokens controller (#1360, #1359) - BREAKING: Remove the
SuggestedAssetMetaandSuggestedAssetMetaBasetypes from the token controller (#1268) - BREAKING: Remove the
acceptWatchAssetandrejectWatchAssetmethods from the token controller (#1268)- Suggested assets can be accepted or rejected using the approval controller instead
- BREAKING: peerDeps: @metamask/network-controller@6.0.0->8.0.0 (#1196)
- BREAKING: Create approval requests using
@metamask/approval-controller(#1166)
- Support watching assets on a specific account (#1124)
- Update
@metamask/contract-metadatafrom 2.1.0 to 2.3.1 (#1141)
- BREAKING: Remove
isomorphic-fetch(#1106)- Consumers must now import
isomorphic-fetchor another polyfill themselves if they are running in an environment withoutfetch
- Consumers must now import
- Update Nft Controller to add the NFT back to its own group if we are re-importing it (#1082)
- Add Sepolia support to the currency rate controller (#1041)
- The currency rate controller will now treat Sepolia as a testnet, and return the Mainnet exchange rate when asked for the Sepolia exchange rate.
- BREAKING: Update
@metamask/network-controllerpeer dependency to v3 (#1041) - BREAKING: Migrate from
metaswaptometafisubdomain for OpenSea proxy and token icons API (#1060) - Rename this repository to
core(#1031) - Update ERC20Standard to use
@metamask/abi-utilsinstead of@ethersproject/abi(#985) - Update
@metamask/controller-utilspackage (#1041)
- BREAKING: Drop support for Ropsten, Rinkeby, and Kovan (#1041)
- The currency rate controller no longer has special handling of these three networks. It used to return the Mainnet exchange rate for these three networks, but now it includes no special handling for them.
- The NFT controller no longer supports the Rinkeby OpenSea test API.
- Export
isTokenDetectionSupportedForNetworkfunction (#1034) - Update
@metamask/contract-metadatafrom 1.35.0 to 2.1.0 (#1013)
- Fix token controller state updates (#1015)
- Attempts to empty the list of "added", "ignored", or "detected" tokens were not saved in state correctly, resulting in that operation being undone after switching account or network.
- BREAKING: A new private property, controlled by the
startandstopmethods, is added to the CurrencyRateController:enabled. When this is false, no network requests will be made from the controller. Previously, setNativeCurrency or setCurrentCurrency would trigger a network request. That is now prevented ifenabledis false. (#1002)
- The TokenRatesController no longer overwrites the
disabledconfig property passed to the constructor, allowing the controller to be instantiated withconfig.disabledset to either true or false. (#1002) - This package will now warn if a required package is not present (#1003)
- BREAKING: Update
onNetworkStateChange, a constructor option for several controllers, to take an object with aproviderConfigproperty instead ofprovider(#995)- This affects:
- AssetsContractController
- NftController
- NftDetectionController
- TokenDetectionController
- TokenListController
- TokenRatesController
- TokenController
- This affects:
- BREAKING: [TokenDetectionController] Update
getNetworkStateconstructor option to take an object withproviderConfigproperty rather thanproviderConfig(#995) - Relax dependencies on
@metamask/base-controller,@metamask/controller-utils,@metamask/network-controller, and@metamask/preferences-controller(use^instead of~) (#998)
- Fix race condition where some token detections can get mistakenly added to the wrong account (#956)
-
Initial release
-
As a result of converting our shared controllers repo into a monorepo (#831), we've created this package from select parts of
@metamask/controllersv33.0.0, namely:- Everything in
src/assets - Asset-related functions from
src/util.tsand accompanying tests
All changes listed after this point were applied to this package following the monorepo conversion.
- Everything in
-
- Use Ethers for AssetsContractController (#845)