@metamask-previews/assets-controller 11.0.0-preview-5cac90a → 11.0.0-preview-355b70c

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.
Files changed (32) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/dist/AssetsController.cjs.map +1 -1
  3. package/dist/AssetsController.d.cts +2 -2
  4. package/dist/AssetsController.d.cts.map +1 -1
  5. package/dist/AssetsController.d.mts +2 -2
  6. package/dist/AssetsController.d.mts.map +1 -1
  7. package/dist/AssetsController.mjs.map +1 -1
  8. package/dist/data-sources/AccountsApiDataSource.cjs +50 -8
  9. package/dist/data-sources/AccountsApiDataSource.cjs.map +1 -1
  10. package/dist/data-sources/AccountsApiDataSource.d.cts +2 -1
  11. package/dist/data-sources/AccountsApiDataSource.d.cts.map +1 -1
  12. package/dist/data-sources/AccountsApiDataSource.d.mts +2 -1
  13. package/dist/data-sources/AccountsApiDataSource.d.mts.map +1 -1
  14. package/dist/data-sources/AccountsApiDataSource.mjs +50 -8
  15. package/dist/data-sources/AccountsApiDataSource.mjs.map +1 -1
  16. package/dist/index.cjs +10 -1
  17. package/dist/index.cjs.map +1 -1
  18. package/dist/index.d.cts +2 -0
  19. package/dist/index.d.cts.map +1 -1
  20. package/dist/index.d.mts +2 -0
  21. package/dist/index.d.mts.map +1 -1
  22. package/dist/index.mjs +2 -0
  23. package/dist/index.mjs.map +1 -1
  24. package/dist/utils/snaps-assets-migration.cjs +171 -0
  25. package/dist/utils/snaps-assets-migration.cjs.map +1 -0
  26. package/dist/utils/snaps-assets-migration.d.cts +113 -0
  27. package/dist/utils/snaps-assets-migration.d.cts.map +1 -0
  28. package/dist/utils/snaps-assets-migration.d.mts +113 -0
  29. package/dist/utils/snaps-assets-migration.d.mts.map +1 -0
  30. package/dist/utils/snaps-assets-migration.mjs +162 -0
  31. package/dist/utils/snaps-assets-migration.mjs.map +1 -0
  32. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -11,11 +11,16 @@ 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` now resolves the per-network migration stage from `RemoteFeatureFlagController` state (read via the `RemoteFeatureFlagController:getState` messenger action) using the per-network flags `networkAssetsSnapsMigrationSolana`, `networkAssetsSnapsMigrationStellar`, and `networkAssetsSnapsMigrationTron`. The controller ingests those networks via the Account Activity WebSocket + AccountsAPI only from `SnapsAssetsMigrationStage.ReadAssetsControllerWithFallback` onward, and leaves them to the Snap when the stage is `Off` (also the fail-safe when the flag is missing). Non-migration namespaces (e.g. `eip155`) are never gated.
16
+ - `AccountsApiDataSource` now gates the supported networks it surfaces as active chains on the same per-network migration stage instead of the previous hardcoded `eip155`-only filter. Non-migration namespaces (e.g. `eip155`) are always surfaced, while migration networks (Solana, Stellar, Tron) are only surfaced once their stage reaches `SnapsAssetsMigrationStage.ReadAssetsControllerWithFallback`.
17
+ - Export the `SnapsAssetsMigrationStage` enum, the `SNAPS_ASSETS_MIGRATION_FLAG_KEYS` and `SNAPS_ASSETS_MIGRATION_NAMESPACES` constants, and the `getSnapsAssetsMigrationNamespace` / `parseSnapsAssetsMigrationStage` / `isMigrationStageActive` / `isSnapsAssetsMigrationNamespace` helpers.
14
18
 
15
19
  ### Changed
16
20
 
17
21
  - `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))
18
22
  - `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))
23
+ - Add `@metamask/remote-feature-flag-controller` as a dependency ([#9534](https://github.com/MetaMask/core/pull/9534))
19
24
  - Bump `@metamask/network-enablement-controller` from `^5.5.0` to `^5.6.0` ([#9520](https://github.com/MetaMask/core/pull/9520))
20
25
  - Bump `@metamask/phishing-controller` from `^17.2.1` to `^17.3.0` ([#9532](https://github.com/MetaMask/core/pull/9532))
21
26