Adds transactionBatches into transaction controller state#5793
Merged
vinistevam merged 27 commits intomainfrom May 27, 2025
Merged
Adds transactionBatches into transaction controller state#5793vinistevam merged 27 commits intomainfrom
transactionBatches into transaction controller state#5793vinistevam merged 27 commits intomainfrom
Conversation
c3f8a6b to
49e9a89
Compare
31069c4 to
e62592d
Compare
matthewwalsh0
requested changes
May 14, 2025
Co-authored-by: Matthew Walsh <matthew.walsh@consensys.net>
…:MetaMask/core into feat/add-batch-transaction-approval-type
transactionBatches into transaction controller statetransactionBatches into transaction controller state
matthewwalsh0
requested changes
May 22, 2025
Contributor
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. |
matthewwalsh0
requested changes
May 23, 2025
Contributor
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. |
matthewwalsh0
approved these changes
May 26, 2025
pedronfigueiredo
approved these changes
May 26, 2025
mikesposito
approved these changes
May 27, 2025
Member
mikesposito
left a comment
There was a problem hiding this comment.
Changes to controller-utils look good
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
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
This PR introduces support for batch transactions in the Transaction Controller by adding a new
ApprovalTypeand extending the state to handleTransactionBatches. These changes enable enhanced metadata management for sequential batch flows, including UI updates for gas estimation and future automation capabilities.Changes
Controller Utils
ApprovalTypeto the enum:TransactionBatch, to support batch transactions.Transaction Controller
transactionBatches, to store metadata for transaction batches.addBatchMetadata, responsible for populating batch-specific metadata.TransactionBatchMeta, to manage metadata for transaction batches.addBatchMetadatato store batch metadata andwipeTransactionBatchesto clean up state after batch hook completion.Rationale
The introduction of
TransactionBatchMetaallows for a clean separation of metadata for batch transactions, which conceptually differ from individual transactions. This ensures:TransactionMetafor individual transactions may not yet exist.These changes lay the groundwork for improved handling of batch transactions and pave the way for future enhancements.
References
Changelog
Checklist