@metamask-previews/assets-controller 20.3.1-preview-d1da3c817 → 20.3.1-preview-d853a918a
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 -8
- package/dist/AssetsController.d.ts +1 -2
- package/dist/AssetsController.d.ts.map +1 -1
- package/dist/AssetsController.js +4 -33
- package/dist/AssetsController.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/dist/selectors/loading.d.ts +0 -48
- package/dist/selectors/loading.d.ts.map +1 -1
- package/dist/selectors/loading.js +16 -105
- package/dist/selectors/loading.js.map +1 -1
- package/dist/trackAssetsLoading.d.ts +0 -25
- package/dist/trackAssetsLoading.d.ts.map +1 -1
- package/dist/trackAssetsLoading.js +6 -71
- package/dist/trackAssetsLoading.js.map +1 -1
- package/dist/types.d.ts +0 -5
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +1 -2
- package/dist/syncAusUserAssets.d.ts +0 -12
- package/dist/syncAusUserAssets.d.ts.map +0 -1
- package/dist/syncAusUserAssets.js +0 -128
- package/dist/syncAusUserAssets.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,14 +7,6 @@ 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
|
-
- Sync custom-token changes to Authenticated User Storage: adding or hiding a custom asset now mirrors it to the user's AUS user-assets blob (fire-and-forget; failures are reported via the messenger's `captureException` and never roll back local state), and removing or unhiding strips the asset from the corresponding AUS list ([#10336](https://github.com/MetaMask/core/pull/10336))
|
|
13
|
-
- Add `assetsBackgroundLoadingStatus` to `AssetsControllerState`, a transient per-account status of the background (Snap + RPC) fetch that runs after the initial balance has resolved ([#11412](https://github.com/MetaMask/core/pull/11412))
|
|
14
|
-
- Unlike `assetsLoadingStatus`, which only tracks an account's first load, it is set to `'loading'` on every forced fetch that has slow-pipeline chains and settles to `'loaded'` once every overlapping background fetch for the account has finished, whether it succeeded or failed.
|
|
15
|
-
- Add `getAccountBackgroundLoadingStatus`, `isAccountBackgroundLoading`, `getAccountGroupBackgroundLoadingStatus`, `isAccountGroupBackgroundLoading` and `getIsAssetsBackgroundLoadingForSelectedAccountGroup` selectors ([#11412](https://github.com/MetaMask/core/pull/11412))
|
|
16
|
-
- Log `assetsLoadingStatus` and `assetsBackgroundLoadingStatus` transitions, and accounts skipped because their first load already settled, under the `metamask:assets-controller:trackAssetsLoading` debug namespace ([#11412](https://github.com/MetaMask/core/pull/11412))
|
|
17
|
-
|
|
18
10
|
## [20.3.1]
|
|
19
11
|
|
|
20
12
|
### Changed
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { AccountTreeControllerGetAccountsFromSelectedAccountGroupAction, AccountTreeControllerInitializedEvent, AccountTreeControllerIsInitializedAction, AccountTreeControllerSelectedAccountGroupChangeEvent, AccountTreeControllerUninitializedEvent } from '@metamask/account-tree-controller';
|
|
2
2
|
import type { AccountsControllerGetSelectedAccountAction } from '@metamask/accounts-controller';
|
|
3
|
-
import type { AuthenticatedUserStorageServiceGetUserAssetsAction, AuthenticatedUserStorageServiceHideTokensAction, AuthenticatedUserStorageServiceImportTokensAction, AuthenticatedUserStorageServiceSetUserAssetsAction } from '@metamask/authenticated-user-storage';
|
|
4
3
|
import { BaseController } from '@metamask/base-controller';
|
|
5
4
|
import type { ControllerGetStateAction, ControllerStateChangeEvent } from '@metamask/base-controller';
|
|
6
5
|
import type { ClientControllerGetStateAction, ClientControllerStateChangeEvent } from '@metamask/client-controller';
|
|
@@ -74,7 +73,7 @@ export type AssetsControllerPriceChangedEvent = {
|
|
|
74
73
|
}];
|
|
75
74
|
};
|
|
76
75
|
export type AssetsControllerEvents = AssetsControllerStateChangeEvent | AssetsControllerBalanceChangedEvent | AssetsControllerPriceChangedEvent;
|
|
77
|
-
type AllowedActions = AccountsControllerGetSelectedAccountAction | AccountTreeControllerGetAccountsFromSelectedAccountGroupAction | AccountTreeControllerIsInitializedAction | ClientControllerGetStateAction | KeyringControllerIsUnlockedAction | NetworkControllerGetStateAction | NetworkControllerGetNetworkClientByIdAction | ConfigRegistryControllerGetNetworkConfigByCaip2ChainIdAction | NetworkEnablementControllerGetStateAction | SnapControllerGetRunnableSnapsAction | SnapControllerHandleRequestAction | GetPermissions | PhishingControllerBulkScanTokensAction | RemoteFeatureFlagControllerGetStateAction
|
|
76
|
+
type AllowedActions = AccountsControllerGetSelectedAccountAction | AccountTreeControllerGetAccountsFromSelectedAccountGroupAction | AccountTreeControllerIsInitializedAction | ClientControllerGetStateAction | KeyringControllerIsUnlockedAction | NetworkControllerGetStateAction | NetworkControllerGetNetworkClientByIdAction | ConfigRegistryControllerGetNetworkConfigByCaip2ChainIdAction | NetworkEnablementControllerGetStateAction | SnapControllerGetRunnableSnapsAction | SnapControllerHandleRequestAction | GetPermissions | PhishingControllerBulkScanTokensAction | RemoteFeatureFlagControllerGetStateAction;
|
|
78
77
|
type AllowedEvents = AccountTreeControllerSelectedAccountGroupChangeEvent | AccountTreeControllerInitializedEvent | AccountTreeControllerUninitializedEvent | ClientControllerStateChangeEvent | KeyringControllerLockEvent | KeyringControllerUnlockEvent | PreferencesControllerStateChangeEvent | TransactionControllerUnapprovedTransactionAddedEvent | TransactionControllerTransactionConfirmedEvent | MultichainTransactionsControllerTransactionConfirmedEvent | NetworkControllerStateChangeEvent | NetworkControllerNetworkAddedEvent | NetworkControllerNetworkDidChangeEvent | NetworkControllerNetworkRemovedEvent | NetworkEnablementControllerEvents | AccountsControllerAccountBalancesUpdatedEvent | PermissionControllerStateChange | SnapControllerSnapInstalledEvent | AccountActivityServiceBalanceUpdatedEvent | AccountActivityServiceStatusChangedEvent | RemoteFeatureFlagControllerStateChangeEvent;
|
|
79
78
|
export type AssetsControllerMessenger = Messenger<typeof CONTROLLER_NAME, AssetsControllerActions | AllowedActions, AssetsControllerEvents | AllowedEvents>;
|
|
80
79
|
export type AssetsControllerOptions = {
|
|
@@ -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,
|
|
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,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,iBAAiB,EAClB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,EACV,iCAAiC,EACjC,0BAA0B,EAC1B,4BAA4B,EAC7B,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACtE,OAAO,KAA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AQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,WAAW,GACpB,OAAO,CAAC,IAAI,CAAC,CAYf;IAsMD,OAAO,IAAI,IAAI,CAoDd;CACF"}
|
package/dist/AssetsController.js
CHANGED
|
@@ -55,8 +55,7 @@ import { RpcFallbackMiddleware } from './middlewares/RpcFallbackMiddleware.js';
|
|
|
55
55
|
import { dropBalancesOutsideAccountScopes } from './migrations/dropBalancesOutsideAccountScopes.js';
|
|
56
56
|
import { cleanSpamAssets, isUnlockCleanupEnabled, tempHealAssetsInfoMetadata, } from './migrations/healAssetsInfoMetadata.js';
|
|
57
57
|
import { buildFastFetchSources, buildUpdateSources, buildWsUpdateSources, executeAssetsPipeline, } from './pipeline/index.js';
|
|
58
|
-
import {
|
|
59
|
-
import { trackAssetsLoading, trackBackgroundAssetsLoading, } from './trackAssetsLoading.js';
|
|
58
|
+
import { trackAssetsLoading } from './trackAssetsLoading.js';
|
|
60
59
|
import { getAssetVisibility } from './utils/assetVisibility.js';
|
|
61
60
|
import { UNKNOWN_EVM_NATIVE_ASSET_REFERENCE, ZERO_ADDRESS, } from './utils/constants.js';
|
|
62
61
|
import { pickRpcCustomAssetsSupplement } from './utils/customAssetsRpcSupplement.js';
|
|
@@ -172,12 +171,6 @@ const stateMetadata = {
|
|
|
172
171
|
includeInDebugSnapshot: true,
|
|
173
172
|
usedInUi: true,
|
|
174
173
|
},
|
|
175
|
-
assetsBackgroundLoadingStatus: {
|
|
176
|
-
persist: false,
|
|
177
|
-
includeInStateLogs: true,
|
|
178
|
-
includeInDebugSnapshot: true,
|
|
179
|
-
usedInUi: true,
|
|
180
|
-
},
|
|
181
174
|
};
|
|
182
175
|
// ============================================================================
|
|
183
176
|
// HELPER FUNCTIONS
|
|
@@ -343,23 +336,11 @@ let AssetsController = (() => {
|
|
|
343
336
|
let _classSuper = BaseController;
|
|
344
337
|
let _instanceExtraInitializers = [];
|
|
345
338
|
let _getAssets_decorators;
|
|
346
|
-
let _addCustomAsset_decorators;
|
|
347
|
-
let _removeCustomAsset_decorators;
|
|
348
|
-
let _hideAsset_decorators;
|
|
349
|
-
let _unhideAsset_decorators;
|
|
350
339
|
return class AssetsController extends _classSuper {
|
|
351
340
|
static {
|
|
352
341
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
353
342
|
_getAssets_decorators = [trackAssetsLoading];
|
|
354
|
-
_addCustomAsset_decorators = [syncAusUserAssets];
|
|
355
|
-
_removeCustomAsset_decorators = [syncAusUserAssets];
|
|
356
|
-
_hideAsset_decorators = [syncAusUserAssets];
|
|
357
|
-
_unhideAsset_decorators = [syncAusUserAssets];
|
|
358
343
|
__esDecorate(this, null, _getAssets_decorators, { kind: "method", name: "getAssets", static: false, private: false, access: { has: obj => "getAssets" in obj, get: obj => obj.getAssets }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
359
|
-
__esDecorate(this, null, _addCustomAsset_decorators, { kind: "method", name: "addCustomAsset", static: false, private: false, access: { has: obj => "addCustomAsset" in obj, get: obj => obj.addCustomAsset }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
360
|
-
__esDecorate(this, null, _removeCustomAsset_decorators, { kind: "method", name: "removeCustomAsset", static: false, private: false, access: { has: obj => "removeCustomAsset" in obj, get: obj => obj.removeCustomAsset }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
361
|
-
__esDecorate(this, null, _hideAsset_decorators, { kind: "method", name: "hideAsset", static: false, private: false, access: { has: obj => "hideAsset" in obj, get: obj => obj.hideAsset }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
362
|
-
__esDecorate(this, null, _unhideAsset_decorators, { kind: "method", name: "unhideAsset", static: false, private: false, access: { has: obj => "unhideAsset" in obj, get: obj => obj.unhideAsset }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
363
344
|
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
364
345
|
}
|
|
365
346
|
/** Whether the controller is enabled */
|
|
@@ -616,7 +597,7 @@ let AssetsController = (() => {
|
|
|
616
597
|
return undefined;
|
|
617
598
|
}
|
|
618
599
|
},
|
|
619
|
-
removeCustomAsset: (accountId, assetId) => this
|
|
600
|
+
removeCustomAsset: (accountId, assetId) => this.removeCustomAsset(accountId, assetId),
|
|
620
601
|
getAssetsState: () => this.state,
|
|
621
602
|
});
|
|
622
603
|
this.#rpcFallbackMiddleware = new RpcFallbackMiddleware({
|
|
@@ -1257,7 +1238,7 @@ let AssetsController = (() => {
|
|
|
1257
1238
|
? [this.#snapDataSource, this.#rpcDataSource]
|
|
1258
1239
|
: [this.#rpcDataSource];
|
|
1259
1240
|
const slowRequest = { ...request, chainIds };
|
|
1260
|
-
|
|
1241
|
+
withTrace({
|
|
1261
1242
|
name: TRACE_BACKGROUND_FETCH,
|
|
1262
1243
|
trace: pipelineTrace,
|
|
1263
1244
|
data: {
|
|
@@ -1283,7 +1264,7 @@ let AssetsController = (() => {
|
|
|
1283
1264
|
});
|
|
1284
1265
|
await this.#updateState(response);
|
|
1285
1266
|
},
|
|
1286
|
-
})
|
|
1267
|
+
}).catch((error) => log('Background pipeline failed', { error }));
|
|
1287
1268
|
}
|
|
1288
1269
|
#emitFastFetchTraces({ accounts, chainIds, result, durationMs, isBasicFunctionality, parentContext, pipelineTrace, }) {
|
|
1289
1270
|
emitTrace({
|
|
@@ -1603,16 +1584,6 @@ let AssetsController = (() => {
|
|
|
1603
1584
|
* @param assetId - The CAIP-19 asset ID to remove.
|
|
1604
1585
|
*/
|
|
1605
1586
|
removeCustomAsset(accountId, assetId) {
|
|
1606
|
-
this.#removeCustomAssetInternal(accountId, assetId);
|
|
1607
|
-
}
|
|
1608
|
-
/**
|
|
1609
|
-
* Remove a custom asset without mirroring the removal to AUS (used by
|
|
1610
|
-
* auto-graduation, which is not user intent).
|
|
1611
|
-
*
|
|
1612
|
-
* @param accountId - The account ID to remove the custom asset from.
|
|
1613
|
-
* @param assetId - The CAIP-19 asset ID to remove.
|
|
1614
|
-
*/
|
|
1615
|
-
#removeCustomAssetInternal(accountId, assetId) {
|
|
1616
1587
|
const normalizedAssetId = normalizeAssetId(assetId);
|
|
1617
1588
|
log('Removing custom asset', { accountId, assetId: normalizedAssetId });
|
|
1618
1589
|
this.update((state) => {
|