-
-
Notifications
You must be signed in to change notification settings - Fork 252
feat: optimise transaction pay quote refresh #7008
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
Conversation
|
@metamaskbot publish-preview |
|
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions. |
|
@metamaskbot publish-preview |
|
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions. |
|
@metamaskbot publish-preview |
|
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions. |
Fix totals.
Calculate source network cost of all steps.
7df8698 to
7983b22
Compare
| * | ||
| * @param quote - Relay quote. | ||
| * @param messenger - Controller messenger. | ||
| * @returns Total source network cost in USD and fiat. |
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.
what is the difference between USD and fiat? Is fiat the user's selected currency?
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.
Exactly, I've made a point of providing both everywhere so it's easy to access since Perps and Predict force USD everywhere.
I've confirmed the difference in the FiatRates and FiatValue JSDoc.
Explanation
Only check if transaction pay quotes need refreshing when quotes exist in the controller state.
Also:
isLoadingstate if quote update fails.References
Checklist
Note
Introduce quote-refresh polling based on existing quotes, correct feature flag keys, improve fee/fiat calculations, and refine transaction/quote refresh behavior.
src/TransactionPayController.ts):queueRefreshQuoteswithQuoteRefresherand ensureisLoadingreset afterupdateQuotes.QuoteRefresherto pollrefreshQuotesonly whentransactionDatacontains quotes; prevents concurrent updates and handles errors.bridge-quotes.ts):confirmations_payfeature flag key.request.sourceTokenAddressfor source fiat rate.relay-quotes.ts):confirmations_payfeature flag key.utils/quotes.ts):sourceAmountstotokensby address.refreshQuotes; remove internal polling; respect per-strategy refresh intervals; set loading during refresh.utils/totals.ts):skipIfBalancewhen balance ≥ amount from totals.utils/transaction.ts):CHANGELOG.mdwith fixes (ignore tokens without quotes; correct feature flag).Written by Cursor Bugbot for commit 7983b22. This will update automatically on new commits. Configure here.