-
Notifications
You must be signed in to change notification settings - Fork 5k
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
feat: cross chain swap STX #28460
feat: cross chain swap STX #28460
Conversation
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. |
3d57b48
to
c1adb80
Compare
4359f25
to
44ac2e3
Compare
c082ed0
to
0825eeb
Compare
e43b87a
to
4ad79f2
Compare
0825eeb
to
e296149
Compare
4ad79f2
to
05c5197
Compare
67de92a
to
0e21993
Compare
## **Description** This PR implements the following: 1. Submit bridge transaction for normal transactions 3. Submit bridge transaction for native gas tokens that don't require approval 4. Submit bridge transaction for ERC20s that require approval Does not fully: 1. Submit bridge transaction for smart transactions - You can submit an STX, but the status screens don't make the most sense right now. - Improved STX support be handled by #28460 and MetaMask/core#4918 [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/27262?quickstart=1) ## **Related issues** - Targeting: #27522 ## **Manual testing steps** 1. Go to Bridge 2. Fill in source/dest token and amounts 3. Get a quote 4. Execute Bridge ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> https://github.com/user-attachments/assets/b73f917d-e3e4-468b-b0fa-29f41f559488 ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] 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.
088a7b4
to
076a868
Compare
cc7daf3
to
86a80a0
Compare
09c70ae
to
686cf28
Compare
Builds ready [098d118]
Page Load Metrics (1915 ± 151 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Builds ready [5b2b7fb]
Page Load Metrics (1707 ± 59 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
…ash, move state update outside of it
f33d3f0
to
86e1202
Compare
Builds ready [42c5559]
Page Load Metrics (1942 ± 103 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Builds ready [c577043]
Page Load Metrics (2270 ± 126 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice job! I've shared feedback about some UI improvements in DMs and it will be resolved in upcoming PRs before this feature is enabled in production.
Description
This PR improves support for Smart Transactions (STX). It will not show the STX status page if the tx is a Bridge tx. Instead users will be immediately sent to the Activity list. If the user opens the Bridge tx detaills, they should be able to see the proper info.
The main change is that in
BridgeStatusController
thetxHistory
is now keyed bytxMeta.id
rather thantxMeta.hash
. This is because for an STX we might not have the hash immediately, but we still want to look things up.We also add a way to call
addTransaction
from the UI side. Previously we usedaddTransactionAndWaitForPublish
. However for STX, this will cause the app to wait until atxHash
is available before returning atxMeta
, which means we can't even use thetxMeta.id
to key aBridgeHistoryItem
. If we useaddTransaction
this will allow us to receive atxMeta
object back immediately and usetxMeta.id
.Related issues
Depends on MetaMask/core#4918
Manual testing steps
BRIDGE_USE_DEV_APIS=1
to.metamaskrc
Screenshots/Recordings
Before
After
Screen.Recording.2024-11-25.at.11.05.55.AM.mov
Pre-merge author checklist
Pre-merge reviewer checklist