feat: add useFirstPartyContractName hook and use it in useDisplayName#23092
Merged
feat: add useFirstPartyContractName hook and use it in useDisplayName#23092
Conversation
Contributor
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
2bdcc15 to
fc6e93f
Compare
matthewwalsh0
approved these changes
Feb 22, 2024
Collaborator
Builds ready [c0efa11]
Page Load Metrics (1869 ± 89 ms)
Bundle size diffs
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #23092 +/- ##
===========================================
+ Coverage 68.49% 68.49% +0.01%
===========================================
Files 1090 1092 +2
Lines 43133 43142 +9
Branches 11501 11504 +3
===========================================
+ Hits 29541 29550 +9
Misses 13592 13592 ☔ View full report in Codecov by Sentry. |
13 tasks
sleepytanya
approved these changes
Feb 22, 2024
Collaborator
|
Missing release label release-11.11.0 on PR. Adding release label release-11.11.0 on PR and removing other release labels(release-11.13.0), as PR was cherry-picked in branch 11.11.0. |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Description
Add
useFirstPartyContractNamehook to find names for our first-party contracts based on their address and chainID.Integrated with
useDisplayNameto ensure Petnames recognize these contracts correctly.Why It Matters:
Prior to Petnames, MetaMask displayed first-party contracts like the MetaMask Bridge as cryptic hex addresses. This wasn't very user-friendly. However, with the introduction of Petnames in version 11.11, these addresses will start appearing even more alarming due to the new color scheme and icons. Our update aims to make these contracts easily recognizable and less intimidating.
Before Petnames:
With Petnames, before this PR:
Related issues
Fixes: https://github.com/MetaMask/MetaMask-planning/issues/2136
Manual testing steps
0x0439e60F02a8900a951603950d8D4527f400C3f1as the recipientIf you want to test other addresses and names on other chains, you can refer to first-party-contracts.ts in this PR for a full list.
Screenshots/Recordings
Before
See description
After
Pre-merge author checklist
Pre-merge reviewer checklist