feat: add SelectedGasFeeToken component#17556
Conversation
|
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. |
selectedGasFee componentSelectedGasFeeToken component
|
5bd6994 to
93b56b3
Compare
|
|
|
|
| : `${formatCurrency( | ||
| formattedFiat, | ||
| currentCurrency, | ||
| )} ${currentCurrency.toUpperCase()}`; |
There was a problem hiding this comment.
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.
|



Description
This PR aims to introduce the first component to support gasless transactions (pay with another token).
SelectedGasFeeTokencomponentuseInsufficientBalanceAlertadding an optional booleanignoreGasFeeTokenuseIsGaslessSupportedhookuseEthFiatAmounthook to get an Eth amount converted to fiat and formatted for displayuseGasFeeTokenhook to fetch the available tokens to be used to pay for the transactionChangelog
CHANGELOG entry: null
Related issues
Fixes: https://github.com/MetaMask/mobile-planning/issues/2262
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist