Conversation
added 4 commits
May 21, 2024 14:39
ensure parity with swap method
0cc7de2 to
ea30346
Compare
micaelae
previously approved these changes
May 21, 2024
micaelae
approved these changes
May 21, 2024
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
What is the current state of things and why does it need to change?
With MetaMask/metamask-extension#23703, we will be implementing a new type of transaction, swap+send – a swap targeting the recipient. To properly track this transaction, we will need a new transaction type with new properties.
What is the solution your changes offer and how does it work?
We add a new
swapAndSendtransaction type with properties that track the source+destination tokens, as well as the recipient.Are there any changes whose purpose might not obvious to those unfamiliar with the domain?
We include certain swap properties that we may not use initially (e.g.,
swapTokenValue,swapMetaData) in case we add more parity with the swaps functionality over time.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?
The
TransactionTypeenum was abstracted to this library rather than the Extension.If you had to upgrade a dependency, why did you do so?
N/A
References
MB-843
MetaMask/metamask-extension#23703 (MetaMask/metamask-extension#24429 latest in merge train targeting that branch)
Changelog
@metamask/transaction-controllerswapAndSendtypeupdateSwapAndSendTransaction()TransactionMetaBaseproperties:destinationTokenAmount,sourceTokenAddress,sourceTokenAmount,sourceTokenDecimals,swapAndSendRecipientChecklist