Conversation
Contributor
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
62ce1ca to
76c19b0
Compare
da5ccce to
5af4375
Compare
5af4375 to
445ded4
Compare
c3c62d5 to
62b1b4f
Compare
445ded4 to
06baed6
Compare
c5eae22 to
fe5df5a
Compare
f0455a3 to
0b2d7a4
Compare
0b2d7a4 to
8abd2d0
Compare
fbf3ac0 to
a3fa6a7
Compare
3 tasks
BZahory
added a commit
to MetaMask/core
that referenced
this pull request
May 21, 2024
## 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 `swapAndSend` transaction 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 `TransactionType` enum 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](https://consensyssoftware.atlassian.net/browse/METABRIDGE-843) MetaMask/metamask-extension#23703 (MetaMask/metamask-extension#24429 latest in merge train targeting that branch) <!-- Are there any issues that this pull request is tied to? Are there other links that reviewers should consult to understand these changes better? For example: * --> ## Changelog <!-- If you're making any consumer-facing changes, list those changes here as if you were updating a changelog, using the template below as a guide. (CATEGORY is one of BREAKING, ADDED, CHANGED, DEPRECATED, REMOVED, or FIXED. For security-related issues, follow the Security Advisory process.) Please take care to name the exact pieces of the API you've added or changed (e.g. types, interfaces, functions, or methods). If there are any breaking changes, make sure to offer a solution for consumers to follow once they upgrade to the changes. Finally, if you're only making changes to development scripts or tests, you may replace the template below with "None". --> ### `@metamask/transaction-controller` - **ADDED**: `swapAndSend` type and respective - **ADDED**: `updateSwapAndSendTransaction()` - **ADDED**: `TransactionMetaBase` properties: `destinationTokenAmount`, `sourceTokenAddress`, `sourceTokenAmount`, `sourceTokenDecimals`, `swapAndSendRecipient` ## 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 highlighted breaking changes using the "BREAKING" category above as appropriate
a3fa6a7 to
6b5250e
Compare
micaelae
approved these changes
May 24, 2024
ca18ea6 to
88efd3e
Compare
<!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> [](https://codespaces.new/MetaMask/metamask-extension/pull/23889?quickstart=1) Fixes: 1. Go to this page... 2. 3. <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> <!-- [screenshots/recordings] --> <!-- [screenshots/recordings] --> - [ ] I’ve followed [MetaMask Coding Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. --------- Co-authored-by: micaelae <100321200+micaelae@users.noreply.github.com>
<!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> [](https://codespaces.new/MetaMask/metamask-extension/pull/23921?quickstart=1) ## **Related issues** Fixes: ## **Manual testing steps** 1. Go to this page... 2. 3. ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [ ] I’ve followed [MetaMask Coding Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. --------- Signed-off-by: Ethan Wessel <ethan.wessel@consensys.net> Co-authored-by: Ethan Wessel <ethan.wessel@consensys.net>
Signed-off-by: Ethan Wessel <ethan.wessel@consensys.net> Co-authored-by: micaelae <100321200+micaelae@users.noreply.github.com> Co-authored-by: Ethan Wessel <ejwessel@gmail.com>
<!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> [](https://codespaces.new/MetaMask/metamask-extension/pull/24449?quickstart=1) ## **Related issues** Fixes: ## **Manual testing steps** 1. Go to this page... 2. 3. ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [ ] I’ve followed [MetaMask Coding Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. --------- Co-authored-by: Bilal Zahory <bilal.zahory@consensys.net>
b5c6a9d to
3f59f82
Compare
micaelae
previously approved these changes
May 25, 2024
micaelae
previously approved these changes
May 25, 2024
sleepytanya
previously approved these changes
May 25, 2024
sleepytanya
previously approved these changes
May 25, 2024
micaelae
previously approved these changes
May 25, 2024
f748aa0 to
8562dbb
Compare
sleepytanya
approved these changes
May 26, 2024
micaelae
approved these changes
May 26, 2024
Collaborator
Builds ready [d324bd2]
Page Load Metrics (766 ± 517 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Description
As part of the ongoing monetization initiative in default experiences, Swap+Send was prioritized and assigned to the bridge team in an effort to capture revenue immediately following a send transaction; these typically go to MetaMask alternatives (i.e., Uniswap).
This PR fully implements the full Swap+Send experience, without degrading the existing swaps experience.
Related issues
METABRIDGE-843
Manual testing steps
Screenshots/Recordings
Before
new.flow.recording.mov
Existing functionality
Basic send: ERC-20
Screen.Recording.2024-05-24.at.9.55.51.PM.mov
Basic send: Native Asset
Screen.Recording.2024-05-24.at.9.56.56.PM.mov
Basic send: ERC-1155
Screen.Recording.2024-05-24.at.9.57.56.PM.mov
Basic send: ERC-721
Screen.Recording.2024-05-24.at.9.59.42.PM.mov
Fun stuff
Swap+Send Native -> ERC-20
Screen.Recording.2024-05-24.at.10.03.24.PM.mov
Swap+Send ERC-20 -> Native
Screen.Recording.2024-05-24.at.10.04.51.PM.mov
Swap+Send ERC-20 -> ERC-20
Screen.Recording.2024-05-24.at.10.05.45.PM.mov
Pre-merge author checklist
Pre-merge reviewer checklist