Skip to content

Commit 873b4f6

Browse files
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 changes
1 parent 7c7632b commit 873b4f6

File tree

9 files changed

+986
-713
lines changed

9 files changed

+986
-713
lines changed

packages/transaction-controller/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2424
- Add `transactionBatches` array to state.
2525
- Add `TransactionBatchMeta` type.
2626

27+
### Changed
28+
29+
- Include gas limit and gas fees in simulation requests ([#5754](https://github.com/MetaMask/core/pull/5754))
30+
- Add optional `fee` property to `GasFeeToken`.
31+
2732
### Fixed
2833

2934
- Support leading zeroes in `authorizationList` properties ([#5830](https://github.com/MetaMask/core/pull/5830))

0 commit comments

Comments
 (0)