-
-
Notifications
You must be signed in to change notification settings - Fork 252
feat: add gasSponsored flag to bridgeController #6687
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
b1c1210
to
f1e41b9
Compare
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.
Left a couple of comments, but they are non-blocking. LGTM.
totalFeeAmountUsd: optional(string()), | ||
}), | ||
), | ||
gasSponsored: optional(boolean()), |
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.
nit
please update the comment for gasIncluded7702, as gas sponser will also set this field to true
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.
please double confirm
if gasIncluded7702 is true and gasSponsored is true
what happen to the extension when it is not ready support that from UI?
51b571e
to
f8d57f1
Compare
Co-authored-by: Elliot Winkler <[email protected]>
39c3c82
to
cb85254
Compare
Explanation
What is the current state of things and why does it need to change?
gasIncluded
and when EIP‑7702 delegated execution can be used viagasIncluded7702
, but there’s no explicit way to signal that a third party will sponsor the gas cost.What is the solution your changes offer and how does it work?
quote.gasSponsored
toQuoteSchema
in@validators.ts
to allow the bridge API to flag gas‑sponsored quotes.gasSponsored
.BridgeController.fetchQuotes
and the fee‑augmentation path preserve the field unchanged so the UI and metrics layers can consume it.bridge-controller.test.ts
verifying thatfetchQuotes
returns quotes wherequote.gasSponsored
is preserved when present, and remains undefined when omitted.Are there any changes whose purpose might not obvious to those unfamiliar with the domain?
gasIncluded
: Quote includes gas fees in the trade economics, but the user still submits and pays gas.gasIncluded7702
: Quote can use delegated execution under EIP‑7702.gasSponsored
: A third party sponsors the gas so the user doesn’t pay it; this is orthogonal to whether gas is “included” in pricing or delegated via 7702.References
This PR is related to this BridgeAPI PR https://github.com/consensys-vertical-apps/va-mmcx-bridge-api/pull/527.
PR related for MM Extension: MetaMask/metamask-extension#36227.
PR related for MM Mobile: MetaMask/metamask-mobile#20878.
Checklist
Note
Introduce optional
quote.gasSponsored
in schema and ensurefetchQuotes
preserves it; add tests and changelog entry.QuoteSchema
insrc/utils/validators.ts
with optionalquote.gasSponsored
boolean.GenericQuoteRequest
and addmakeQuoteRequest
helper.fetchQuotes
preservesquote.gasSponsored
when present.fetchQuotes
now includegasSponsored
under Unreleased.Written by Cursor Bugbot for commit cb85254. This will update automatically on new commits. Configure here.