-
-
Notifications
You must be signed in to change notification settings - Fork 267
fix: include gas in simulation requests #5754
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6c3d296 to
4d99de2
Compare
e5a0379 to
9126697
Compare
1a8ff2b to
4ec8b2d
Compare
Member
Author
|
@metamaskbot publish-preview |
Contributor
|
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions. |
16c451b to
27e53e1
Compare
OGPoyraz
approved these changes
Jun 2, 2025
pedronfigueiredo
approved these changes
Jun 2, 2025
Override balance if insufficient.
Add gas fee token fee.
27e53e1 to
8a24e34
Compare
matthewwalsh0
added a commit
that referenced
this pull request
Jun 11, 2025
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. - [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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Explanation
Include gas limit and gas fees in balance change simulation requests.
Specifically:
utils/gas-fee-tokens.ts.utils/simulation.tstoutils/balance-changes.ts.withGasandwithDefaultBlockOverridesto balance change simulation requests.authorizationListincludingfromproperty.References
Fixes #4756
Checklist