@metamask-previews/assets-controller 21.0.0-preview-826c10a → 21.0.0-preview-98d550d
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 +11 -10
- package/dist/AssetsController.d.ts +2 -2
- package/dist/AssetsController.d.ts.map +1 -1
- package/dist/AssetsController.js +11 -5
- package/dist/AssetsController.js.map +1 -1
- package/dist/data-sources/MarketStatsPriceStream.d.ts +17 -10
- package/dist/data-sources/MarketStatsPriceStream.d.ts.map +1 -1
- package/dist/data-sources/MarketStatsPriceStream.js +27 -96
- package/dist/data-sources/MarketStatsPriceStream.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,13 +7,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- Poll `/v3/spot-prices` for every tracked asset, and also stream prices over `market-stats.v1` when the spot price reports `wssSupport`. An open channel does not take that asset off the poll. Without a registered `MarketStatsService`, every asset stays on the poll ([#11193](https://github.com/MetaMask/core/pull/11193))
|
|
13
|
+
|
|
10
14
|
### Changed
|
|
11
15
|
|
|
16
|
+
- **BREAKING:** `AssetsControllerMessenger` now includes `MarketStatsService:subscribe`, `unsubscribe`, `getSubscriptions`, and `getChainStatuses`. Delegate them from the root messenger ([#11193](https://github.com/MetaMask/core/pull/11193))
|
|
17
|
+
- **BREAKING:** `PriceDataSource` requires `messenger` ([#11193](https://github.com/MetaMask/core/pull/11193))
|
|
12
18
|
- Bump `@ethersproject/abi` from `^5.7.0` to `^5.8.0` ([#11645](https://github.com/MetaMask/core/pull/11645))
|
|
13
19
|
- Bump `@metamask/assets-controllers` from `^113.3.2` to `^113.3.3` ([#11669](https://github.com/MetaMask/core/pull/11669))
|
|
14
20
|
- Bump `@metamask/network-enablement-controller` from `^7.1.3` to `^7.1.4` ([#11669](https://github.com/MetaMask/core/pull/11669))
|
|
15
21
|
- Bump `@metamask/phishing-controller` from `^18.3.1` to `^18.3.2` ([#11669](https://github.com/MetaMask/core/pull/11669))
|
|
16
22
|
- Bump `@metamask/transaction-controller` from `^74.2.0` to `^74.3.0` ([#11669](https://github.com/MetaMask/core/pull/11669))
|
|
23
|
+
- The price stream subscribes as the `assets-controller` caller and sends the assets it wants on each reconcile. `MarketStatsService` keeps the callers on each channel, so a screen watching the same asset stays subscribed when the price set changes ([#11193](https://github.com/MetaMask/core/pull/11193))
|
|
24
|
+
|
|
25
|
+
### Removed
|
|
26
|
+
|
|
27
|
+
- **BREAKING:** Remove `AssetsController:priceChanged`. Socket prices are not written to `assetsPrice`. Subscribe to `MarketStatsService:pricesUpdated` ([#11193](https://github.com/MetaMask/core/pull/11193))
|
|
17
28
|
|
|
18
29
|
## [21.0.0]
|
|
19
30
|
|
|
@@ -21,15 +32,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
21
32
|
|
|
22
33
|
- Add optional `bypassServerCache` parameter to `addCustomAsset` (and the `AssetsController:addCustomAsset` action) ([#11613](https://github.com/MetaMask/core/pull/11613))
|
|
23
34
|
- When `true`, the force-fetch of the asset's chain also bypasses server-side HTTP caches such as the Accounts API's 60s cache. It only applies when the account is in the selected account group.
|
|
24
|
-
- Poll `/v3/spot-prices` for every tracked asset, and also stream prices over `market-stats.v1` when the spot price reports `wssSupport`. An open channel does not take that asset off the poll. Without a registered `MarketStatsService`, every asset stays on the poll ([#11193](https://github.com/MetaMask/core/pull/11193))
|
|
25
35
|
|
|
26
36
|
### Changed
|
|
27
37
|
|
|
28
38
|
- **BREAKING:** Remove `getAssetsState` from `AccountsApiDataSourceOptions`. Include and exclude asset IDs come from `getAssetVisibility`.
|
|
29
39
|
- **BREAKING:** Balance data sources always use the Accounts API v6 path. `isBalanceV6Enabled` is no longer accepted. Fetches use the v6 balances endpoint and `full` snapshots, and the stale-asset RPC supplement is removed. The `assetsAccountsApiV6` remote feature flag is no longer read ([#11564](https://github.com/MetaMask/core/pull/11564))
|
|
30
40
|
- **BREAKING:** Remove `CustomAssetGraduationMiddleware` and `includeCustomAssetGraduation`. A reported balance no longer removes a pin from `customAssets` ([#11564](https://github.com/MetaMask/core/pull/11564))
|
|
31
|
-
- **BREAKING:** `AssetsControllerMessenger` now includes `MarketStatsService:subscribe`, `unsubscribe`, `getSubscriptions`, `getChainStatuses`, and `chainStatusChanged`. Delegate them from the root messenger ([#11193](https://github.com/MetaMask/core/pull/11193))
|
|
32
|
-
- **BREAKING:** `PriceDataSource` requires `messenger` ([#11193](https://github.com/MetaMask/core/pull/11193))
|
|
33
41
|
- Bump `@metamask/transaction-controller` from `^74.0.0` to `^74.2.0` ([#11579](https://github.com/MetaMask/core/pull/11579), [#11605](https://github.com/MetaMask/core/pull/11605))
|
|
34
42
|
- Bump `@metamask/keyring-controller` from `^28.2.0` to `^28.2.2` ([#11474](https://github.com/MetaMask/core/pull/11474), [#11537](https://github.com/MetaMask/core/pull/11537))
|
|
35
43
|
- Bump `@metamask/utils` from `^12.0.1` to `^12.0.2` ([#11474](https://github.com/MetaMask/core/pull/11474))
|
|
@@ -37,13 +45,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
37
45
|
### Removed
|
|
38
46
|
|
|
39
47
|
- Remove Blast Mainnet (`0x13e31`) from the EVM RPC Multicall3 address map, as the network is being terminated ([#11598](https://github.com/MetaMask/core/pull/11598))
|
|
40
|
-
- **BREAKING:** Remove `MarketStatsStore`. Fold `pricesUpdated` into a map with `applyMarketStatsPrices`, and `chainStatusChanged` with `applyMarketStatsChainStatus` ([#11193](https://github.com/MetaMask/core/pull/11193))
|
|
41
|
-
- Remove `readLiveQuote`. Read one asset or a list with `readLiveQuotes` ([#11193](https://github.com/MetaMask/core/pull/11193))
|
|
42
|
-
- **BREAKING:** Remove `AssetsController:priceChanged`. Socket prices are not written to `assetsPrice`. Subscribe to `MarketStatsService:pricesUpdated` ([#11193](https://github.com/MetaMask/core/pull/11193))
|
|
43
|
-
|
|
44
|
-
### Fixed
|
|
45
|
-
|
|
46
|
-
- Open a market-stats channel after a balance update writes a spot price with `wssSupport`, instead of waiting for the next price poll
|
|
47
48
|
|
|
48
49
|
## [20.4.1]
|
|
49
50
|
|
|
@@ -6,7 +6,7 @@ import type { ControllerGetStateAction, ControllerStateChangeEvent } from '@meta
|
|
|
6
6
|
import type { ClientControllerGetStateAction, ClientControllerStateChangeEvent } from '@metamask/client-controller';
|
|
7
7
|
import type { ConfigRegistryControllerGetNetworkConfigByCaip2ChainIdAction } from '@metamask/config-registry-controller';
|
|
8
8
|
import type { TraceCallback } from '@metamask/controller-utils';
|
|
9
|
-
import type { ApiPlatformClient, AccountActivityServiceBalanceUpdatedEvent, AccountActivityServiceStatusChangedEvent, MarketStatsServiceActions,
|
|
9
|
+
import type { ApiPlatformClient, AccountActivityServiceBalanceUpdatedEvent, AccountActivityServiceStatusChangedEvent, MarketStatsServiceActions, SupportedCurrency } from '@metamask/core-backend';
|
|
10
10
|
import type { KeyringControllerIsUnlockedAction, KeyringControllerLockEvent, KeyringControllerUnlockEvent } from '@metamask/keyring-controller';
|
|
11
11
|
import type { InternalAccount } from '@metamask/keyring-internal-api';
|
|
12
12
|
import type { Messenger } from '@metamask/messenger';
|
|
@@ -69,7 +69,7 @@ export type AssetsControllerBalanceChangedEvent = {
|
|
|
69
69
|
};
|
|
70
70
|
export type AssetsControllerEvents = AssetsControllerStateChangeEvent | AssetsControllerBalanceChangedEvent;
|
|
71
71
|
type AllowedActions = AccountsControllerGetSelectedAccountAction | AccountTreeControllerGetAccountsFromSelectedAccountGroupAction | AccountTreeControllerIsInitializedAction | ClientControllerGetStateAction | KeyringControllerIsUnlockedAction | NetworkControllerGetStateAction | NetworkControllerGetNetworkClientByIdAction | ConfigRegistryControllerGetNetworkConfigByCaip2ChainIdAction | NetworkEnablementControllerGetStateAction | SnapControllerGetRunnableSnapsAction | SnapControllerHandleRequestAction | GetPermissions | PhishingControllerBulkScanTokensAction | RemoteFeatureFlagControllerGetStateAction | AuthenticatedUserStorageServiceGetUserAssetsAction | AuthenticatedUserStorageServiceSetUserAssetsAction | AuthenticatedUserStorageServiceImportTokensAction | AuthenticatedUserStorageServiceHideTokensAction | MarketStatsServiceActions;
|
|
72
|
-
type AllowedEvents = AccountTreeControllerSelectedAccountGroupChangeEvent | AccountTreeControllerInitializedEvent | AccountTreeControllerUninitializedEvent | ClientControllerStateChangeEvent | KeyringControllerLockEvent | KeyringControllerUnlockEvent | PreferencesControllerStateChangeEvent | TransactionControllerUnapprovedTransactionAddedEvent | TransactionControllerTransactionConfirmedEvent | MultichainTransactionsControllerTransactionConfirmedEvent | NetworkControllerStateChangeEvent | NetworkControllerNetworkAddedEvent | NetworkControllerNetworkDidChangeEvent | NetworkControllerNetworkRemovedEvent | NetworkEnablementControllerEvents | AccountsControllerAccountBalancesUpdatedEvent | PermissionControllerStateChange | SnapControllerSnapInstalledEvent | AccountActivityServiceBalanceUpdatedEvent | AccountActivityServiceStatusChangedEvent | RemoteFeatureFlagControllerStateChangeEvent
|
|
72
|
+
type AllowedEvents = AccountTreeControllerSelectedAccountGroupChangeEvent | AccountTreeControllerInitializedEvent | AccountTreeControllerUninitializedEvent | ClientControllerStateChangeEvent | KeyringControllerLockEvent | KeyringControllerUnlockEvent | PreferencesControllerStateChangeEvent | TransactionControllerUnapprovedTransactionAddedEvent | TransactionControllerTransactionConfirmedEvent | MultichainTransactionsControllerTransactionConfirmedEvent | NetworkControllerStateChangeEvent | NetworkControllerNetworkAddedEvent | NetworkControllerNetworkDidChangeEvent | NetworkControllerNetworkRemovedEvent | NetworkEnablementControllerEvents | AccountsControllerAccountBalancesUpdatedEvent | PermissionControllerStateChange | SnapControllerSnapInstalledEvent | AccountActivityServiceBalanceUpdatedEvent | AccountActivityServiceStatusChangedEvent | RemoteFeatureFlagControllerStateChangeEvent;
|
|
73
73
|
export type AssetsControllerMessenger = Messenger<typeof CONTROLLER_NAME, AssetsControllerActions | AllowedActions, AssetsControllerEvents | AllowedEvents>;
|
|
74
74
|
export type AssetsControllerOptions = {
|
|
75
75
|
messenger: AssetsControllerMessenger;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssetsController.d.ts","sourceRoot":"","sources":["../src/AssetsController.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,8DAA8D,EAC9D,qCAAqC,EACrC,wCAAwC,EACxC,oDAAoD,EACpD,uCAAuC,EACxC,MAAM,mCAAmC,CAAC;AAC3C,OAAO,KAAK,EAAE,0CAA0C,EAAE,MAAM,+BAA+B,CAAC;AAChG,OAAO,KAAK,EACV,kDAAkD,EAClD,+CAA+C,EAC/C,iDAAiD,EACjD,kDAAkD,EACnD,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,KAAK,EACV,wBAAwB,EACxB,0BAA0B,EAE3B,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EACV,8BAA8B,EAC9B,gCAAgC,EACjC,MAAM,6BAA6B,CAAC;AAErC,OAAO,KAAK,EAAE,4DAA4D,EAAE,MAAM,sCAAsC,CAAC;AACzH,OAAO,KAAK,EAAE,aAAa,EAAgB,MAAM,4BAA4B,CAAC;AAC9E,OAAO,KAAK,EACV,iBAAiB,EACjB,yCAAyC,EACzC,wCAAwC,EACxC,yBAAyB,EACzB,
|
|
1
|
+
{"version":3,"file":"AssetsController.d.ts","sourceRoot":"","sources":["../src/AssetsController.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,8DAA8D,EAC9D,qCAAqC,EACrC,wCAAwC,EACxC,oDAAoD,EACpD,uCAAuC,EACxC,MAAM,mCAAmC,CAAC;AAC3C,OAAO,KAAK,EAAE,0CAA0C,E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oBpE;IAED;;;;;OAKG;IACH,eAAe,CAAC,SAAS,EAAE,SAAS,GAAG,aAAa,EAAE,CAErD;IAMD;;;;;;OAMG;IAEH,SAAS,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI,CActC;IAED;;;;;;;OAOG;IAEG,WAAW,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CA6BvD;IAMD;;;;OAIG;IACH,mBAAmB,CAAC,gBAAgB,EAAE,iBAAiB,GAAG,IAAI,CAoC7D;IAMD;;;;;;OAMG;IACH,oBAAoB,CAAC,QAAQ,EAAE,eAAe,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,IAAI,CAkC3E;IAED;;OAEG;IACH,sBAAsB,IAAI,IAAI,CAS7B;IAwxBD;;;;;;;OAOG;IACH,8BAA8B,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI,CAGtD;IAimBD;;;;;;;;;;OAUG;IACG,kBAAkB,CACtB,QAAQ,EAAE,YAAY,EACtB,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,WAAW,GACpB,OAAO,CAAC,IAAI,CAAC,CA2Df;IAkED,OAAO,IAAI,IAAI,CAoDd;CACF"}
|
package/dist/AssetsController.js
CHANGED
|
@@ -1541,12 +1541,18 @@ let AssetsController = (() => {
|
|
|
1541
1541
|
return;
|
|
1542
1542
|
}
|
|
1543
1543
|
// Currency changed — old cached prices are in the wrong currency.
|
|
1544
|
+
// Open the new channels after those prices are stored, so a live tick is
|
|
1545
|
+
// not applied against fiat still in the previous currency.
|
|
1544
1546
|
this.#priceDataSource.invalidatePriceCache();
|
|
1545
|
-
this
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1547
|
+
const assetIds = Object.values(this.state.assetsBalance).flatMap((balances) => Object.keys(balances));
|
|
1548
|
+
this.syncAssetsPrices(assetIds)
|
|
1549
|
+
.then(async () => {
|
|
1550
|
+
if (this.state.selectedCurrency === selectedCurrency) {
|
|
1551
|
+
await this.#priceDataSource.resubscribeForCurrencyChange();
|
|
1552
|
+
}
|
|
1553
|
+
})
|
|
1554
|
+
.catch((error) => {
|
|
1555
|
+
log('Failed to refresh prices after current currency change', error);
|
|
1550
1556
|
});
|
|
1551
1557
|
}
|
|
1552
1558
|
// ============================================================================
|