Skip to content

feat: add SelectedGasFeeToken component#17556

Merged
vinistevam merged 19 commits into
mainfrom
feat/add-selected-gas-fee-component
Aug 6, 2025
Merged

feat: add SelectedGasFeeToken component#17556
vinistevam merged 19 commits into
mainfrom
feat/add-selected-gas-fee-component

Conversation

@vinistevam

@vinistevam vinistevam commented Jul 24, 2025

Copy link
Copy Markdown
Contributor

Description

This PR aims to introduce the first component to support gasless transactions (pay with another token).

  • Created SelectedGasFeeToken component
  • Modified useInsufficientBalanceAlert adding an optional boolean ignoreGasFeeToken
  • Created useIsGaslessSupported hook
  • Created useEthFiatAmount hook to get an Eth amount converted to fiat and formatted for display
  • Created useGasFeeToken hook to fetch the available tokens to be used to pay for the transaction

Changelog

CHANGELOG entry: null

Related issues

Fixes: https://github.com/MetaMask/mobile-planning/issues/2262

Manual testing steps

  1. component not available to the user

Screenshots/Recordings

gas-fee-token

Before

After

Pre-merge author checklist

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.

@vinistevam vinistevam added the team-confirmations Push issues to confirmations team label Jul 24, 2025
@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.

@vinistevam vinistevam changed the title feat: add selectedGasFee component feat: add SelectedGasFeeToken component Jul 25, 2025
@vinistevam vinistevam marked this pull request as ready for review July 25, 2025 13:01
@vinistevam vinistevam requested a review from a team as a code owner July 25, 2025 13:01
@github-actions

github-actions Bot commented Jul 25, 2025

Copy link
Copy Markdown
Contributor

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: 5bd699478d76611789fe49283361f29cb07acb9a
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/2b2ba697-1fab-489b-a149-60bca5800969

Note

  • You can rerun any failed steps by opening the Bitrise build, tapping Rebuild on the upper right then Rebuild unsuccessful Workflows
  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

Tip

  • Check the documentation if you have any doubts on how to understand the failure on bitrise

cursor[bot]

This comment was marked as outdated.

@vinistevam vinistevam force-pushed the feat/add-selected-gas-fee-component branch from 5bd6994 to 93b56b3 Compare July 25, 2025 13:05
cursor[bot]

This comment was marked as outdated.

@github-actions

github-actions Bot commented Jul 28, 2025

Copy link
Copy Markdown
Contributor

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: 18d001d
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/f0ce778c-423e-4949-a5d5-69dc9e17406c

Note

  • You can rerun any failed steps by opening the Bitrise build, tapping Rebuild on the upper right then Rebuild unsuccessful Workflows
  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

Tip

  • Check the documentation if you have any doubts on how to understand the failure on bitrise

cursor[bot]

This comment was marked as outdated.

@github-actions

github-actions Bot commented Aug 5, 2025

Copy link
Copy Markdown
Contributor

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: 300b3e1
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/6d15b386-770f-4649-bbde-5595abc6921d

Note

  • You can rerun any failed steps by opening the Bitrise build, tapping Rebuild on the upper right then Rebuild unsuccessful Workflows
  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

Tip

  • Check the documentation if you have any doubts on how to understand the failure on bitrise

@github-actions

github-actions Bot commented Aug 6, 2025

Copy link
Copy Markdown
Contributor

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: 854eb31
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/fecbd0a6-988b-4573-b837-e790adc701f4

Note

  • You can rerun any failed steps by opening the Bitrise build, tapping Rebuild on the upper right then Rebuild unsuccessful Workflows
  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

Tip

  • Check the documentation if you have any doubts on how to understand the failure on bitrise

@github-actions

github-actions Bot commented Aug 6, 2025

Copy link
Copy Markdown
Contributor

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: c0746db
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/f2d00d96-0a64-46f8-bdeb-dd2a8c930180

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

: `${formatCurrency(
formattedFiat,
currentCurrency,
)} ${currentCurrency.toUpperCase()}`;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Fiat Calculation Inconsistency and Currency Symbol Issue

The useEthFiatAmount hook has inconsistent fiat amount calculations and formatting. It uses decEthToConvertedCurrency for the final output but direct BigNumber multiplication for the small amount threshold check, which can lead to discrepancies if their rounding or precision differs. Furthermore, for small amounts (e.g., < $0.01), the currency symbol is always included, even when hideCurrencySymbol is true, due to the use of formatCurrency.

Fix in Cursor Fix in Web

@sonarqubecloud

sonarqubecloud Bot commented Aug 6, 2025

Copy link
Copy Markdown

@vinistevam vinistevam added the No QA Needed Apply this label when your PR does not need any QA effort. label Aug 6, 2025
@vinistevam vinistevam enabled auto-merge August 6, 2025 08:03
@vinistevam vinistevam added this pull request to the merge queue Aug 6, 2025
Merged via the queue into main with commit f663ffc Aug 6, 2025
60 of 66 checks passed
@vinistevam vinistevam deleted the feat/add-selected-gas-fee-component branch August 6, 2025 08:18
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 6, 2025
@metamaskbot metamaskbot added the release-7.55.0 Issue or pull request that will be included in release 7.55.0 label Aug 6, 2025
@tommasini tommasini added release-7.54.0 Issue or pull request that will be included in release 7.54.0 and removed release-7.55.0 Issue or pull request that will be included in release 7.55.0 labels Aug 22, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

No QA Needed Apply this label when your PR does not need any QA effort. release-7.54.0 Issue or pull request that will be included in release 7.54.0 team-confirmations Push issues to confirmations team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants