Commit 873b4f6
authored
fix: include gas in simulation requests (#5754)
## Explanation
Include gas limit and gas fees in balance change simulation requests.
Specifically:
- Create alternate simulation request specifically for gas fee tokens in
new `utils/gas-fee-tokens.ts`.
- Rename `utils/simulation.ts` to `utils/balance-changes.ts`.
- Add `withGas` and `withDefaultBlockOverrides` to balance change
simulation requests.
- Override balance in balance change requests if insufficient balance.
- Subtract gas cost from native balance change.
- Replace code override with `authorizationList` including `from`
property.
- Retrieve MetaMask fee from simulation API.
## References
## 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
- [x] I've prepared draft pull requests for clients and consumer
packages to resolve any breaking changes1 parent 7c7632b commit 873b4f6
File tree
9 files changed
+986
-713
lines changed- packages/transaction-controller
- src
- api
- utils
9 files changed
+986
-713
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
27 | 32 | | |
28 | 33 | | |
29 | 34 | | |
| |||
0 commit comments