Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/assets-controllers/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

- Add `AssetsByAccountGroup` to list of exported types ([#6983](https://github.com/MetaMask/core/pull/6983))

### Changed

- `isNative` is inferred as `true` for all non-evm assets with slip44 as its asset namespace ([#6983](https://github.com/MetaMask/core/pull/6983))
- **BREAKING:** Modify DeFi position fetching behaviour ([#6944](https://github.com/MetaMask/core/pull/6944))
- The fetch request to the API times out after 8 seconds and attempts a single retry
- Refresh only updates the selected evm address
Expand Down
1 change: 1 addition & 0 deletions packages/assets-controllers/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ export {
calculateBalanceChangeForAccountGroup,
} from './balances';
export type {
AssetsByAccountGroup,
AccountGroupAssets,
Asset,
AssetListState,
Expand Down
10 changes: 2 additions & 8 deletions packages/assets-controllers/src/selectors/token-selectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,14 @@ import type { TokenBalancesControllerState } from '../TokenBalancesController';
import type { Token, TokenRatesControllerState } from '../TokenRatesController';
import type { TokensControllerState } from '../TokensController';

type AssetsByAccountGroup = {
export type AssetsByAccountGroup = {
[accountGroupId: AccountGroupId]: AccountGroupAssets;
};

export type AccountGroupAssets = {
[network: string]: Asset[];
};

// If this gets out of hand with other chains, we should probably have a permanent object that defines them
const MULTICHAIN_NATIVE_ASSET_IDS = [
`bip122:000000000019d6689c085ae165831e93/slip44:0`,
`solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp/slip44:501`,
];

type EvmAccountType = Extract<InternalAccount['type'], `eip155:${string}`>;
type MultichainAccountType = Exclude<
InternalAccount['type'],
Expand Down Expand Up @@ -401,7 +395,7 @@ const selectAllMultichainAssets = createAssetListSelector(
groupChainAssets.push({
accountType: type as MultichainAccountType,
assetId,
isNative: MULTICHAIN_NATIVE_ASSET_IDS.includes(assetId),
isNative: caipAsset.assetNamespace === 'slip44',
image: assetMetadata.iconUrl,
name: assetMetadata.name ?? assetMetadata.symbol ?? asset,
symbol: assetMetadata.symbol ?? asset,
Expand Down
Loading