@metamask-previews/assets-controller 9.1.0-preview-bd7b53f49 → 9.1.0-preview-e0ee14da7
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 +2 -8
- package/dist/AssetsController.cjs +136 -309
- package/dist/AssetsController.cjs.map +1 -1
- package/dist/AssetsController.d.cts +8 -11
- package/dist/AssetsController.d.cts.map +1 -1
- package/dist/AssetsController.d.mts +8 -11
- package/dist/AssetsController.d.mts.map +1 -1
- package/dist/AssetsController.mjs +136 -309
- package/dist/AssetsController.mjs.map +1 -1
- package/dist/data-sources/AccountsApiDataSource.cjs +0 -10
- package/dist/data-sources/AccountsApiDataSource.cjs.map +1 -1
- package/dist/data-sources/AccountsApiDataSource.d.cts +0 -8
- package/dist/data-sources/AccountsApiDataSource.d.cts.map +1 -1
- package/dist/data-sources/AccountsApiDataSource.d.mts +0 -8
- package/dist/data-sources/AccountsApiDataSource.d.mts.map +1 -1
- package/dist/data-sources/AccountsApiDataSource.mjs +0 -10
- package/dist/data-sources/AccountsApiDataSource.mjs.map +1 -1
- package/dist/data-sources/BackendWebsocketDataSource.cjs +60 -36
- package/dist/data-sources/BackendWebsocketDataSource.cjs.map +1 -1
- package/dist/data-sources/BackendWebsocketDataSource.d.cts +0 -8
- package/dist/data-sources/BackendWebsocketDataSource.d.cts.map +1 -1
- package/dist/data-sources/BackendWebsocketDataSource.d.mts +0 -8
- package/dist/data-sources/BackendWebsocketDataSource.d.mts.map +1 -1
- package/dist/data-sources/BackendWebsocketDataSource.mjs +57 -36
- package/dist/data-sources/BackendWebsocketDataSource.mjs.map +1 -1
- package/dist/data-sources/PriceDataSource.cjs +9 -18
- package/dist/data-sources/PriceDataSource.cjs.map +1 -1
- package/dist/data-sources/PriceDataSource.d.cts.map +1 -1
- package/dist/data-sources/PriceDataSource.d.mts.map +1 -1
- package/dist/data-sources/PriceDataSource.mjs +10 -19
- package/dist/data-sources/PriceDataSource.mjs.map +1 -1
- package/dist/data-sources/RpcDataSource.cjs +9 -29
- package/dist/data-sources/RpcDataSource.cjs.map +1 -1
- package/dist/data-sources/RpcDataSource.d.cts +0 -5
- package/dist/data-sources/RpcDataSource.d.cts.map +1 -1
- package/dist/data-sources/RpcDataSource.d.mts +0 -5
- package/dist/data-sources/RpcDataSource.d.mts.map +1 -1
- package/dist/data-sources/RpcDataSource.mjs +9 -29
- package/dist/data-sources/RpcDataSource.mjs.map +1 -1
- package/dist/data-sources/evm-rpc-services/services/BalanceFetcher.d.cts +2 -2
- package/dist/data-sources/evm-rpc-services/services/BalanceFetcher.d.mts +2 -2
- package/dist/data-sources/evm-rpc-services/services/StakedBalanceFetcher.d.cts +2 -2
- package/dist/data-sources/evm-rpc-services/services/StakedBalanceFetcher.d.mts +2 -2
- package/dist/data-sources/evm-rpc-services/services/TokenDetector.d.cts +2 -2
- package/dist/data-sources/evm-rpc-services/services/TokenDetector.d.mts +2 -2
- package/dist/middlewares/DetectionMiddleware.cjs +1 -22
- package/dist/middlewares/DetectionMiddleware.cjs.map +1 -1
- package/dist/middlewares/DetectionMiddleware.d.cts +0 -3
- package/dist/middlewares/DetectionMiddleware.d.cts.map +1 -1
- package/dist/middlewares/DetectionMiddleware.d.mts +0 -3
- package/dist/middlewares/DetectionMiddleware.d.mts.map +1 -1
- package/dist/middlewares/DetectionMiddleware.mjs +1 -22
- package/dist/middlewares/DetectionMiddleware.mjs.map +1 -1
- package/dist/middlewares/ParallelMiddleware.cjs +0 -7
- package/dist/middlewares/ParallelMiddleware.cjs.map +1 -1
- package/dist/middlewares/ParallelMiddleware.d.cts.map +1 -1
- package/dist/middlewares/ParallelMiddleware.d.mts.map +1 -1
- package/dist/middlewares/ParallelMiddleware.mjs +0 -7
- package/dist/middlewares/ParallelMiddleware.mjs.map +1 -1
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +9 -18
- package/dist/types.d.cts.map +1 -1
- package/dist/types.d.mts +9 -18
- package/dist/types.d.mts.map +1 -1
- package/dist/types.mjs.map +1 -1
- package/dist/utils/dedupingBatchFetcher.cjs +0 -11
- package/dist/utils/dedupingBatchFetcher.cjs.map +1 -1
- package/dist/utils/dedupingBatchFetcher.d.cts +0 -7
- package/dist/utils/dedupingBatchFetcher.d.cts.map +1 -1
- package/dist/utils/dedupingBatchFetcher.d.mts +0 -7
- package/dist/utils/dedupingBatchFetcher.d.mts.map +1 -1
- package/dist/utils/dedupingBatchFetcher.mjs +0 -11
- package/dist/utils/dedupingBatchFetcher.mjs.map +1 -1
- package/package.json +1 -1
- package/dist/utils/processAccountActivityBalanceUpdates.cjs +0 -54
- package/dist/utils/processAccountActivityBalanceUpdates.cjs.map +0 -1
- package/dist/utils/processAccountActivityBalanceUpdates.d.cts +0 -13
- package/dist/utils/processAccountActivityBalanceUpdates.d.cts.map +0 -1
- package/dist/utils/processAccountActivityBalanceUpdates.d.mts +0 -13
- package/dist/utils/processAccountActivityBalanceUpdates.d.mts.map +0 -1
- package/dist/utils/processAccountActivityBalanceUpdates.mjs +0 -47
- package/dist/utils/processAccountActivityBalanceUpdates.mjs.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -9,19 +9,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
9
9
|
|
|
10
10
|
### Changed
|
|
11
11
|
|
|
12
|
-
- **BREAKING:** `AssetsController` messenger must now allow `AccountActivityService:balanceUpdated` so unified `assetsBalance` state receives real-time websocket balance updates when `AccountActivityService` owns the server subscription ([#9273](https://github.com/MetaMask/core/pull/9273))
|
|
13
12
|
- Bump `@metamask/transaction-controller` from `^68.1.1` to `^68.2.0` ([#9253](https://github.com/MetaMask/core/pull/9253))
|
|
14
13
|
|
|
15
14
|
### Fixed
|
|
16
15
|
|
|
17
|
-
- Fix stale token balances after transactions when switching accounts or when websocket subscriptions reconnect; `AssetsController` now fetches before re-subscribing on account switch
|
|
16
|
+
- Fix stale token balances after transactions when switching accounts or when websocket subscriptions reconnect; `AssetsController` now fetches before re-subscribing on account switch, serializes overlapping refresh work, treats `getAssets({ forceUpdate: true })` as authoritative over recent websocket freshness guards, and prevents passive polling from overwriting websocket balances for 120 seconds ([#9265](https://github.com/MetaMask/core/pull/9265))
|
|
18
17
|
- `AccountsApiDataSource` bypasses the TanStack Query balance cache when `forceUpdate` is true so forced refreshes return up-to-date balances instead of 60-second cached values ([#9265](https://github.com/MetaMask/core/pull/9265))
|
|
19
|
-
- `BackendWebsocketDataSource` re-subscribes when subscribed accounts change (case-insensitive EVM address matching), serializes subscribe/unsubscribe to prevent races on account switch, and registers channel callbacks
|
|
20
|
-
- Remove the 120-second websocket balance freshness guard that blocked force-refresh and polling updates from correcting stale websocket balances ([#9273](https://github.com/MetaMask/core/pull/9273))
|
|
21
|
-
- `BackendWebsocketDataSource` registers subscription handlers before the subscribe handshake so in-flight account-activity notifications are not dropped, cleans up subscription state on subscribe failure, and resolves balance updates from stored subscription state when notifications arrive with stale subscription IDs ([#9273](https://github.com/MetaMask/core/pull/9273))
|
|
22
|
-
- `AssetsController` refreshes data-source `activeChains`, re-subscribes, and force-fetches balances for the newly selected EVM chain when the user switches networks via `NetworkController:networkDidChange`
|
|
23
|
-
- `AssetsController` bypasses the price deduper cache and fetches spot prices for assets on a newly selected or added EVM network only when those assets have no entry in `assetsPrice` yet; `DetectionMiddleware` queues newly detected assets for the same pipeline price fetch so RPC-detected tokens are priced without waiting for the poll interval
|
|
24
|
-
- `AssetsController` merge updates from `getAssets({ forceUpdate: true })` now replace balances on API-covered chains so unlock/startup reflects the fresh Accounts API snapshot instead of preserving stale pre-lock tokens; subscription-driven merges are unchanged
|
|
18
|
+
- `BackendWebsocketDataSource` re-subscribes when subscribed accounts change (case-insensitive EVM address matching), serializes subscribe/unsubscribe to prevent races on account switch, and registers optional channel callbacks for more reliable notification delivery ([#9265](https://github.com/MetaMask/core/pull/9265))
|
|
25
19
|
|
|
26
20
|
## [9.1.0]
|
|
27
21
|
|