…cker cp-13.56-0 (#47602)
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->
## **Description**
Update ticker resolution to exact symbol or rwa ticker
<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->
## **Changelog**
<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`
If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`
(This helps the Release Engineer do their job more quickly and
accurately)
-->
CHANGELOG entry: cashtag: exact symbol/ticker match
## **Related issues**
Fixes:
## **Manual testing steps**
1. Open x.com
2. Search for $TICKERs
## **Screenshots/Recordings**
<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->
### **Before**
<!-- [screenshots/recordings] -->
### **After**
<!-- [screenshots/recordings] -->
## **Pre-merge author checklist**
- [ ] 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).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] 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]
> **Medium Risk**
> Changes user-visible cashtag resolution on external sites and depends
on RWA fields from the token search API; wrong filtering could show the
wrong asset or none at all.
>
> **Overview**
> Cashtag ticker lookup no longer treats search hits as prefix matches
(e.g. `$DOG` won’t pick `DOGE` just because it has higher market cap).
**`resolveTicker`** now keeps only assets whose **token symbol** or
**`rwaData.ticker`** equals the trimmed, uppercased query, then still
picks the primary hit by market cap among those exact matches.
>
> Token search requests add **`includeRwaData=true`** so
stock/RWA-backed tokens can match on their real-world ticker, not only
the on-chain symbol. Tests were updated for the new matching rules and
cover exact-symbol vs prefix cases and RWA ticker resolution.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
5a9ae03. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
---------
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Description
Update ticker resolution to exact symbol or rwa ticker
Changelog
CHANGELOG entry: cashtag: exact symbol/ticker match
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
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
Medium Risk
Changes user-visible cashtag resolution on external sites and depends
on RWA fields from the token search API; wrong filtering could show the
wrong asset or none at all.
Overview
Cashtag ticker lookup no longer treats search hits as prefix matches
(e.g.
$DOGwon’t pickDOGEjust because it has higher market cap).resolveTickernow keeps only assets whose token symbol orrwaData.tickerequals the trimmed, uppercased query, then stillpicks the primary hit by market cap among those exact matches.
Token search requests add
includeRwaData=truesostock/RWA-backed tokens can match on their real-world ticker, not only
the on-chain symbol. Tests were updated for the new matching rules and
cover exact-symbol vs prefix cases and RWA ticker resolution.
Reviewed by Cursor Bugbot for commit
5a9ae03. Bugbot is set up for automated
code reviews on this repo. Configure
here.
Co-authored-by: Cursor Agent cursoragent@cursor.com 2338170