Skip to content
Open
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
4 changes: 4 additions & 0 deletions packages/assets-controllers/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [109.3.1]

### Added

- Add DeFi Oracle Meta Mainnet (`138`/`0x8a`) to token autodetection allowlists for `SupportedTokenDetectionNetworks` and `SUPPORTED_NETWORKS_ACCOUNTS_API_V4` ([#9297](https://github.com/MetaMask/core/pull/9297))

### Changed

- Bump `@metamask/messenger` from `^1.2.0` to `^2.0.0` ([#9392](https://github.com/MetaMask/core/pull/9392))
Expand Down
15 changes: 15 additions & 0 deletions packages/assets-controllers/src/assetsUtil.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import type { Hex } from '@metamask/utils';

import * as assetsUtil from './assetsUtil.js';
import { TOKEN_PRICES_BATCH_SIZE } from './assetsUtil.js';
import { SUPPORTED_NETWORKS_ACCOUNTS_API_V4 } from './constants.js';
import type { Nft, NftMetadata } from './NftController.js';
import { EvmAssetWithMarketData } from './token-prices-service/abstract-token-prices-service.js';
import { getNativeTokenAddress } from './token-prices-service/index.js';
Expand Down Expand Up @@ -273,6 +274,20 @@ describe('assetsUtil', () => {
).toBe(true);
});

it('returns true for DeFi Oracle Meta Mainnet (138)', () => {
expect(
assetsUtil.isTokenDetectionSupportedForNetwork(
assetsUtil.SupportedTokenDetectionNetworks.DefiOracleMeta,
),
).toBe(true);
});

it('includes DeFi Oracle Meta Mainnet in the Accounts API v4 allowlist', () => {
expect(SUPPORTED_NETWORKS_ACCOUNTS_API_V4).toContain(
assetsUtil.SupportedTokenDetectionNetworks.DefiOracleMeta,
);
});

it('returns false for testnets such as Goerli', () => {
expect(assetsUtil.isTokenDetectionSupportedForNetwork(toHex(5))).toBe(
false,
Expand Down
1 change: 1 addition & 0 deletions packages/assets-controllers/src/assetsUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ export enum SupportedTokenDetectionNetworks {
Hyperevm = '0x3e7', // decimal: 999
Arc = '0x13b2', // decimal: 5042
Robinhood = '0x1237', // decimal: 4663
DefiOracleMeta = '0x8a', // decimal: 138 — DeFi Oracle Meta Mainnet
}

/**
Expand Down
1 change: 1 addition & 0 deletions packages/assets-controllers/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export const SUPPORTED_NETWORKS_ACCOUNTS_API_V4 = [
'0x3e7', // 999 HyperEVM
'0x13b2', // 5042 Arc
'0x1237', // 4663 Robinhood
'0x8a', // 138 DeFi Oracle Meta Mainnet
];

/** Lowercase ERC-20 address for MetaMask USD (mUSD), same contract on listed chains. */
Expand Down