Commit 83a199e
Add
## Explanation
This PR enhances `TransactionBatchMeta` by adding support for
`gasFeeEstimates` and `status`.
When both `useHook` and `requireApproval` are `true`, the batch approval
flow is triggered, and `gasFeeEstimates` are populated using the
`DefaultGasFeeFlow`. These estimates are then passed along with the
request to be consumed by the client.
## Changes
- Extended `TransactionBatchMeta` to include:
- `gasFeeEstimates`
- `status`
- Introduced a new helper function: `prepareApprovalData`
- Responsible for preparing approval data before creating the request
<!--
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
-->
* Related to MetaMask/MetaMask-planning#5006
## Changelog
<!--
THIS SECTION IS NO LONGER NEEDED.
The process for updating changelogs has changed. Please consult the
"Updating changelogs" section of the Contributing doc for more.
-->
## Checklist
- [x] I've updated the test suite for new or updated code as appropriate
- [x] I've updated documentation (JSDoc, Markdown, etc.) for new or
updated code as appropriate
- [x] 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
---------
Co-authored-by: Pedro Figueiredo <pedro.figueiredo@consensys.net>
Co-authored-by: Matthew Walsh <matthew.walsh@consensys.net>
Co-authored-by: OGPoyraz <omergoktugpoyraz@gmail.com>gasFeeEstimates for batch transactions (#5886)1 parent c7f9f73 commit 83a199e
File tree
5 files changed
+228
-52
lines changed- packages/transaction-controller
- src
- utils
5 files changed
+228
-52
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: 10 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1034 | 1034 | | |
1035 | 1035 | | |
1036 | 1036 | | |
| 1037 | + | |
1037 | 1038 | | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
1038 | 1046 | | |
1039 | 1047 | | |
1040 | 1048 | | |
1041 | 1049 | | |
1042 | 1050 | | |
1043 | 1051 | | |
1044 | | - | |
1045 | | - | |
1046 | 1052 | | |
1047 | 1053 | | |
1048 | 1054 | | |
1049 | 1055 | | |
1050 | | - | |
1051 | | - | |
1052 | | - | |
1053 | | - | |
1054 | | - | |
1055 | | - | |
1056 | | - | |
| 1056 | + | |
1057 | 1057 | | |
| 1058 | + | |
1058 | 1059 | | |
1059 | 1060 | | |
1060 | 1061 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
504 | 504 | | |
505 | 505 | | |
506 | 506 | | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
507 | 510 | | |
508 | 511 | | |
509 | 512 | | |
| |||
524 | 527 | | |
525 | 528 | | |
526 | 529 | | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
527 | 533 | | |
528 | 534 | | |
529 | 535 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
28 | 30 | | |
29 | 31 | | |
| 32 | + | |
30 | 33 | | |
31 | | - | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
32 | 39 | | |
33 | 40 | | |
34 | 41 | | |
| |||
168 | 175 | | |
169 | 176 | | |
170 | 177 | | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
171 | 190 | | |
172 | 191 | | |
173 | 192 | | |
| |||
214 | 233 | | |
215 | 234 | | |
216 | 235 | | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
217 | 242 | | |
218 | 243 | | |
219 | 244 | | |
| |||
225 | 250 | | |
226 | 251 | | |
227 | 252 | | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
228 | 279 | | |
229 | 280 | | |
230 | 281 | | |
| |||
273 | 324 | | |
274 | 325 | | |
275 | 326 | | |
| 327 | + | |
276 | 328 | | |
277 | 329 | | |
278 | 330 | | |
| |||
767 | 819 | | |
768 | 820 | | |
769 | 821 | | |
| 822 | + | |
| 823 | + | |
770 | 824 | | |
771 | 825 | | |
772 | 826 | | |
| |||
1466 | 1520 | | |
1467 | 1521 | | |
1468 | 1522 | | |
| 1523 | + | |
| 1524 | + | |
| 1525 | + | |
| 1526 | + | |
| 1527 | + | |
| 1528 | + | |
| 1529 | + | |
| 1530 | + | |
| 1531 | + | |
| 1532 | + | |
| 1533 | + | |
| 1534 | + | |
| 1535 | + | |
| 1536 | + | |
| 1537 | + | |
| 1538 | + | |
| 1539 | + | |
| 1540 | + | |
| 1541 | + | |
| 1542 | + | |
| 1543 | + | |
| 1544 | + | |
| 1545 | + | |
| 1546 | + | |
| 1547 | + | |
| 1548 | + | |
| 1549 | + | |
| 1550 | + | |
| 1551 | + | |
| 1552 | + | |
| 1553 | + | |
| 1554 | + | |
| 1555 | + | |
| 1556 | + | |
| 1557 | + | |
| 1558 | + | |
| 1559 | + | |
| 1560 | + | |
| 1561 | + | |
| 1562 | + | |
| 1563 | + | |
| 1564 | + | |
| 1565 | + | |
| 1566 | + | |
| 1567 | + | |
| 1568 | + | |
| 1569 | + | |
| 1570 | + | |
| 1571 | + | |
| 1572 | + | |
| 1573 | + | |
| 1574 | + | |
| 1575 | + | |
| 1576 | + | |
| 1577 | + | |
| 1578 | + | |
| 1579 | + | |
| 1580 | + | |
| 1581 | + | |
| 1582 | + | |
| 1583 | + | |
| 1584 | + | |
| 1585 | + | |
| 1586 | + | |
| 1587 | + | |
| 1588 | + | |
| 1589 | + | |
| 1590 | + | |
1469 | 1591 | | |
1470 | 1592 | | |
1471 | 1593 | | |
| |||
1545 | 1667 | | |
1546 | 1668 | | |
1547 | 1669 | | |
| 1670 | + | |
| 1671 | + | |
1548 | 1672 | | |
1549 | 1673 | | |
1550 | 1674 | | |
| |||
1642 | 1766 | | |
1643 | 1767 | | |
1644 | 1768 | | |
| 1769 | + | |
1645 | 1770 | | |
1646 | 1771 | | |
1647 | 1772 | | |
| |||
0 commit comments