Skip to content

Conversation

@matthewwalsh0
Copy link
Member

@matthewwalsh0 matthewwalsh0 commented Nov 19, 2025

Explanation

Use gas fee tokens for deposit transactions in Relay strategy, if native balance is insufficient for max fee.

References

Related to #6150

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

Enables using a gas fee token for Relay source network fees when native balance is insufficient, propagating through quotes, totals, and submission.

  • Relay strategy (quotes):
    • Compute source network fee using gas fee token if native balance < max fee; add fees.isSourceGasFeeToken and use TransactionController:getGasFeeTokens to match source token, including batch estimation and normalized value.
    • Keep native-fee path as fallback; total gas across multiple txs; fallback gas when missing.
  • Submission:
    • Pass gasFeeToken to addTransaction/addTransactionBatch when fees.isSourceGasFeeToken is true.
  • Utils:
    • Add calculateGasFeeTokenCost and use it in source-fee calculation; refactor transaction gas fee token cost path.
  • Types/Totals:
    • Extend TransactionPayFees and TransactionPayTotals with optional isSourceGasFeeToken.
  • Tests/Mocks/Docs:
    • Update tests and messenger mock to cover gas fee token flow; update CHANGELOG.

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

@matthewwalsh0 matthewwalsh0 force-pushed the feat/transaction-pay-gas-fee-token branch from 7ae130c to 27e60df Compare November 20, 2025 09:22
@matthewwalsh0 matthewwalsh0 changed the title feat: gas station on transaction pay feat: gas station support for relay source transactions Nov 20, 2025
@matthewwalsh0 matthewwalsh0 force-pushed the feat/transaction-pay-gas-fee-token branch from 27e60df to 6fabc7c Compare November 20, 2025 09:31
@matthewwalsh0 matthewwalsh0 marked this pull request as ready for review November 20, 2025 11:56
@matthewwalsh0 matthewwalsh0 requested review from a team as code owners November 20, 2025 11:56
@matthewwalsh0
Copy link
Member Author

@metamaskbot publish-preview

@matthewwalsh0 matthewwalsh0 added this pull request to the merge queue Nov 20, 2025
Merged via the queue into main with commit a1c0fa8 Nov 20, 2025
274 checks passed
@matthewwalsh0 matthewwalsh0 deleted the feat/transaction-pay-gas-fee-token branch November 20, 2025 14:58
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