Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Comments

fix: custom token balances#7879

Open
milos-ethernal wants to merge 7 commits intoMetaMask:main from
milos-ethernal:fix/custom-token-balances
Open

fix: custom token balances #7879
milos-ethernal wants to merge 7 commits intoMetaMask:main from
milos-ethernal:fix/custom-token-balances

Conversation

@milos-ethernal
Copy link

@milos-ethernal milos-ethernal commented Feb 9, 2026
edited by cursor bot
Loading

Explanation

At this moment the custom token balances on chains like Base and BNB are not showing correct token amounts on MetaMask token section. I traced the error to TokenBalancesController where AccountsAPI fetcher returns balances but misses custom tokens. The controller now detects this and triggers an RPC fallback for those specific tokens

Screenshot from 2026年02月06日 13-13-22 Screenshot from 2026年02月06日 13-17-34 Screenshot from 2026年02月06日 13-17-42 Screenshot from 2026年02月06日 13-17-51

This change fixes the problem that I was facing on Base and BNB chains

References

This fixes the problem that I faced and submitted the ticket #74726250 to Technical Support

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

Note

Medium Risk
Touches core balance-fetch selection/fallback logic; incorrect detection could increase RPC traffic or still miss balances on some chains/accounts.

Overview
Fixes cases where TokenBalancesController relies on Accounts API results that omit custom token balances by detecting missing token/account entries and re-adding those chain IDs to the RPC fallback path.

Adds a regression test ensuring custom token balance fetching respects queryAllAccounts (only queried accounts are fetched in single-account polling; all accounts are fetched when enabled), and updates the changelog accordingly.

Written by Cursor Bugbot for commit e7d23f8. This will update automatically on new commits. Configure here.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

@milos-ethernal milos-ethernal changed the title (削除) Custom token balances fix (削除ここまで) (追記) fix: custom token balances (追記ここまで) Feb 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@cursor cursor[bot] cursor[bot] left review comments

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

AltStyle によって変換されたページ (->オリジナル) /