@metamask/assets-controllers 73.3.0 → 74.1.0

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.
Files changed (44) hide show
  1. package/CHANGELOG.md +51 -1
  2. package/dist/AccountTrackerController.cjs +214 -84
  3. package/dist/AccountTrackerController.cjs.map +1 -1
  4. package/dist/AccountTrackerController.d.cts +7 -1
  5. package/dist/AccountTrackerController.d.cts.map +1 -1
  6. package/dist/AccountTrackerController.d.mts +7 -1
  7. package/dist/AccountTrackerController.d.mts.map +1 -1
  8. package/dist/AccountTrackerController.mjs +216 -85
  9. package/dist/AccountTrackerController.mjs.map +1 -1
  10. package/dist/TokenBalancesController.cjs +14 -9
  11. package/dist/TokenBalancesController.cjs.map +1 -1
  12. package/dist/TokenBalancesController.d.cts.map +1 -1
  13. package/dist/TokenBalancesController.d.mts.map +1 -1
  14. package/dist/TokenBalancesController.mjs +15 -10
  15. package/dist/TokenBalancesController.mjs.map +1 -1
  16. package/dist/index.cjs +3 -1
  17. package/dist/index.cjs.map +1 -1
  18. package/dist/index.d.cts +2 -0
  19. package/dist/index.d.cts.map +1 -1
  20. package/dist/index.d.mts +2 -0
  21. package/dist/index.d.mts.map +1 -1
  22. package/dist/index.mjs +1 -0
  23. package/dist/index.mjs.map +1 -1
  24. package/dist/multicall.cjs +1 -1
  25. package/dist/multicall.cjs.map +1 -1
  26. package/dist/multicall.mjs +1 -1
  27. package/dist/multicall.mjs.map +1 -1
  28. package/dist/selectors/stringify-balance.cjs +43 -0
  29. package/dist/selectors/stringify-balance.cjs.map +1 -0
  30. package/dist/selectors/stringify-balance.d.cts +8 -0
  31. package/dist/selectors/stringify-balance.d.cts.map +1 -0
  32. package/dist/selectors/stringify-balance.d.mts +8 -0
  33. package/dist/selectors/stringify-balance.d.mts.map +1 -0
  34. package/dist/selectors/stringify-balance.mjs +39 -0
  35. package/dist/selectors/stringify-balance.mjs.map +1 -0
  36. package/dist/selectors/token-selectors.cjs +290 -0
  37. package/dist/selectors/token-selectors.cjs.map +1 -0
  38. package/dist/selectors/token-selectors.d.cts +810 -0
  39. package/dist/selectors/token-selectors.d.cts.map +1 -0
  40. package/dist/selectors/token-selectors.d.mts +810 -0
  41. package/dist/selectors/token-selectors.d.mts.map +1 -0
  42. package/dist/selectors/token-selectors.mjs +287 -0
  43. package/dist/selectors/token-selectors.mjs.map +1 -0
  44. package/package.json +12 -12
@@ -0,0 +1,810 @@
1
+ import type { AccountGroupId } from "@metamask/account-api";
2
+ import type { AccountTreeControllerState } from "@metamask/account-tree-controller";
3
+ import type { AccountsControllerState } from "@metamask/accounts-controller";
4
+ import type { InternalAccount } from "@metamask/keyring-internal-api";
5
+ import type { NetworkState } from "@metamask/network-controller";
6
+ import { type Hex } from "@metamask/utils";
7
+ import type { CurrencyRateState } from "../CurrencyRateController.cjs";
8
+ import type { MultichainAssetsControllerState } from "../MultichainAssetsController/index.cjs";
9
+ import type { MultichainAssetsRatesControllerState } from "../MultichainAssetsRatesController/index.cjs";
10
+ import type { MultichainBalancesControllerState } from "../MultichainBalancesController/index.cjs";
11
+ import type { TokenBalancesControllerState } from "../TokenBalancesController.cjs";
12
+ import type { Token, TokenRatesControllerState } from "../TokenRatesController.cjs";
13
+ import type { TokensControllerState } from "../TokensController.cjs";
14
+ type AssetsByAccountGroup = {
15
+ [accountGroupId: AccountGroupId]: AccountGroupAssets;
16
+ };
17
+ export type AccountGroupAssets = {
18
+ [network: string]: Asset[];
19
+ };
20
+ type EvmAccountType = Extract<InternalAccount['type'], `eip155:${string}`>;
21
+ type MultichainAccountType = Exclude<InternalAccount['type'], `eip155:${string}`>;
22
+ export type Asset = ({
23
+ type: EvmAccountType;
24
+ assetId: Hex;
25
+ address: Hex;
26
+ chainId: Hex;
27
+ } | {
28
+ type: MultichainAccountType;
29
+ assetId: `${string}:${string}/${string}:${string}`;
30
+ chainId: `${string}:${string}`;
31
+ }) & {
32
+ accountId: string;
33
+ image: string;
34
+ name: string;
35
+ symbol: string;
36
+ decimals: number;
37
+ isNative: boolean;
38
+ balance: string;
39
+ fiat: {
40
+ balance: number;
41
+ currency: string;
42
+ conversionRate: number;
43
+ } | undefined;
44
+ };
45
+ export type AssetListState = {
46
+ accountTree: AccountTreeControllerState['accountTree'];
47
+ internalAccounts: AccountsControllerState['internalAccounts'];
48
+ allTokens: TokensControllerState['allTokens'];
49
+ allIgnoredTokens: TokensControllerState['allIgnoredTokens'];
50
+ tokenBalances: TokenBalancesControllerState['tokenBalances'];
51
+ marketData: TokenRatesControllerState['marketData'];
52
+ currencyRates: CurrencyRateState['currencyRates'];
53
+ accountsAssets: MultichainAssetsControllerState['accountsAssets'];
54
+ assetsMetadata: MultichainAssetsControllerState['assetsMetadata'];
55
+ balances: MultichainBalancesControllerState['balances'];
56
+ conversionRates: MultichainAssetsRatesControllerState['conversionRates'];
57
+ currentCurrency: CurrencyRateState['currentCurrency'];
58
+ networkConfigurationsByChainId: NetworkState['networkConfigurationsByChainId'];
59
+ accountsByChainId: Record<Hex, Record<Hex, {
60
+ balance: Hex | null;
61
+ }>>;
62
+ };
63
+ export declare const selectAssetsBySelectedAccountGroup: ((state: AssetListState) => AccountGroupAssets) & {
64
+ clearCache: () => void;
65
+ resultsCount: () => number;
66
+ resetResultsCount: () => void;
67
+ } & {
68
+ resultFunc: (resultFuncArgs_0: AssetsByAccountGroup, resultFuncArgs_1: {
69
+ wallets: {
70
+ [walletId: `entropy:${string}`]: import("../../../account-tree-controller/src/wallet.cjs").AccountWalletEntropyObject | import("../../../account-tree-controller/src/wallet.cjs").AccountWalletSnapObject | import("../../../account-tree-controller/src/wallet.cjs").AccountWalletKeyringObject;
71
+ [walletId: `keyring:${string}`]: import("../../../account-tree-controller/src/wallet.cjs").AccountWalletEntropyObject | import("../../../account-tree-controller/src/wallet.cjs").AccountWalletSnapObject | import("../../../account-tree-controller/src/wallet.cjs").AccountWalletKeyringObject;
72
+ [walletId: `snap:${string}`]: import("../../../account-tree-controller/src/wallet.cjs").AccountWalletEntropyObject | import("../../../account-tree-controller/src/wallet.cjs").AccountWalletSnapObject | import("../../../account-tree-controller/src/wallet.cjs").AccountWalletKeyringObject;
73
+ };
74
+ selectedAccountGroup: "" | `entropy:${string}/${string}` | `keyring:${string}/${string}` | `snap:${string}/${string}`;
75
+ }) => AccountGroupAssets;
76
+ memoizedResultFunc: ((resultFuncArgs_0: AssetsByAccountGroup, resultFuncArgs_1: {
77
+ wallets: {
78
+ [walletId: `entropy:${string}`]: import("../../../account-tree-controller/src/wallet.cjs").AccountWalletEntropyObject | import("../../../account-tree-controller/src/wallet.cjs").AccountWalletSnapObject | import("../../../account-tree-controller/src/wallet.cjs").AccountWalletKeyringObject;
79
+ [walletId: `keyring:${string}`]: import("../../../account-tree-controller/src/wallet.cjs").AccountWalletEntropyObject | import("../../../account-tree-controller/src/wallet.cjs").AccountWalletSnapObject | import("../../../account-tree-controller/src/wallet.cjs").AccountWalletKeyringObject;
80
+ [walletId: `snap:${string}`]: import("../../../account-tree-controller/src/wallet.cjs").AccountWalletEntropyObject | import("../../../account-tree-controller/src/wallet.cjs").AccountWalletSnapObject | import("../../../account-tree-controller/src/wallet.cjs").AccountWalletKeyringObject;
81
+ };
82
+ selectedAccountGroup: "" | `entropy:${string}/${string}` | `keyring:${string}/${string}` | `snap:${string}/${string}`;
83
+ }) => AccountGroupAssets) & {
84
+ clearCache: () => void;
85
+ resultsCount: () => number;
86
+ resetResultsCount: () => void;
87
+ };
88
+ lastResult: () => AccountGroupAssets;
89
+ dependencies: [((state: AssetListState) => AssetsByAccountGroup) & {
90
+ clearCache: () => void;
91
+ resultsCount: () => number;
92
+ resetResultsCount: () => void;
93
+ } & {
94
+ resultFunc: (resultFuncArgs_0: AssetsByAccountGroup, resultFuncArgs_1: AssetsByAccountGroup, resultFuncArgs_2: AssetsByAccountGroup) => AssetsByAccountGroup;
95
+ memoizedResultFunc: ((resultFuncArgs_0: AssetsByAccountGroup, resultFuncArgs_1: AssetsByAccountGroup, resultFuncArgs_2: AssetsByAccountGroup) => AssetsByAccountGroup) & {
96
+ clearCache: () => void;
97
+ resultsCount: () => number;
98
+ resetResultsCount: () => void;
99
+ };
100
+ lastResult: () => AssetsByAccountGroup;
101
+ dependencies: [((state: AssetListState) => AssetsByAccountGroup) & {
102
+ clearCache: () => void;
103
+ resultsCount: () => number;
104
+ resetResultsCount: () => void;
105
+ } & {
106
+ resultFunc: (resultFuncArgs_0: Record<string, {
107
+ accountGroupId: AccountGroupId;
108
+ type: InternalAccount['type'];
109
+ accountId: string;
110
+ }>, resultFuncArgs_1: {
111
+ [chainId: `0x${string}`]: {
112
+ [key: string]: Token[];
113
+ };
114
+ }, resultFuncArgs_2: {
115
+ [chainId: `0x${string}`]: {
116
+ [key: string]: string[];
117
+ };
118
+ }, resultFuncArgs_3: import("../TokenBalancesController.cjs").TokenBalances, resultFuncArgs_4: Record<`0x${string}`, Record<`0x${string}`, import("../TokenRatesController.cjs").MarketDataDetails>>, resultFuncArgs_5: Record<string, {
119
+ conversionDate: number | null;
120
+ conversionRate: number | null;
121
+ usdConversionRate: number | null;
122
+ }>, resultFuncArgs_6: string) => AssetsByAccountGroup;
123
+ memoizedResultFunc: ((resultFuncArgs_0: Record<string, {
124
+ accountGroupId: AccountGroupId;
125
+ type: InternalAccount['type'];
126
+ accountId: string;
127
+ }>, resultFuncArgs_1: {
128
+ [chainId: `0x${string}`]: {
129
+ [key: string]: Token[];
130
+ };
131
+ }, resultFuncArgs_2: {
132
+ [chainId: `0x${string}`]: {
133
+ [key: string]: string[];
134
+ };
135
+ }, resultFuncArgs_3: import("../TokenBalancesController.cjs").TokenBalances, resultFuncArgs_4: Record<`0x${string}`, Record<`0x${string}`, import("../TokenRatesController.cjs").MarketDataDetails>>, resultFuncArgs_5: Record<string, {
136
+ conversionDate: number | null;
137
+ conversionRate: number | null;
138
+ usdConversionRate: number | null;
139
+ }>, resultFuncArgs_6: string) => AssetsByAccountGroup) & {
140
+ clearCache: () => void;
141
+ resultsCount: () => number;
142
+ resetResultsCount: () => void;
143
+ };
144
+ lastResult: () => AssetsByAccountGroup;
145
+ dependencies: [((state: AssetListState) => Record<string, {
146
+ accountGroupId: AccountGroupId;
147
+ type: InternalAccount['type'];
148
+ accountId: string;
149
+ }>) & {
150
+ clearCache: () => void;
151
+ resultsCount: () => number;
152
+ resetResultsCount: () => void;
153
+ } & {
154
+ resultFunc: (resultFuncArgs_0: {
155
+ wallets: {
156
+ [walletId: `entropy:${string}`]: import("../../../account-tree-controller/src/wallet.cjs").AccountWalletEntropyObject | import("../../../account-tree-controller/src/wallet.cjs").AccountWalletSnapObject | import("../../../account-tree-controller/src/wallet.cjs").AccountWalletKeyringObject;
157
+ [walletId: `keyring:${string}`]: import("../../../account-tree-controller/src/wallet.cjs").AccountWalletEntropyObject | import("../../../account-tree-controller/src/wallet.cjs").AccountWalletSnapObject | import("../../../account-tree-controller/src/wallet.cjs").AccountWalletKeyringObject;
158
+ [walletId: `snap:${string}`]: import("../../../account-tree-controller/src/wallet.cjs").AccountWalletEntropyObject | import("../../../account-tree-controller/src/wallet.cjs").AccountWalletSnapObject | import("../../../account-tree-controller/src/wallet.cjs").AccountWalletKeyringObject;
159
+ };
160
+ selectedAccountGroup: "" | `entropy:${string}/${string}` | `keyring:${string}/${string}` | `snap:${string}/${string}`;
161
+ }, resultFuncArgs_1: {
162
+ accounts: Record<string, {
163
+ type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account";
164
+ id: string;
165
+ options: Record<string, import("@metamask/utils").Json> & {
166
+ entropy?: {
167
+ type: "mnemonic";
168
+ id: string;
169
+ derivationPath: string;
170
+ groupIndex: number;
171
+ } | {
172
+ type: "private-key";
173
+ } | undefined;
174
+ exportable?: boolean | undefined;
175
+ };
176
+ metadata: {
177
+ name: string;
178
+ importTime: number;
179
+ keyring: {
180
+ type: string;
181
+ };
182
+ nameLastUpdatedAt?: number | undefined;
183
+ snap?: {
184
+ name: string;
185
+ id: string;
186
+ enabled: boolean;
187
+ } | undefined;
188
+ lastSelected?: number | undefined;
189
+ };
190
+ address: string;
191
+ scopes: `${string}:${string}`[];
192
+ methods: string[];
193
+ }>;
194
+ selectedAccount: string;
195
+ }) => Record<string, {
196
+ accountGroupId: AccountGroupId;
197
+ type: InternalAccount['type'];
198
+ accountId: string;
199
+ }>;
200
+ memoizedResultFunc: ((resultFuncArgs_0: {
201
+ wallets: {
202
+ [walletId: `entropy:${string}`]: import("../../../account-tree-controller/src/wallet.cjs").AccountWalletEntropyObject | import("../../../account-tree-controller/src/wallet.cjs").AccountWalletSnapObject | import("../../../account-tree-controller/src/wallet.cjs").AccountWalletKeyringObject;
203
+ [walletId: `keyring:${string}`]: import("../../../account-tree-controller/src/wallet.cjs").AccountWalletEntropyObject | import("../../../account-tree-controller/src/wallet.cjs").AccountWalletSnapObject | import("../../../account-tree-controller/src/wallet.cjs").AccountWalletKeyringObject;
204
+ [walletId: `snap:${string}`]: import("../../../account-tree-controller/src/wallet.cjs").AccountWalletEntropyObject | import("../../../account-tree-controller/src/wallet.cjs").AccountWalletSnapObject | import("../../../account-tree-controller/src/wallet.cjs").AccountWalletKeyringObject;
205
+ };
206
+ selectedAccountGroup: "" | `entropy:${string}/${string}` | `keyring:${string}/${string}` | `snap:${string}/${string}`;
207
+ }, resultFuncArgs_1: {
208
+ accounts: Record<string, {
209
+ type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account";
210
+ id: string;
211
+ options: Record<string, import("@metamask/utils").Json> & {
212
+ entropy?: {
213
+ type: "mnemonic";
214
+ id: string;
215
+ derivationPath: string;
216
+ groupIndex: number;
217
+ } | {
218
+ type: "private-key";
219
+ } | undefined;
220
+ exportable?: boolean | undefined;
221
+ };
222
+ metadata: {
223
+ name: string;
224
+ importTime: number;
225
+ keyring: {
226
+ type: string;
227
+ };
228
+ nameLastUpdatedAt?: number | undefined;
229
+ snap?: {
230
+ name: string;
231
+ id: string;
232
+ enabled: boolean;
233
+ } | undefined;
234
+ lastSelected?: number | undefined;
235
+ };
236
+ address: string;
237
+ scopes: `${string}:${string}`[];
238
+ methods: string[];
239
+ }>;
240
+ selectedAccount: string;
241
+ }) => Record<string, {
242
+ accountGroupId: AccountGroupId;
243
+ type: InternalAccount['type'];
244
+ accountId: string;
245
+ }>) & {
246
+ clearCache: () => void;
247
+ resultsCount: () => number;
248
+ resetResultsCount: () => void;
249
+ };
250
+ lastResult: () => Record<string, {
251
+ accountGroupId: AccountGroupId;
252
+ type: InternalAccount['type'];
253
+ accountId: string;
254
+ }>;
255
+ dependencies: [(state: AssetListState) => {
256
+ wallets: {
257
+ [walletId: `entropy:${string}`]: import("../../../account-tree-controller/src/wallet.cjs").AccountWalletEntropyObject | import("../../../account-tree-controller/src/wallet.cjs").AccountWalletSnapObject | import("../../../account-tree-controller/src/wallet.cjs").AccountWalletKeyringObject;
258
+ [walletId: `keyring:${string}`]: import("../../../account-tree-controller/src/wallet.cjs").AccountWalletEntropyObject | import("../../../account-tree-controller/src/wallet.cjs").AccountWalletSnapObject | import("../../../account-tree-controller/src/wallet.cjs").AccountWalletKeyringObject;
259
+ [walletId: `snap:${string}`]: import("../../../account-tree-controller/src/wallet.cjs").AccountWalletEntropyObject | import("../../../account-tree-controller/src/wallet.cjs").AccountWalletSnapObject | import("../../../account-tree-controller/src/wallet.cjs").AccountWalletKeyringObject;
260
+ };
261
+ selectedAccountGroup: "" | `entropy:${string}/${string}` | `keyring:${string}/${string}` | `snap:${string}/${string}`;
262
+ }, (state: AssetListState) => {
263
+ accounts: Record<string, {
264
+ type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account";
265
+ id: string;
266
+ options: Record<string, import("@metamask/utils").Json> & {
267
+ entropy?: {
268
+ type: "mnemonic";
269
+ id: string;
270
+ derivationPath: string;
271
+ groupIndex: number;
272
+ } | {
273
+ type: "private-key";
274
+ } | undefined;
275
+ exportable?: boolean | undefined;
276
+ };
277
+ metadata: {
278
+ name: string;
279
+ importTime: number;
280
+ keyring: {
281
+ type: string;
282
+ };
283
+ nameLastUpdatedAt?: number | undefined;
284
+ snap?: {
285
+ name: string;
286
+ id: string;
287
+ enabled: boolean;
288
+ } | undefined;
289
+ lastSelected?: number | undefined;
290
+ };
291
+ address: string;
292
+ scopes: `${string}:${string}`[];
293
+ methods: string[];
294
+ }>;
295
+ selectedAccount: string;
296
+ }];
297
+ recomputations: () => number;
298
+ resetRecomputations: () => void;
299
+ dependencyRecomputations: () => number;
300
+ resetDependencyRecomputations: () => void;
301
+ } & {
302
+ argsMemoize: typeof import("reselect").weakMapMemoize;
303
+ memoize: typeof import("reselect").weakMapMemoize;
304
+ }, (state: AssetListState) => {
305
+ [chainId: `0x${string}`]: {
306
+ [key: string]: Token[];
307
+ };
308
+ }, (state: AssetListState) => {
309
+ [chainId: `0x${string}`]: {
310
+ [key: string]: string[];
311
+ };
312
+ }, (state: AssetListState) => import("../TokenBalancesController.cjs").TokenBalances, (state: AssetListState) => Record<`0x${string}`, Record<`0x${string}`, import("../TokenRatesController.cjs").MarketDataDetails>>, (state: AssetListState) => Record<string, {
313
+ conversionDate: number | null;
314
+ conversionRate: number | null;
315
+ usdConversionRate: number | null;
316
+ }>, (state: AssetListState) => string];
317
+ recomputations: () => number;
318
+ resetRecomputations: () => void;
319
+ dependencyRecomputations: () => number;
320
+ resetDependencyRecomputations: () => void;
321
+ } & {
322
+ argsMemoize: typeof import("reselect").weakMapMemoize;
323
+ memoize: typeof import("reselect").weakMapMemoize;
324
+ }, ((state: AssetListState) => AssetsByAccountGroup) & {
325
+ clearCache: () => void;
326
+ resultsCount: () => number;
327
+ resetResultsCount: () => void;
328
+ } & {
329
+ resultFunc: (resultFuncArgs_0: Record<string, {
330
+ accountGroupId: AccountGroupId;
331
+ type: InternalAccount['type'];
332
+ accountId: string;
333
+ }>, resultFuncArgs_1: {
334
+ [account: string]: `${string}:${string}/${string}:${string}`[];
335
+ }, resultFuncArgs_2: {
336
+ [asset: `${string}:${string}/${string}:${string}`]: {
337
+ fungible: true;
338
+ iconUrl: string;
339
+ units: {
340
+ decimals: number;
341
+ symbol?: string | undefined;
342
+ name?: string | undefined;
343
+ }[];
344
+ symbol?: string | undefined;
345
+ name?: string | undefined;
346
+ };
347
+ }, resultFuncArgs_3: {
348
+ [account: string]: {
349
+ [asset: string]: {
350
+ amount: string;
351
+ unit: string;
352
+ };
353
+ };
354
+ }, resultFuncArgs_4: Record<`${string}:${string}/${string}:${string}`, import("@metamask/snaps-sdk").AssetConversion & {
355
+ marketData?: import("@metamask/snaps-sdk").FungibleAssetMarketData | undefined;
356
+ }>, resultFuncArgs_5: string) => AssetsByAccountGroup;
357
+ memoizedResultFunc: ((resultFuncArgs_0: Record<string, {
358
+ accountGroupId: AccountGroupId;
359
+ type: InternalAccount['type'];
360
+ accountId: string;
361
+ }>, resultFuncArgs_1: {
362
+ [account: string]: `${string}:${string}/${string}:${string}`[];
363
+ }, resultFuncArgs_2: {
364
+ [asset: `${string}:${string}/${string}:${string}`]: {
365
+ fungible: true;
366
+ iconUrl: string;
367
+ units: {
368
+ decimals: number;
369
+ symbol?: string | undefined;
370
+ name?: string | undefined;
371
+ }[];
372
+ symbol?: string | undefined;
373
+ name?: string | undefined;
374
+ };
375
+ }, resultFuncArgs_3: {
376
+ [account: string]: {
377
+ [asset: string]: {
378
+ amount: string;
379
+ unit: string;
380
+ };
381
+ };
382
+ }, resultFuncArgs_4: Record<`${string}:${string}/${string}:${string}`, import("@metamask/snaps-sdk").AssetConversion & {
383
+ marketData?: import("@metamask/snaps-sdk").FungibleAssetMarketData | undefined;
384
+ }>, resultFuncArgs_5: string) => AssetsByAccountGroup) & {
385
+ clearCache: () => void;
386
+ resultsCount: () => number;
387
+ resetResultsCount: () => void;
388
+ };
389
+ lastResult: () => AssetsByAccountGroup;
390
+ dependencies: [((state: AssetListState) => Record<string, {
391
+ accountGroupId: AccountGroupId;
392
+ type: InternalAccount['type'];
393
+ accountId: string;
394
+ }>) & {
395
+ clearCache: () => void;
396
+ resultsCount: () => number;
397
+ resetResultsCount: () => void;
398
+ } & {
399
+ resultFunc: (resultFuncArgs_0: {
400
+ wallets: {
401
+ [walletId: `entropy:${string}`]: import("../../../account-tree-controller/src/wallet.cjs").AccountWalletEntropyObject | import("../../../account-tree-controller/src/wallet.cjs").AccountWalletSnapObject | import("../../../account-tree-controller/src/wallet.cjs").AccountWalletKeyringObject;
402
+ [walletId: `keyring:${string}`]: import("../../../account-tree-controller/src/wallet.cjs").AccountWalletEntropyObject | import("../../../account-tree-controller/src/wallet.cjs").AccountWalletSnapObject | import("../../../account-tree-controller/src/wallet.cjs").AccountWalletKeyringObject;
403
+ [walletId: `snap:${string}`]: import("../../../account-tree-controller/src/wallet.cjs").AccountWalletEntropyObject | import("../../../account-tree-controller/src/wallet.cjs").AccountWalletSnapObject | import("../../../account-tree-controller/src/wallet.cjs").AccountWalletKeyringObject;
404
+ };
405
+ selectedAccountGroup: "" | `entropy:${string}/${string}` | `keyring:${string}/${string}` | `snap:${string}/${string}`;
406
+ }, resultFuncArgs_1: {
407
+ accounts: Record<string, {
408
+ type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account";
409
+ id: string;
410
+ options: Record<string, import("@metamask/utils").Json> & {
411
+ entropy?: {
412
+ type: "mnemonic";
413
+ id: string;
414
+ derivationPath: string;
415
+ groupIndex: number;
416
+ } | {
417
+ type: "private-key";
418
+ } | undefined;
419
+ exportable?: boolean | undefined;
420
+ };
421
+ metadata: {
422
+ name: string;
423
+ importTime: number;
424
+ keyring: {
425
+ type: string;
426
+ };
427
+ nameLastUpdatedAt?: number | undefined;
428
+ snap?: {
429
+ name: string;
430
+ id: string;
431
+ enabled: boolean;
432
+ } | undefined;
433
+ lastSelected?: number | undefined;
434
+ };
435
+ address: string;
436
+ scopes: `${string}:${string}`[];
437
+ methods: string[];
438
+ }>;
439
+ selectedAccount: string;
440
+ }) => Record<string, {
441
+ accountGroupId: AccountGroupId;
442
+ type: InternalAccount['type'];
443
+ accountId: string;
444
+ }>;
445
+ memoizedResultFunc: ((resultFuncArgs_0: {
446
+ wallets: {
447
+ [walletId: `entropy:${string}`]: import("../../../account-tree-controller/src/wallet.cjs").AccountWalletEntropyObject | import("../../../account-tree-controller/src/wallet.cjs").AccountWalletSnapObject | import("../../../account-tree-controller/src/wallet.cjs").AccountWalletKeyringObject;
448
+ [walletId: `keyring:${string}`]: import("../../../account-tree-controller/src/wallet.cjs").AccountWalletEntropyObject | import("../../../account-tree-controller/src/wallet.cjs").AccountWalletSnapObject | import("../../../account-tree-controller/src/wallet.cjs").AccountWalletKeyringObject;
449
+ [walletId: `snap:${string}`]: import("../../../account-tree-controller/src/wallet.cjs").AccountWalletEntropyObject | import("../../../account-tree-controller/src/wallet.cjs").AccountWalletSnapObject | import("../../../account-tree-controller/src/wallet.cjs").AccountWalletKeyringObject;
450
+ };
451
+ selectedAccountGroup: "" | `entropy:${string}/${string}` | `keyring:${string}/${string}` | `snap:${string}/${string}`;
452
+ }, resultFuncArgs_1: {
453
+ accounts: Record<string, {
454
+ type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account";
455
+ id: string;
456
+ options: Record<string, import("@metamask/utils").Json> & {
457
+ entropy?: {
458
+ type: "mnemonic";
459
+ id: string;
460
+ derivationPath: string;
461
+ groupIndex: number;
462
+ } | {
463
+ type: "private-key";
464
+ } | undefined;
465
+ exportable?: boolean | undefined;
466
+ };
467
+ metadata: {
468
+ name: string;
469
+ importTime: number;
470
+ keyring: {
471
+ type: string;
472
+ };
473
+ nameLastUpdatedAt?: number | undefined;
474
+ snap?: {
475
+ name: string;
476
+ id: string;
477
+ enabled: boolean;
478
+ } | undefined;
479
+ lastSelected?: number | undefined;
480
+ };
481
+ address: string;
482
+ scopes: `${string}:${string}`[];
483
+ methods: string[];
484
+ }>;
485
+ selectedAccount: string;
486
+ }) => Record<string, {
487
+ accountGroupId: AccountGroupId;
488
+ type: InternalAccount['type'];
489
+ accountId: string;
490
+ }>) & {
491
+ clearCache: () => void;
492
+ resultsCount: () => number;
493
+ resetResultsCount: () => void;
494
+ };
495
+ lastResult: () => Record<string, {
496
+ accountGroupId: AccountGroupId;
497
+ type: InternalAccount['type'];
498
+ accountId: string;
499
+ }>;
500
+ dependencies: [(state: AssetListState) => {
501
+ wallets: {
502
+ [walletId: `entropy:${string}`]: import("../../../account-tree-controller/src/wallet.cjs").AccountWalletEntropyObject | import("../../../account-tree-controller/src/wallet.cjs").AccountWalletSnapObject | import("../../../account-tree-controller/src/wallet.cjs").AccountWalletKeyringObject;
503
+ [walletId: `keyring:${string}`]: import("../../../account-tree-controller/src/wallet.cjs").AccountWalletEntropyObject | import("../../../account-tree-controller/src/wallet.cjs").AccountWalletSnapObject | import("../../../account-tree-controller/src/wallet.cjs").AccountWalletKeyringObject;
504
+ [walletId: `snap:${string}`]: import("../../../account-tree-controller/src/wallet.cjs").AccountWalletEntropyObject | import("../../../account-tree-controller/src/wallet.cjs").AccountWalletSnapObject | import("../../../account-tree-controller/src/wallet.cjs").AccountWalletKeyringObject;
505
+ };
506
+ selectedAccountGroup: "" | `entropy:${string}/${string}` | `keyring:${string}/${string}` | `snap:${string}/${string}`;
507
+ }, (state: AssetListState) => {
508
+ accounts: Record<string, {
509
+ type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account";
510
+ id: string;
511
+ options: Record<string, import("@metamask/utils").Json> & {
512
+ entropy?: {
513
+ type: "mnemonic";
514
+ id: string;
515
+ derivationPath: string;
516
+ groupIndex: number;
517
+ } | {
518
+ type: "private-key";
519
+ } | undefined;
520
+ exportable?: boolean | undefined;
521
+ };
522
+ metadata: {
523
+ name: string;
524
+ importTime: number;
525
+ keyring: {
526
+ type: string;
527
+ };
528
+ nameLastUpdatedAt?: number | undefined;
529
+ snap?: {
530
+ name: string;
531
+ id: string;
532
+ enabled: boolean;
533
+ } | undefined;
534
+ lastSelected?: number | undefined;
535
+ };
536
+ address: string;
537
+ scopes: `${string}:${string}`[];
538
+ methods: string[];
539
+ }>;
540
+ selectedAccount: string;
541
+ }];
542
+ recomputations: () => number;
543
+ resetRecomputations: () => void;
544
+ dependencyRecomputations: () => number;
545
+ resetDependencyRecomputations: () => void;
546
+ } & {
547
+ argsMemoize: typeof import("reselect").weakMapMemoize;
548
+ memoize: typeof import("reselect").weakMapMemoize;
549
+ }, (state: AssetListState) => {
550
+ [account: string]: `${string}:${string}/${string}:${string}`[];
551
+ }, (state: AssetListState) => {
552
+ [asset: `${string}:${string}/${string}:${string}`]: {
553
+ fungible: true;
554
+ iconUrl: string;
555
+ units: {
556
+ decimals: number;
557
+ symbol?: string | undefined;
558
+ name?: string | undefined;
559
+ }[];
560
+ symbol?: string | undefined;
561
+ name?: string | undefined;
562
+ };
563
+ }, (state: AssetListState) => {
564
+ [account: string]: {
565
+ [asset: string]: {
566
+ amount: string;
567
+ unit: string;
568
+ };
569
+ };
570
+ }, (state: AssetListState) => Record<`${string}:${string}/${string}:${string}`, import("@metamask/snaps-sdk").AssetConversion & {
571
+ marketData?: import("@metamask/snaps-sdk").FungibleAssetMarketData | undefined;
572
+ }>, (state: AssetListState) => string];
573
+ recomputations: () => number;
574
+ resetRecomputations: () => void;
575
+ dependencyRecomputations: () => number;
576
+ resetDependencyRecomputations: () => void;
577
+ } & {
578
+ argsMemoize: typeof import("reselect").weakMapMemoize;
579
+ memoize: typeof import("reselect").weakMapMemoize;
580
+ }, ((state: AssetListState) => AssetsByAccountGroup) & {
581
+ clearCache: () => void;
582
+ resultsCount: () => number;
583
+ resetResultsCount: () => void;
584
+ } & {
585
+ resultFunc: (resultFuncArgs_0: Record<string, {
586
+ accountGroupId: AccountGroupId;
587
+ type: InternalAccount['type'];
588
+ accountId: string;
589
+ }>, resultFuncArgs_1: Record<`0x${string}`, Record<`0x${string}`, {
590
+ balance: Hex | null;
591
+ }>>, resultFuncArgs_2: Record<`0x${string}`, Record<`0x${string}`, import("../TokenRatesController.cjs").MarketDataDetails>>, resultFuncArgs_3: Record<string, {
592
+ conversionDate: number | null;
593
+ conversionRate: number | null;
594
+ usdConversionRate: number | null;
595
+ }>, resultFuncArgs_4: string, resultFuncArgs_5: Record<`0x${string}`, import("@metamask/network-controller").NetworkConfiguration>) => AssetsByAccountGroup;
596
+ memoizedResultFunc: ((resultFuncArgs_0: Record<string, {
597
+ accountGroupId: AccountGroupId;
598
+ type: InternalAccount['type'];
599
+ accountId: string;
600
+ }>, resultFuncArgs_1: Record<`0x${string}`, Record<`0x${string}`, {
601
+ balance: Hex | null;
602
+ }>>, resultFuncArgs_2: Record<`0x${string}`, Record<`0x${string}`, import("../TokenRatesController.cjs").MarketDataDetails>>, resultFuncArgs_3: Record<string, {
603
+ conversionDate: number | null;
604
+ conversionRate: number | null;
605
+ usdConversionRate: number | null;
606
+ }>, resultFuncArgs_4: string, resultFuncArgs_5: Record<`0x${string}`, import("@metamask/network-controller").NetworkConfiguration>) => AssetsByAccountGroup) & {
607
+ clearCache: () => void;
608
+ resultsCount: () => number;
609
+ resetResultsCount: () => void;
610
+ };
611
+ lastResult: () => AssetsByAccountGroup;
612
+ dependencies: [((state: AssetListState) => Record<string, {
613
+ accountGroupId: AccountGroupId;
614
+ type: InternalAccount['type'];
615
+ accountId: string;
616
+ }>) & {
617
+ clearCache: () => void;
618
+ resultsCount: () => number;
619
+ resetResultsCount: () => void;
620
+ } & {
621
+ resultFunc: (resultFuncArgs_0: {
622
+ wallets: {
623
+ [walletId: `entropy:${string}`]: import("../../../account-tree-controller/src/wallet.cjs").AccountWalletEntropyObject | import("../../../account-tree-controller/src/wallet.cjs").AccountWalletSnapObject | import("../../../account-tree-controller/src/wallet.cjs").AccountWalletKeyringObject;
624
+ [walletId: `keyring:${string}`]: import("../../../account-tree-controller/src/wallet.cjs").AccountWalletEntropyObject | import("../../../account-tree-controller/src/wallet.cjs").AccountWalletSnapObject | import("../../../account-tree-controller/src/wallet.cjs").AccountWalletKeyringObject;
625
+ [walletId: `snap:${string}`]: import("../../../account-tree-controller/src/wallet.cjs").AccountWalletEntropyObject | import("../../../account-tree-controller/src/wallet.cjs").AccountWalletSnapObject | import("../../../account-tree-controller/src/wallet.cjs").AccountWalletKeyringObject;
626
+ };
627
+ selectedAccountGroup: "" | `entropy:${string}/${string}` | `keyring:${string}/${string}` | `snap:${string}/${string}`;
628
+ }, resultFuncArgs_1: {
629
+ accounts: Record<string, {
630
+ type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account";
631
+ id: string;
632
+ options: Record<string, import("@metamask/utils").Json> & {
633
+ entropy?: {
634
+ type: "mnemonic";
635
+ id: string;
636
+ derivationPath: string;
637
+ groupIndex: number;
638
+ } | {
639
+ type: "private-key";
640
+ } | undefined;
641
+ exportable?: boolean | undefined;
642
+ };
643
+ metadata: {
644
+ name: string;
645
+ importTime: number;
646
+ keyring: {
647
+ type: string;
648
+ };
649
+ nameLastUpdatedAt?: number | undefined;
650
+ snap?: {
651
+ name: string;
652
+ id: string;
653
+ enabled: boolean;
654
+ } | undefined;
655
+ lastSelected?: number | undefined;
656
+ };
657
+ address: string;
658
+ scopes: `${string}:${string}`[];
659
+ methods: string[];
660
+ }>;
661
+ selectedAccount: string;
662
+ }) => Record<string, {
663
+ accountGroupId: AccountGroupId;
664
+ type: InternalAccount['type'];
665
+ accountId: string;
666
+ }>;
667
+ memoizedResultFunc: ((resultFuncArgs_0: {
668
+ wallets: {
669
+ [walletId: `entropy:${string}`]: import("../../../account-tree-controller/src/wallet.cjs").AccountWalletEntropyObject | import("../../../account-tree-controller/src/wallet.cjs").AccountWalletSnapObject | import("../../../account-tree-controller/src/wallet.cjs").AccountWalletKeyringObject;
670
+ [walletId: `keyring:${string}`]: import("../../../account-tree-controller/src/wallet.cjs").AccountWalletEntropyObject | import("../../../account-tree-controller/src/wallet.cjs").AccountWalletSnapObject | import("../../../account-tree-controller/src/wallet.cjs").AccountWalletKeyringObject;
671
+ [walletId: `snap:${string}`]: import("../../../account-tree-controller/src/wallet.cjs").AccountWalletEntropyObject | import("../../../account-tree-controller/src/wallet.cjs").AccountWalletSnapObject | import("../../../account-tree-controller/src/wallet.cjs").AccountWalletKeyringObject;
672
+ };
673
+ selectedAccountGroup: "" | `entropy:${string}/${string}` | `keyring:${string}/${string}` | `snap:${string}/${string}`;
674
+ }, resultFuncArgs_1: {
675
+ accounts: Record<string, {
676
+ type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account";
677
+ id: string;
678
+ options: Record<string, import("@metamask/utils").Json> & {
679
+ entropy?: {
680
+ type: "mnemonic";
681
+ id: string;
682
+ derivationPath: string;
683
+ groupIndex: number;
684
+ } | {
685
+ type: "private-key";
686
+ } | undefined;
687
+ exportable?: boolean | undefined;
688
+ };
689
+ metadata: {
690
+ name: string;
691
+ importTime: number;
692
+ keyring: {
693
+ type: string;
694
+ };
695
+ nameLastUpdatedAt?: number | undefined;
696
+ snap?: {
697
+ name: string;
698
+ id: string;
699
+ enabled: boolean;
700
+ } | undefined;
701
+ lastSelected?: number | undefined;
702
+ };
703
+ address: string;
704
+ scopes: `${string}:${string}`[];
705
+ methods: string[];
706
+ }>;
707
+ selectedAccount: string;
708
+ }) => Record<string, {
709
+ accountGroupId: AccountGroupId;
710
+ type: InternalAccount['type'];
711
+ accountId: string;
712
+ }>) & {
713
+ clearCache: () => void;
714
+ resultsCount: () => number;
715
+ resetResultsCount: () => void;
716
+ };
717
+ lastResult: () => Record<string, {
718
+ accountGroupId: AccountGroupId;
719
+ type: InternalAccount['type'];
720
+ accountId: string;
721
+ }>;
722
+ dependencies: [(state: AssetListState) => {
723
+ wallets: {
724
+ [walletId: `entropy:${string}`]: import("../../../account-tree-controller/src/wallet.cjs").AccountWalletEntropyObject | import("../../../account-tree-controller/src/wallet.cjs").AccountWalletSnapObject | import("../../../account-tree-controller/src/wallet.cjs").AccountWalletKeyringObject;
725
+ [walletId: `keyring:${string}`]: import("../../../account-tree-controller/src/wallet.cjs").AccountWalletEntropyObject | import("../../../account-tree-controller/src/wallet.cjs").AccountWalletSnapObject | import("../../../account-tree-controller/src/wallet.cjs").AccountWalletKeyringObject;
726
+ [walletId: `snap:${string}`]: import("../../../account-tree-controller/src/wallet.cjs").AccountWalletEntropyObject | import("../../../account-tree-controller/src/wallet.cjs").AccountWalletSnapObject | import("../../../account-tree-controller/src/wallet.cjs").AccountWalletKeyringObject;
727
+ };
728
+ selectedAccountGroup: "" | `entropy:${string}/${string}` | `keyring:${string}/${string}` | `snap:${string}/${string}`;
729
+ }, (state: AssetListState) => {
730
+ accounts: Record<string, {
731
+ type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account";
732
+ id: string;
733
+ options: Record<string, import("@metamask/utils").Json> & {
734
+ entropy?: {
735
+ type: "mnemonic";
736
+ id: string;
737
+ derivationPath: string;
738
+ groupIndex: number;
739
+ } | {
740
+ type: "private-key";
741
+ } | undefined;
742
+ exportable?: boolean | undefined;
743
+ };
744
+ metadata: {
745
+ name: string;
746
+ importTime: number;
747
+ keyring: {
748
+ type: string;
749
+ };
750
+ nameLastUpdatedAt?: number | undefined;
751
+ snap?: {
752
+ name: string;
753
+ id: string;
754
+ enabled: boolean;
755
+ } | undefined;
756
+ lastSelected?: number | undefined;
757
+ };
758
+ address: string;
759
+ scopes: `${string}:${string}`[];
760
+ methods: string[];
761
+ }>;
762
+ selectedAccount: string;
763
+ }];
764
+ recomputations: () => number;
765
+ resetRecomputations: () => void;
766
+ dependencyRecomputations: () => number;
767
+ resetDependencyRecomputations: () => void;
768
+ } & {
769
+ argsMemoize: typeof import("reselect").weakMapMemoize;
770
+ memoize: typeof import("reselect").weakMapMemoize;
771
+ }, (state: AssetListState) => Record<`0x${string}`, Record<`0x${string}`, {
772
+ balance: Hex | null;
773
+ }>>, (state: AssetListState) => Record<`0x${string}`, Record<`0x${string}`, import("../TokenRatesController.cjs").MarketDataDetails>>, (state: AssetListState) => Record<string, {
774
+ conversionDate: number | null;
775
+ conversionRate: number | null;
776
+ usdConversionRate: number | null;
777
+ }>, (state: AssetListState) => string, (state: AssetListState) => Record<`0x${string}`, import("@metamask/network-controller").NetworkConfiguration>];
778
+ recomputations: () => number;
779
+ resetRecomputations: () => void;
780
+ dependencyRecomputations: () => number;
781
+ resetDependencyRecomputations: () => void;
782
+ } & {
783
+ argsMemoize: typeof import("reselect").weakMapMemoize;
784
+ memoize: typeof import("reselect").weakMapMemoize;
785
+ }];
786
+ recomputations: () => number;
787
+ resetRecomputations: () => void;
788
+ dependencyRecomputations: () => number;
789
+ resetDependencyRecomputations: () => void;
790
+ } & {
791
+ argsMemoize: typeof import("reselect").weakMapMemoize;
792
+ memoize: typeof import("reselect").weakMapMemoize;
793
+ }, (state: AssetListState) => {
794
+ wallets: {
795
+ [walletId: `entropy:${string}`]: import("../../../account-tree-controller/src/wallet.cjs").AccountWalletEntropyObject | import("../../../account-tree-controller/src/wallet.cjs").AccountWalletSnapObject | import("../../../account-tree-controller/src/wallet.cjs").AccountWalletKeyringObject;
796
+ [walletId: `keyring:${string}`]: import("../../../account-tree-controller/src/wallet.cjs").AccountWalletEntropyObject | import("../../../account-tree-controller/src/wallet.cjs").AccountWalletSnapObject | import("../../../account-tree-controller/src/wallet.cjs").AccountWalletKeyringObject;
797
+ [walletId: `snap:${string}`]: import("../../../account-tree-controller/src/wallet.cjs").AccountWalletEntropyObject | import("../../../account-tree-controller/src/wallet.cjs").AccountWalletSnapObject | import("../../../account-tree-controller/src/wallet.cjs").AccountWalletKeyringObject;
798
+ };
799
+ selectedAccountGroup: "" | `entropy:${string}/${string}` | `keyring:${string}/${string}` | `snap:${string}/${string}`;
800
+ }];
801
+ recomputations: () => number;
802
+ resetRecomputations: () => void;
803
+ dependencyRecomputations: () => number;
804
+ resetDependencyRecomputations: () => void;
805
+ } & {
806
+ argsMemoize: typeof import("reselect").weakMapMemoize;
807
+ memoize: typeof import("reselect").weakMapMemoize;
808
+ };
809
+ export {};
810
+ //# sourceMappingURL=token-selectors.d.cts.map