-
Notifications
You must be signed in to change notification settings - Fork 5.4k
feat: for quoted swap use data from quote to populate estimated changes #37574
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
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. |
✨ Files requiring CODEOWNER review ✨✅ @MetaMask/confirmations (10 files, +270 -15)
|
Builds ready [ec93043]
UI Startup Metrics (1254 ± 106 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
|
...irmations/components/confirm/quote-swap-simulation-details/quote-swap-simulation-details.tsx
Show resolved
Hide resolved
...irmations/components/confirm/quote-swap-simulation-details/quote-swap-simulation-details.tsx
Outdated
Show resolved
Hide resolved
...irmations/components/confirm/quote-swap-simulation-details/quote-swap-simulation-details.tsx
Show resolved
Hide resolved
...irmations/components/confirm/quote-swap-simulation-details/quote-swap-simulation-details.tsx
Outdated
Show resolved
Hide resolved
Builds ready [056ea61]
UI Startup Metrics (1131 ± 99 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
|
Builds ready [cacbbec]
UI Startup Metrics (1230 ± 105 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
|
...irmations/components/confirm/quote-swap-simulation-details/quote-swap-simulation-details.tsx
Outdated
Show resolved
Hide resolved
Builds ready [a049e99]
UI Startup Metrics (1187 ± 95 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
...ions/components/confirm/quote-swap-simulation-details/quote-swap-simulation-details.test.tsx
Outdated
Show resolved
Hide resolved
Builds ready [12c0d94]
UI Startup Metrics (1242 ± 76 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
…-extension into simulation_fix
Builds ready [25b8695]
UI Startup Metrics (1251 ± 88 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Builds ready [aded29b]
UI Startup Metrics (1226 ± 94 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
...irmations/components/confirm/quote-swap-simulation-details/quote-swap-simulation-details.tsx
Show resolved
Hide resolved
| asset: { | ||
| ...tokenDetails[srcAsset.address as Hex], | ||
| chainId: toHex(srcAsset.chainId), | ||
| address: srcAsset.address as Hex, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Case-Sensitive Token Detail Lookup Mismatch Failure
The tokenDetails lookup uses srcAsset.address directly without lowercasing, but fetchAllTokenDetails returns keys normalized to lowercase. This causes the spread operation to fail silently when the address has mixed case, resulting in missing token details. The same code correctly lowercases addresses when accessing fiatRates on line 49.
| asset: { | ||
| ...tokenDetails[destAsset.address as Hex], | ||
| chainId: toHex(destAsset.chainId), | ||
| address: destAsset.address as Hex, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Case-Sensitive Token Detail Lookup Mismatch
The tokenDetails lookup uses destAsset.address directly without lowercasing, but fetchAllTokenDetails returns keys normalized to lowercase. This causes the spread operation to fail silently when the address has mixed case, resulting in missing token details. The same code correctly lowercases addresses when accessing fiatRates on line 64.
Builds ready [eaae3e6]
UI Startup Metrics (1246 ± 95 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Description
For MetaMask suggested swap estimated changes should be populated from quote data.
Changelog
CHANGELOG entry:
Related issues
Fixes: https://github.com/MetaMask/MetaMask-planning/issues/6192
Manual testing steps
Screenshots/Recordings
Screen.Recording.2025-11-07.at.12.16.22.PM.mov
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Displays estimated changes for MetaMask quoted swaps using quote/fiat data via a new simulation details component; hides batch simulation for quoted swaps; exposes fiat rates from hooks.
QuoteSwapSimulationDetailsindapp-swap-comparison-bannerwhenSwapType.Metamaskis selected.useDappSwapComparisonInfo(fiatRates,sourceTokenAmount,tokenDetails).components/confirm/quote-swap-simulation-details/quote-swap-simulation-details: renders outgoing/incoming balance changes fromQuoteResponseusing fiat rates and token metadata.SimulationDetailsLayout(nowexport const).batch-simulation-details: skip rendering forrevokeDelegation, upgrade-only, and quoted swaps viauseSwapCheck.useDappSwapUSDValues: now returnsfiatRates.useDappSwapComparisonInfo: returnsfiatRates,sourceTokenAmount,tokenDetails, and computes differences; consumes new USD values.QuoteSwapSimulationDetails.fiatRatespropagation.Written by Cursor Bugbot for commit eaae3e6. This will update automatically on new commits. Configure here.