-
-
Notifications
You must be signed in to change notification settings - Fork 252
chore: add is gasFeeSponsored field in transaction batch params #7064
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. |
ab5f7a6 to
e983f05
Compare
|
@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. |
| >[0] = { | ||
| disable7702, | ||
| isGasFeeIncluded: Boolean(gasIncluded7702), | ||
| isGasFeeSponsored: Boolean(gasSponsored), |
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: Gas Sponsorship Not Reflected in Quote Response
The gasSponsored property is destructured from quoteResponse.quote but it's not included in the quoteResponse parameter type definition. Looking at the context, the function signature shows quoteResponse: Omit<QuoteResponse, 'approval' | 'trade'> & Partial<QuoteMetadata>, but gasSponsored is not part of the quote object's known structure based on the imports from @metamask/bridge-controller. This could result in gasSponsored being undefined and isGasFeeSponsored always being false, even when gas is actually sponsored.
|
@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. |
7b44fb9 to
c307071
Compare
| const { result } = await addTransaction(txParams, { | ||
| batchId, | ||
| isGasFeeIncluded: userRequest.isGasFeeIncluded, | ||
| isGasFeeSponsored: userRequest.isGasFeeSponsored, |
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.
This is only for EIP-7702 flow, do we also want want to pass it for the hook fallback via STX or sequentially?
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.
The requirement is 7702 support from the chain to activate sponsorship. If 7702 is not supported by the chain then sponsorship cannot happen.
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.
Current gas fees sponsored use case is only for EIP-7702 delegation flow.
| const { result } = await addTransaction(txParams, { | ||
| batchId, | ||
| isGasFeeIncluded: userRequest.isGasFeeIncluded, | ||
| isGasFeeSponsored: userRequest.isGasFeeSponsored, |
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.
Minor, is it worth asserting this is passed in one of the existing unit tests?
Explanation
This PR introduces a new boolean flag, isGasFeeSponsored, across the Transaction Controller and Bridge Status Controller to indicate when a transaction’s gas fee is sponsored (i.e., paid by MetaMask or another service provider).
This complements the existing isGasFeeIncluded flag, which tracks when the gas cost is embedded within the transaction itself. Together, these flags enable more accurate handling of different gas payment scenarios.
Especially needed for the fully sponsored scenario for SEI and MONAD chain.
References
Checklist
Note
Adds
isGasFeeSponsoredflag end-to-end (types, plumbing, and tests) for transaction batches and addTransaction, and passes quotegasSponsoredthrough BridgeStatusController.isGasFeeSponsoredtoTransactionBatchRequestandAddTransactionOptionsinsrc/types.ts.isGasFeeSponsoredinaddTransaction; pass through inaddTransactionBatch(EIP-7702 path) viautils/batch.ts.isGasFeeSponsoredpropagation (TransactionController.test.ts,utils/batch.test.ts).CHANGELOG.mdnoting new support.gasSponsored=>isGasFeeSponsoredingetAddTransactionBatchParams(src/utils/transaction.ts).isGasFeeSponsored; updateCHANGELOG.md.Written by Cursor Bugbot for commit 0995577. This will update automatically on new commits. Configure here.