Skip to content

Conversation

@matthewwalsh0
Copy link
Member

@matthewwalsh0 matthewwalsh0 commented Nov 3, 2025

Explanation

Calculate totals using required tokens and target transaction network fee even when there are no quotes, in order to reduce duplication in clients.

References

Related to #6160

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed, highlighting breaking changes as necessary
  • I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes

Note

Calculates totals using transaction gas fee when no quotes are returned, refactors quote building/fetching, updates sync logic, tests, and changelog.

  • Transaction Pay Utils:
    • Totals: calculateTotals now takes a single params object including transaction/messenger; falls back to transaction gas cost for target network fees when quotes are empty.
    • Quotes: Extracts buildQuoteRequests and getQuotes; always computes totals; improves logging; syncTransaction no-ops if paymentToken is undefined.
  • Tests:
    • Update totals.test to mock gas cost and cover no-quotes case.
    • Update quotes.test to expect state clearing and quotesLastUpdated set when no payment token and to match new request building.
  • Changelog:
    • Adds note about calculating totals when no quotes are received.

Written by Cursor Bugbot for commit 9ce9bfa. This will update automatically on new commits. Configure here.

@matthewwalsh0 matthewwalsh0 force-pushed the feat/calculate-pay-totals-no-quotes branch from 1b78395 to ac85658 Compare November 3, 2025 14:55
@matthewwalsh0 matthewwalsh0 marked this pull request as ready for review November 3, 2025 14:58
@matthewwalsh0 matthewwalsh0 requested review from a team as code owners November 3, 2025 14:58
@matthewwalsh0 matthewwalsh0 force-pushed the feat/calculate-pay-totals-no-quotes branch from ac85658 to 4d1ffa0 Compare November 4, 2025 10:27
@matthewwalsh0 matthewwalsh0 enabled auto-merge (squash) November 4, 2025 12:31
@matthewwalsh0 matthewwalsh0 force-pushed the feat/calculate-pay-totals-no-quotes branch from 4d1ffa0 to 9ce9bfa Compare November 4, 2025 12:31
@matthewwalsh0 matthewwalsh0 merged commit 25fad1d into main Nov 4, 2025
259 checks passed
@matthewwalsh0 matthewwalsh0 deleted the feat/calculate-pay-totals-no-quotes branch November 4, 2025 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants