Skip to content

feat: fetch token fiat amount on import confirmation modal#22263

Merged
sahar-fehri merged 6 commits intodevelopfrom
feat/MMASSSETS-88-Add-TokenFiatBalance-before-import-v2
Jan 8, 2024
Merged

feat: fetch token fiat amount on import confirmation modal#22263
sahar-fehri merged 6 commits intodevelopfrom
feat/MMASSSETS-88-Add-TokenFiatBalance-before-import-v2

Conversation

@sahar-fehri
Copy link
Copy Markdown
Contributor

@sahar-fehri sahar-fehri commented Dec 13, 2023

Description

The goal of this PR is to fetch user token fiat balance on the import modal confirmation page.
There is an ongoing PR on core to enable this:
MetaMask/core#3657

Related issues

Fixes: https://consensyssoftware.atlassian.net/browse/MMASSETS-88
also design wise relates to this PR #21704

Manual testing steps

  1. Go to home page
  2. Click on import tokens button
  3. Select a token
  4. Click import
  5. Notice the token balance in fiat on the confirmation page

Screenshots/Recordings

Before

image

After

image

Pre-merge author checklist

  • [] I’ve followed MetaMask Coding Standards.
  • I've clearly explained what problem this PR is solving and how it is solved.
  • I've linked related issues
  • I've included manual testing steps
  • I've included screenshots/recordings if applicable
  • I’ve included tests if applicable
  • I’ve documented my code using JSDoc format if applicable
  • I’ve applied the right labels on the PR (see labeling guidelines). Not required for external contributors.
  • I’ve properly set the pull request status:
    • In case it's not yet "ready for review", I've set it to "draft".
    • In case it's "ready for review", I've changed it from "draft" to "non-draft".

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.

@sahar-fehri sahar-fehri requested a review from a team as a code owner December 13, 2023 11:52
@github-actions
Copy link
Copy Markdown
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.

@sahar-fehri sahar-fehri self-assigned this Dec 13, 2023
@sahar-fehri sahar-fehri marked this pull request as draft December 13, 2023 11:59
@sahar-fehri sahar-fehri marked this pull request as ready for review December 13, 2023 13:36
@sahar-fehri sahar-fehri force-pushed the feat/MMASSSETS-88-Add-TokenFiatBalance-before-import-v2 branch 2 times, most recently from ac3aad2 to 6dd45b2 Compare December 14, 2023 12:45
@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [9c32928]
Page Load Metrics (1277 ± 146 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint912571364421
domContentLoaded10171364320
load80418401277304146
domInteractive10171364320
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 29 Bytes (0.00%)
  • ui: 1.86 KiB (0.03%)
  • common: 29 Bytes (0.00%)

@codecov
Copy link
Copy Markdown

codecov bot commented Dec 14, 2023

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (7e66e23) 67.90% compared to head (0dd772e) 67.91%.
Report is 4 commits behind head on develop.

Files Patch % Lines
ui/store/actions.ts 0.00% 2 Missing ⚠️
ui/components/ui/token-balance/token-balance.js 85.71% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #22263      +/-   ##
===========================================
+ Coverage    67.90%   67.91%   +0.01%     
===========================================
  Files         1071     1071              
  Lines        41378    41407      +29     
  Branches     11112    11116       +4     
===========================================
+ Hits         28095    28120      +25     
- Misses       13283    13287       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sahar-fehri sahar-fehri force-pushed the feat/MMASSSETS-88-Add-TokenFiatBalance-before-import-v2 branch 4 times, most recently from fd02720 to 8eb5af9 Compare December 18, 2023 15:00
@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [d52dd9c]
Page Load Metrics (1224 ± 126 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint973021816632
domContentLoaded8217757737
load80716831224262126
domInteractive8217757737
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 29 Bytes (0.00%)
  • ui: 1.99 KiB (0.03%)
  • common: 29 Bytes (0.00%)

@sahar-fehri sahar-fehri force-pushed the feat/MMASSSETS-88-Add-TokenFiatBalance-before-import-v2 branch from a920a07 to 96a683b Compare December 19, 2023 13:00
DDDDDanica
DDDDDanica previously approved these changes Dec 19, 2023
NidhiKJha
NidhiKJha previously approved these changes Dec 19, 2023
@sahar-fehri sahar-fehri dismissed stale reviews from NidhiKJha and DDDDDanica via 9363eea December 20, 2023 00:09
@sahar-fehri sahar-fehri force-pushed the feat/MMASSSETS-88-Add-TokenFiatBalance-before-import-v2 branch from 9363eea to 0dd772e Compare December 20, 2023 00:13
@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [0dd772e]
Page Load Metrics (1538 ± 141 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint964961779746
domContentLoaded10189385024
load86220011538293141
domInteractive10189385024
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 29 Bytes (0.00%)
  • ui: 1.73 KiB (0.03%)
  • common: 276 Bytes (0.01%)

sahar-fehri added a commit to MetaMask/core that referenced this pull request Dec 21, 2023
## Explanation

Export a function from assets controller to fetch token exchange rates.

This function will be used by extension to compute user token fiat
amount and display it on the import token modal confirmation page.

## References

* Fixes
[#12345](https://consensyssoftware.atlassian.net/browse/MMASSETS-88)
* Related to
[#67890](MetaMask/metamask-extension#22263)

## Changelog

<!--
If you're making any consumer-facing changes, list those changes here as
if you were updating a changelog, using the template below as a guide.

(CATEGORY is one of BREAKING, ADDED, CHANGED, DEPRECATED, REMOVED, or
FIXED. For security-related issues, follow the Security Advisory
process.)

Please take care to name the exact pieces of the API you've added or
changed (e.g. types, interfaces, functions, or methods).

If there are any breaking changes, make sure to offer a solution for
consumers to follow once they upgrade to the changes.

Finally, if you're only making changes to development scripts or tests,
you may replace the template below with "None".
-->


### `@metamask/assets-controllers`

- **<CATEGORY>**: Updated `assetsUtil `file to export
`fetchAndMapExchangeRates `function

## Checklist

- [x] I've updated the test suite for new or updated code as appropriate
- [x] I've updated documentation (JSDoc, Markdown, etc.) for new or
updated code as appropriate
- [ ] I've highlighted breaking changes using the "BREAKING" category
above as appropriate
@sahar-fehri sahar-fehri merged commit e76a992 into develop Jan 8, 2024
@sahar-fehri sahar-fehri deleted the feat/MMASSSETS-88-Add-TokenFiatBalance-before-import-v2 branch January 8, 2024 14:40
@github-actions github-actions bot locked and limited conversation to collaborators Jan 8, 2024
@metamaskbot metamaskbot added the release-11.9.0 Issue or pull request that will be included in release 11.9.0 label Jan 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-11.9.0 Issue or pull request that will be included in release 11.9.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants