@metamask-previews/assets-controller 11.0.0-preview-3f3e1111c → 11.0.0-preview-1ed087802
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +0 -12
- package/dist/AssetsController.cjs +1 -3
- package/dist/AssetsController.cjs.map +1 -1
- package/dist/AssetsController.d.cts +2 -2
- package/dist/AssetsController.d.cts.map +1 -1
- package/dist/AssetsController.d.mts +2 -2
- package/dist/AssetsController.d.mts.map +1 -1
- package/dist/AssetsController.mjs +1 -3
- package/dist/AssetsController.mjs.map +1 -1
- package/dist/data-sources/AccountsApiDataSource.cjs +8 -50
- package/dist/data-sources/AccountsApiDataSource.cjs.map +1 -1
- package/dist/data-sources/AccountsApiDataSource.d.cts +1 -2
- package/dist/data-sources/AccountsApiDataSource.d.cts.map +1 -1
- package/dist/data-sources/AccountsApiDataSource.d.mts +1 -2
- package/dist/data-sources/AccountsApiDataSource.d.mts.map +1 -1
- package/dist/data-sources/AccountsApiDataSource.mjs +8 -50
- package/dist/data-sources/AccountsApiDataSource.mjs.map +1 -1
- package/dist/data-sources/TokenDataSource.cjs +1 -19
- package/dist/data-sources/TokenDataSource.cjs.map +1 -1
- package/dist/data-sources/TokenDataSource.d.cts +1 -2
- package/dist/data-sources/TokenDataSource.d.cts.map +1 -1
- package/dist/data-sources/TokenDataSource.d.mts +1 -2
- package/dist/data-sources/TokenDataSource.d.mts.map +1 -1
- package/dist/data-sources/TokenDataSource.mjs +1 -19
- package/dist/data-sources/TokenDataSource.mjs.map +1 -1
- package/dist/index.cjs +1 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -3
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +1 -3
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +0 -2
- package/dist/index.mjs.map +1 -1
- package/dist/utils/formatExchangeRatesForBridge.cjs +7 -36
- package/dist/utils/formatExchangeRatesForBridge.cjs.map +1 -1
- package/dist/utils/formatExchangeRatesForBridge.d.cts +14 -20
- package/dist/utils/formatExchangeRatesForBridge.d.cts.map +1 -1
- package/dist/utils/formatExchangeRatesForBridge.d.mts +14 -20
- package/dist/utils/formatExchangeRatesForBridge.d.mts.map +1 -1
- package/dist/utils/formatExchangeRatesForBridge.mjs +5 -34
- package/dist/utils/formatExchangeRatesForBridge.mjs.map +1 -1
- package/dist/utils/formatStateForTransactionPay.cjs +9 -40
- package/dist/utils/formatStateForTransactionPay.cjs.map +1 -1
- package/dist/utils/formatStateForTransactionPay.d.cts +17 -23
- package/dist/utils/formatStateForTransactionPay.d.cts.map +1 -1
- package/dist/utils/formatStateForTransactionPay.d.mts +17 -23
- package/dist/utils/formatStateForTransactionPay.d.mts.map +1 -1
- package/dist/utils/formatStateForTransactionPay.mjs +7 -38
- package/dist/utils/formatStateForTransactionPay.mjs.map +1 -1
- package/dist/utils/index.cjs +1 -4
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.d.cts +5 -5
- package/dist/utils/index.d.cts.map +1 -1
- package/dist/utils/index.d.mts +5 -5
- package/dist/utils/index.d.mts.map +1 -1
- package/dist/utils/index.mjs +3 -3
- package/dist/utils/index.mjs.map +1 -1
- package/dist/utils/normalizeAssetId.cjs +3 -17
- package/dist/utils/normalizeAssetId.cjs.map +1 -1
- package/dist/utils/normalizeAssetId.d.cts +1 -10
- package/dist/utils/normalizeAssetId.d.cts.map +1 -1
- package/dist/utils/normalizeAssetId.d.mts +1 -10
- package/dist/utils/normalizeAssetId.d.mts.map +1 -1
- package/dist/utils/normalizeAssetId.mjs +1 -19
- package/dist/utils/normalizeAssetId.mjs.map +1 -1
- package/package.json +1 -1
- package/dist/utils/snaps-assets-migration.cjs +0 -171
- package/dist/utils/snaps-assets-migration.cjs.map +0 -1
- package/dist/utils/snaps-assets-migration.d.cts +0 -113
- package/dist/utils/snaps-assets-migration.d.cts.map +0 -1
- package/dist/utils/snaps-assets-migration.d.mts +0 -113
- package/dist/utils/snaps-assets-migration.d.mts.map +0 -1
- package/dist/utils/snaps-assets-migration.mjs +0 -162
- package/dist/utils/snaps-assets-migration.mjs.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -11,26 +11,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
11
11
|
|
|
12
12
|
- `AccountsApiDataSource` now selects the Accounts API balances endpoint version from the `RemoteFeatureFlagController` (`assetsAccountsApiV6` flag, read per fetch off the shared messenger, default v5) so the v6 endpoint is gated consistently across clients (extension, mobile) without each client wiring a getter. The flag is read as a JSON variation shaped `{ value: boolean }` (same shape as `backendWebSocketConnection`). Adds a required `messenger` option and `RemoteFeatureFlagController:getState` to `AccountsApiDataSourceAllowedActions`. Only `category: 'token'` rows from the v6 response are consumed (DeFi positions are ignored) to preserve parity with v5 ([#9344](https://github.com/MetaMask/core/pull/9344))
|
|
13
13
|
- Add `getAsset(accountId, assetId)` method and `AssetsController:getAsset` messenger action that returns the combined `Asset` (balance, metadata, price) for a single account/asset pair from controller state, or `undefined` when a complete renderable asset is not available ([#9521](https://github.com/MetaMask/core/pull/9521))
|
|
14
|
-
- Add stage-gated ingestion of the Snaps → AssetsController migration networks (Solana, Stellar, Tron) ([#9534](https://github.com/MetaMask/core/pull/9534))
|
|
15
|
-
- `AssetsController` and `AccountsApiDataSource` now resolve a per-network migration stage from `RemoteFeatureFlagController` state (via `RemoteFeatureFlagController:getState`) using the `networkAssetsSnapsMigrationSolana`, `networkAssetsSnapsMigrationStellar`, and `networkAssetsSnapsMigrationTron` flags. Migration networks are only ingested and surfaced as active chains from `SnapsAssetsMigrationStage.ReadAssetsControllerWithFallback` onward, and left to the Snap when the stage is `Off` (the fail-safe when the flag is missing). Non-migration namespaces (e.g. `eip155`) are never gated.
|
|
16
14
|
|
|
17
15
|
### Changed
|
|
18
16
|
|
|
19
|
-
- Memoize hot-path asset ID / legacy-format conversions to cut repeated keccak256 (`toChecksumAddress`) and CAIP parsing ([#9555](https://github.com/MetaMask/core/pull/9555))
|
|
20
|
-
- `normalizeAssetId` uses lodash `memoize` so already-normalized IDs skip re-checksumming across the pipeline
|
|
21
|
-
- `formatExchangeRatesForBridge` caches the last result on input identity (`===` for BaseController slices, lodash `isEqual` for rebuilt native maps); exports `FormatExchangeRatesForBridgeParams`
|
|
22
|
-
- `formatStateForTransactionPay` caches the last result the same way (`isEqual` for rebuilt `accounts` / `nativeAssetIdentifiers`); exports `FormatStateForTransactionPayParams`
|
|
23
|
-
- `#getNativeAssetMap` returns a stable empty object when uncached so memoized formatters are not busted by `?? {}` identity churn
|
|
24
17
|
- `TokenDataSource` EVM spam filtering now uses per-chain floors from Token API `GET /v1/suggestedOccurrenceFloors` (`queryApiClient.token.fetchV1SuggestedOccurrenceFloors`) instead of a hardcoded minimum of 3 occurrences. Chains missing from the response (or a failed floors fetch) still fall back to 3 ([#9537](https://github.com/MetaMask/core/pull/9537))
|
|
25
18
|
- `TokensApiClient` (used by `RpcDataSource` / `TokenDetector`) now sets the token-list `occurrenceFloor` query param from the same Token API `GET /v1/suggestedOccurrenceFloors` endpoint (cached 1h), replacing the hardcoded Linea/MegaETH/Tempo special cases. Missing chains or failed fetches fall back to 3 ([#9537](https://github.com/MetaMask/core/pull/9537))
|
|
26
|
-
- Add `@metamask/remote-feature-flag-controller` as a dependency ([#9534](https://github.com/MetaMask/core/pull/9534))
|
|
27
19
|
- Bump `@metamask/network-enablement-controller` from `^5.5.0` to `^5.6.0` ([#9520](https://github.com/MetaMask/core/pull/9520))
|
|
28
20
|
- Bump `@metamask/phishing-controller` from `^17.2.1` to `^17.3.0` ([#9532](https://github.com/MetaMask/core/pull/9532))
|
|
29
21
|
|
|
30
|
-
### Fixed
|
|
31
|
-
|
|
32
|
-
- `TokenDataSource` now also fetches token metadata for assets present in `assetsBalance` that are missing `assetsInfo` (previously only detected assets without metadata were enriched) ([#9547](https://github.com/MetaMask/core/pull/9547))
|
|
33
|
-
|
|
34
22
|
## [11.0.0]
|
|
35
23
|
|
|
36
24
|
### Fixed
|
|
@@ -43,8 +43,6 @@ const constants_1 = require("./utils/constants.cjs");
|
|
|
43
43
|
const customAssetsRpcSupplement_1 = require("./utils/customAssetsRpcSupplement.cjs");
|
|
44
44
|
const processAccountActivityBalanceUpdates_1 = require("./utils/processAccountActivityBalanceUpdates.cjs");
|
|
45
45
|
const NATIVE_ASSETS_QUERY_KEY = ['nativeAssets'];
|
|
46
|
-
/** Stable empty map so memoized formatters are not busted by `?? {}` identity churn. */
|
|
47
|
-
const EMPTY_NATIVE_ASSET_MAP = {};
|
|
48
46
|
// ============================================================================
|
|
49
47
|
// CONTROLLER CONSTANTS
|
|
50
48
|
// ============================================================================
|
|
@@ -1493,7 +1491,7 @@ async function _AssetsController_executeMiddlewares(sources, request, initialRes
|
|
|
1493
1491
|
log('Failed to fetch missing prices', { error });
|
|
1494
1492
|
});
|
|
1495
1493
|
}, _AssetsController_getNativeAssetMap = function _AssetsController_getNativeAssetMap() {
|
|
1496
|
-
return (__classPrivateFieldGet(this, _AssetsController_queryApiClient, "f").getCachedData(NATIVE_ASSETS_QUERY_KEY) ??
|
|
1494
|
+
return (__classPrivateFieldGet(this, _AssetsController_queryApiClient, "f").getCachedData(NATIVE_ASSETS_QUERY_KEY) ?? {});
|
|
1497
1495
|
}, _AssetsController_isNativeAsset = function _AssetsController_isNativeAsset(assetId) {
|
|
1498
1496
|
const parsed = (0, utils_1.parseCaipAssetType)(assetId);
|
|
1499
1497
|
if (parsed.assetNamespace === 'slip44') {
|