…ta cp-13.58.0 (#47914)
## **Description**
The X widget still rendered when every matching token had a missing or
zero market cap. Those tickers now produce no result, so no pill or
popover are rendered.
## **Changelog**
CHANGELOG entry: Hide the X widget when none of the matching tokens have
a market cap
<!--
## **Related issues**
Fixes:
-->
## **Manual testing steps**
1. Enable the X widget feature flag and setting.
2. On x.com, open a cashtag whose matches all have no market cap or a
market cap of 0.
3. Confirm no MetaMask pill or widget appears.
4. Open a cashtag such as `$ETH` that has a market cap.
5. Confirm the widget still appears.
<!--
## **Screenshots/Recordings**
### **Before**
### **After**
-->
## **Pre-merge author checklist**
- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.
## **Pre-merge reviewer checklist**
- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Low Risk**
> Localized cashtag lookup guard with unit tests; no auth or payment
paths affected.
>
> **Overview**
> **`resolveTicker`** now returns **`null`** when the highest market-cap
match has a missing or zero market cap, so the X cashtag widget does not
render for tokens without usable cap data. Matches that include at least
one asset with cap **> 0** behave as before, with zero/null-cap entries
still listed as similar options.
>
> Tests cover the all-invalid-cap case and the mixed list where a priced
asset remains the primary.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
58a23cc. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
Description
The X widget still rendered when every matching token had a missing or
zero market cap. Those tickers now produce no result, so no pill or
popover are rendered.
Changelog
CHANGELOG entry: Hide the X widget when none of the matching tokens have
a market cap
Manual testing steps
market cap of 0.
$ETHthat has a market cap.Pre-merge author checklist
Docs and MetaMask
Extension Coding
Standards.
if applicable
guidelines).
Not required for external contributors.
Pre-merge reviewer checklist
app, test code being changed).
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
Note
Low Risk
Localized cashtag lookup guard with unit tests; no auth or payment
paths affected.
Overview
resolveTickernow returnsnullwhen the highest market-capmatch has a missing or zero market cap, so the X cashtag widget does not
render for tokens without usable cap data. Matches that include at least
one asset with cap > 0 behave as before, with zero/null-cap entries
still listed as similar options.
Tests cover the all-invalid-cap case and the mixed list where a priced
asset remains the primary.
Reviewed by Cursor Bugbot for commit
58a23cc. Bugbot is set up for automated
code reviews on this repo. Configure
here.