@metamask-previews/assets-controller 20.3.1-preview-693aef2bf → 20.3.1-preview-91dd16c
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 -7
- package/dist/AssetsController.d.ts.map +1 -1
- package/dist/AssetsController.js +3 -9
- 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 -1
package/dist/index.d.ts
CHANGED
|
@@ -22,6 +22,6 @@ export type { CustomAssetGraduationMiddlewareOptions, RpcFallbackMiddlewareOptio
|
|
|
22
22
|
export { normalizeAssetId, formatExchangeRatesForBridge, formatStateForTransactionPay, } from './utils/index.js';
|
|
23
23
|
export type { AccountForLegacyFormat, BridgeExchangeRatesFormat, FormatExchangeRatesForBridgeParams, FormatStateForTransactionPayParams, LegacyToken, TransactionPayLegacyFormat, } from './utils/index.js';
|
|
24
24
|
export { calculateBalanceForAllWallets, calculateBalanceChangeForAccountGroup, getAggregatedBalanceForAccount, getGroupIdForAccount, getInternalAccountsForGroup, } from './selectors/balance.js';
|
|
25
|
-
export {
|
|
25
|
+
export { getAccountGroupLoadingStatus, getAccountLoadingStatus, getIsAssetsLoadingForSelectedAccountGroup, isAccountGroupLoading, isAccountLoading, } from './selectors/loading.js';
|
|
26
26
|
export type { AccountGroupBalance, AccountsById, AggregatedBalanceEntry, AggregatedBalanceForAccount, AllWalletsBalance, BalanceChangePeriod, BalanceChangeResult, EnabledNetworkMap, WalletBalance, } from './selectors/balance.js';
|
|
27
27
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,gBAAgB,EAChB,+BAA+B,GAChC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EACL,+BAA+B,EAC/B,kCAAkC,EAClC,sBAAsB,EACtB,sBAAsB,EACtB,+BAA+B,EAC/B,uBAAuB,GACxB,MAAM,eAAe,CAAC;AACvB,YAAY,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAGlE,OAAO,EACL,gCAAgC,EAChC,iCAAiC,EACjC,yBAAyB,EACzB,gCAAgC,EAChC,sBAAsB,EACtB,+BAA+B,EAC/B,8BAA8B,GAC/B,MAAM,mCAAmC,CAAC;AAC3C,YAAY,EAAE,6BAA6B,EAAE,MAAM,mCAAmC,CAAC;AAGvF,YAAY,EACV,qBAAqB,EACrB,yBAAyB,EACzB,uBAAuB,EACvB,8BAA8B,EAC9B,uBAAuB,EACvB,gCAAgC,EAChC,mCAAmC,EACnC,iCAAiC,EACjC,sBAAsB,GACvB,MAAM,uBAAuB,CAAC;AAC/B,YAAY,EACV,+BAA+B,EAC/B,sCAAsC,EACtC,sCAAsC,EACtC,yCAAyC,EACzC,2CAA2C,EAC3C,6CAA6C,EAC7C,oCAAoC,EACpC,sCAAsC,EACtC,oCAAoC,EACpC,uCAAuC,EACvC,qCAAqC,EACrC,+BAA+B,EAC/B,iCAAiC,EACjC,+CAA+C,EAC/C,+CAA+C,EAC/C,yCAAyC,GAC1C,MAAM,2CAA2C,CAAC;AAGnD,YAAY,EAEV,aAAa,EACb,SAAS,EACT,OAAO,EAEP,SAAS,EACT,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AAC;AAGjC,OAAO,EACL,cAAc,EACd,oBAAoB,EACpB,qBAAqB,EAErB,kBAAkB,EAElB,iBAAiB,EACjB,uBAAuB,GACxB,MAAM,yBAAyB,CAAC;AAEjC,YAAY,EACV,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE3E,YAAY,EACV,sBAAsB,EACtB,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EACL,+BAA+B,EAC/B,qBAAqB,GACtB,MAAM,wBAAwB,CAAC;AAChC,YAAY,EACV,sCAAsC,EACtC,4BAA4B,GAC7B,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EACL,gBAAgB,EAChB,4BAA4B,EAC5B,4BAA4B,GAC7B,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EACV,sBAAsB,EACtB,yBAAyB,EACzB,kCAAkC,EAClC,kCAAkC,EAClC,WAAW,EACX,0BAA0B,GAC3B,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EACL,6BAA6B,EAC7B,qCAAqC,EACrC,8BAA8B,EAC9B,oBAAoB,EACpB,2BAA2B,GAC5B,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACL,4BAA4B,EAC5B,uBAAuB,EACvB,yCAAyC,EACzC,qBAAqB,EACrB,gBAAgB,GACjB,MAAM,wBAAwB,CAAC;AAEhC,YAAY,EACV,mBAAmB,EACnB,YAAY,EACZ,sBAAsB,EACtB,2BAA2B,EAC3B,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,EACjB,aAAa,GACd,MAAM,wBAAwB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -24,5 +24,5 @@ export { CustomAssetGraduationMiddleware, RpcFallbackMiddleware, } from './middl
|
|
|
24
24
|
export { normalizeAssetId, formatExchangeRatesForBridge, formatStateForTransactionPay, } from './utils/index.js';
|
|
25
25
|
// Selectors
|
|
26
26
|
export { calculateBalanceForAllWallets, calculateBalanceChangeForAccountGroup, getAggregatedBalanceForAccount, getGroupIdForAccount, getInternalAccountsForGroup, } from './selectors/balance.js';
|
|
27
|
-
export {
|
|
27
|
+
export { getAccountGroupLoadingStatus, getAccountLoadingStatus, getIsAssetsLoadingForSelectedAccountGroup, isAccountGroupLoading, isAccountLoading, } from './selectors/loading.js';
|
|
28
28
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,yBAAyB;AACzB,OAAO,EACL,gBAAgB,EAChB,+BAA+B,GAChC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EACL,+BAA+B,EAC/B,kCAAkC,EAClC,sBAAsB,EACtB,sBAAsB,EACtB,+BAA+B,EAC/B,uBAAuB,GACxB,MAAM,eAAe,CAAC;AAGvB,4CAA4C;AAC5C,OAAO,EACL,gCAAgC,EAChC,iCAAiC,EACjC,yBAAyB,EACzB,gCAAgC,EAChC,sBAAsB,EACtB,+BAA+B,EAC/B,8BAA8B,GAC/B,MAAM,mCAAmC,CAAC;AAwF3C,sCAAsC;AACtC,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAO7D,6BAA6B;AAC7B,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAQhE,qBAAqB;AACrB,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAS7E,gFAAgF;AAChF,OAAO,EACL,cAAc,EACd,oBAAoB,EACpB,qBAAqB;AACrB,YAAY;AACZ,kBAAkB;AAClB,oBAAoB;AACpB,iBAAiB,EACjB,uBAAuB,GACxB,MAAM,yBAAyB,CAAC;AAOjC,0BAA0B;AAC1B,OAAO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,CAAC;AAOjC,0BAA0B;AAC1B,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAQ3E,cAAc;AACd,OAAO,EACL,+BAA+B,EAC/B,qBAAqB,GACtB,MAAM,wBAAwB,CAAC;AAMhC,YAAY;AACZ,OAAO,EACL,gBAAgB,EAChB,4BAA4B,EAC5B,4BAA4B,GAC7B,MAAM,kBAAkB,CAAC;AAU1B,YAAY;AACZ,OAAO,EACL,6BAA6B,EAC7B,qCAAqC,EACrC,8BAA8B,EAC9B,oBAAoB,EACpB,2BAA2B,GAC5B,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACL,4BAA4B,EAC5B,uBAAuB,EACvB,yCAAyC,EACzC,qBAAqB,EACrB,gBAAgB,GACjB,MAAM,wBAAwB,CAAC","sourcesContent":["// Main controller export\nexport {\n AssetsController,\n getDefaultAssetsControllerState,\n} from './AssetsController.js';\nexport { AssetsDataSourceError } from './errors.js';\nexport {\n DEFAULT_TRACKED_ASSETS_BY_CHAIN,\n CHAINS_WITH_DEFAULT_TRACKED_ASSETS,\n DEFAULT_ASSET_METADATA,\n buildDefaultAssetsInfo,\n getDefaultTrackedAssetsForChain,\n getDefaultAssetMetadata,\n} from './defaults.js';\nexport type { PendingTokenMetadata } from './AssetsController.js';\n\n// Snaps → AssetsController assets migration\nexport {\n SNAPS_ASSETS_MIGRATION_FLAG_KEYS,\n SNAPS_ASSETS_MIGRATION_NAMESPACES,\n SnapsAssetsMigrationStage,\n getSnapsAssetsMigrationNamespace,\n isMigrationStageActive,\n isSnapsAssetsMigrationNamespace,\n parseSnapsAssetsMigrationStage,\n} from './utils/snaps-assets-migration.js';\nexport type { SnapsAssetsMigrationNamespace } from './utils/snaps-assets-migration.js';\n\n// State and messenger types\nexport type {\n AssetsControllerState,\n AssetsControllerMessenger,\n AssetsControllerOptions,\n AssetsControllerGetStateAction,\n AssetsControllerActions,\n AssetsControllerStateChangeEvent,\n AssetsControllerBalanceChangedEvent,\n AssetsControllerPriceChangedEvent,\n AssetsControllerEvents,\n} from './AssetsController.js';\nexport type {\n AssetsControllerGetAssetsAction,\n AssetsControllerGetAssetsBalanceAction,\n AssetsControllerGetAssetMetadataAction,\n AssetsControllerGetAccountAssetByIDAction,\n AssetsControllerGetAccountAssetsByIDsAction,\n AssetsControllerGetAccountAssetsByScopeAction,\n AssetsControllerGetAssetsPriceAction,\n AssetsControllerSyncAssetsPricesAction,\n AssetsControllerAddCustomAssetAction,\n AssetsControllerRemoveCustomAssetAction,\n AssetsControllerGetCustomAssetsAction,\n AssetsControllerHideAssetAction,\n AssetsControllerUnhideAssetAction,\n AssetsControllerGetExchangeRatesForBridgeAction,\n AssetsControllerGetStateForTransactionPayAction,\n AssetsControllerSetSelectedCurrencyAction,\n} from './AssetsController-method-action-types.js';\n\n// Core types\nexport type {\n // CAIP types\n Caip19AssetId,\n AccountId,\n ChainId,\n // Asset types\n AssetType,\n TokenStandard,\n // Contract data types\n TokenFees,\n HoneypotStatus,\n StorageSlots,\n LocalizedDescription,\n // Metadata types\n BaseAssetMetadata,\n FungibleAssetMetadata,\n ERC721AssetMetadata,\n ERC1155AssetMetadata,\n AssetMetadata,\n // Price types\n BaseAssetPrice,\n FungibleAssetPrice,\n NFTAssetPrice,\n AssetPrice,\n // Balance types\n FungibleAssetBalance,\n ERC721AssetBalance,\n ERC1155AssetBalance,\n AssetBalance,\n // Data source types\n AccountWithSupportedChains,\n DataType,\n DataRequest,\n DataResponse,\n AssetsUpdateMode,\n AssetsLoadingStatus,\n // Middleware types\n Context,\n NextFunction,\n Middleware,\n AssetsDataSource,\n FetchContext,\n FetchNextFunction,\n FetchMiddleware,\n SubscriptionResponse,\n // Combined asset type\n Asset,\n // Event types\n BalanceChangeEvent,\n PriceChangeEvent,\n MetadataChangeEvent,\n} from './types.js';\n\n// Data sources - base class and types\nexport { AbstractDataSource } from './data-sources/index.js';\n\nexport type {\n DataSourceState,\n SubscriptionRequest,\n} from './data-sources/index.js';\n\n// Data sources - AccountsApi\nexport { AccountsApiDataSource } from './data-sources/index.js';\n\nexport type {\n AccountsApiDataSourceConfig,\n AccountsApiDataSourceOptions,\n AccountsApiDataSourceState,\n} from './data-sources/index.js';\n\n// Data sources - RPC\nexport { RpcDataSource, createRpcDataSource } from './data-sources/index.js';\n\nexport type {\n RpcDataSourceConfig,\n RpcDataSourceOptions,\n RpcDataSourceState,\n ChainStatus,\n} from './data-sources/index.js';\n\n// Data sources - Unified Snap Data Source (dynamically discovers keyring snaps)\nexport {\n SnapDataSource,\n createSnapDataSource,\n SNAP_DATA_SOURCE_NAME,\n // Constants\n KEYRING_PERMISSION,\n // Utility functions\n getChainIdsCaveat,\n extractChainFromAssetId,\n} from './data-sources/index.js';\n\nexport type {\n SnapDataSourceState,\n SnapDataSourceOptions,\n} from './data-sources/index.js';\n\n// Enrichment data sources\nexport { TokenDataSource, PriceDataSource } from './data-sources/index.js';\n\nexport type {\n TokenDataSourceOptions,\n PriceDataSourceConfig,\n PriceDataSourceOptions,\n} from './data-sources/index.js';\n\n// Middlewares\nexport {\n CustomAssetGraduationMiddleware,\n RpcFallbackMiddleware,\n} from './middlewares/index.js';\nexport type {\n CustomAssetGraduationMiddlewareOptions,\n RpcFallbackMiddlewareOptions,\n} from './middlewares/index.js';\n\n// Utilities\nexport {\n normalizeAssetId,\n formatExchangeRatesForBridge,\n formatStateForTransactionPay,\n} from './utils/index.js';\nexport type {\n AccountForLegacyFormat,\n BridgeExchangeRatesFormat,\n FormatExchangeRatesForBridgeParams,\n FormatStateForTransactionPayParams,\n LegacyToken,\n TransactionPayLegacyFormat,\n} from './utils/index.js';\n\n// Selectors\nexport {\n calculateBalanceForAllWallets,\n calculateBalanceChangeForAccountGroup,\n getAggregatedBalanceForAccount,\n getGroupIdForAccount,\n getInternalAccountsForGroup,\n} from './selectors/balance.js';\n\nexport {\n getAccountGroupLoadingStatus,\n getAccountLoadingStatus,\n getIsAssetsLoadingForSelectedAccountGroup,\n isAccountGroupLoading,\n isAccountLoading,\n} from './selectors/loading.js';\n\nexport type {\n AccountGroupBalance,\n AccountsById,\n AggregatedBalanceEntry,\n AggregatedBalanceForAccount,\n AllWalletsBalance,\n BalanceChangePeriod,\n BalanceChangeResult,\n EnabledNetworkMap,\n WalletBalance,\n} from './selectors/balance.js';\n"]}
|
|
@@ -45,52 +45,4 @@ export declare function isAccountGroupLoading(state: Pick<AssetsControllerState,
|
|
|
45
45
|
* @returns True while any account in the selected account group is loading.
|
|
46
46
|
*/
|
|
47
47
|
export declare function getIsAssetsLoadingForSelectedAccountGroup(state: Pick<AssetsControllerState, 'assetsLoadingStatus'>, accountTreeState: AccountTreeControllerState): boolean;
|
|
48
|
-
/**
|
|
49
|
-
* Get the background (Snap + RPC) loading status for a single account.
|
|
50
|
-
*
|
|
51
|
-
* @param state - AssetsController state slice.
|
|
52
|
-
* @param accountId - The account id (`InternalAccount.id`).
|
|
53
|
-
* @returns `'loading'` while a background fetch for the account is in
|
|
54
|
-
* flight, `'loaded'` once every background fetch has settled, or `undefined`
|
|
55
|
-
* if no background fetch was triggered.
|
|
56
|
-
*/
|
|
57
|
-
export declare function getAccountBackgroundLoadingStatus(state: Pick<AssetsControllerState, 'assetsBackgroundLoadingStatus'>, accountId: AccountId): AssetsLoadingStatus | undefined;
|
|
58
|
-
/**
|
|
59
|
-
* Check whether a background fetch for an account is currently in flight.
|
|
60
|
-
*
|
|
61
|
-
* @param state - AssetsController state slice.
|
|
62
|
-
* @param accountId - The account id (`InternalAccount.id`).
|
|
63
|
-
* @returns True while a background fetch for the account is in flight.
|
|
64
|
-
*/
|
|
65
|
-
export declare function isAccountBackgroundLoading(state: Pick<AssetsControllerState, 'assetsBackgroundLoadingStatus'>, accountId: AccountId): boolean;
|
|
66
|
-
/**
|
|
67
|
-
* Get the background loading statuses for every account in an account group.
|
|
68
|
-
*
|
|
69
|
-
* @param state - AssetsController state slice.
|
|
70
|
-
* @param accountTreeState - AccountTreeController state slice.
|
|
71
|
-
* @param groupId - The account group id.
|
|
72
|
-
* @returns A record containing an entry for each account in the group that
|
|
73
|
-
* has a background loading status, keyed by account id.
|
|
74
|
-
*/
|
|
75
|
-
export declare function getAccountGroupBackgroundLoadingStatus(state: Pick<AssetsControllerState, 'assetsBackgroundLoadingStatus'>, accountTreeState: AccountTreeControllerState, groupId: string): Record<AccountId, AssetsLoadingStatus>;
|
|
76
|
-
/**
|
|
77
|
-
* Check whether any account in an account group has a background fetch in
|
|
78
|
-
* flight.
|
|
79
|
-
*
|
|
80
|
-
* @param state - AssetsController state slice.
|
|
81
|
-
* @param accountTreeState - AccountTreeController state slice.
|
|
82
|
-
* @param groupId - The account group id.
|
|
83
|
-
* @returns True while at least one account in the group is background
|
|
84
|
-
* loading.
|
|
85
|
-
*/
|
|
86
|
-
export declare function isAccountGroupBackgroundLoading(state: Pick<AssetsControllerState, 'assetsBackgroundLoadingStatus'>, accountTreeState: AccountTreeControllerState, groupId: string): boolean;
|
|
87
|
-
/**
|
|
88
|
-
* Check whether the selected account group has a background fetch in flight.
|
|
89
|
-
*
|
|
90
|
-
* @param state - AssetsController state slice.
|
|
91
|
-
* @param accountTreeState - AccountTreeController state slice.
|
|
92
|
-
* @returns True while any account in the selected account group is
|
|
93
|
-
* background loading.
|
|
94
|
-
*/
|
|
95
|
-
export declare function getIsAssetsBackgroundLoadingForSelectedAccountGroup(state: Pick<AssetsControllerState, 'assetsBackgroundLoadingStatus'>, accountTreeState: AccountTreeControllerState): boolean;
|
|
96
48
|
//# sourceMappingURL=loading.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loading.d.ts","sourceRoot":"","sources":["../../src/selectors/loading.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAC;AAEpF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,KAAK,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"loading.d.ts","sourceRoot":"","sources":["../../src/selectors/loading.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAC;AAEpF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,KAAK,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAGlE;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,IAAI,CAAC,qBAAqB,EAAE,qBAAqB,CAAC,EACzD,SAAS,EAAE,SAAS,GACnB,mBAAmB,GAAG,SAAS,CAEjC;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,IAAI,CAAC,qBAAqB,EAAE,qBAAqB,CAAC,EACzD,SAAS,EAAE,SAAS,GACnB,OAAO,CAET;AAED;;;;;;;;GAQG;AACH,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,IAAI,CAAC,qBAAqB,EAAE,qBAAqB,CAAC,EACzD,gBAAgB,EAAE,0BAA0B,EAC5C,OAAO,EAAE,MAAM,GACd,MAAM,CAAC,SAAS,EAAE,mBAAmB,CAAC,CAUxC;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,IAAI,CAAC,qBAAqB,EAAE,qBAAqB,CAAC,EACzD,gBAAgB,EAAE,0BAA0B,EAC5C,OAAO,EAAE,MAAM,GACd,OAAO,CAKT;AAED;;;;;;GAMG;AACH,wBAAgB,yCAAyC,CACvD,KAAK,EAAE,IAAI,CAAC,qBAAqB,EAAE,qBAAqB,CAAC,EACzD,gBAAgB,EAAE,0BAA0B,GAC3C,OAAO,CAMT"}
|
|
@@ -1,48 +1,4 @@
|
|
|
1
1
|
import { getAccountIdsForGroup } from './balance.js';
|
|
2
|
-
/**
|
|
3
|
-
* Collect the statuses for every account in an account group.
|
|
4
|
-
*
|
|
5
|
-
* @param statuses - The per-account statuses to read from.
|
|
6
|
-
* @param accountTreeState - AccountTreeController state slice.
|
|
7
|
-
* @param groupId - The account group id.
|
|
8
|
-
* @returns A record with an entry for each account in the group that has a
|
|
9
|
-
* status, keyed by account id.
|
|
10
|
-
*/
|
|
11
|
-
function collectGroupStatuses(statuses, accountTreeState, groupId) {
|
|
12
|
-
const result = {};
|
|
13
|
-
for (const accountId of getAccountIdsForGroup(accountTreeState, groupId)) {
|
|
14
|
-
const status = statuses?.[accountId];
|
|
15
|
-
if (status !== undefined) {
|
|
16
|
-
result[accountId] = status;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
return result;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Check whether any account in an account group is `'loading'`.
|
|
23
|
-
*
|
|
24
|
-
* @param statuses - The per-account statuses to read from.
|
|
25
|
-
* @param accountTreeState - AccountTreeController state slice.
|
|
26
|
-
* @param groupId - The account group id.
|
|
27
|
-
* @returns True while at least one account in the group is loading.
|
|
28
|
-
*/
|
|
29
|
-
function isAnyGroupAccountLoading(statuses, accountTreeState, groupId) {
|
|
30
|
-
return getAccountIdsForGroup(accountTreeState, groupId).some((accountId) => statuses?.[accountId] === 'loading');
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Check whether any account in the selected account group is `'loading'`.
|
|
34
|
-
*
|
|
35
|
-
* @param statuses - The per-account statuses to read from.
|
|
36
|
-
* @param accountTreeState - AccountTreeController state slice.
|
|
37
|
-
* @returns True while any account in the selected account group is loading.
|
|
38
|
-
*/
|
|
39
|
-
function isSelectedGroupLoading(statuses, accountTreeState) {
|
|
40
|
-
const groupId = accountTreeState.selectedAccountGroup;
|
|
41
|
-
if (!groupId) {
|
|
42
|
-
return false;
|
|
43
|
-
}
|
|
44
|
-
return isAnyGroupAccountLoading(statuses, accountTreeState, groupId);
|
|
45
|
-
}
|
|
46
2
|
/**
|
|
47
3
|
* Get the loading status for a single account.
|
|
48
4
|
*
|
|
@@ -74,7 +30,15 @@ export function isAccountLoading(state, accountId) {
|
|
|
74
30
|
* has a loading status, keyed by account id.
|
|
75
31
|
*/
|
|
76
32
|
export function getAccountGroupLoadingStatus(state, accountTreeState, groupId) {
|
|
77
|
-
|
|
33
|
+
const loadingStatus = state.assetsLoadingStatus;
|
|
34
|
+
const result = {};
|
|
35
|
+
for (const accountId of getAccountIdsForGroup(accountTreeState, groupId)) {
|
|
36
|
+
const status = loadingStatus?.[accountId];
|
|
37
|
+
if (status !== undefined) {
|
|
38
|
+
result[accountId] = status;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return result;
|
|
78
42
|
}
|
|
79
43
|
/**
|
|
80
44
|
* Check whether any account in an account group is currently loading.
|
|
@@ -85,7 +49,8 @@ export function getAccountGroupLoadingStatus(state, accountTreeState, groupId) {
|
|
|
85
49
|
* @returns True while at least one account in the group is loading.
|
|
86
50
|
*/
|
|
87
51
|
export function isAccountGroupLoading(state, accountTreeState, groupId) {
|
|
88
|
-
|
|
52
|
+
const loadingStatus = state.assetsLoadingStatus;
|
|
53
|
+
return getAccountIdsForGroup(accountTreeState, groupId).some((accountId) => loadingStatus?.[accountId] === 'loading');
|
|
89
54
|
}
|
|
90
55
|
/**
|
|
91
56
|
* Check whether the selected account group is currently loading its assets.
|
|
@@ -95,64 +60,10 @@ export function isAccountGroupLoading(state, accountTreeState, groupId) {
|
|
|
95
60
|
* @returns True while any account in the selected account group is loading.
|
|
96
61
|
*/
|
|
97
62
|
export function getIsAssetsLoadingForSelectedAccountGroup(state, accountTreeState) {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
* @param state - AssetsController state slice.
|
|
104
|
-
* @param accountId - The account id (`InternalAccount.id`).
|
|
105
|
-
* @returns `'loading'` while a background fetch for the account is in
|
|
106
|
-
* flight, `'loaded'` once every background fetch has settled, or `undefined`
|
|
107
|
-
* if no background fetch was triggered.
|
|
108
|
-
*/
|
|
109
|
-
export function getAccountBackgroundLoadingStatus(state, accountId) {
|
|
110
|
-
return state.assetsBackgroundLoadingStatus?.[accountId];
|
|
111
|
-
}
|
|
112
|
-
/**
|
|
113
|
-
* Check whether a background fetch for an account is currently in flight.
|
|
114
|
-
*
|
|
115
|
-
* @param state - AssetsController state slice.
|
|
116
|
-
* @param accountId - The account id (`InternalAccount.id`).
|
|
117
|
-
* @returns True while a background fetch for the account is in flight.
|
|
118
|
-
*/
|
|
119
|
-
export function isAccountBackgroundLoading(state, accountId) {
|
|
120
|
-
return getAccountBackgroundLoadingStatus(state, accountId) === 'loading';
|
|
121
|
-
}
|
|
122
|
-
/**
|
|
123
|
-
* Get the background loading statuses for every account in an account group.
|
|
124
|
-
*
|
|
125
|
-
* @param state - AssetsController state slice.
|
|
126
|
-
* @param accountTreeState - AccountTreeController state slice.
|
|
127
|
-
* @param groupId - The account group id.
|
|
128
|
-
* @returns A record containing an entry for each account in the group that
|
|
129
|
-
* has a background loading status, keyed by account id.
|
|
130
|
-
*/
|
|
131
|
-
export function getAccountGroupBackgroundLoadingStatus(state, accountTreeState, groupId) {
|
|
132
|
-
return collectGroupStatuses(state.assetsBackgroundLoadingStatus, accountTreeState, groupId);
|
|
133
|
-
}
|
|
134
|
-
/**
|
|
135
|
-
* Check whether any account in an account group has a background fetch in
|
|
136
|
-
* flight.
|
|
137
|
-
*
|
|
138
|
-
* @param state - AssetsController state slice.
|
|
139
|
-
* @param accountTreeState - AccountTreeController state slice.
|
|
140
|
-
* @param groupId - The account group id.
|
|
141
|
-
* @returns True while at least one account in the group is background
|
|
142
|
-
* loading.
|
|
143
|
-
*/
|
|
144
|
-
export function isAccountGroupBackgroundLoading(state, accountTreeState, groupId) {
|
|
145
|
-
return isAnyGroupAccountLoading(state.assetsBackgroundLoadingStatus, accountTreeState, groupId);
|
|
146
|
-
}
|
|
147
|
-
/**
|
|
148
|
-
* Check whether the selected account group has a background fetch in flight.
|
|
149
|
-
*
|
|
150
|
-
* @param state - AssetsController state slice.
|
|
151
|
-
* @param accountTreeState - AccountTreeController state slice.
|
|
152
|
-
* @returns True while any account in the selected account group is
|
|
153
|
-
* background loading.
|
|
154
|
-
*/
|
|
155
|
-
export function getIsAssetsBackgroundLoadingForSelectedAccountGroup(state, accountTreeState) {
|
|
156
|
-
return isSelectedGroupLoading(state.assetsBackgroundLoadingStatus, accountTreeState);
|
|
63
|
+
const groupId = accountTreeState.selectedAccountGroup;
|
|
64
|
+
if (!groupId) {
|
|
65
|
+
return false;
|
|
66
|
+
}
|
|
67
|
+
return isAccountGroupLoading(state, accountTreeState, groupId);
|
|
157
68
|
}
|
|
158
69
|
//# sourceMappingURL=loading.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loading.js","sourceRoot":"","sources":["../../src/selectors/loading.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAErD;;;;;;;;GAQG;AACH,SAAS,oBAAoB,CAC3B,QAA4D,EAC5D,gBAA4C,EAC5C,OAAe;IAEf,MAAM,MAAM,GAA2C,EAAE,CAAC;IAC1D,KAAK,MAAM,SAAS,IAAI,qBAAqB,CAAC,gBAAgB,EAAE,OAAO,CAAC,EAAE,CAAC;QACzE,MAAM,MAAM,GAAG,QAAQ,EAAE,CAAC,SAAS,CAAC,CAAC;QACrC,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;YACzB,MAAM,CAAC,SAAS,CAAC,GAAG,MAAM,CAAC;QAC7B,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;;;;GAOG;AACH,SAAS,wBAAwB,CAC/B,QAA4D,EAC5D,gBAA4C,EAC5C,OAAe;IAEf,OAAO,qBAAqB,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC,IAAI,CAC1D,CAAC,SAAS,EAAE,EAAE,CAAC,QAAQ,EAAE,CAAC,SAAS,CAAC,KAAK,SAAS,CACnD,CAAC;AACJ,CAAC;AAED;;;;;;GAM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;;;;;GAMG;AACH,MAAM,UAAU,0BAA0B,CACxC,KAAmE,EACnE,SAAoB;IAEpB,OAAO,iCAAiC,CAAC,KAAK,EAAE,SAAS,CAAC,KAAK,SAAS,CAAC;AAC3E,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,sCAAsC,CACpD,KAAmE,EACnE,gBAA4C,EAC5C,OAAe;IAEf,OAAO,oBAAoB,CACzB,KAAK,CAAC,6BAA6B,EACnC,gBAAgB,EAChB,OAAO,CACR,CAAC;AACJ,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,+BAA+B,CAC7C,KAAmE,EACnE,gBAA4C,EAC5C,OAAe;IAEf,OAAO,wBAAwB,CAC7B,KAAK,CAAC,6BAA6B,EACnC,gBAAgB,EAChB,OAAO,CACR,CAAC;AACJ,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,mDAAmD,CACjE,KAAmE,EACnE,gBAA4C;IAE5C,OAAO,sBAAsB,CAC3B,KAAK,CAAC,6BAA6B,EACnC,gBAAgB,CACjB,CAAC;AACJ,CAAC","sourcesContent":["import type { AccountTreeControllerState } from '@metamask/account-tree-controller';\n\nimport type { AssetsControllerState } from '../AssetsController.js';\nimport type { AccountId, AssetsLoadingStatus } from '../types.js';\nimport { getAccountIdsForGroup } from './balance.js';\n\n/**\n * Collect the statuses for every account in an account group.\n *\n * @param statuses - The per-account statuses to read from.\n * @param accountTreeState - AccountTreeController state slice.\n * @param groupId - The account group id.\n * @returns A record with an entry for each account in the group that has a\n * status, keyed by account id.\n */\nfunction collectGroupStatuses(\n statuses: Record<AccountId, AssetsLoadingStatus> | undefined,\n accountTreeState: AccountTreeControllerState,\n groupId: string,\n): Record<AccountId, AssetsLoadingStatus> {\n const result: Record<AccountId, AssetsLoadingStatus> = {};\n for (const accountId of getAccountIdsForGroup(accountTreeState, groupId)) {\n const status = statuses?.[accountId];\n if (status !== undefined) {\n result[accountId] = status;\n }\n }\n return result;\n}\n\n/**\n * Check whether any account in an account group is `'loading'`.\n *\n * @param statuses - The per-account statuses to read from.\n * @param accountTreeState - AccountTreeController state slice.\n * @param groupId - The account group id.\n * @returns True while at least one account in the group is loading.\n */\nfunction isAnyGroupAccountLoading(\n statuses: Record<AccountId, AssetsLoadingStatus> | undefined,\n accountTreeState: AccountTreeControllerState,\n groupId: string,\n): boolean {\n return getAccountIdsForGroup(accountTreeState, groupId).some(\n (accountId) => statuses?.[accountId] === 'loading',\n );\n}\n\n/**\n * Check whether any account in the selected account group is `'loading'`.\n *\n * @param statuses - The per-account statuses to read from.\n * @param accountTreeState - AccountTreeController state slice.\n * @returns True while any account in the selected account group is loading.\n */\nfunction isSelectedGroupLoading(\n statuses: Record<AccountId, AssetsLoadingStatus> | undefined,\n accountTreeState: AccountTreeControllerState,\n): boolean {\n const groupId = accountTreeState.selectedAccountGroup;\n if (!groupId) {\n return false;\n }\n return isAnyGroupAccountLoading(statuses, accountTreeState, groupId);\n}\n\n/**\n * Get the loading status for a single account.\n *\n * @param state - AssetsController state slice.\n * @param accountId - The account id (`InternalAccount.id`).\n * @returns `'loading'` while the account's assets are loading, `'loaded'`\n * after its fetch has settled, or `undefined` if no fetch was triggered.\n */\nexport function getAccountLoadingStatus(\n state: Pick<AssetsControllerState, 'assetsLoadingStatus'>,\n accountId: AccountId,\n): AssetsLoadingStatus | undefined {\n return state.assetsLoadingStatus?.[accountId];\n}\n\n/**\n * Check whether an account's assets are currently loading.\n *\n * @param state - AssetsController state slice.\n * @param accountId - The account id (`InternalAccount.id`).\n * @returns True while the account's assets are loading.\n */\nexport function isAccountLoading(\n state: Pick<AssetsControllerState, 'assetsLoadingStatus'>,\n accountId: AccountId,\n): boolean {\n return getAccountLoadingStatus(state, accountId) === 'loading';\n}\n\n/**\n * Get the loading statuses for every account in an account group.\n *\n * @param state - AssetsController state slice.\n * @param accountTreeState - AccountTreeController state slice.\n * @param groupId - The account group id.\n * @returns A record containing an entry for each account in the group that\n * has a loading status, keyed by account id.\n */\nexport function getAccountGroupLoadingStatus(\n state: Pick<AssetsControllerState, 'assetsLoadingStatus'>,\n accountTreeState: AccountTreeControllerState,\n groupId: string,\n): Record<AccountId, AssetsLoadingStatus> {\n return collectGroupStatuses(\n state.assetsLoadingStatus,\n accountTreeState,\n groupId,\n );\n}\n\n/**\n * Check whether any account in an account group is currently loading.\n *\n * @param state - AssetsController state slice.\n * @param accountTreeState - AccountTreeController state slice.\n * @param groupId - The account group id.\n * @returns True while at least one account in the group is loading.\n */\nexport function isAccountGroupLoading(\n state: Pick<AssetsControllerState, 'assetsLoadingStatus'>,\n accountTreeState: AccountTreeControllerState,\n groupId: string,\n): boolean {\n return isAnyGroupAccountLoading(\n state.assetsLoadingStatus,\n accountTreeState,\n groupId,\n );\n}\n\n/**\n * Check whether the selected account group is currently loading its assets.\n *\n * @param state - AssetsController state slice.\n * @param accountTreeState - AccountTreeController state slice.\n * @returns True while any account in the selected account group is loading.\n */\nexport function getIsAssetsLoadingForSelectedAccountGroup(\n state: Pick<AssetsControllerState, 'assetsLoadingStatus'>,\n accountTreeState: AccountTreeControllerState,\n): boolean {\n return isSelectedGroupLoading(state.assetsLoadingStatus, accountTreeState);\n}\n\n/**\n * Get the background (Snap + RPC) loading status for a single account.\n *\n * @param state - AssetsController state slice.\n * @param accountId - The account id (`InternalAccount.id`).\n * @returns `'loading'` while a background fetch for the account is in\n * flight, `'loaded'` once every background fetch has settled, or `undefined`\n * if no background fetch was triggered.\n */\nexport function getAccountBackgroundLoadingStatus(\n state: Pick<AssetsControllerState, 'assetsBackgroundLoadingStatus'>,\n accountId: AccountId,\n): AssetsLoadingStatus | undefined {\n return state.assetsBackgroundLoadingStatus?.[accountId];\n}\n\n/**\n * Check whether a background fetch for an account is currently in flight.\n *\n * @param state - AssetsController state slice.\n * @param accountId - The account id (`InternalAccount.id`).\n * @returns True while a background fetch for the account is in flight.\n */\nexport function isAccountBackgroundLoading(\n state: Pick<AssetsControllerState, 'assetsBackgroundLoadingStatus'>,\n accountId: AccountId,\n): boolean {\n return getAccountBackgroundLoadingStatus(state, accountId) === 'loading';\n}\n\n/**\n * Get the background loading statuses for every account in an account group.\n *\n * @param state - AssetsController state slice.\n * @param accountTreeState - AccountTreeController state slice.\n * @param groupId - The account group id.\n * @returns A record containing an entry for each account in the group that\n * has a background loading status, keyed by account id.\n */\nexport function getAccountGroupBackgroundLoadingStatus(\n state: Pick<AssetsControllerState, 'assetsBackgroundLoadingStatus'>,\n accountTreeState: AccountTreeControllerState,\n groupId: string,\n): Record<AccountId, AssetsLoadingStatus> {\n return collectGroupStatuses(\n state.assetsBackgroundLoadingStatus,\n accountTreeState,\n groupId,\n );\n}\n\n/**\n * Check whether any account in an account group has a background fetch in\n * flight.\n *\n * @param state - AssetsController state slice.\n * @param accountTreeState - AccountTreeController state slice.\n * @param groupId - The account group id.\n * @returns True while at least one account in the group is background\n * loading.\n */\nexport function isAccountGroupBackgroundLoading(\n state: Pick<AssetsControllerState, 'assetsBackgroundLoadingStatus'>,\n accountTreeState: AccountTreeControllerState,\n groupId: string,\n): boolean {\n return isAnyGroupAccountLoading(\n state.assetsBackgroundLoadingStatus,\n accountTreeState,\n groupId,\n );\n}\n\n/**\n * Check whether the selected account group has a background fetch in flight.\n *\n * @param state - AssetsController state slice.\n * @param accountTreeState - AccountTreeController state slice.\n * @returns True while any account in the selected account group is\n * background loading.\n */\nexport function getIsAssetsBackgroundLoadingForSelectedAccountGroup(\n state: Pick<AssetsControllerState, 'assetsBackgroundLoadingStatus'>,\n accountTreeState: AccountTreeControllerState,\n): boolean {\n return isSelectedGroupLoading(\n state.assetsBackgroundLoadingStatus,\n accountTreeState,\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"loading.js","sourceRoot":"","sources":["../../src/selectors/loading.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAErD;;;;;;;GAOG;AACH,MAAM,UAAU,uBAAuB,CACrC,KAAyD,EACzD,SAAoB;IAEpB,OAAO,KAAK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,CAAC,CAAC;AACjE,CAAC","sourcesContent":["import type { AccountTreeControllerState } from '@metamask/account-tree-controller';\n\nimport type { AssetsControllerState } from '../AssetsController.js';\nimport type { AccountId, AssetsLoadingStatus } from '../types.js';\nimport { getAccountIdsForGroup } from './balance.js';\n\n/**\n * Get the loading status for a single account.\n *\n * @param state - AssetsController state slice.\n * @param accountId - The account id (`InternalAccount.id`).\n * @returns `'loading'` while the account's assets are loading, `'loaded'`\n * after its fetch has settled, or `undefined` if no fetch was triggered.\n */\nexport function getAccountLoadingStatus(\n state: Pick<AssetsControllerState, 'assetsLoadingStatus'>,\n accountId: AccountId,\n): AssetsLoadingStatus | undefined {\n return state.assetsLoadingStatus?.[accountId];\n}\n\n/**\n * Check whether an account's assets are currently loading.\n *\n * @param state - AssetsController state slice.\n * @param accountId - The account id (`InternalAccount.id`).\n * @returns True while the account's assets are loading.\n */\nexport function isAccountLoading(\n state: Pick<AssetsControllerState, 'assetsLoadingStatus'>,\n accountId: AccountId,\n): boolean {\n return getAccountLoadingStatus(state, accountId) === 'loading';\n}\n\n/**\n * Get the loading statuses for every account in an account group.\n *\n * @param state - AssetsController state slice.\n * @param accountTreeState - AccountTreeController state slice.\n * @param groupId - The account group id.\n * @returns A record containing an entry for each account in the group that\n * has a loading status, keyed by account id.\n */\nexport function getAccountGroupLoadingStatus(\n state: Pick<AssetsControllerState, 'assetsLoadingStatus'>,\n accountTreeState: AccountTreeControllerState,\n groupId: string,\n): Record<AccountId, AssetsLoadingStatus> {\n const loadingStatus = state.assetsLoadingStatus;\n const result: Record<AccountId, AssetsLoadingStatus> = {};\n for (const accountId of getAccountIdsForGroup(accountTreeState, groupId)) {\n const status = loadingStatus?.[accountId];\n if (status !== undefined) {\n result[accountId] = status;\n }\n }\n return result;\n}\n\n/**\n * Check whether any account in an account group is currently loading.\n *\n * @param state - AssetsController state slice.\n * @param accountTreeState - AccountTreeController state slice.\n * @param groupId - The account group id.\n * @returns True while at least one account in the group is loading.\n */\nexport function isAccountGroupLoading(\n state: Pick<AssetsControllerState, 'assetsLoadingStatus'>,\n accountTreeState: AccountTreeControllerState,\n groupId: string,\n): boolean {\n const loadingStatus = state.assetsLoadingStatus;\n return getAccountIdsForGroup(accountTreeState, groupId).some(\n (accountId) => loadingStatus?.[accountId] === 'loading',\n );\n}\n\n/**\n * Check whether the selected account group is currently loading its assets.\n *\n * @param state - AssetsController state slice.\n * @param accountTreeState - AccountTreeController state slice.\n * @returns True while any account in the selected account group is loading.\n */\nexport function getIsAssetsLoadingForSelectedAccountGroup(\n state: Pick<AssetsControllerState, 'assetsLoadingStatus'>,\n accountTreeState: AccountTreeControllerState,\n): boolean {\n const groupId = accountTreeState.selectedAccountGroup;\n if (!groupId) {\n return false;\n }\n return isAccountGroupLoading(state, accountTreeState, groupId);\n}\n"]}
|
|
@@ -1,15 +1,4 @@
|
|
|
1
1
|
import type { InternalAccount } from '@metamask/keyring-internal-api';
|
|
2
|
-
import type { AssetsControllerState } from './AssetsController.js';
|
|
3
|
-
type AssetsLoadingStatusKey = 'assetsLoadingStatus' | 'assetsBackgroundLoadingStatus';
|
|
4
|
-
type AssetsLoadingState = Pick<AssetsControllerState, AssetsLoadingStatusKey>;
|
|
5
|
-
/**
|
|
6
|
-
* The controller surface the loading tracker needs. `update` is spelled out
|
|
7
|
-
* here because it is protected on the controller and so cannot be picked.
|
|
8
|
-
*/
|
|
9
|
-
export type AssetsLoadingStateUpdater = {
|
|
10
|
-
state: AssetsLoadingState;
|
|
11
|
-
update: (callback: (state: AssetsLoadingState) => void) => void;
|
|
12
|
-
};
|
|
13
2
|
/**
|
|
14
3
|
* Method decorator that tracks a per-account first-load status around the
|
|
15
4
|
* decorated fetch method: accounts whose assets have never been fetched are
|
|
@@ -26,18 +15,4 @@ export type AssetsLoadingStateUpdater = {
|
|
|
26
15
|
export declare function trackAssetsLoading<This, Args extends [InternalAccount[], {
|
|
27
16
|
forceUpdate?: boolean;
|
|
28
17
|
}?, ...unknown[]], Return>(target: (this: This, ...args: Args) => Promise<Return>, _context: ClassMethodDecoratorContext<This, (this: This, ...args: Args) => Promise<Return>>): (this: This, ...args: Args) => Promise<Return>;
|
|
29
|
-
/**
|
|
30
|
-
* Track the per-account background loading status around a background fetch.
|
|
31
|
-
* Unlike {@link trackAssetsLoading}, every call is tracked: the accounts are
|
|
32
|
-
* marked `'loading'` before the fetch starts and settle to `'loaded'` once
|
|
33
|
-
* every overlapping background fetch for that account has completed, whether
|
|
34
|
-
* it succeeded or failed.
|
|
35
|
-
*
|
|
36
|
-
* @param controller - The controller whose state should be updated.
|
|
37
|
-
* @param accounts - The accounts the background fetch covers.
|
|
38
|
-
* @param runFetch - Starts the background fetch.
|
|
39
|
-
* @returns The result of the background fetch.
|
|
40
|
-
*/
|
|
41
|
-
export declare function trackBackgroundAssetsLoading<Result>(controller: AssetsLoadingStateUpdater, accounts: InternalAccount[], runFetch: () => Promise<Result>): Promise<Result>;
|
|
42
|
-
export {};
|
|
43
18
|
//# sourceMappingURL=trackAssetsLoading.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trackAssetsLoading.d.ts","sourceRoot":"","sources":["../src/trackAssetsLoading.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"trackAssetsLoading.d.ts","sourceRoot":"","sources":["../src/trackAssetsLoading.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAwCtE;;;;;;;;;;;;GAYG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EACJ,IAAI,SAAS,CAAC,eAAe,EAAE,EAAE;IAAE,WAAW,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC,EAAE,GAAG,OAAO,EAAE,CAAC,EAC1E,MAAM,EAEN,MAAM,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,MAAM,CAAC,EACtD,QAAQ,EAAE,2BAA2B,CACnC,IAAI,EACJ,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,MAAM,CAAC,CAC/C,GACA,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,MAAM,CAAC,CAkBhD"}
|
|
@@ -1,33 +1,20 @@
|
|
|
1
|
-
import { createModuleLogger, projectLogger } from './logger.js';
|
|
2
|
-
const log = createModuleLogger(projectLogger, 'trackAssetsLoading');
|
|
3
|
-
/**
|
|
4
|
-
* In-flight background fetch counts per account, keyed by controller, so an
|
|
5
|
-
* account only settles once every overlapping background fetch has finished.
|
|
6
|
-
*/
|
|
7
|
-
const inFlightBackgroundFetches = new WeakMap();
|
|
8
1
|
/**
|
|
9
2
|
* Set the loading status of the given accounts.
|
|
10
3
|
*
|
|
11
4
|
* @param controller - The controller whose state should be updated.
|
|
12
|
-
* @param key - The loading status state property to update.
|
|
13
5
|
* @param accounts - The accounts to set the status for.
|
|
14
6
|
* @param status - The loading status to set.
|
|
15
7
|
*/
|
|
16
|
-
function setAssetsLoadingStatus(controller,
|
|
8
|
+
function setAssetsLoadingStatus(controller, accounts, status) {
|
|
17
9
|
if (accounts.length === 0) {
|
|
18
10
|
return;
|
|
19
11
|
}
|
|
20
12
|
controller.update((state) => {
|
|
21
|
-
state
|
|
13
|
+
state.assetsLoadingStatus ??= {};
|
|
22
14
|
for (const account of accounts) {
|
|
23
|
-
state[
|
|
15
|
+
state.assetsLoadingStatus[account.id] = status;
|
|
24
16
|
}
|
|
25
17
|
});
|
|
26
|
-
log(`${key} updated`, {
|
|
27
|
-
status,
|
|
28
|
-
accountIds: accounts.map((account) => account.id),
|
|
29
|
-
[key]: controller.state[key],
|
|
30
|
-
});
|
|
31
18
|
}
|
|
32
19
|
/**
|
|
33
20
|
* Method decorator that tracks a per-account first-load status around the
|
|
@@ -49,66 +36,14 @@ export function trackAssetsLoading(target, _context) {
|
|
|
49
36
|
return target.call(this, ...args);
|
|
50
37
|
}
|
|
51
38
|
const controller = this;
|
|
52
|
-
const firstLoadAccounts = [];
|
|
53
|
-
|
|
54
|
-
for (const account of accounts) {
|
|
55
|
-
if (controller.state.assetsLoadingStatus?.[account.id] === undefined) {
|
|
56
|
-
firstLoadAccounts.push(account);
|
|
57
|
-
}
|
|
58
|
-
else {
|
|
59
|
-
settledAccountIds.push(account.id);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
if (settledAccountIds.length > 0) {
|
|
63
|
-
log('Skipping assetsLoadingStatus for settled accounts', {
|
|
64
|
-
accountIds: settledAccountIds,
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
setAssetsLoadingStatus(controller, 'assetsLoadingStatus', firstLoadAccounts, 'loading');
|
|
39
|
+
const firstLoadAccounts = accounts.filter((account) => controller.state.assetsLoadingStatus?.[account.id] === undefined);
|
|
40
|
+
setAssetsLoadingStatus(controller, firstLoadAccounts, 'loading');
|
|
68
41
|
try {
|
|
69
42
|
return await target.call(this, ...args);
|
|
70
43
|
}
|
|
71
44
|
finally {
|
|
72
|
-
setAssetsLoadingStatus(controller,
|
|
45
|
+
setAssetsLoadingStatus(controller, firstLoadAccounts, 'loaded');
|
|
73
46
|
}
|
|
74
47
|
};
|
|
75
48
|
}
|
|
76
|
-
/**
|
|
77
|
-
* Track the per-account background loading status around a background fetch.
|
|
78
|
-
* Unlike {@link trackAssetsLoading}, every call is tracked: the accounts are
|
|
79
|
-
* marked `'loading'` before the fetch starts and settle to `'loaded'` once
|
|
80
|
-
* every overlapping background fetch for that account has completed, whether
|
|
81
|
-
* it succeeded or failed.
|
|
82
|
-
*
|
|
83
|
-
* @param controller - The controller whose state should be updated.
|
|
84
|
-
* @param accounts - The accounts the background fetch covers.
|
|
85
|
-
* @param runFetch - Starts the background fetch.
|
|
86
|
-
* @returns The result of the background fetch.
|
|
87
|
-
*/
|
|
88
|
-
export async function trackBackgroundAssetsLoading(controller, accounts, runFetch) {
|
|
89
|
-
let counts = inFlightBackgroundFetches.get(controller);
|
|
90
|
-
if (!counts) {
|
|
91
|
-
counts = new Map();
|
|
92
|
-
inFlightBackgroundFetches.set(controller, counts);
|
|
93
|
-
}
|
|
94
|
-
for (const account of accounts) {
|
|
95
|
-
counts.set(account.id, (counts.get(account.id) ?? 0) + 1);
|
|
96
|
-
}
|
|
97
|
-
setAssetsLoadingStatus(controller, 'assetsBackgroundLoadingStatus', accounts, 'loading');
|
|
98
|
-
try {
|
|
99
|
-
return await runFetch();
|
|
100
|
-
}
|
|
101
|
-
finally {
|
|
102
|
-
const settledAccounts = accounts.filter((account) => {
|
|
103
|
-
const remaining = (counts.get(account.id) ?? 1) - 1;
|
|
104
|
-
if (remaining > 0) {
|
|
105
|
-
counts.set(account.id, remaining);
|
|
106
|
-
return false;
|
|
107
|
-
}
|
|
108
|
-
counts.delete(account.id);
|
|
109
|
-
return true;
|
|
110
|
-
});
|
|
111
|
-
setAssetsLoadingStatus(controller, 'assetsBackgroundLoadingStatus', settledAccounts, 'loaded');
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
49
|
//# sourceMappingURL=trackAssetsLoading.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trackAssetsLoading.js","sourceRoot":"","sources":["../src/trackAssetsLoading.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"trackAssetsLoading.js","sourceRoot":"","sources":["../src/trackAssetsLoading.ts"],"names":[],"mappings":"AAiBA;;;;;;GAMG;AACH,SAAS,sBAAsB,CAC7B,UAAqC,EACrC,QAA2B,EAC3B,MAA2B;IAE3B,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC1B,OAAO;IACT,CAAC;IACD,UAAU,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE;QAC1B,KAAK,CAAC,mBAAmB,KAAK,EAAE,CAAC;QACjC,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;YAC/B,KAAK,CAAC,mBAAmB,CAAC,OAAO,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC;QACjD,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,kBAAkB,CAKhC,MAAsD,EACtD,QAGC;IAED,OAAO,KAAK,WAAuB,GAAG,IAAU;QAC9C,MAAM,CAAC,QAAQ,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;QACjC,IAAI,OAAO,EAAE,WAAW,KAAK,IAAI,EAAE,CAAC;YAClC,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,CAAC;QACpC,CAAC;QACD,MAAM,UAAU,GAAG,IAA4C,CAAC;QAChE,MAAM,iBAAiB,GAAG,QAAQ,CAAC,MAAM,CACvC,CAAC,OAAO,EAAE,EAAE,CACV,UAAU,CAAC,KAAK,CAAC,mBAAmB,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,KAAK,SAAS,CACnE,CAAC;QACF,sBAAsB,CAAC,UAAU,EAAE,iBAAiB,EAAE,SAAS,CAAC,CAAC;QACjE,IAAI,CAAC;YACH,OAAO,MAAM,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,CAAC;QAC1C,CAAC;gBAAS,CAAC;YACT,sBAAsB,CAAC,UAAU,EAAE,iBAAiB,EAAE,QAAQ,CAAC,CAAC;QAClE,CAAC;IACH,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import type { InternalAccount } from '@metamask/keyring-internal-api';\n\nimport type { AssetsController } from './AssetsController.js';\nimport type { AccountId, AssetsLoadingStatus } from './types.js';\n\n/**\n * The controller surface the loading tracker needs. `update` is spelled out\n * here because it is protected on the controller and so cannot be picked.\n */\ntype AssetsLoadingStateUpdater = Pick<AssetsController, 'state'> & {\n update: (\n callback: (state: {\n assetsLoadingStatus?: Record<AccountId, AssetsLoadingStatus>;\n }) => void,\n ) => void;\n};\n\n/**\n * Set the loading status of the given accounts.\n *\n * @param controller - The controller whose state should be updated.\n * @param accounts - The accounts to set the status for.\n * @param status - The loading status to set.\n */\nfunction setAssetsLoadingStatus(\n controller: AssetsLoadingStateUpdater,\n accounts: InternalAccount[],\n status: AssetsLoadingStatus,\n): void {\n if (accounts.length === 0) {\n return;\n }\n controller.update((state) => {\n state.assetsLoadingStatus ??= {};\n for (const account of accounts) {\n state.assetsLoadingStatus[account.id] = status;\n }\n });\n}\n\n/**\n * Method decorator that tracks a per-account first-load status around the\n * decorated fetch method: accounts whose assets have never been fetched are\n * marked `'loading'` when the method is invoked and settle to `'loaded'` once\n * it completes, whether it succeeded or failed. Accounts that already\n * settled are never re-marked, so later refreshes (network switches, unlocks,\n * direct calls, and so on) do not re-toggle the status. Calls that do not\n * force an update are cache reads and are not tracked.\n *\n * @param target - The decorated fetch method.\n * @param _context - The decorator context.\n * @returns The wrapped fetch method.\n */\nexport function trackAssetsLoading<\n This,\n Args extends [InternalAccount[], { forceUpdate?: boolean }?, ...unknown[]],\n Return,\n>(\n target: (this: This, ...args: Args) => Promise<Return>,\n _context: ClassMethodDecoratorContext<\n This,\n (this: This, ...args: Args) => Promise<Return>\n >,\n): (this: This, ...args: Args) => Promise<Return> {\n return async function (this: This, ...args: Args): Promise<Return> {\n const [accounts, options] = args;\n if (options?.forceUpdate !== true) {\n return target.call(this, ...args);\n }\n const controller = this as unknown as AssetsLoadingStateUpdater;\n const firstLoadAccounts = accounts.filter(\n (account) =>\n controller.state.assetsLoadingStatus?.[account.id] === undefined,\n );\n setAssetsLoadingStatus(controller, firstLoadAccounts, 'loading');\n try {\n return await target.call(this, ...args);\n } finally {\n setAssetsLoadingStatus(controller, firstLoadAccounts, 'loaded');\n }\n };\n}\n"]}
|
package/dist/types.d.ts
CHANGED
|
@@ -423,11 +423,6 @@ export type AssetsControllerState = {
|
|
|
423
423
|
/** Currently-active ISO 4217 currency code */
|
|
424
424
|
selectedCurrency: SupportedCurrency;
|
|
425
425
|
assetsLoadingStatus?: Record<AccountId, AssetsLoadingStatus>;
|
|
426
|
-
/**
|
|
427
|
-
* Per-account status of the background (Snap + RPC) fetch that runs after
|
|
428
|
-
* the initial balance has resolved. Tracked on every forced fetch.
|
|
429
|
-
*/
|
|
430
|
-
assetsBackgroundLoadingStatus?: Record<AccountId, AssetsLoadingStatus>;
|
|
431
426
|
};
|
|
432
427
|
/**
|
|
433
428
|
* Base context for all middleware operations.
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACtE,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAExE;;;;;;;;;GASG;AACH,MAAM,MAAM,aAAa,GAAG,aAAa,CAAC;AAE1C;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC;AAE/B;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG,WAAW,CAAC;AAMlC;;;;GAIG;AACH,MAAM,MAAM,SAAS,GAAG,UAAU,GAAG,KAAK,GAAG,aAAa,CAAC;AAE3D;;GAEG;AACH,MAAM,MAAM,aAAa,GACrB,QAAQ,GACR,OAAO,GACP,QAAQ,GACR,SAAS,GACT,KAAK,GACL,MAAM,CAAC;AAMX;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,+CAA+C;IAC/C,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,8DAA8D;IAC9D,IAAI,EAAE,aAAa,CAAC;IACpB,2CAA2C;IAC3C,MAAM,EAAE,MAAM,CA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