Skip to content

feat(assets-controllers): enable token detection for DeFi Oracle Meta (138) - #9297

Open
defiQUG wants to merge 2 commits into
MetaMask:mainfrom
defiQUG:feat/chain138-token-detection-0x8a
Open

feat(assets-controllers): enable token detection for DeFi Oracle Meta (138)#9297
defiQUG wants to merge 2 commits into
MetaMask:mainfrom
defiQUG:feat/chain138-token-detection-0x8a

Conversation

@defiQUG

@defiQUG defiQUG commented Jun 28, 2026

Copy link
Copy Markdown

Summary

Add DeFi Oracle Meta Mainnet (chain 138 / 0x8a) to MetaMask token detection allowlists so mobile and extension users can use Autodetect tokens on Chain 138.

Mirrors recent network additions such as ARC (#9006) and HyperEVM (#7790): enum entry + Accounts API v4 list. Does not replace hosted Tokens API registration (token.api.cx.metamask.io).

Chain metadata is already on Chainlist: https://github.com/ethereum-lists/chains/blob/master/_data/chains/eip155-138.json

Changes

1. packages/assets-controllers/src/assetsUtil.ts

Add to SupportedTokenDetectionNetworks:

DefiOracleMeta = '0x8a', // decimal: 138 — DeFi Oracle Meta Mainnet

2. packages/assets-controllers/src/constants.ts

Add to SUPPORTED_NETWORKS_ACCOUNTS_API_V4:

'0x8a', // 138 DeFi Oracle Meta Mainnet

3. packages/assets-controllers/src/assetsUtil.test.ts

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

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

4. packages\/assets-controllers\/CHANGELOG.md

Add an unreleased changelog entry for the Chain 138 token autodetection allowlist change.

Not in scope for v1: SINGLE_CALL_BALANCES_ADDRESS_BY_CHAINID — modern chains (e.g. Monad) rely on Accounts API v4; ARC/HyperEVM PRs did not require a balance-checker deploy.

Token list (for MetaMask Tokens API ops)

URL Role
https://tokens.d-bis.org/lists/dbis-138.tokenlist.json Pinned Uniswap-schema list
https://explorer.d-bis.org/token-aggregation/api/v1/report/token-list?chainId=138&wallet=1 Wallet-eligible subset
https://explorer.d-bis.org/token-aggregation/api/v1/config/metamask?chainId=138 EIP-747 + tokenDetection metadata

Why

  • Chain 138 is a live EVM mainnet (public RPC https://rpc-http-pub.d-bis.org, explorer https://explorer.d-bis.org).
  • Mobile currently shows: “Token detection is not available on this network yet.”
  • DBIS operates explorer-side detection (Blockscout index + EIP-747) until upstream gates clear; native autodetect requires this client allowlist and Tokens API ingestion.

Relationship to other DBIS PRs

  • #9118 — Price API / native ETH spot fallback only; does not enable token detection.
  • Tokens API email (separate Consensys track) — register eip155:138 on token.api.cx.metamask.io.

Test plan

  • yarn test packages/assets-controllers/src/assetsUtil.test.ts
  • isTokenDetectionSupportedForNetwork('0x8a')true
  • isTokenListSupportedForNetwork('0x8a')true
  • SUPPORTED_NETWORKS_ACCOUNTS_API_V4 includes '0x8a'

References

Made with Cursor

@defiQUG
defiQUG requested a review from a team as a code owner June 28, 2026 00:53
@defiQUG

defiQUG commented Jun 28, 2026

Copy link
Copy Markdown
Author

Operator note (2026-06-28): Companion to MetaMask/core #9118 (Price API client fallback).

  • Tokens API registration email sent to support@codefi-data.zendesk.com (2026-06-28).
  • Chainlist merged: eip155-138.json
  • Operator token lists live: https://tokens.d-bis.org/lists/dbis-138.tokenlist.json

Hosted token.api.cx.metamask.io ingestion is a separate Consensys track; this PR enables the client-side allowlist gate only.

@defiQUG
defiQUG force-pushed the feat/chain138-token-detection-0x8a branch from 3d5276b to 3dcec72 Compare July 6, 2026 08:50
@defiQUG
defiQUG requested a review from a team as a code owner July 6, 2026 08:50
@defiQUG

defiQUG commented Jul 6, 2026

Copy link
Copy Markdown
Author

Rebased onto current MetaMask/core main and force-pushed head 3dcec72.

Review fixes in this update:

  • added a direct assertion that DeFi Oracle Meta Mainnet stays in the Accounts API v4 allowlist
  • added the missing assets-controllers unreleased changelog entry

Local validation:

  • PASS: yarn workspace @metamask/assets-controllers changelog:validate
  • PASS: yarn exec jest src/assetsUtil.test.ts --coverage=false --reporters=default

@defiQUG

defiQUG commented Jul 7, 2026

Copy link
Copy Markdown
Author

Follow-up pass (2026-07-07): CI/validation is green on our side where applicable. Requesting maintainer review when convenient.

Chain 138 (ID 138) — DeFi Oracle Meta Mainnet

  • Canonical RPC: https://rpc.d-bis.org (also LAN http://192.168.11.211:8545)
  • Explorer: https://explorer.d-bis.org
  • Chainlist: https://chainlist.org/chain/138

Happy to rebase or adjust per review feedback.

@defiQUG
defiQUG force-pushed the feat/chain138-token-detection-0x8a branch 3 times, most recently from 57005bc to 02c17f4 Compare July 12, 2026 07:44
defiQUG and others added 2 commits July 24, 2026 21:23
… (138)

Add chain 0x8a to SupportedTokenDetectionNetworks and
SUPPORTED_NETWORKS_ACCOUNTS_API_V4 so MetaMask extension and mobile
can autodetect tokens on DeFi Oracle Meta Mainnet.

Mirrors recent ARC and HyperEVM network additions.

Co-authored-by: Cursor <cursoragent@cursor.com>
@defiQUG
defiQUG force-pushed the feat/chain138-token-detection-0x8a branch from 02c17f4 to d43c279 Compare July 25, 2026 04:30

@defiQUG defiQUG left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the allowlist/test change. I did not find a blocking code issue in the diff. Remaining blocker is required review approval.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant