Commit f35ae4c
authored
chore: add is gasFeeSponsored field in transaction batch params (#7064)
## 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.
<!--
Thanks for your contribution! Take a moment to answer these questions so
that reviewers have the information they need to properly understand
your changes:
* What is the current state of things and why does it need to change?
* What is the solution your changes offer and how does it work?
* Are there any changes whose purpose might not obvious to those
unfamiliar with the domain?
* If your primary goal was to update one package but you found you had
to update another one along the way, why did you do so?
* If you had to upgrade a dependency, why did you do so?
-->
## References
<!--
Are there any issues that this pull request is tied to?
Are there other links that reviewers should consult to understand these
changes better?
Are there client or consumer pull requests to adopt any breaking
changes?
For example:
* Fixes #12345
* Related to #67890
-->
## 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](https://github.com/MetaMask/core/tree/main/docs/contributing.md#updating-changelogs),
highlighting breaking changes as necessary
- [ ] I've prepared draft pull requests for clients and consumer
packages to resolve any breaking changes
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Adds `isGasFeeSponsored` flag to transaction batches and
addTransaction, wiring it from BridgeStatusController quotes through to
TransactionController.
>
> - **Transaction Controller**:
> - Add `isGasFeeSponsored` to `TransactionBatchRequest` and
`AddTransactionOptions` types; persist on transactions.
> - Pass `isGasFeeSponsored` through `addTransactionBatch` paths
(EIP-7702 and hook-based) by forwarding `userRequest.isGasFeeSponsored`
when calling `addTransaction`.
> - Update tests to include `isGasFeeSponsored` in expected metadata;
changelog updated.
> - **Bridge Status Controller**:
> - Read `gasSponsored` from quote and set `isGasFeeSponsored` on batch
params in `getAddTransactionBatchParams`.
> - Update snapshots to include `isGasFeeSponsored` in batch request
objects.
> - **Changelogs**: Document new `isGasFeeSponsored` support in both
packages.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
0a5a3ad. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent 6175608 commit f35ae4c
File tree
9 files changed
+46
-0
lines changed- packages
- bridge-status-controller
- src
- __snapshots__
- utils
- transaction-controller
- src
- utils
9 files changed
+46
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
10 | 14 | | |
11 | 15 | | |
12 | 16 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1252 | 1252 | | |
1253 | 1253 | | |
1254 | 1254 | | |
| 1255 | + | |
1255 | 1256 | | |
1256 | 1257 | | |
1257 | 1258 | | |
| |||
2952 | 2953 | | |
2953 | 2954 | | |
2954 | 2955 | | |
| 2956 | + | |
2955 | 2957 | | |
2956 | 2958 | | |
2957 | 2959 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
300 | 300 | | |
301 | 301 | | |
302 | 302 | | |
| 303 | + | |
303 | 304 | | |
304 | 305 | | |
305 | 306 | | |
| |||
393 | 394 | | |
394 | 395 | | |
395 | 396 | | |
| 397 | + | |
396 | 398 | | |
397 | 399 | | |
398 | 400 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1692 | 1692 | | |
1693 | 1693 | | |
1694 | 1694 | | |
| 1695 | + | |
1695 | 1696 | | |
1696 | 1697 | | |
1697 | 1698 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1216 | 1216 | | |
1217 | 1217 | | |
1218 | 1218 | | |
| 1219 | + | |
1219 | 1220 | | |
1220 | 1221 | | |
1221 | 1222 | | |
| |||
1315 | 1316 | | |
1316 | 1317 | | |
1317 | 1318 | | |
| 1319 | + | |
1318 | 1320 | | |
1319 | 1321 | | |
1320 | 1322 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1726 | 1726 | | |
1727 | 1727 | | |
1728 | 1728 | | |
| 1729 | + | |
| 1730 | + | |
| 1731 | + | |
1729 | 1732 | | |
1730 | 1733 | | |
1731 | 1734 | | |
| |||
2061 | 2064 | | |
2062 | 2065 | | |
2063 | 2066 | | |
| 2067 | + | |
| 2068 | + | |
| 2069 | + | |
2064 | 2070 | | |
2065 | 2071 | | |
2066 | 2072 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
810 | 810 | | |
811 | 811 | | |
812 | 812 | | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
813 | 840 | | |
814 | 841 | | |
815 | 842 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
401 | 401 | | |
402 | 402 | | |
403 | 403 | | |
| 404 | + | |
404 | 405 | | |
405 | 406 | | |
406 | 407 | | |
| |||
0 commit comments