@metamask/assets-controllers 100.2.1 → 101.0.1
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 +65 -1
- package/dist/AccountTrackerController-method-action-types.cjs +7 -0
- package/dist/AccountTrackerController-method-action-types.cjs.map +1 -0
- package/dist/AccountTrackerController-method-action-types.d.cts +32 -0
- package/dist/AccountTrackerController-method-action-types.d.cts.map +1 -0
- package/dist/AccountTrackerController-method-action-types.d.mts +32 -0
- package/dist/AccountTrackerController-method-action-types.d.mts.map +1 -0
- package/dist/AccountTrackerController-method-action-types.mjs +6 -0
- package/dist/AccountTrackerController-method-action-types.mjs.map +1 -0
- package/dist/AccountTrackerController.cjs +6 -5
- package/dist/AccountTrackerController.cjs.map +1 -1
- package/dist/AccountTrackerController.d.cts +2 -15
- package/dist/AccountTrackerController.d.cts.map +1 -1
- package/dist/AccountTrackerController.d.mts +2 -15
- package/dist/AccountTrackerController.d.mts.map +1 -1
- package/dist/AccountTrackerController.mjs +6 -5
- package/dist/AccountTrackerController.mjs.map +1 -1
- package/dist/AssetsContractController-method-action-types.cjs +7 -0
- package/dist/AssetsContractController-method-action-types.cjs.map +1 -0
- package/dist/AssetsContractController-method-action-types.d.cts +210 -0
- package/dist/AssetsContractController-method-action-types.d.cts.map +1 -0
- package/dist/AssetsContractController-method-action-types.d.mts +210 -0
- package/dist/AssetsContractController-method-action-types.d.mts.map +1 -0
- package/dist/AssetsContractController-method-action-types.mjs +6 -0
- package/dist/AssetsContractController-method-action-types.mjs.map +1 -0
- package/dist/AssetsContractController.cjs +22 -22
- package/dist/AssetsContractController.cjs.map +1 -1
- package/dist/AssetsContractController.d.cts +3 -35
- package/dist/AssetsContractController.d.cts.map +1 -1
- package/dist/AssetsContractController.d.mts +3 -35
- package/dist/AssetsContractController.d.mts.map +1 -1
- package/dist/AssetsContractController.mjs +22 -22
- package/dist/AssetsContractController.mjs.map +1 -1
- package/dist/MultichainAssetsController/MultichainAssetsController-method-action-types.cjs +7 -0
- package/dist/MultichainAssetsController/MultichainAssetsController-method-action-types.cjs.map +1 -0
- package/dist/MultichainAssetsController/MultichainAssetsController-method-action-types.d.cts +43 -0
- package/dist/MultichainAssetsController/MultichainAssetsController-method-action-types.d.cts.map +1 -0
- package/dist/MultichainAssetsController/MultichainAssetsController-method-action-types.d.mts +43 -0
- package/dist/MultichainAssetsController/MultichainAssetsController-method-action-types.d.mts.map +1 -0
- package/dist/MultichainAssetsController/MultichainAssetsController-method-action-types.mjs +6 -0
- package/dist/MultichainAssetsController/MultichainAssetsController-method-action-types.mjs.map +1 -0
- package/dist/MultichainAssetsController/MultichainAssetsController.cjs +7 -6
- package/dist/MultichainAssetsController/MultichainAssetsController.cjs.map +1 -1
- package/dist/MultichainAssetsController/MultichainAssetsController.d.cts +2 -13
- package/dist/MultichainAssetsController/MultichainAssetsController.d.cts.map +1 -1
- package/dist/MultichainAssetsController/MultichainAssetsController.d.mts +2 -13
- package/dist/MultichainAssetsController/MultichainAssetsController.d.mts.map +1 -1
- package/dist/MultichainAssetsController/MultichainAssetsController.mjs +7 -6
- package/dist/MultichainAssetsController/MultichainAssetsController.mjs.map +1 -1
- package/dist/MultichainAssetsController/index.cjs.map +1 -1
- package/dist/MultichainAssetsController/index.d.cts +1 -0
- package/dist/MultichainAssetsController/index.d.cts.map +1 -1
- package/dist/MultichainAssetsController/index.d.mts +1 -0
- package/dist/MultichainAssetsController/index.d.mts.map +1 -1
- package/dist/MultichainAssetsController/index.mjs.map +1 -1
- package/dist/MultichainAssetsRatesController/MultichainAssetsRatesController-method-action-types.cjs +7 -0
- package/dist/MultichainAssetsRatesController/MultichainAssetsRatesController-method-action-types.cjs.map +1 -0
- package/dist/MultichainAssetsRatesController/MultichainAssetsRatesController-method-action-types.d.cts +30 -0
- package/dist/MultichainAssetsRatesController/MultichainAssetsRatesController-method-action-types.d.cts.map +1 -0
- package/dist/MultichainAssetsRatesController/MultichainAssetsRatesController-method-action-types.d.mts +30 -0
- package/dist/MultichainAssetsRatesController/MultichainAssetsRatesController-method-action-types.d.mts.map +1 -0
- package/dist/MultichainAssetsRatesController/MultichainAssetsRatesController-method-action-types.mjs +6 -0
- package/dist/MultichainAssetsRatesController/MultichainAssetsRatesController-method-action-types.mjs.map +1 -0
- package/dist/MultichainAssetsRatesController/MultichainAssetsRatesController.cjs +5 -0
- package/dist/MultichainAssetsRatesController/MultichainAssetsRatesController.cjs.map +1 -1
- package/dist/MultichainAssetsRatesController/MultichainAssetsRatesController.d.cts +2 -8
- package/dist/MultichainAssetsRatesController/MultichainAssetsRatesController.d.cts.map +1 -1
- package/dist/MultichainAssetsRatesController/MultichainAssetsRatesController.d.mts +2 -8
- package/dist/MultichainAssetsRatesController/MultichainAssetsRatesController.d.mts.map +1 -1
- package/dist/MultichainAssetsRatesController/MultichainAssetsRatesController.mjs +5 -0
- package/dist/MultichainAssetsRatesController/MultichainAssetsRatesController.mjs.map +1 -1
- package/dist/MultichainAssetsRatesController/index.cjs.map +1 -1
- package/dist/MultichainAssetsRatesController/index.d.cts +1 -0
- package/dist/MultichainAssetsRatesController/index.d.cts.map +1 -1
- package/dist/MultichainAssetsRatesController/index.d.mts +1 -0
- package/dist/MultichainAssetsRatesController/index.d.mts.map +1 -1
- package/dist/MultichainAssetsRatesController/index.mjs.map +1 -1
- package/dist/NftController.cjs.map +1 -1
- package/dist/NftController.d.cts +3 -3
- package/dist/NftController.d.cts.map +1 -1
- package/dist/NftController.d.mts +3 -3
- package/dist/NftController.d.mts.map +1 -1
- package/dist/NftController.mjs.map +1 -1
- package/dist/NftDetectionController.cjs +11 -18
- package/dist/NftDetectionController.cjs.map +1 -1
- package/dist/NftDetectionController.d.cts +3 -3
- package/dist/NftDetectionController.d.cts.map +1 -1
- package/dist/NftDetectionController.d.mts +3 -3
- package/dist/NftDetectionController.d.mts.map +1 -1
- package/dist/NftDetectionController.mjs +11 -18
- package/dist/NftDetectionController.mjs.map +1 -1
- package/dist/TokenBalancesController-method-action-types.cjs +7 -0
- package/dist/TokenBalancesController-method-action-types.cjs.map +1 -0
- package/dist/TokenBalancesController-method-action-types.d.cts +18 -0
- package/dist/TokenBalancesController-method-action-types.d.cts.map +1 -0
- package/dist/TokenBalancesController-method-action-types.d.mts +18 -0
- package/dist/TokenBalancesController-method-action-types.d.mts.map +1 -0
- package/dist/TokenBalancesController-method-action-types.mjs +6 -0
- package/dist/TokenBalancesController-method-action-types.mjs.map +1 -0
- package/dist/TokenBalancesController.cjs +30 -19
- package/dist/TokenBalancesController.cjs.map +1 -1
- package/dist/TokenBalancesController.d.cts +6 -12
- package/dist/TokenBalancesController.d.cts.map +1 -1
- package/dist/TokenBalancesController.d.mts +6 -12
- package/dist/TokenBalancesController.d.mts.map +1 -1
- package/dist/TokenBalancesController.mjs +30 -19
- package/dist/TokenBalancesController.mjs.map +1 -1
- package/dist/TokenDetectionController-method-action-types.cjs +7 -0
- package/dist/TokenDetectionController-method-action-types.cjs.map +1 -0
- package/dist/TokenDetectionController-method-action-types.d.cts +89 -0
- package/dist/TokenDetectionController-method-action-types.d.cts.map +1 -0
- package/dist/TokenDetectionController-method-action-types.d.mts +89 -0
- package/dist/TokenDetectionController-method-action-types.d.mts.map +1 -0
- package/dist/TokenDetectionController-method-action-types.mjs +6 -0
- package/dist/TokenDetectionController-method-action-types.mjs.map +1 -0
- package/dist/TokenDetectionController.cjs +10 -3
- package/dist/TokenDetectionController.cjs.map +1 -1
- package/dist/TokenDetectionController.d.cts +4 -14
- package/dist/TokenDetectionController.d.cts.map +1 -1
- package/dist/TokenDetectionController.d.mts +4 -14
- package/dist/TokenDetectionController.d.mts.map +1 -1
- package/dist/TokenDetectionController.mjs +10 -3
- package/dist/TokenDetectionController.mjs.map +1 -1
- package/dist/TokensController-method-action-types.cjs +7 -0
- package/dist/TokensController-method-action-types.cjs.map +1 -0
- package/dist/TokensController-method-action-types.d.cts +104 -0
- package/dist/TokensController-method-action-types.d.cts.map +1 -0
- package/dist/TokensController-method-action-types.d.mts +104 -0
- package/dist/TokensController-method-action-types.d.mts.map +1 -0
- package/dist/TokensController-method-action-types.mjs +6 -0
- package/dist/TokensController-method-action-types.mjs.map +1 -0
- package/dist/TokensController.cjs +11 -2
- package/dist/TokensController.cjs.map +1 -1
- package/dist/TokensController.d.cts +5 -22
- package/dist/TokensController.d.cts.map +1 -1
- package/dist/TokensController.d.mts +5 -22
- package/dist/TokensController.d.mts.map +1 -1
- package/dist/TokensController.mjs +11 -2
- package/dist/TokensController.mjs.map +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -4
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +11 -4
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/multicall.cjs +2 -0
- package/dist/multicall.cjs.map +1 -1
- package/dist/multicall.d.cts.map +1 -1
- package/dist/multicall.d.mts.map +1 -1
- package/dist/multicall.mjs +2 -0
- package/dist/multicall.mjs.map +1 -1
- package/dist/selectors/token-selectors.cjs +3 -0
- package/dist/selectors/token-selectors.cjs.map +1 -1
- package/dist/selectors/token-selectors.d.cts +3 -0
- package/dist/selectors/token-selectors.d.cts.map +1 -1
- package/dist/selectors/token-selectors.d.mts +3 -0
- package/dist/selectors/token-selectors.d.mts.map +1 -1
- package/dist/selectors/token-selectors.mjs +3 -0
- package/dist/selectors/token-selectors.mjs.map +1 -1
- package/dist/token-prices-service/codefi-v2.cjs +2 -0
- package/dist/token-prices-service/codefi-v2.cjs.map +1 -1
- package/dist/token-prices-service/codefi-v2.d.cts +2 -1
- package/dist/token-prices-service/codefi-v2.d.cts.map +1 -1
- package/dist/token-prices-service/codefi-v2.d.mts +2 -1
- package/dist/token-prices-service/codefi-v2.d.mts.map +1 -1
- package/dist/token-prices-service/codefi-v2.mjs +2 -0
- package/dist/token-prices-service/codefi-v2.mjs.map +1 -1
- package/package.json +11 -7
|
@@ -9,7 +9,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
9
9
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
10
10
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
11
|
};
|
|
12
|
-
var _AccountTrackerController_instances, _AccountTrackerController_refreshMutex, _AccountTrackerController_includeStakedAssets, _AccountTrackerController_accountsApiChainIds, _AccountTrackerController_getStakedBalanceForChain, _AccountTrackerController_balanceFetchers, _AccountTrackerController_fetchingEnabled, _AccountTrackerController_isOnboarded, _AccountTrackerController_isHomepageSectionsV1Enabled, _AccountTrackerController_isLocked, _AccountTrackerController_syncAccounts, _AccountTrackerController_getProvider, _AccountTrackerController_getNetworkClient, _AccountTrackerController_createAccountsApiFetcher, _AccountTrackerController_getCorrectNetworkClient, _AccountTrackerController_getNetworkClientIds, _AccountTrackerController_refreshAccounts
|
|
12
|
+
var _AccountTrackerController_instances, _AccountTrackerController_refreshMutex, _AccountTrackerController_includeStakedAssets, _AccountTrackerController_accountsApiChainIds, _AccountTrackerController_getStakedBalanceForChain, _AccountTrackerController_balanceFetchers, _AccountTrackerController_fetchingEnabled, _AccountTrackerController_isOnboarded, _AccountTrackerController_isHomepageSectionsV1Enabled, _AccountTrackerController_isLocked, _AccountTrackerController_syncAccounts, _AccountTrackerController_getProvider, _AccountTrackerController_getNetworkClient, _AccountTrackerController_createAccountsApiFetcher, _AccountTrackerController_getCorrectNetworkClient, _AccountTrackerController_getNetworkClientIds, _AccountTrackerController_refreshAccounts;
|
|
13
13
|
function $importDefault(module) {
|
|
14
14
|
if (module?.__esModule) {
|
|
15
15
|
return module.default;
|
|
@@ -75,6 +75,10 @@ const accountTrackerMetadata = {
|
|
|
75
75
|
usedInUi: true,
|
|
76
76
|
},
|
|
77
77
|
};
|
|
78
|
+
const MESSENGER_EXPOSED_METHODS = [
|
|
79
|
+
'updateNativeBalances',
|
|
80
|
+
'updateStakedBalances',
|
|
81
|
+
];
|
|
78
82
|
/**
|
|
79
83
|
* Controller that tracks the network balances for all user accounts.
|
|
80
84
|
*/
|
|
@@ -213,7 +217,7 @@ export class AccountTrackerController extends StaticIntervalPollingController()
|
|
|
213
217
|
// Silently handle refresh errors
|
|
214
218
|
});
|
|
215
219
|
});
|
|
216
|
-
|
|
220
|
+
messenger.registerMethodActionHandlers(this, MESSENGER_EXPOSED_METHODS);
|
|
217
221
|
}
|
|
218
222
|
/**
|
|
219
223
|
* Whether the controller is active (keyring is unlocked and user is onboarded).
|
|
@@ -582,9 +586,6 @@ _AccountTrackerController_refreshMutex = new WeakMap(), _AccountTrackerControlle
|
|
|
582
586
|
finally {
|
|
583
587
|
releaseLock();
|
|
584
588
|
}
|
|
585
|
-
}, _AccountTrackerController_registerMessageHandlers = function _AccountTrackerController_registerMessageHandlers() {
|
|
586
|
-
this.messenger.registerActionHandler(`${controllerName}:updateNativeBalances`, this.updateNativeBalances.bind(this));
|
|
587
|
-
this.messenger.registerActionHandler(`${controllerName}:updateStakedBalances`, this.updateStakedBalances.bind(this));
|
|
588
589
|
};
|
|
589
590
|
export default AccountTrackerController;
|
|
590
591
|
//# sourceMappingURL=AccountTrackerController.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccountTrackerController.mjs","sourceRoot":"","sources":["../src/AccountTrackerController.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,YAAY,EAAE,iCAAiC;AAWxD,OAAO,EACL,KAAK,EACL,wBAAwB,EACxB,oBAAoB,EACrB,mCAAmC;AACpC,OAAO,SAAQ,4BAA4B;;AAmB3C,OAAO,EAAE,+BAA+B,EAAE,qCAAqC;AAM/E,OAAO,EAAE,MAAM,EAAE,kBAAkB,EAAE,wBAAwB;AAE7D,OAAO,EAAE,KAAK,EAAE,oBAAoB;;;AAGpC,OAAO,EAAE,mCAAmC,EAAE,uCAAmC;AAKjF,OAAO,EAAE,yBAAyB,EAAE,+DAA2D;AAM/F,OAA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AClC,GAAG,cAAc,uBAAgC,EACjD,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,IAAI,CAAC,CACrC,CAAC;AACJ,CAAC;AAGH,eAAe,wBAAwB,CAAC","sourcesContent":["import { Web3Provider } from '@ethersproject/providers';\nimport type {\n AccountsControllerSelectedEvmAccountChangeEvent,\n AccountsControllerGetSelectedAccountAction,\n AccountsControllerListAccountsAction,\n} from '@metamask/accounts-controller';\nimport type {\n ControllerStateChangeEvent,\n ControllerGetStateAction,\n StateMetadata,\n} from '@metamask/base-controller';\nimport {\n query,\n safelyExecuteWithTimeout,\n toChecksumHexAddress,\n} from '@metamask/controller-utils';\nimport EthQuery from '@metamask/eth-query';\nimport type {\n KeyringControllerGetStateAction,\n KeyringControllerLockEvent,\n KeyringControllerUnlockEvent,\n} from '@metamask/keyring-controller';\nimport type { InternalAccount } from '@metamask/keyring-internal-api';\nimport type { Messenger } from '@metamask/messenger';\nimport type {\n NetworkClient,\n NetworkClientId,\n NetworkControllerGetNetworkClientByIdAction,\n NetworkControllerGetStateAction,\n NetworkControllerNetworkAddedEvent,\n} from '@metamask/network-controller';\nimport type {\n NetworkEnablementControllerGetStateAction,\n NetworkEnablementControllerListPopularEvmNetworksAction,\n} from '@metamask/network-enablement-controller';\nimport { StaticIntervalPollingController } from '@metamask/polling-controller';\nimport type {\n TransactionControllerTransactionConfirmedEvent,\n TransactionControllerUnapprovedTransactionAddedEvent,\n TransactionMeta,\n} from '@metamask/transaction-controller';\nimport { assert, KnownCaipNamespace } from '@metamask/utils';\nimport type { Hex } from '@metamask/utils';\nimport { Mutex } from 'async-mutex';\nimport { cloneDeep, isEqual } from 'lodash';\n\nimport { STAKING_CONTRACT_ADDRESS_BY_CHAINID } from './AssetsContractController';\nimport type {\n AssetsContractController,\n StakedBalance,\n} from './AssetsContractController';\nimport { AccountsApiBalanceFetcher } from './multi-chain-accounts-service/api-balance-fetcher';\nimport type {\n BalanceFetcher,\n BalanceFetchResult,\n ProcessedBalance,\n} from './multi-chain-accounts-service/api-balance-fetcher';\nimport { RpcBalanceFetcher } from './rpc-service/rpc-balance-fetcher';\n\n/**\n * The name of the {@link AccountTrackerController}.\n */\nconst controllerName = 'AccountTrackerController';\n\nexport type ChainIdHex = Hex;\nexport type ChecksumAddress = Hex;\n\nconst ZERO_ADDRESS =\n '0x0000000000000000000000000000000000000000' as ChecksumAddress;\n\n/**\n * Creates an RPC balance fetcher configured for AccountTracker use case.\n * Returns only native balances and staked balances (no token balances).\n *\n * @param getProvider - Function to get Web3Provider for a given chain ID\n * @param getNetworkClient - Function to get NetworkClient for a given chain ID\n * @param includeStakedAssets - Whether to include staked assets in the fetch\n * @returns BalanceFetcher configured to fetch only native and optionally staked balances\n */\nfunction createAccountTrackerRpcBalanceFetcher(\n getProvider: (chainId: Hex) => Web3Provider,\n getNetworkClient: (chainId: Hex) => NetworkClient,\n includeStakedAssets: boolean,\n): BalanceFetcher {\n // Provide empty tokens state to ensure only native and staked balances are fetched\n const getEmptyTokensState = (): {\n allTokens: Record<string, never>;\n allDetectedTokens: Record<string, never>;\n } => ({\n allTokens: {},\n allDetectedTokens: {},\n });\n\n const rpcBalanceFetcher = new RpcBalanceFetcher(\n getProvider,\n getNetworkClient,\n getEmptyTokensState,\n );\n\n // Wrap the RpcBalanceFetcher to filter staked balances when not needed\n return {\n supports(_chainId: ChainIdHex): boolean {\n return rpcBalanceFetcher.supports();\n },\n\n async fetch(\n params: Parameters<BalanceFetcher['fetch']>[0],\n ): Promise<BalanceFetchResult> {\n const result = await rpcBalanceFetcher.fetch(params);\n\n if (!includeStakedAssets) {\n // Filter out staked balances from the results\n return {\n balances: result.balances.filter(\n (balance) => balance.token === ZERO_ADDRESS,\n ),\n unprocessedChainIds: result.unprocessedChainIds,\n };\n }\n\n return result;\n },\n };\n}\n\n/**\n * AccountInformation\n *\n * Account information object\n *\n * balance - Hex string of an account balance in wei\n *\n * stakedBalance - Hex string of an account staked balance in wei\n */\nexport type AccountInformation = {\n balance: string;\n stakedBalance?: string;\n};\n\n/**\n * AccountTrackerControllerState\n *\n * Account tracker controller state\n *\n * accountsByChainId - Map of addresses to account information by chain\n */\nexport type AccountTrackerControllerState = {\n accountsByChainId: Record<string, { [address: string]: AccountInformation }>;\n};\n\nconst accountTrackerMetadata: StateMetadata<AccountTrackerControllerState> = {\n accountsByChainId: {\n includeInStateLogs: false,\n persist: true,\n includeInDebugSnapshot: false,\n usedInUi: true,\n },\n};\n\n/**\n * The action that can be performed to get the state of the {@link AccountTrackerController}.\n */\nexport type AccountTrackerControllerGetStateAction = ControllerGetStateAction<\n typeof controllerName,\n AccountTrackerControllerState\n>;\n\n/**\n * The action that can be performed to update multiple native token balances in batch.\n */\nexport type AccountTrackerUpdateNativeBalancesAction = {\n type: `${typeof controllerName}:updateNativeBalances`;\n handler: AccountTrackerController['updateNativeBalances'];\n};\n\n/**\n * The action that can be performed to update multiple staked balances in batch.\n */\nexport type AccountTrackerUpdateStakedBalancesAction = {\n type: `${typeof controllerName}:updateStakedBalances`;\n handler: AccountTrackerController['updateStakedBalances'];\n};\n\n/**\n * The actions that can be performed using the {@link AccountTrackerController}.\n */\nexport type AccountTrackerControllerActions =\n | AccountTrackerControllerGetStateAction\n | AccountTrackerUpdateNativeBalancesAction\n | AccountTrackerUpdateStakedBalancesAction;\n\n/**\n * The messenger of the {@link AccountTrackerController} for communication.\n */\nexport type AllowedActions =\n | AccountsControllerListAccountsAction\n | {\n type: 'PreferencesController:getState';\n handler: () => { isMultiAccountBalancesEnabled: boolean };\n }\n | AccountsControllerGetSelectedAccountAction\n | NetworkControllerGetStateAction\n | NetworkControllerGetNetworkClientByIdAction\n | NetworkEnablementControllerGetStateAction\n | NetworkEnablementControllerListPopularEvmNetworksAction\n | KeyringControllerGetStateAction;\n\n/**\n * The event that {@link AccountTrackerController} can emit.\n */\nexport type AccountTrackerControllerStateChangeEvent =\n ControllerStateChangeEvent<\n typeof controllerName,\n AccountTrackerControllerState\n >;\n\n/**\n * The events that {@link AccountTrackerController} can emit.\n */\nexport type AccountTrackerControllerEvents =\n AccountTrackerControllerStateChangeEvent;\n\n/**\n * The external events available to the {@link AccountTrackerController}.\n */\nexport type AllowedEvents =\n | AccountsControllerSelectedEvmAccountChangeEvent\n | TransactionControllerUnapprovedTransactionAddedEvent\n | TransactionControllerTransactionConfirmedEvent\n | NetworkControllerNetworkAddedEvent\n | KeyringControllerLockEvent\n | KeyringControllerUnlockEvent;\n\n/**\n * The messenger of the {@link AccountTrackerController}.\n */\nexport type AccountTrackerControllerMessenger = Messenger<\n typeof controllerName,\n AccountTrackerControllerActions | AllowedActions,\n AccountTrackerControllerEvents | AllowedEvents\n>;\n\n/** The input to start polling for the {@link AccountTrackerController} */\ntype AccountTrackerPollingInput = {\n networkClientIds: NetworkClientId[];\n queryAllAccounts?: boolean;\n};\n\n/**\n * Controller that tracks the network balances for all user accounts.\n */\nexport class AccountTrackerController extends StaticIntervalPollingController<AccountTrackerPollingInput>()<\n typeof controllerName,\n AccountTrackerControllerState,\n AccountTrackerControllerMessenger\n> {\n readonly #refreshMutex = new Mutex();\n\n readonly #includeStakedAssets: boolean;\n\n readonly #accountsApiChainIds: () => ChainIdHex[];\n\n readonly #getStakedBalanceForChain: AssetsContractController['getStakedBalanceForChain'];\n\n readonly #balanceFetchers: BalanceFetcher[];\n\n readonly #fetchingEnabled: () => boolean;\n\n readonly #isOnboarded: () => boolean;\n\n readonly #isHomepageSectionsV1Enabled: () => boolean;\n\n /** Track if the keyring is locked */\n #isLocked = true;\n\n /**\n * Creates an AccountTracker instance.\n *\n * @param options - The controller options.\n * @param options.interval - Polling interval used to fetch new account balances.\n * @param options.state - Initial state to set on this controller.\n * @param options.messenger - The controller messenger.\n * @param options.getStakedBalanceForChain - The function to get the staked native asset balance for a chain.\n * @param options.includeStakedAssets - Whether to include staked assets in the account balances.\n * @param options.accountsApiChainIds - Function that returns array of chainIds that should use Accounts-API strategy (if supported by API).\n * @param options.allowExternalServices - Disable external HTTP calls (privacy / offline mode).\n * @param options.fetchingEnabled - Function that returns whether the controller is fetching enabled.\n * @param options.isOnboarded - Whether the user has completed onboarding. If false, balance updates are skipped.\n * @param options.isHomepageSectionsV1Enabled - Whether the homepage sections v1 is enabled.\n */\n constructor({\n interval = 10000,\n state,\n messenger,\n getStakedBalanceForChain,\n includeStakedAssets = false,\n accountsApiChainIds = (): ChainIdHex[] => [],\n allowExternalServices = (): boolean => true,\n fetchingEnabled = (): boolean => true,\n isOnboarded = (): boolean => true,\n isHomepageSectionsV1Enabled = (): boolean => false,\n }: {\n interval?: number;\n state?: Partial<AccountTrackerControllerState>;\n messenger: AccountTrackerControllerMessenger;\n getStakedBalanceForChain: AssetsContractController['getStakedBalanceForChain'];\n includeStakedAssets?: boolean;\n accountsApiChainIds?: () => ChainIdHex[];\n isHomepageSectionsV1Enabled?: () => boolean;\n allowExternalServices?: () => boolean;\n fetchingEnabled?: () => boolean;\n isOnboarded?: () => boolean;\n }) {\n const { selectedNetworkClientId } = messenger.call(\n 'NetworkController:getState',\n );\n const {\n configuration: { chainId },\n } = messenger.call(\n 'NetworkController:getNetworkClientById',\n selectedNetworkClientId,\n );\n super({\n name: controllerName,\n messenger,\n state: {\n accountsByChainId: {\n [chainId]: {},\n },\n ...state,\n },\n metadata: accountTrackerMetadata,\n });\n this.#getStakedBalanceForChain = getStakedBalanceForChain;\n\n this.#includeStakedAssets = includeStakedAssets;\n this.#accountsApiChainIds = accountsApiChainIds;\n this.#isHomepageSectionsV1Enabled = isHomepageSectionsV1Enabled;\n\n // Initialize balance fetchers - Strategy order: API first, then RPC fallback\n this.#balanceFetchers = [\n ...(accountsApiChainIds().length > 0 && allowExternalServices()\n ? [this.#createAccountsApiFetcher()]\n : []),\n createAccountTrackerRpcBalanceFetcher(\n this.#getProvider,\n this.#getNetworkClient,\n this.#includeStakedAssets,\n ),\n ];\n\n this.#fetchingEnabled = fetchingEnabled;\n this.#isOnboarded = isOnboarded;\n\n const { isUnlocked } = this.messenger.call('KeyringController:getState');\n this.#isLocked = !isUnlocked;\n\n this.setIntervalLength(interval);\n\n this.messenger.subscribe(\n 'AccountsController:selectedEvmAccountChange',\n (newAddress, prevAddress) => {\n if (newAddress !== prevAddress) {\n // Making an async call for this new event\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this.refresh(this.#getNetworkClientIds());\n }\n },\n (event): string => event.address,\n );\n\n this.messenger.subscribe(\n 'NetworkController:networkAdded',\n (networkConfiguration) => {\n const { networkClientId } =\n networkConfiguration.rpcEndpoints[\n networkConfiguration.defaultRpcEndpointIndex\n ];\n this.refresh([networkClientId]).catch(() => {\n // Silently handle refresh errors\n });\n },\n );\n\n this.messenger.subscribe('KeyringController:unlock', () => {\n this.#isLocked = false;\n const networkClientIds = this.#getNetworkClientIds();\n this.refresh(networkClientIds).catch((error) => {\n console.error('Error refreshing balances after keyring unlock:', error);\n });\n });\n\n this.messenger.subscribe('KeyringController:lock', () => {\n this.#isLocked = true;\n });\n\n this.messenger.subscribe(\n 'TransactionController:unapprovedTransactionAdded',\n (transactionMeta: TransactionMeta) => {\n const addresses = [transactionMeta.txParams.from];\n if (transactionMeta.txParams.to) {\n addresses.push(transactionMeta.txParams.to);\n }\n this.refreshAddresses({\n networkClientIds: [transactionMeta.networkClientId],\n addresses,\n }).catch(() => {\n // Silently handle refresh errors\n });\n },\n );\n\n this.messenger.subscribe(\n 'TransactionController:transactionConfirmed',\n (transactionMeta: TransactionMeta) => {\n const addresses = [transactionMeta.txParams.from];\n if (transactionMeta.txParams.to) {\n addresses.push(transactionMeta.txParams.to);\n }\n this.refreshAddresses({\n networkClientIds: [transactionMeta.networkClientId],\n addresses,\n }).catch(() => {\n // Silently handle refresh errors\n });\n },\n );\n\n this.#registerMessageHandlers();\n }\n\n /**\n * Whether the controller is active (keyring is unlocked and user is onboarded).\n * When locked or not onboarded, balance updates should be skipped.\n *\n * @returns Whether the controller should perform balance updates.\n */\n get isActive(): boolean {\n return !this.#isLocked && this.#isOnboarded();\n }\n\n #syncAccounts(newChainIds: string[]): void {\n const accountsByChainId = cloneDeep(this.state.accountsByChainId);\n const { selectedNetworkClientId } = this.messenger.call(\n 'NetworkController:getState',\n );\n const {\n configuration: { chainId: currentChainId },\n } = this.messenger.call(\n 'NetworkController:getNetworkClientById',\n selectedNetworkClientId,\n );\n\n const existing = Object.keys(accountsByChainId?.[currentChainId] ?? {});\n\n // Initialize new chain IDs if they don't exist\n newChainIds.forEach((newChainId) => {\n if (!accountsByChainId[newChainId]) {\n accountsByChainId[newChainId] = {};\n existing.forEach((address) => {\n accountsByChainId[newChainId][address] = { balance: '0x0' };\n });\n }\n });\n\n // Note: The address from the preferences controller are checksummed\n // The addresses from the accounts controller are lowercased\n const addresses = Object.values(\n this.messenger\n .call('AccountsController:listAccounts')\n .map((internalAccount) =>\n toChecksumHexAddress(internalAccount.address),\n ),\n );\n const newAddresses = addresses.filter(\n (address) => !existing.includes(address),\n );\n const oldAddresses = existing.filter(\n (address) => !addresses.includes(address),\n );\n Object.keys(accountsByChainId).forEach((chainId) => {\n newAddresses.forEach((address) => {\n accountsByChainId[chainId][address] = {\n balance: '0x0',\n };\n });\n });\n\n Object.keys(accountsByChainId).forEach((chainId) => {\n oldAddresses.forEach((address) => {\n delete accountsByChainId[chainId][address];\n });\n });\n\n if (!isEqual(this.state.accountsByChainId, accountsByChainId)) {\n this.update((state) => {\n state.accountsByChainId = accountsByChainId;\n });\n }\n }\n\n readonly #getProvider = (chainId: Hex): Web3Provider => {\n const { networkConfigurationsByChainId } = this.messenger.call(\n 'NetworkController:getState',\n );\n const networkConfig = networkConfigurationsByChainId[chainId];\n const { networkClientId } =\n networkConfig.rpcEndpoints[networkConfig.defaultRpcEndpointIndex];\n const client = this.messenger.call(\n 'NetworkController:getNetworkClientById',\n networkClientId,\n );\n return new Web3Provider(client.provider);\n };\n\n readonly #getNetworkClient = (chainId: Hex): NetworkClient => {\n const { networkConfigurationsByChainId } = this.messenger.call(\n 'NetworkController:getState',\n );\n const networkConfig = networkConfigurationsByChainId[chainId];\n const { networkClientId } =\n networkConfig.rpcEndpoints[networkConfig.defaultRpcEndpointIndex];\n return this.messenger.call(\n 'NetworkController:getNetworkClientById',\n networkClientId,\n );\n };\n\n /**\n * Creates an AccountsApiBalanceFetcher that only supports chains in the accountsApiChainIds array\n *\n * @returns A BalanceFetcher that wraps AccountsApiBalanceFetcher with chainId filtering\n */\n readonly #createAccountsApiFetcher = (): BalanceFetcher => {\n const originalFetcher = new AccountsApiBalanceFetcher(\n 'extension',\n this.#getProvider,\n );\n\n return {\n supports: (chainId: ChainIdHex): boolean => {\n // Only support chains that are both:\n // 1. In our specified accountsApiChainIds array\n // 2. Actually supported by the AccountsApi\n return (\n this.#accountsApiChainIds().includes(chainId) &&\n originalFetcher.supports(chainId)\n );\n },\n fetch: originalFetcher.fetch.bind(originalFetcher),\n };\n };\n\n /**\n * Resolves a networkClientId to a network client config\n * or globally selected network config if not provided\n *\n * @param networkClientId - Optional networkClientId to fetch a network client with\n * @returns network client config\n */\n #getCorrectNetworkClient(networkClientId?: NetworkClientId): {\n chainId: Hex;\n provider: NetworkClient['provider'];\n ethQuery: EthQuery;\n blockTracker: NetworkClient['blockTracker'];\n } {\n const selectedNetworkClientId =\n networkClientId ??\n this.messenger.call('NetworkController:getState').selectedNetworkClientId;\n const {\n configuration: { chainId },\n provider,\n blockTracker,\n } = this.messenger.call(\n 'NetworkController:getNetworkClientById',\n selectedNetworkClientId,\n );\n\n return {\n chainId,\n provider,\n ethQuery: new EthQuery(provider),\n blockTracker,\n };\n }\n\n /**\n * Retrieves the list of network client IDs.\n *\n * @returns An array of network client IDs.\n */\n #getNetworkClientIds(): NetworkClientId[] {\n const { networkConfigurationsByChainId } = this.messenger.call(\n 'NetworkController:getState',\n );\n\n if (this.#isHomepageSectionsV1Enabled()) {\n const popularEvmChainIds = this.messenger.call(\n 'NetworkEnablementController:listPopularEvmNetworks',\n );\n return popularEvmChainIds\n .map((hexChainId) => {\n const networkConfig = networkConfigurationsByChainId[hexChainId];\n return networkConfig?.rpcEndpoints[\n networkConfig.defaultRpcEndpointIndex\n ]?.networkClientId;\n })\n .filter((id): id is NetworkClientId => id !== undefined);\n }\n\n const { enabledNetworkMap } = this.messenger.call(\n 'NetworkEnablementController:getState',\n );\n\n const evmEnabledStorageKeys = enabledNetworkMap[KnownCaipNamespace.Eip155]\n ? Object.keys(enabledNetworkMap[KnownCaipNamespace.Eip155])\n : [];\n\n return evmEnabledStorageKeys\n .map((hexChainId) => {\n const networkConfig = networkConfigurationsByChainId[hexChainId as Hex];\n return networkConfig?.rpcEndpoints[\n networkConfig.defaultRpcEndpointIndex\n ]?.networkClientId;\n })\n .filter((id): id is NetworkClientId => id !== undefined);\n }\n\n /**\n * Refreshes the balances of the accounts using the networkClientId\n *\n * @param input - The input for the poll.\n * @param input.networkClientIds - The network client IDs used to get balances.\n * @param input.queryAllAccounts - Whether to query all accounts or just the selected account\n */\n async _executePoll({\n networkClientIds,\n queryAllAccounts = false,\n }: AccountTrackerPollingInput): Promise<void> {\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this.refresh(networkClientIds, queryAllAccounts);\n }\n\n /**\n * Refreshes the balances of the accounts depending on the multi-account setting.\n * If multi-account is disabled, only updates the selected account balance.\n * If multi-account is enabled, updates balances for all accounts.\n *\n * @param networkClientIds - Optional network client IDs to fetch a network client with\n * @param queryAllAccounts - Whether to query all accounts or just the selected account\n */\n async refresh(\n networkClientIds: NetworkClientId[],\n queryAllAccounts: boolean = false,\n ): Promise<void> {\n const selectedAccount = this.messenger.call(\n 'AccountsController:getSelectedAccount',\n );\n const allAccounts = this.messenger.call('AccountsController:listAccounts');\n const { isMultiAccountBalancesEnabled } = this.messenger.call(\n 'PreferencesController:getState',\n );\n\n await this.#refreshAccounts({\n networkClientIds,\n queryAllAccounts: queryAllAccounts ?? isMultiAccountBalancesEnabled,\n selectedAccount: toChecksumHexAddress(\n selectedAccount.address,\n ) as ChecksumAddress,\n allAccounts,\n });\n }\n\n async refreshAddresses({\n networkClientIds,\n addresses,\n }: {\n networkClientIds: NetworkClientId[];\n addresses: string[];\n }): Promise<void> {\n const checksummedAddresses = addresses.map((address) =>\n toChecksumHexAddress(address),\n );\n\n const accounts = this.messenger\n .call('AccountsController:listAccounts')\n .filter((account) =>\n checksummedAddresses.includes(toChecksumHexAddress(account.address)),\n );\n\n await this.#refreshAccounts({\n networkClientIds,\n queryAllAccounts: true,\n selectedAccount: '0x0',\n allAccounts: accounts,\n });\n }\n\n async #refreshAccounts({\n networkClientIds,\n queryAllAccounts,\n selectedAccount,\n allAccounts,\n }: {\n networkClientIds: NetworkClientId[];\n queryAllAccounts: boolean;\n selectedAccount: ChecksumAddress;\n allAccounts: InternalAccount[];\n }): Promise<void> {\n const releaseLock = await this.#refreshMutex.acquire();\n try {\n const chainIds = networkClientIds.map((networkClientId) => {\n const { chainId } = this.#getCorrectNetworkClient(networkClientId);\n return chainId;\n });\n\n this.#syncAccounts(chainIds);\n\n if (!this.#fetchingEnabled() || !this.isActive) {\n return;\n }\n\n // Use balance fetchers with fallback strategy\n const aggregated: ProcessedBalance[] = [];\n let remainingChains = [...chainIds] as ChainIdHex[];\n\n // Temporary normalization to lowercase for balance fetching to match TokenBalancesController and enable HTTP caching\n const lowerCaseSelectedAccount =\n selectedAccount.toLowerCase() as ChecksumAddress;\n const lowerCaseAllAccounts = allAccounts.map((account) => ({\n ...account,\n address: account.address.toLowerCase(),\n }));\n\n // Try each fetcher in order, removing successfully processed chains\n for (const fetcher of this.#balanceFetchers) {\n const supportedChains = remainingChains.filter((chainId) =>\n fetcher.supports(chainId),\n );\n if (!supportedChains.length) {\n continue;\n }\n\n try {\n const result = await fetcher.fetch({\n chainIds: supportedChains,\n queryAllAccounts,\n selectedAccount: lowerCaseSelectedAccount,\n allAccounts: lowerCaseAllAccounts,\n });\n\n if (result.balances && result.balances.length > 0) {\n aggregated.push(...result.balances);\n // Remove chains that were successfully processed\n const processedChains = new Set(\n result.balances.map((b) => b.chainId),\n );\n remainingChains = remainingChains.filter(\n (chain) => !processedChains.has(chain),\n );\n }\n\n // Add unprocessed chains back to remainingChains for next fetcher\n if (\n result.unprocessedChainIds &&\n result.unprocessedChainIds.length > 0\n ) {\n // Only add chains that were originally requested and aren't already in remainingChains\n const currentRemainingChains = remainingChains;\n const chainsToAdd = result.unprocessedChainIds.filter(\n (chainId) =>\n supportedChains.includes(chainId) &&\n !currentRemainingChains.includes(chainId),\n );\n remainingChains.push(...chainsToAdd);\n }\n } catch (error) {\n console.warn(\n `Balance fetcher failed for chains ${supportedChains.join(', ')}: ${String(error)}`,\n );\n // Continue to next fetcher (fallback)\n }\n\n // If all chains have been processed, break early\n if (remainingChains.length === 0) {\n break;\n }\n }\n\n // Build a _copy_ of the current state and track whether anything changed\n const nextAccountsByChainId: AccountTrackerControllerState['accountsByChainId'] =\n cloneDeep(this.state.accountsByChainId);\n let hasChanges = false;\n\n // Process the aggregated balance results\n const stakedBalancesByChainAndAddress: Record<\n string,\n Record<string, string>\n > = {};\n\n aggregated.forEach(({ success, value, account, token, chainId }) => {\n if (success && value !== undefined) {\n const checksumAddress = toChecksumHexAddress(account);\n const hexValue = `0x${value.toString(16)}`;\n\n if (token === ZERO_ADDRESS) {\n // Native balance\n // Ensure the account entry exists before accessing it\n if (!nextAccountsByChainId[chainId]) {\n nextAccountsByChainId[chainId] = {};\n }\n if (!nextAccountsByChainId[chainId][checksumAddress]) {\n nextAccountsByChainId[chainId][checksumAddress] = {\n balance: '0x0',\n };\n }\n\n if (\n nextAccountsByChainId[chainId][checksumAddress].balance !==\n hexValue\n ) {\n nextAccountsByChainId[chainId][checksumAddress].balance =\n hexValue;\n hasChanges = true;\n }\n } else if (\n STAKING_CONTRACT_ADDRESS_BY_CHAINID[chainId]?.toLowerCase() ===\n token.toLowerCase()\n ) {\n // Staked balance (from staking contract address)\n if (!stakedBalancesByChainAndAddress[chainId]) {\n stakedBalancesByChainAndAddress[chainId] = {};\n }\n stakedBalancesByChainAndAddress[chainId][checksumAddress] =\n hexValue;\n }\n }\n });\n\n // Apply staked balances\n Object.entries(stakedBalancesByChainAndAddress).forEach(\n ([chainId, balancesByAddress]) => {\n Object.entries(balancesByAddress).forEach(\n ([address, stakedBalance]) => {\n // Ensure account structure exists\n if (!nextAccountsByChainId[chainId]) {\n nextAccountsByChainId[chainId] = {};\n }\n if (!nextAccountsByChainId[chainId][address]) {\n nextAccountsByChainId[chainId][address] = { balance: '0x0' };\n }\n if (\n nextAccountsByChainId[chainId][address].stakedBalance !==\n stakedBalance\n ) {\n nextAccountsByChainId[chainId][address].stakedBalance =\n stakedBalance;\n hasChanges = true;\n }\n },\n );\n },\n );\n\n // Only update state if something changed\n if (hasChanges) {\n this.update((state) => {\n state.accountsByChainId = nextAccountsByChainId;\n });\n }\n } finally {\n releaseLock();\n }\n }\n\n /**\n * Sync accounts balances with some additional addresses.\n *\n * @param addresses - the additional addresses, may be hardware wallet addresses.\n * @param networkClientId - Optional networkClientId to fetch a network client with.\n * @returns accounts - addresses with synced balance\n */\n async syncBalanceWithAddresses(\n addresses: string[],\n networkClientId?: NetworkClientId,\n ): Promise<\n Record<string, { balance: string; stakedBalance?: StakedBalance }>\n > {\n // Skip balance fetching if locked or not onboarded to avoid unnecessary RPC calls\n if (!this.isActive) {\n return {};\n }\n\n const { ethQuery } = this.#getCorrectNetworkClient(networkClientId);\n\n // TODO: This should use multicall when enabled by the user.\n return await Promise.all(\n addresses.map(\n (address): Promise<[string, string, StakedBalance] | undefined> => {\n return safelyExecuteWithTimeout(async () => {\n assert(ethQuery, 'Provider not set.');\n const balance = await query(ethQuery, 'getBalance', [address]);\n\n let stakedBalance: StakedBalance;\n if (this.#includeStakedAssets) {\n stakedBalance = (\n await this.#getStakedBalanceForChain([address], networkClientId)\n )[address];\n }\n return [address, balance, stakedBalance];\n });\n },\n ),\n ).then((value) => {\n return value.reduce((obj, item) => {\n if (!item) {\n return obj;\n }\n\n const [address, balance, stakedBalance] = item;\n return {\n ...obj,\n [address]: {\n balance,\n stakedBalance,\n },\n };\n }, {});\n });\n }\n\n /**\n * Updates the balances of multiple native tokens in a single batch operation.\n * This is more efficient than calling updateNativeToken multiple times as it\n * triggers only one state update.\n *\n * @param balances - Array of balance updates, each containing address, chainId, and balance.\n */\n updateNativeBalances(\n balances: { address: string; chainId: Hex; balance: Hex }[],\n ): void {\n const nextAccountsByChainId = cloneDeep(this.state.accountsByChainId);\n let hasChanges = false;\n\n balances.forEach(({ address, chainId, balance }) => {\n const checksumAddress = toChecksumHexAddress(address);\n\n // Ensure the chainId exists in the state\n if (!nextAccountsByChainId[chainId]) {\n nextAccountsByChainId[chainId] = {};\n hasChanges = true;\n }\n\n // Check if the address exists for this chain\n const accountExists = Boolean(\n nextAccountsByChainId[chainId][checksumAddress],\n );\n\n // Ensure the address exists for this chain\n if (!accountExists) {\n nextAccountsByChainId[chainId][checksumAddress] = {\n balance: '0x0',\n };\n hasChanges = true;\n }\n\n // Only update the balance if it has changed, or if this is a new account\n const currentBalance =\n nextAccountsByChainId[chainId][checksumAddress].balance;\n if (!accountExists || currentBalance !== balance) {\n nextAccountsByChainId[chainId][checksumAddress].balance = balance;\n hasChanges = true;\n }\n });\n\n // Only call update if there are actual changes\n if (hasChanges) {\n this.update((state) => {\n state.accountsByChainId = nextAccountsByChainId;\n });\n }\n }\n\n /**\n * Updates the staked balances of multiple accounts in a single batch operation.\n * This is more efficient than updating staked balances individually as it\n * triggers only one state update.\n *\n * @param stakedBalances - Array of staked balance updates, each containing address, chainId, and stakedBalance.\n */\n updateStakedBalances(\n stakedBalances: {\n address: string;\n chainId: Hex;\n stakedBalance: StakedBalance;\n }[],\n ): void {\n const nextAccountsByChainId = cloneDeep(this.state.accountsByChainId);\n let hasChanges = false;\n\n stakedBalances.forEach(({ address, chainId, stakedBalance }) => {\n const checksumAddress = toChecksumHexAddress(address);\n\n // Ensure the chainId exists in the state\n if (!nextAccountsByChainId[chainId]) {\n nextAccountsByChainId[chainId] = {};\n hasChanges = true;\n }\n\n // Check if the address exists for this chain\n const accountExists = Boolean(\n nextAccountsByChainId[chainId][checksumAddress],\n );\n\n // Ensure the address exists for this chain\n if (!accountExists) {\n nextAccountsByChainId[chainId][checksumAddress] = {\n balance: '0x0',\n };\n hasChanges = true;\n }\n\n // Only update the staked balance if it has changed, or if this is a new account\n const currentStakedBalance =\n nextAccountsByChainId[chainId][checksumAddress].stakedBalance;\n if (!accountExists || !isEqual(currentStakedBalance, stakedBalance)) {\n nextAccountsByChainId[chainId][checksumAddress].stakedBalance =\n stakedBalance;\n hasChanges = true;\n }\n });\n\n // Only call update if there are actual changes\n if (hasChanges) {\n this.update((state) => {\n state.accountsByChainId = nextAccountsByChainId;\n });\n }\n }\n\n #registerMessageHandlers(): void {\n this.messenger.registerActionHandler(\n `${controllerName}:updateNativeBalances` as const,\n this.updateNativeBalances.bind(this),\n );\n\n this.messenger.registerActionHandler(\n `${controllerName}:updateStakedBalances` as const,\n this.updateStakedBalances.bind(this),\n );\n }\n}\n\nexport default AccountTrackerController;\n"]}
|
|
1
|
+
{"version":3,"file":"AccountTrackerController.mjs","sourceRoot":"","sources":["../src/AccountTrackerController.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,YAAY,EAAE,iCAAiC;AAWxD,OAAO,EACL,KAAK,EACL,wBAAwB,EACxB,oBAAoB,EACrB,mCAAmC;AACpC,OAAO,SAAQ,4BAA4B;;AAmB3C,OAAO,EAAE,+BAA+B,EAAE,qCAAqC;AAM/E,OAAO,EAAE,MAAM,EAAE,kBAAkB,EAAE,wBAAwB;AAE7D,OAAO,EAAE,KAAK,EAAE,oBAAoB;;;AAIpC,OAAO,EAAE,mCAAmC,EAAE,uCAAmC;AAKjF,OAAO,EAAE,yBAAyB,EAAE,+DAA2D;AAM/F,OAAO,EAAE,iBAAiB,EAAE,8CAA0C;AAEtE;;GAEG;AACH,MAAM,cAAc,GAAG,0BAA0B,CAAC;AAKlD,MAAM,YAAY,GAChB,4CAA+D,CAAC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AC,OAAO,CACrD,CAAC,CAAC,OAAO,EAAE,iBAAiB,CAAC,EAAE,EAAE;YAC/B,MAAM,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC,OAAO,CACvC,CAAC,CAAC,OAAO,EAAE,aAAa,CAAC,EAAE,EAAE;gBAC3B,kCAAkC;gBAClC,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC,EAAE,CAAC;oBACpC,qBAAqB,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC;gBACtC,CAAC;gBACD,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;oBAC7C,qBAAqB,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;gBAC/D,CAAC;gBACD,IACE,qBAAqB,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,aAAa;oBACrD,aAAa,EACb,CAAC;oBACD,qBAAqB,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,aAAa;wBACnD,aAAa,CAAC;oBAChB,UAAU,GAAG,IAAI,CAAC;gBACpB,CAAC;YACH,CAAC,CACF,CAAC;QACJ,CAAC,CACF,CAAC;QAEF,yCAAyC;QACzC,IAAI,UAAU,EAAE,CAAC;YACf,IAAI,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE;gBACpB,KAAK,CAAC,iBAAiB,GAAG,qBAAqB,CAAC;YAClD,CAAC,CAAC,CAAC;QACL,CAAC;IACH,CAAC;YAAS,CAAC;QACT,WAAW,EAAE,CAAC;IAChB,CAAC;AACH,CAAC;AAwKH,eAAe,wBAAwB,CAAC","sourcesContent":["import { Web3Provider } from '@ethersproject/providers';\nimport type {\n AccountsControllerSelectedEvmAccountChangeEvent,\n AccountsControllerGetSelectedAccountAction,\n AccountsControllerListAccountsAction,\n} from '@metamask/accounts-controller';\nimport type {\n ControllerStateChangeEvent,\n ControllerGetStateAction,\n StateMetadata,\n} from '@metamask/base-controller';\nimport {\n query,\n safelyExecuteWithTimeout,\n toChecksumHexAddress,\n} from '@metamask/controller-utils';\nimport EthQuery from '@metamask/eth-query';\nimport type {\n KeyringControllerGetStateAction,\n KeyringControllerLockEvent,\n KeyringControllerUnlockEvent,\n} from '@metamask/keyring-controller';\nimport type { InternalAccount } from '@metamask/keyring-internal-api';\nimport type { Messenger } from '@metamask/messenger';\nimport type {\n NetworkClient,\n NetworkClientId,\n NetworkControllerGetNetworkClientByIdAction,\n NetworkControllerGetStateAction,\n NetworkControllerNetworkAddedEvent,\n} from '@metamask/network-controller';\nimport type {\n NetworkEnablementControllerGetStateAction,\n NetworkEnablementControllerListPopularEvmNetworksAction,\n} from '@metamask/network-enablement-controller';\nimport { StaticIntervalPollingController } from '@metamask/polling-controller';\nimport type {\n TransactionControllerTransactionConfirmedEvent,\n TransactionControllerUnapprovedTransactionAddedEvent,\n TransactionMeta,\n} from '@metamask/transaction-controller';\nimport { assert, KnownCaipNamespace } from '@metamask/utils';\nimport type { Hex } from '@metamask/utils';\nimport { Mutex } from 'async-mutex';\nimport { cloneDeep, isEqual } from 'lodash';\n\nimport type { AccountTrackerControllerMethodActions } from './AccountTrackerController-method-action-types';\nimport { STAKING_CONTRACT_ADDRESS_BY_CHAINID } from './AssetsContractController';\nimport type {\n AssetsContractController,\n StakedBalance,\n} from './AssetsContractController';\nimport { AccountsApiBalanceFetcher } from './multi-chain-accounts-service/api-balance-fetcher';\nimport type {\n BalanceFetcher,\n BalanceFetchResult,\n ProcessedBalance,\n} from './multi-chain-accounts-service/api-balance-fetcher';\nimport { RpcBalanceFetcher } from './rpc-service/rpc-balance-fetcher';\n\n/**\n * The name of the {@link AccountTrackerController}.\n */\nconst controllerName = 'AccountTrackerController';\n\nexport type ChainIdHex = Hex;\nexport type ChecksumAddress = Hex;\n\nconst ZERO_ADDRESS =\n '0x0000000000000000000000000000000000000000' as ChecksumAddress;\n\n/**\n * Creates an RPC balance fetcher configured for AccountTracker use case.\n * Returns only native balances and staked balances (no token balances).\n *\n * @param getProvider - Function to get Web3Provider for a given chain ID\n * @param getNetworkClient - Function to get NetworkClient for a given chain ID\n * @param includeStakedAssets - Whether to include staked assets in the fetch\n * @returns BalanceFetcher configured to fetch only native and optionally staked balances\n */\nfunction createAccountTrackerRpcBalanceFetcher(\n getProvider: (chainId: Hex) => Web3Provider,\n getNetworkClient: (chainId: Hex) => NetworkClient,\n includeStakedAssets: boolean,\n): BalanceFetcher {\n // Provide empty tokens state to ensure only native and staked balances are fetched\n const getEmptyTokensState = (): {\n allTokens: Record<string, never>;\n allDetectedTokens: Record<string, never>;\n } => ({\n allTokens: {},\n allDetectedTokens: {},\n });\n\n const rpcBalanceFetcher = new RpcBalanceFetcher(\n getProvider,\n getNetworkClient,\n getEmptyTokensState,\n );\n\n // Wrap the RpcBalanceFetcher to filter staked balances when not needed\n return {\n supports(_chainId: ChainIdHex): boolean {\n return rpcBalanceFetcher.supports();\n },\n\n async fetch(\n params: Parameters<BalanceFetcher['fetch']>[0],\n ): Promise<BalanceFetchResult> {\n const result = await rpcBalanceFetcher.fetch(params);\n\n if (!includeStakedAssets) {\n // Filter out staked balances from the results\n return {\n balances: result.balances.filter(\n (balance) => balance.token === ZERO_ADDRESS,\n ),\n unprocessedChainIds: result.unprocessedChainIds,\n };\n }\n\n return result;\n },\n };\n}\n\n/**\n * AccountInformation\n *\n * Account information object\n *\n * balance - Hex string of an account balance in wei\n *\n * stakedBalance - Hex string of an account staked balance in wei\n */\nexport type AccountInformation = {\n balance: string;\n stakedBalance?: string;\n};\n\n/**\n * AccountTrackerControllerState\n *\n * Account tracker controller state\n *\n * accountsByChainId - Map of addresses to account information by chain\n */\nexport type AccountTrackerControllerState = {\n accountsByChainId: Record<string, { [address: string]: AccountInformation }>;\n};\n\nconst accountTrackerMetadata: StateMetadata<AccountTrackerControllerState> = {\n accountsByChainId: {\n includeInStateLogs: false,\n persist: true,\n includeInDebugSnapshot: false,\n usedInUi: true,\n },\n};\n\n/**\n * The action that can be performed to get the state of the {@link AccountTrackerController}.\n */\nexport type AccountTrackerControllerGetStateAction = ControllerGetStateAction<\n typeof controllerName,\n AccountTrackerControllerState\n>;\n\n/**\n * The actions that can be performed using the {@link AccountTrackerController}.\n */\nexport type AccountTrackerControllerActions =\n | AccountTrackerControllerGetStateAction\n | AccountTrackerControllerMethodActions;\n\n/**\n * The messenger of the {@link AccountTrackerController} for communication.\n */\nexport type AllowedActions =\n | AccountsControllerListAccountsAction\n | {\n type: 'PreferencesController:getState';\n handler: () => { isMultiAccountBalancesEnabled: boolean };\n }\n | AccountsControllerGetSelectedAccountAction\n | NetworkControllerGetStateAction\n | NetworkControllerGetNetworkClientByIdAction\n | NetworkEnablementControllerGetStateAction\n | NetworkEnablementControllerListPopularEvmNetworksAction\n | KeyringControllerGetStateAction;\n\n/**\n * The event that {@link AccountTrackerController} can emit.\n */\nexport type AccountTrackerControllerStateChangeEvent =\n ControllerStateChangeEvent<\n typeof controllerName,\n AccountTrackerControllerState\n >;\n\n/**\n * The events that {@link AccountTrackerController} can emit.\n */\nexport type AccountTrackerControllerEvents =\n AccountTrackerControllerStateChangeEvent;\n\n/**\n * The external events available to the {@link AccountTrackerController}.\n */\nexport type AllowedEvents =\n | AccountsControllerSelectedEvmAccountChangeEvent\n | TransactionControllerUnapprovedTransactionAddedEvent\n | TransactionControllerTransactionConfirmedEvent\n | NetworkControllerNetworkAddedEvent\n | KeyringControllerLockEvent\n | KeyringControllerUnlockEvent;\n\n/**\n * The messenger of the {@link AccountTrackerController}.\n */\nexport type AccountTrackerControllerMessenger = Messenger<\n typeof controllerName,\n AccountTrackerControllerActions | AllowedActions,\n AccountTrackerControllerEvents | AllowedEvents\n>;\n\n/** The input to start polling for the {@link AccountTrackerController} */\ntype AccountTrackerPollingInput = {\n networkClientIds: NetworkClientId[];\n queryAllAccounts?: boolean;\n};\n\nconst MESSENGER_EXPOSED_METHODS = [\n 'updateNativeBalances',\n 'updateStakedBalances',\n] as const;\n\n/**\n * Controller that tracks the network balances for all user accounts.\n */\nexport class AccountTrackerController extends StaticIntervalPollingController<AccountTrackerPollingInput>()<\n typeof controllerName,\n AccountTrackerControllerState,\n AccountTrackerControllerMessenger\n> {\n readonly #refreshMutex = new Mutex();\n\n readonly #includeStakedAssets: boolean;\n\n readonly #accountsApiChainIds: () => ChainIdHex[];\n\n readonly #getStakedBalanceForChain: AssetsContractController['getStakedBalanceForChain'];\n\n readonly #balanceFetchers: BalanceFetcher[];\n\n readonly #fetchingEnabled: () => boolean;\n\n readonly #isOnboarded: () => boolean;\n\n readonly #isHomepageSectionsV1Enabled: () => boolean;\n\n /** Track if the keyring is locked */\n #isLocked = true;\n\n /**\n * Creates an AccountTracker instance.\n *\n * @param options - The controller options.\n * @param options.interval - Polling interval used to fetch new account balances.\n * @param options.state - Initial state to set on this controller.\n * @param options.messenger - The controller messenger.\n * @param options.getStakedBalanceForChain - The function to get the staked native asset balance for a chain.\n * @param options.includeStakedAssets - Whether to include staked assets in the account balances.\n * @param options.accountsApiChainIds - Function that returns array of chainIds that should use Accounts-API strategy (if supported by API).\n * @param options.allowExternalServices - Disable external HTTP calls (privacy / offline mode).\n * @param options.fetchingEnabled - Function that returns whether the controller is fetching enabled.\n * @param options.isOnboarded - Whether the user has completed onboarding. If false, balance updates are skipped.\n * @param options.isHomepageSectionsV1Enabled - Whether the homepage sections v1 is enabled.\n */\n constructor({\n interval = 10000,\n state,\n messenger,\n getStakedBalanceForChain,\n includeStakedAssets = false,\n accountsApiChainIds = (): ChainIdHex[] => [],\n allowExternalServices = (): boolean => true,\n fetchingEnabled = (): boolean => true,\n isOnboarded = (): boolean => true,\n isHomepageSectionsV1Enabled = (): boolean => false,\n }: {\n interval?: number;\n state?: Partial<AccountTrackerControllerState>;\n messenger: AccountTrackerControllerMessenger;\n getStakedBalanceForChain: AssetsContractController['getStakedBalanceForChain'];\n includeStakedAssets?: boolean;\n accountsApiChainIds?: () => ChainIdHex[];\n isHomepageSectionsV1Enabled?: () => boolean;\n allowExternalServices?: () => boolean;\n fetchingEnabled?: () => boolean;\n isOnboarded?: () => boolean;\n }) {\n const { selectedNetworkClientId } = messenger.call(\n 'NetworkController:getState',\n );\n const {\n configuration: { chainId },\n } = messenger.call(\n 'NetworkController:getNetworkClientById',\n selectedNetworkClientId,\n );\n super({\n name: controllerName,\n messenger,\n state: {\n accountsByChainId: {\n [chainId]: {},\n },\n ...state,\n },\n metadata: accountTrackerMetadata,\n });\n this.#getStakedBalanceForChain = getStakedBalanceForChain;\n\n this.#includeStakedAssets = includeStakedAssets;\n this.#accountsApiChainIds = accountsApiChainIds;\n this.#isHomepageSectionsV1Enabled = isHomepageSectionsV1Enabled;\n\n // Initialize balance fetchers - Strategy order: API first, then RPC fallback\n this.#balanceFetchers = [\n ...(accountsApiChainIds().length > 0 && allowExternalServices()\n ? [this.#createAccountsApiFetcher()]\n : []),\n createAccountTrackerRpcBalanceFetcher(\n this.#getProvider,\n this.#getNetworkClient,\n this.#includeStakedAssets,\n ),\n ];\n\n this.#fetchingEnabled = fetchingEnabled;\n this.#isOnboarded = isOnboarded;\n\n const { isUnlocked } = this.messenger.call('KeyringController:getState');\n this.#isLocked = !isUnlocked;\n\n this.setIntervalLength(interval);\n\n this.messenger.subscribe(\n 'AccountsController:selectedEvmAccountChange',\n (newAddress, prevAddress) => {\n if (newAddress !== prevAddress) {\n // Making an async call for this new event\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this.refresh(this.#getNetworkClientIds());\n }\n },\n (event): string => event.address,\n );\n\n this.messenger.subscribe(\n 'NetworkController:networkAdded',\n (networkConfiguration) => {\n const { networkClientId } =\n networkConfiguration.rpcEndpoints[\n networkConfiguration.defaultRpcEndpointIndex\n ];\n this.refresh([networkClientId]).catch(() => {\n // Silently handle refresh errors\n });\n },\n );\n\n this.messenger.subscribe('KeyringController:unlock', () => {\n this.#isLocked = false;\n const networkClientIds = this.#getNetworkClientIds();\n this.refresh(networkClientIds).catch((error) => {\n console.error('Error refreshing balances after keyring unlock:', error);\n });\n });\n\n this.messenger.subscribe('KeyringController:lock', () => {\n this.#isLocked = true;\n });\n\n this.messenger.subscribe(\n 'TransactionController:unapprovedTransactionAdded',\n (transactionMeta: TransactionMeta) => {\n const addresses = [transactionMeta.txParams.from];\n if (transactionMeta.txParams.to) {\n addresses.push(transactionMeta.txParams.to);\n }\n this.refreshAddresses({\n networkClientIds: [transactionMeta.networkClientId],\n addresses,\n }).catch(() => {\n // Silently handle refresh errors\n });\n },\n );\n\n this.messenger.subscribe(\n 'TransactionController:transactionConfirmed',\n (transactionMeta: TransactionMeta) => {\n const addresses = [transactionMeta.txParams.from];\n if (transactionMeta.txParams.to) {\n addresses.push(transactionMeta.txParams.to);\n }\n this.refreshAddresses({\n networkClientIds: [transactionMeta.networkClientId],\n addresses,\n }).catch(() => {\n // Silently handle refresh errors\n });\n },\n );\n\n messenger.registerMethodActionHandlers(this, MESSENGER_EXPOSED_METHODS);\n }\n\n /**\n * Whether the controller is active (keyring is unlocked and user is onboarded).\n * When locked or not onboarded, balance updates should be skipped.\n *\n * @returns Whether the controller should perform balance updates.\n */\n get isActive(): boolean {\n return !this.#isLocked && this.#isOnboarded();\n }\n\n #syncAccounts(newChainIds: string[]): void {\n const accountsByChainId = cloneDeep(this.state.accountsByChainId);\n const { selectedNetworkClientId } = this.messenger.call(\n 'NetworkController:getState',\n );\n const {\n configuration: { chainId: currentChainId },\n } = this.messenger.call(\n 'NetworkController:getNetworkClientById',\n selectedNetworkClientId,\n );\n\n const existing = Object.keys(accountsByChainId?.[currentChainId] ?? {});\n\n // Initialize new chain IDs if they don't exist\n newChainIds.forEach((newChainId) => {\n if (!accountsByChainId[newChainId]) {\n accountsByChainId[newChainId] = {};\n existing.forEach((address) => {\n accountsByChainId[newChainId][address] = { balance: '0x0' };\n });\n }\n });\n\n // Note: The address from the preferences controller are checksummed\n // The addresses from the accounts controller are lowercased\n const addresses = Object.values(\n this.messenger\n .call('AccountsController:listAccounts')\n .map((internalAccount) =>\n toChecksumHexAddress(internalAccount.address),\n ),\n );\n const newAddresses = addresses.filter(\n (address) => !existing.includes(address),\n );\n const oldAddresses = existing.filter(\n (address) => !addresses.includes(address),\n );\n Object.keys(accountsByChainId).forEach((chainId) => {\n newAddresses.forEach((address) => {\n accountsByChainId[chainId][address] = {\n balance: '0x0',\n };\n });\n });\n\n Object.keys(accountsByChainId).forEach((chainId) => {\n oldAddresses.forEach((address) => {\n delete accountsByChainId[chainId][address];\n });\n });\n\n if (!isEqual(this.state.accountsByChainId, accountsByChainId)) {\n this.update((state) => {\n state.accountsByChainId = accountsByChainId;\n });\n }\n }\n\n readonly #getProvider = (chainId: Hex): Web3Provider => {\n const { networkConfigurationsByChainId } = this.messenger.call(\n 'NetworkController:getState',\n );\n const networkConfig = networkConfigurationsByChainId[chainId];\n const { networkClientId } =\n networkConfig.rpcEndpoints[networkConfig.defaultRpcEndpointIndex];\n const client = this.messenger.call(\n 'NetworkController:getNetworkClientById',\n networkClientId,\n );\n return new Web3Provider(client.provider);\n };\n\n readonly #getNetworkClient = (chainId: Hex): NetworkClient => {\n const { networkConfigurationsByChainId } = this.messenger.call(\n 'NetworkController:getState',\n );\n const networkConfig = networkConfigurationsByChainId[chainId];\n const { networkClientId } =\n networkConfig.rpcEndpoints[networkConfig.defaultRpcEndpointIndex];\n return this.messenger.call(\n 'NetworkController:getNetworkClientById',\n networkClientId,\n );\n };\n\n /**\n * Creates an AccountsApiBalanceFetcher that only supports chains in the accountsApiChainIds array\n *\n * @returns A BalanceFetcher that wraps AccountsApiBalanceFetcher with chainId filtering\n */\n readonly #createAccountsApiFetcher = (): BalanceFetcher => {\n const originalFetcher = new AccountsApiBalanceFetcher(\n 'extension',\n this.#getProvider,\n );\n\n return {\n supports: (chainId: ChainIdHex): boolean => {\n // Only support chains that are both:\n // 1. In our specified accountsApiChainIds array\n // 2. Actually supported by the AccountsApi\n return (\n this.#accountsApiChainIds().includes(chainId) &&\n originalFetcher.supports(chainId)\n );\n },\n fetch: originalFetcher.fetch.bind(originalFetcher),\n };\n };\n\n /**\n * Resolves a networkClientId to a network client config\n * or globally selected network config if not provided\n *\n * @param networkClientId - Optional networkClientId to fetch a network client with\n * @returns network client config\n */\n #getCorrectNetworkClient(networkClientId?: NetworkClientId): {\n chainId: Hex;\n provider: NetworkClient['provider'];\n ethQuery: EthQuery;\n blockTracker: NetworkClient['blockTracker'];\n } {\n const selectedNetworkClientId =\n networkClientId ??\n this.messenger.call('NetworkController:getState').selectedNetworkClientId;\n const {\n configuration: { chainId },\n provider,\n blockTracker,\n } = this.messenger.call(\n 'NetworkController:getNetworkClientById',\n selectedNetworkClientId,\n );\n\n return {\n chainId,\n provider,\n ethQuery: new EthQuery(provider),\n blockTracker,\n };\n }\n\n /**\n * Retrieves the list of network client IDs.\n *\n * @returns An array of network client IDs.\n */\n #getNetworkClientIds(): NetworkClientId[] {\n const { networkConfigurationsByChainId } = this.messenger.call(\n 'NetworkController:getState',\n );\n\n if (this.#isHomepageSectionsV1Enabled()) {\n const popularEvmChainIds = this.messenger.call(\n 'NetworkEnablementController:listPopularEvmNetworks',\n );\n return popularEvmChainIds\n .map((hexChainId) => {\n const networkConfig = networkConfigurationsByChainId[hexChainId];\n return networkConfig?.rpcEndpoints[\n networkConfig.defaultRpcEndpointIndex\n ]?.networkClientId;\n })\n .filter((id): id is NetworkClientId => id !== undefined);\n }\n\n const { enabledNetworkMap } = this.messenger.call(\n 'NetworkEnablementController:getState',\n );\n\n const evmEnabledStorageKeys = enabledNetworkMap[KnownCaipNamespace.Eip155]\n ? Object.keys(enabledNetworkMap[KnownCaipNamespace.Eip155])\n : [];\n\n return evmEnabledStorageKeys\n .map((hexChainId) => {\n const networkConfig = networkConfigurationsByChainId[hexChainId as Hex];\n return networkConfig?.rpcEndpoints[\n networkConfig.defaultRpcEndpointIndex\n ]?.networkClientId;\n })\n .filter((id): id is NetworkClientId => id !== undefined);\n }\n\n /**\n * Refreshes the balances of the accounts using the networkClientId\n *\n * @param input - The input for the poll.\n * @param input.networkClientIds - The network client IDs used to get balances.\n * @param input.queryAllAccounts - Whether to query all accounts or just the selected account\n */\n async _executePoll({\n networkClientIds,\n queryAllAccounts = false,\n }: AccountTrackerPollingInput): Promise<void> {\n // TODO: Either fix this lint violation or explain why it's necessary to ignore.\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this.refresh(networkClientIds, queryAllAccounts);\n }\n\n /**\n * Refreshes the balances of the accounts depending on the multi-account setting.\n * If multi-account is disabled, only updates the selected account balance.\n * If multi-account is enabled, updates balances for all accounts.\n *\n * @param networkClientIds - Optional network client IDs to fetch a network client with\n * @param queryAllAccounts - Whether to query all accounts or just the selected account\n */\n async refresh(\n networkClientIds: NetworkClientId[],\n queryAllAccounts: boolean = false,\n ): Promise<void> {\n const selectedAccount = this.messenger.call(\n 'AccountsController:getSelectedAccount',\n );\n const allAccounts = this.messenger.call('AccountsController:listAccounts');\n const { isMultiAccountBalancesEnabled } = this.messenger.call(\n 'PreferencesController:getState',\n );\n\n await this.#refreshAccounts({\n networkClientIds,\n queryAllAccounts: queryAllAccounts ?? isMultiAccountBalancesEnabled,\n selectedAccount: toChecksumHexAddress(\n selectedAccount.address,\n ) as ChecksumAddress,\n allAccounts,\n });\n }\n\n async refreshAddresses({\n networkClientIds,\n addresses,\n }: {\n networkClientIds: NetworkClientId[];\n addresses: string[];\n }): Promise<void> {\n const checksummedAddresses = addresses.map((address) =>\n toChecksumHexAddress(address),\n );\n\n const accounts = this.messenger\n .call('AccountsController:listAccounts')\n .filter((account) =>\n checksummedAddresses.includes(toChecksumHexAddress(account.address)),\n );\n\n await this.#refreshAccounts({\n networkClientIds,\n queryAllAccounts: true,\n selectedAccount: '0x0',\n allAccounts: accounts,\n });\n }\n\n async #refreshAccounts({\n networkClientIds,\n queryAllAccounts,\n selectedAccount,\n allAccounts,\n }: {\n networkClientIds: NetworkClientId[];\n queryAllAccounts: boolean;\n selectedAccount: ChecksumAddress;\n allAccounts: InternalAccount[];\n }): Promise<void> {\n const releaseLock = await this.#refreshMutex.acquire();\n try {\n const chainIds = networkClientIds.map((networkClientId) => {\n const { chainId } = this.#getCorrectNetworkClient(networkClientId);\n return chainId;\n });\n\n this.#syncAccounts(chainIds);\n\n if (!this.#fetchingEnabled() || !this.isActive) {\n return;\n }\n\n // Use balance fetchers with fallback strategy\n const aggregated: ProcessedBalance[] = [];\n let remainingChains = [...chainIds] as ChainIdHex[];\n\n // Temporary normalization to lowercase for balance fetching to match TokenBalancesController and enable HTTP caching\n const lowerCaseSelectedAccount =\n selectedAccount.toLowerCase() as ChecksumAddress;\n const lowerCaseAllAccounts = allAccounts.map((account) => ({\n ...account,\n address: account.address.toLowerCase(),\n }));\n\n // Try each fetcher in order, removing successfully processed chains\n for (const fetcher of this.#balanceFetchers) {\n const supportedChains = remainingChains.filter((chainId) =>\n fetcher.supports(chainId),\n );\n if (!supportedChains.length) {\n continue;\n }\n\n try {\n const result = await fetcher.fetch({\n chainIds: supportedChains,\n queryAllAccounts,\n selectedAccount: lowerCaseSelectedAccount,\n allAccounts: lowerCaseAllAccounts,\n });\n\n if (result.balances && result.balances.length > 0) {\n aggregated.push(...result.balances);\n // Remove chains that were successfully processed\n const processedChains = new Set(\n result.balances.map((b) => b.chainId),\n );\n remainingChains = remainingChains.filter(\n (chain) => !processedChains.has(chain),\n );\n }\n\n // Add unprocessed chains back to remainingChains for next fetcher\n if (\n result.unprocessedChainIds &&\n result.unprocessedChainIds.length > 0\n ) {\n // Only add chains that were originally requested and aren't already in remainingChains\n const currentRemainingChains = remainingChains;\n const chainsToAdd = result.unprocessedChainIds.filter(\n (chainId) =>\n supportedChains.includes(chainId) &&\n !currentRemainingChains.includes(chainId),\n );\n remainingChains.push(...chainsToAdd);\n }\n } catch (error) {\n console.warn(\n `Balance fetcher failed for chains ${supportedChains.join(', ')}: ${String(error)}`,\n );\n // Continue to next fetcher (fallback)\n }\n\n // If all chains have been processed, break early\n if (remainingChains.length === 0) {\n break;\n }\n }\n\n // Build a _copy_ of the current state and track whether anything changed\n const nextAccountsByChainId: AccountTrackerControllerState['accountsByChainId'] =\n cloneDeep(this.state.accountsByChainId);\n let hasChanges = false;\n\n // Process the aggregated balance results\n const stakedBalancesByChainAndAddress: Record<\n string,\n Record<string, string>\n > = {};\n\n aggregated.forEach(({ success, value, account, token, chainId }) => {\n if (success && value !== undefined) {\n const checksumAddress = toChecksumHexAddress(account);\n const hexValue = `0x${value.toString(16)}`;\n\n if (token === ZERO_ADDRESS) {\n // Native balance\n // Ensure the account entry exists before accessing it\n if (!nextAccountsByChainId[chainId]) {\n nextAccountsByChainId[chainId] = {};\n }\n if (!nextAccountsByChainId[chainId][checksumAddress]) {\n nextAccountsByChainId[chainId][checksumAddress] = {\n balance: '0x0',\n };\n }\n\n if (\n nextAccountsByChainId[chainId][checksumAddress].balance !==\n hexValue\n ) {\n nextAccountsByChainId[chainId][checksumAddress].balance =\n hexValue;\n hasChanges = true;\n }\n } else if (\n STAKING_CONTRACT_ADDRESS_BY_CHAINID[chainId]?.toLowerCase() ===\n token.toLowerCase()\n ) {\n // Staked balance (from staking contract address)\n if (!stakedBalancesByChainAndAddress[chainId]) {\n stakedBalancesByChainAndAddress[chainId] = {};\n }\n stakedBalancesByChainAndAddress[chainId][checksumAddress] =\n hexValue;\n }\n }\n });\n\n // Apply staked balances\n Object.entries(stakedBalancesByChainAndAddress).forEach(\n ([chainId, balancesByAddress]) => {\n Object.entries(balancesByAddress).forEach(\n ([address, stakedBalance]) => {\n // Ensure account structure exists\n if (!nextAccountsByChainId[chainId]) {\n nextAccountsByChainId[chainId] = {};\n }\n if (!nextAccountsByChainId[chainId][address]) {\n nextAccountsByChainId[chainId][address] = { balance: '0x0' };\n }\n if (\n nextAccountsByChainId[chainId][address].stakedBalance !==\n stakedBalance\n ) {\n nextAccountsByChainId[chainId][address].stakedBalance =\n stakedBalance;\n hasChanges = true;\n }\n },\n );\n },\n );\n\n // Only update state if something changed\n if (hasChanges) {\n this.update((state) => {\n state.accountsByChainId = nextAccountsByChainId;\n });\n }\n } finally {\n releaseLock();\n }\n }\n\n /**\n * Sync accounts balances with some additional addresses.\n *\n * @param addresses - the additional addresses, may be hardware wallet addresses.\n * @param networkClientId - Optional networkClientId to fetch a network client with.\n * @returns accounts - addresses with synced balance\n */\n async syncBalanceWithAddresses(\n addresses: string[],\n networkClientId?: NetworkClientId,\n ): Promise<\n Record<string, { balance: string; stakedBalance?: StakedBalance }>\n > {\n // Skip balance fetching if locked or not onboarded to avoid unnecessary RPC calls\n if (!this.isActive) {\n return {};\n }\n\n const { ethQuery } = this.#getCorrectNetworkClient(networkClientId);\n\n // TODO: This should use multicall when enabled by the user.\n return await Promise.all(\n addresses.map(\n (address): Promise<[string, string, StakedBalance] | undefined> => {\n return safelyExecuteWithTimeout(async () => {\n assert(ethQuery, 'Provider not set.');\n const balance = await query(ethQuery, 'getBalance', [address]);\n\n let stakedBalance: StakedBalance;\n if (this.#includeStakedAssets) {\n stakedBalance = (\n await this.#getStakedBalanceForChain([address], networkClientId)\n )[address];\n }\n return [address, balance, stakedBalance];\n });\n },\n ),\n ).then((value) => {\n return value.reduce((obj, item) => {\n if (!item) {\n return obj;\n }\n\n const [address, balance, stakedBalance] = item;\n return {\n ...obj,\n [address]: {\n balance,\n stakedBalance,\n },\n };\n }, {});\n });\n }\n\n /**\n * Updates the balances of multiple native tokens in a single batch operation.\n * This is more efficient than calling updateNativeToken multiple times as it\n * triggers only one state update.\n *\n * @param balances - Array of balance updates, each containing address, chainId, and balance.\n */\n updateNativeBalances(\n balances: { address: string; chainId: Hex; balance: Hex }[],\n ): void {\n const nextAccountsByChainId = cloneDeep(this.state.accountsByChainId);\n let hasChanges = false;\n\n balances.forEach(({ address, chainId, balance }) => {\n const checksumAddress = toChecksumHexAddress(address);\n\n // Ensure the chainId exists in the state\n if (!nextAccountsByChainId[chainId]) {\n nextAccountsByChainId[chainId] = {};\n hasChanges = true;\n }\n\n // Check if the address exists for this chain\n const accountExists = Boolean(\n nextAccountsByChainId[chainId][checksumAddress],\n );\n\n // Ensure the address exists for this chain\n if (!accountExists) {\n nextAccountsByChainId[chainId][checksumAddress] = {\n balance: '0x0',\n };\n hasChanges = true;\n }\n\n // Only update the balance if it has changed, or if this is a new account\n const currentBalance =\n nextAccountsByChainId[chainId][checksumAddress].balance;\n if (!accountExists || currentBalance !== balance) {\n nextAccountsByChainId[chainId][checksumAddress].balance = balance;\n hasChanges = true;\n }\n });\n\n // Only call update if there are actual changes\n if (hasChanges) {\n this.update((state) => {\n state.accountsByChainId = nextAccountsByChainId;\n });\n }\n }\n\n /**\n * Updates the staked balances of multiple accounts in a single batch operation.\n * This is more efficient than updating staked balances individually as it\n * triggers only one state update.\n *\n * @param stakedBalances - Array of staked balance updates, each containing address, chainId, and stakedBalance.\n */\n updateStakedBalances(\n stakedBalances: {\n address: string;\n chainId: Hex;\n stakedBalance: StakedBalance;\n }[],\n ): void {\n const nextAccountsByChainId = cloneDeep(this.state.accountsByChainId);\n let hasChanges = false;\n\n stakedBalances.forEach(({ address, chainId, stakedBalance }) => {\n const checksumAddress = toChecksumHexAddress(address);\n\n // Ensure the chainId exists in the state\n if (!nextAccountsByChainId[chainId]) {\n nextAccountsByChainId[chainId] = {};\n hasChanges = true;\n }\n\n // Check if the address exists for this chain\n const accountExists = Boolean(\n nextAccountsByChainId[chainId][checksumAddress],\n );\n\n // Ensure the address exists for this chain\n if (!accountExists) {\n nextAccountsByChainId[chainId][checksumAddress] = {\n balance: '0x0',\n };\n hasChanges = true;\n }\n\n // Only update the staked balance if it has changed, or if this is a new account\n const currentStakedBalance =\n nextAccountsByChainId[chainId][checksumAddress].stakedBalance;\n if (!accountExists || !isEqual(currentStakedBalance, stakedBalance)) {\n nextAccountsByChainId[chainId][checksumAddress].stakedBalance =\n stakedBalance;\n hasChanges = true;\n }\n });\n\n // Only call update if there are actual changes\n if (hasChanges) {\n this.update((state) => {\n state.accountsByChainId = nextAccountsByChainId;\n });\n }\n }\n}\n\nexport default AccountTrackerController;\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This file is auto generated by `scripts/generate-method-action-types.ts`.
|
|
4
|
+
* Do not edit manually.
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
//# sourceMappingURL=AssetsContractController-method-action-types.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AssetsContractController-method-action-types.cjs","sourceRoot":"","sources":["../src/AssetsContractController-method-action-types.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/**\n * This file is auto generated by `scripts/generate-method-action-types.ts`.\n * Do not edit manually.\n */\n\nimport type { AssetsContractController } from './AssetsContractController';\n\n/**\n * Get a ERC20Standard instance using the relevant provider instance.\n *\n * @param networkClientId - Network Client ID used to get the provider.\n * @returns ERC20Standard instance.\n */\nexport type AssetsContractControllerGetERC20StandardAction = {\n type: `AssetsContractController:getERC20Standard`;\n handler: AssetsContractController['getERC20Standard'];\n};\n\n/**\n * Get a ERC721Standard instance using the relevant provider instance.\n *\n * @param networkClientId - Network Client ID used to get the provider.\n * @returns ERC721Standard instance.\n */\nexport type AssetsContractControllerGetERC721StandardAction = {\n type: `AssetsContractController:getERC721Standard`;\n handler: AssetsContractController['getERC721Standard'];\n};\n\n/**\n * Get a ERC1155Standard instance using the relevant provider instance.\n *\n * @param networkClientId - Network Client ID used to get the provider.\n * @returns ERC1155Standard instance.\n */\nexport type AssetsContractControllerGetERC1155StandardAction = {\n type: `AssetsContractController:getERC1155Standard`;\n handler: AssetsContractController['getERC1155Standard'];\n};\n\n/**\n * Get balance or count for current account on specific asset contract.\n *\n * @param address - Asset ERC20 contract address.\n * @param selectedAddress - Current account public address.\n * @param networkClientId - Network Client ID to fetch the provider with.\n * @returns Promise resolving to BN object containing balance for current account on specific asset contract.\n */\nexport type AssetsContractControllerGetERC20BalanceOfAction = {\n type: `AssetsContractController:getERC20BalanceOf`;\n handler: AssetsContractController['getERC20BalanceOf'];\n};\n\n/**\n * Query for the decimals for a given ERC20 asset.\n *\n * @param address - ERC20 asset contract address.\n * @param networkClientId - Network Client ID to fetch the provider with.\n * @returns Promise resolving to the 'decimals'.\n */\nexport type AssetsContractControllerGetERC20TokenDecimalsAction = {\n type: `AssetsContractController:getERC20TokenDecimals`;\n handler: AssetsContractController['getERC20TokenDecimals'];\n};\n\n/**\n * Query for the name for a given ERC20 asset.\n *\n * @param address - ERC20 asset contract address.\n * @param networkClientId - Network Client ID to fetch the provider with.\n * @returns Promise resolving to the 'decimals'.\n */\nexport type AssetsContractControllerGetERC20TokenNameAction = {\n type: `AssetsContractController:getERC20TokenName`;\n handler: AssetsContractController['getERC20TokenName'];\n};\n\n/**\n * Enumerate assets assigned to an owner.\n *\n * @param address - ERC721 asset contract address.\n * @param selectedAddress - Current account public address.\n * @param index - An NFT counter less than `balanceOf(selectedAddress)`.\n * @param networkClientId - Network Client ID to fetch the provider with.\n * @returns Promise resolving to token identifier for the 'index'th asset assigned to 'selectedAddress'.\n */\nexport type AssetsContractControllerGetERC721NftTokenIdAction = {\n type: `AssetsContractController:getERC721NftTokenId`;\n handler: AssetsContractController['getERC721NftTokenId'];\n};\n\n/**\n * Enumerate assets assigned to an owner.\n *\n * @param tokenAddress - ERC721 asset contract address.\n * @param userAddress - Current account public address.\n * @param tokenId - ERC721 asset identifier.\n * @param networkClientId - Network Client ID to fetch the provider with.\n * @returns Promise resolving to an object containing the token standard and a set of details which depend on which standard the token supports.\n */\nexport type AssetsContractControllerGetTokenStandardAndDetailsAction = {\n type: `AssetsContractController:getTokenStandardAndDetails`;\n handler: AssetsContractController['getTokenStandardAndDetails'];\n};\n\n/**\n * Query for tokenURI for a given ERC721 asset.\n *\n * @param address - ERC721 asset contract address.\n * @param tokenId - ERC721 asset identifier.\n * @param networkClientId - Network Client ID to fetch the provider with.\n * @returns Promise resolving to the 'tokenURI'.\n */\nexport type AssetsContractControllerGetERC721TokenURIAction = {\n type: `AssetsContractController:getERC721TokenURI`;\n handler: AssetsContractController['getERC721TokenURI'];\n};\n\n/**\n * Query for name for a given asset.\n *\n * @param address - ERC721 or ERC20 asset contract address.\n * @param networkClientId - Network Client ID to fetch the provider with.\n * @returns Promise resolving to the 'name'.\n */\nexport type AssetsContractControllerGetERC721AssetNameAction = {\n type: `AssetsContractController:getERC721AssetName`;\n handler: AssetsContractController['getERC721AssetName'];\n};\n\n/**\n * Query for symbol for a given asset.\n *\n * @param address - ERC721 or ERC20 asset contract address.\n * @param networkClientId - Network Client ID to fetch the provider with.\n * @returns Promise resolving to the 'symbol'.\n */\nexport type AssetsContractControllerGetERC721AssetSymbolAction = {\n type: `AssetsContractController:getERC721AssetSymbol`;\n handler: AssetsContractController['getERC721AssetSymbol'];\n};\n\n/**\n * Query for owner for a given ERC721 asset.\n *\n * @param address - ERC721 asset contract address.\n * @param tokenId - ERC721 asset identifier.\n * @param networkClientId - Network Client ID to fetch the provider with.\n * @returns Promise resolving to the owner address.\n */\nexport type AssetsContractControllerGetERC721OwnerOfAction = {\n type: `AssetsContractController:getERC721OwnerOf`;\n handler: AssetsContractController['getERC721OwnerOf'];\n};\n\n/**\n * Query for tokenURI for a given asset.\n *\n * @param address - ERC1155 asset contract address.\n * @param tokenId - ERC1155 asset identifier.\n * @param networkClientId - Network Client ID to fetch the provider with.\n * @returns Promise resolving to the 'tokenURI'.\n */\nexport type AssetsContractControllerGetERC1155TokenURIAction = {\n type: `AssetsContractController:getERC1155TokenURI`;\n handler: AssetsContractController['getERC1155TokenURI'];\n};\n\n/**\n * Query for balance of a given ERC 1155 token.\n *\n * @param userAddress - Wallet public address.\n * @param nftAddress - ERC1155 asset contract address.\n * @param nftId - ERC1155 asset identifier.\n * @param networkClientId - Network Client ID to fetch the provider with.\n * @returns Promise resolving to the 'balanceOf'.\n */\nexport type AssetsContractControllerGetERC1155BalanceOfAction = {\n type: `AssetsContractController:getERC1155BalanceOf`;\n handler: AssetsContractController['getERC1155BalanceOf'];\n};\n\n/**\n * Transfer single ERC1155 token.\n *\n * @param nftAddress - ERC1155 token address.\n * @param senderAddress - ERC1155 token sender.\n * @param recipientAddress - ERC1155 token recipient.\n * @param nftId - ERC1155 token id.\n * @param qty - Quantity of tokens to be sent.\n * @param networkClientId - Network Client ID to fetch the provider with.\n * @returns Promise resolving to the 'transferSingle' ERC1155 token.\n */\nexport type AssetsContractControllerTransferSingleERC1155Action = {\n type: `AssetsContractController:transferSingleERC1155`;\n handler: AssetsContractController['transferSingleERC1155'];\n};\n\n/**\n * Get the token balance for a list of token addresses in a single call. Only non-zero balances\n * are returned.\n *\n * @param selectedAddress - The address to check token balances for.\n * @param tokensToDetect - The token addresses to detect balances for.\n * @param networkClientId - Network Client ID to fetch the provider with.\n * @returns The list of non-zero token balances.\n */\nexport type AssetsContractControllerGetBalancesInSingleCallAction = {\n type: `AssetsContractController:getBalancesInSingleCall`;\n handler: AssetsContractController['getBalancesInSingleCall'];\n};\n\n/**\n * Get the staked ethereum balance for multiple addresses in a single call.\n *\n * @param addresses - The addresses to check staked ethereum balance for.\n * @param networkClientId - Network Client ID to fetch the provider with.\n * @returns The hex staked ethereum balance for address.\n */\nexport type AssetsContractControllerGetStakedBalanceForChainAction = {\n type: `AssetsContractController:getStakedBalanceForChain`;\n handler: AssetsContractController['getStakedBalanceForChain'];\n};\n\n/**\n * Union of all AssetsContractController action types.\n */\nexport type AssetsContractControllerMethodActions =\n | AssetsContractControllerGetERC20StandardAction\n | AssetsContractControllerGetERC721StandardAction\n | AssetsContractControllerGetERC1155StandardAction\n | AssetsContractControllerGetERC20BalanceOfAction\n | AssetsContractControllerGetERC20TokenDecimalsAction\n | AssetsContractControllerGetERC20TokenNameAction\n | AssetsContractControllerGetERC721NftTokenIdAction\n | AssetsContractControllerGetTokenStandardAndDetailsAction\n | AssetsContractControllerGetERC721TokenURIAction\n | AssetsContractControllerGetERC721AssetNameAction\n | AssetsContractControllerGetERC721AssetSymbolAction\n | AssetsContractControllerGetERC721OwnerOfAction\n | AssetsContractControllerGetERC1155TokenURIAction\n | AssetsContractControllerGetERC1155BalanceOfAction\n | AssetsContractControllerTransferSingleERC1155Action\n | AssetsContractControllerGetBalancesInSingleCallAction\n | AssetsContractControllerGetStakedBalanceForChainAction;\n"]}
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is auto generated by `scripts/generate-method-action-types.ts`.
|
|
3
|
+
* Do not edit manually.
|
|
4
|
+
*/
|
|
5
|
+
import type { AssetsContractController } from "./AssetsContractController.cjs";
|
|
6
|
+
/**
|
|
7
|
+
* Get a ERC20Standard instance using the relevant provider instance.
|
|
8
|
+
*
|
|
9
|
+
* @param networkClientId - Network Client ID used to get the provider.
|
|
10
|
+
* @returns ERC20Standard instance.
|
|
11
|
+
*/
|
|
12
|
+
export type AssetsContractControllerGetERC20StandardAction = {
|
|
13
|
+
type: `AssetsContractController:getERC20Standard`;
|
|
14
|
+
handler: AssetsContractController['getERC20Standard'];
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Get a ERC721Standard instance using the relevant provider instance.
|
|
18
|
+
*
|
|
19
|
+
* @param networkClientId - Network Client ID used to get the provider.
|
|
20
|
+
* @returns ERC721Standard instance.
|
|
21
|
+
*/
|
|
22
|
+
export type AssetsContractControllerGetERC721StandardAction = {
|
|
23
|
+
type: `AssetsContractController:getERC721Standard`;
|
|
24
|
+
handler: AssetsContractController['getERC721Standard'];
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Get a ERC1155Standard instance using the relevant provider instance.
|
|
28
|
+
*
|
|
29
|
+
* @param networkClientId - Network Client ID used to get the provider.
|
|
30
|
+
* @returns ERC1155Standard instance.
|
|
31
|
+
*/
|
|
32
|
+
export type AssetsContractControllerGetERC1155StandardAction = {
|
|
33
|
+
type: `AssetsContractController:getERC1155Standard`;
|
|
34
|
+
handler: AssetsContractController['getERC1155Standard'];
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Get balance or count for current account on specific asset contract.
|
|
38
|
+
*
|
|
39
|
+
* @param address - Asset ERC20 contract address.
|
|
40
|
+
* @param selectedAddress - Current account public address.
|
|
41
|
+
* @param networkClientId - Network Client ID to fetch the provider with.
|
|
42
|
+
* @returns Promise resolving to BN object containing balance for current account on specific asset contract.
|
|
43
|
+
*/
|
|
44
|
+
export type AssetsContractControllerGetERC20BalanceOfAction = {
|
|
45
|
+
type: `AssetsContractController:getERC20BalanceOf`;
|
|
46
|
+
handler: AssetsContractController['getERC20BalanceOf'];
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Query for the decimals for a given ERC20 asset.
|
|
50
|
+
*
|
|
51
|
+
* @param address - ERC20 asset contract address.
|
|
52
|
+
* @param networkClientId - Network Client ID to fetch the provider with.
|
|
53
|
+
* @returns Promise resolving to the 'decimals'.
|
|
54
|
+
*/
|
|
55
|
+
export type AssetsContractControllerGetERC20TokenDecimalsAction = {
|
|
56
|
+
type: `AssetsContractController:getERC20TokenDecimals`;
|
|
57
|
+
handler: AssetsContractController['getERC20TokenDecimals'];
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* Query for the name for a given ERC20 asset.
|
|
61
|
+
*
|
|
62
|
+
* @param address - ERC20 asset contract address.
|
|
63
|
+
* @param networkClientId - Network Client ID to fetch the provider with.
|
|
64
|
+
* @returns Promise resolving to the 'decimals'.
|
|
65
|
+
*/
|
|
66
|
+
export type AssetsContractControllerGetERC20TokenNameAction = {
|
|
67
|
+
type: `AssetsContractController:getERC20TokenName`;
|
|
68
|
+
handler: AssetsContractController['getERC20TokenName'];
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* Enumerate assets assigned to an owner.
|
|
72
|
+
*
|
|
73
|
+
* @param address - ERC721 asset contract address.
|
|
74
|
+
* @param selectedAddress - Current account public address.
|
|
75
|
+
* @param index - An NFT counter less than `balanceOf(selectedAddress)`.
|
|
76
|
+
* @param networkClientId - Network Client ID to fetch the provider with.
|
|
77
|
+
* @returns Promise resolving to token identifier for the 'index'th asset assigned to 'selectedAddress'.
|
|
78
|
+
*/
|
|
79
|
+
export type AssetsContractControllerGetERC721NftTokenIdAction = {
|
|
80
|
+
type: `AssetsContractController:getERC721NftTokenId`;
|
|
81
|
+
handler: AssetsContractController['getERC721NftTokenId'];
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* Enumerate assets assigned to an owner.
|
|
85
|
+
*
|
|
86
|
+
* @param tokenAddress - ERC721 asset contract address.
|
|
87
|
+
* @param userAddress - Current account public address.
|
|
88
|
+
* @param tokenId - ERC721 asset identifier.
|
|
89
|
+
* @param networkClientId - Network Client ID to fetch the provider with.
|
|
90
|
+
* @returns Promise resolving to an object containing the token standard and a set of details which depend on which standard the token supports.
|
|
91
|
+
*/
|
|
92
|
+
export type AssetsContractControllerGetTokenStandardAndDetailsAction = {
|
|
93
|
+
type: `AssetsContractController:getTokenStandardAndDetails`;
|
|
94
|
+
handler: AssetsContractController['getTokenStandardAndDetails'];
|
|
95
|
+
};
|
|
96
|
+
/**
|
|
97
|
+
* Query for tokenURI for a given ERC721 asset.
|
|
98
|
+
*
|
|
99
|
+
* @param address - ERC721 asset contract address.
|
|
100
|
+
* @param tokenId - ERC721 asset identifier.
|
|
101
|
+
* @param networkClientId - Network Client ID to fetch the provider with.
|
|
102
|
+
* @returns Promise resolving to the 'tokenURI'.
|
|
103
|
+
*/
|
|
104
|
+
export type AssetsContractControllerGetERC721TokenURIAction = {
|
|
105
|
+
type: `AssetsContractController:getERC721TokenURI`;
|
|
106
|
+
handler: AssetsContractController['getERC721TokenURI'];
|
|
107
|
+
};
|
|
108
|
+
/**
|
|
109
|
+
* Query for name for a given asset.
|
|
110
|
+
*
|
|
111
|
+
* @param address - ERC721 or ERC20 asset contract address.
|
|
112
|
+
* @param networkClientId - Network Client ID to fetch the provider with.
|
|
113
|
+
* @returns Promise resolving to the 'name'.
|
|
114
|
+
*/
|
|
115
|
+
export type AssetsContractControllerGetERC721AssetNameAction = {
|
|
116
|
+
type: `AssetsContractController:getERC721AssetName`;
|
|
117
|
+
handler: AssetsContractController['getERC721AssetName'];
|
|
118
|
+
};
|
|
119
|
+
/**
|
|
120
|
+
* Query for symbol for a given asset.
|
|
121
|
+
*
|
|
122
|
+
* @param address - ERC721 or ERC20 asset contract address.
|
|
123
|
+
* @param networkClientId - Network Client ID to fetch the provider with.
|
|
124
|
+
* @returns Promise resolving to the 'symbol'.
|
|
125
|
+
*/
|
|
126
|
+
export type AssetsContractControllerGetERC721AssetSymbolAction = {
|
|
127
|
+
type: `AssetsContractController:getERC721AssetSymbol`;
|
|
128
|
+
handler: AssetsContractController['getERC721AssetSymbol'];
|
|
129
|
+
};
|
|
130
|
+
/**
|
|
131
|
+
* Query for owner for a given ERC721 asset.
|
|
132
|
+
*
|
|
133
|
+
* @param address - ERC721 asset contract address.
|
|
134
|
+
* @param tokenId - ERC721 asset identifier.
|
|
135
|
+
* @param networkClientId - Network Client ID to fetch the provider with.
|
|
136
|
+
* @returns Promise resolving to the owner address.
|
|
137
|
+
*/
|
|
138
|
+
export type AssetsContractControllerGetERC721OwnerOfAction = {
|
|
139
|
+
type: `AssetsContractController:getERC721OwnerOf`;
|
|
140
|
+
handler: AssetsContractController['getERC721OwnerOf'];
|
|
141
|
+
};
|
|
142
|
+
/**
|
|
143
|
+
* Query for tokenURI for a given asset.
|
|
144
|
+
*
|
|
145
|
+
* @param address - ERC1155 asset contract address.
|
|
146
|
+
* @param tokenId - ERC1155 asset identifier.
|
|
147
|
+
* @param networkClientId - Network Client ID to fetch the provider with.
|
|
148
|
+
* @returns Promise resolving to the 'tokenURI'.
|
|
149
|
+
*/
|
|
150
|
+
export type AssetsContractControllerGetERC1155TokenURIAction = {
|
|
151
|
+
type: `AssetsContractController:getERC1155TokenURI`;
|
|
152
|
+
handler: AssetsContractController['getERC1155TokenURI'];
|
|
153
|
+
};
|
|
154
|
+
/**
|
|
155
|
+
* Query for balance of a given ERC 1155 token.
|
|
156
|
+
*
|
|
157
|
+
* @param userAddress - Wallet public address.
|
|
158
|
+
* @param nftAddress - ERC1155 asset contract address.
|
|
159
|
+
* @param nftId - ERC1155 asset identifier.
|
|
160
|
+
* @param networkClientId - Network Client ID to fetch the provider with.
|
|
161
|
+
* @returns Promise resolving to the 'balanceOf'.
|
|
162
|
+
*/
|
|
163
|
+
export type AssetsContractControllerGetERC1155BalanceOfAction = {
|
|
164
|
+
type: `AssetsContractController:getERC1155BalanceOf`;
|
|
165
|
+
handler: AssetsContractController['getERC1155BalanceOf'];
|
|
166
|
+
};
|
|
167
|
+
/**
|
|
168
|
+
* Transfer single ERC1155 token.
|
|
169
|
+
*
|
|
170
|
+
* @param nftAddress - ERC1155 token address.
|
|
171
|
+
* @param senderAddress - ERC1155 token sender.
|
|
172
|
+
* @param recipientAddress - ERC1155 token recipient.
|
|
173
|
+
* @param nftId - ERC1155 token id.
|
|
174
|
+
* @param qty - Quantity of tokens to be sent.
|
|
175
|
+
* @param networkClientId - Network Client ID to fetch the provider with.
|
|
176
|
+
* @returns Promise resolving to the 'transferSingle' ERC1155 token.
|
|
177
|
+
*/
|
|
178
|
+
export type AssetsContractControllerTransferSingleERC1155Action = {
|
|
179
|
+
type: `AssetsContractController:transferSingleERC1155`;
|
|
180
|
+
handler: AssetsContractController['transferSingleERC1155'];
|
|
181
|
+
};
|
|
182
|
+
/**
|
|
183
|
+
* Get the token balance for a list of token addresses in a single call. Only non-zero balances
|
|
184
|
+
* are returned.
|
|
185
|
+
*
|
|
186
|
+
* @param selectedAddress - The address to check token balances for.
|
|
187
|
+
* @param tokensToDetect - The token addresses to detect balances for.
|
|
188
|
+
* @param networkClientId - Network Client ID to fetch the provider with.
|
|
189
|
+
* @returns The list of non-zero token balances.
|
|
190
|
+
*/
|
|
191
|
+
export type AssetsContractControllerGetBalancesInSingleCallAction = {
|
|
192
|
+
type: `AssetsContractController:getBalancesInSingleCall`;
|
|
193
|
+
handler: AssetsContractController['getBalancesInSingleCall'];
|
|
194
|
+
};
|
|
195
|
+
/**
|
|
196
|
+
* Get the staked ethereum balance for multiple addresses in a single call.
|
|
197
|
+
*
|
|
198
|
+
* @param addresses - The addresses to check staked ethereum balance for.
|
|
199
|
+
* @param networkClientId - Network Client ID to fetch the provider with.
|
|
200
|
+
* @returns The hex staked ethereum balance for address.
|
|
201
|
+
*/
|
|
202
|
+
export type AssetsContractControllerGetStakedBalanceForChainAction = {
|
|
203
|
+
type: `AssetsContractController:getStakedBalanceForChain`;
|
|
204
|
+
handler: AssetsContractController['getStakedBalanceForChain'];
|
|
205
|
+
};
|
|
206
|
+
/**
|
|
207
|
+
* Union of all AssetsContractController action types.
|
|
208
|
+
*/
|
|
209
|
+
export type AssetsContractControllerMethodActions = AssetsContractControllerGetERC20StandardAction | AssetsContractControllerGetERC721StandardAction | AssetsContractControllerGetERC1155StandardAction | AssetsContractControllerGetERC20BalanceOfAction | AssetsContractControllerGetERC20TokenDecimalsAction | AssetsContractControllerGetERC20TokenNameAction | AssetsContractControllerGetERC721NftTokenIdAction | AssetsContractControllerGetTokenStandardAndDetailsAction | AssetsContractControllerGetERC721TokenURIAction | AssetsContractControllerGetERC721AssetNameAction | AssetsContractControllerGetERC721AssetSymbolAction | AssetsContractControllerGetERC721OwnerOfAction | AssetsContractControllerGetERC1155TokenURIAction | AssetsContractControllerGetERC1155BalanceOfAction | AssetsContractControllerTransferSingleERC1155Action | AssetsContractControllerGetBalancesInSingleCallAction | AssetsContractControllerGetStakedBalanceForChainAction;
|
|
210
|
+
//# sourceMappingURL=AssetsContractController-method-action-types.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AssetsContractController-method-action-types.d.cts","sourceRoot":"","sources":["../src/AssetsContractController-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,wBAAwB,EAAE,uCAAmC;AAE3E;;;;;GAKG;AACH,MAAM,MAAM,8CAA8C,GAAG;IAC3D,IAAI,EAAE,2CAA2C,CAAC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