fix: batch sell value in currency sometimes missing#8928
Merged
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit b8fc768. Configure here.
micaelae
previously approved these changes
May 29, 2026
GeorgeGkas
approved these changes
May 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Explanation
selectExchangeRateByAssetIdpreviously looked up EVM tokenmarketDatausing only the address casing extracted from the provided asset ID. Batch Sell fee assets can arrive fromobtainGaslessBatchwith a lowercase ERC-20 address, while Mobile provides token rates keyed by checksummed addresses. That mismatch causedselectBatchSellTrades(...).totalNetworkFee.amountto be present whilevalueInCurrencyandusdwerenull.This updates the EVM token exchange-rate lookup to try the checksummed address first and then fall back to the lowercase address. That keeps existing checksummed quote metadata behavior working while allowing Batch Sell fee asset IDs with lowercase addresses to resolve against checksummed
marketDatakeys.Regression tests cover both the low-level
selectExchangeRateByAssetIdcasing behavior and the fullselectBatchSellTradespath for Batch Sell network fee fiat values.Screen.Recording.2026-05-28.at.7.06.05.PM.mov
References
Related to MetaMask/metamask-mobile#30710
Checklist
Note
Low Risk
Small selector lookup fix with new tests; no auth, persistence, or API contract changes.
Overview
Fixes Batch Sell network fee fiat display when the fee token’s ERC-20 address in the asset ID is lowercase but
marketDatais keyed by checksummed addresses.selectExchangeRateByAssetIdnow resolves EVM token rates via a shared helper that looks upgetAddress(address)first, then lowercase, and returns safely on invalid hex instead of failing the lookup. That restoresselectBatchSellTradestotalNetworkFeevalueInCurrencyandusdwhen rates were previously missing. Regression tests cover the selector and the full Batch Sell fee path; the package changelog records the fix.Reviewed by Cursor Bugbot for commit 156b42c. Bugbot is set up for automated code reviews on this repo. Configure here.