Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
<!-- 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? --> 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` the `txHistory` is now keyed by `txMeta.id` rather than `txMeta.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 used `addTransactionAndWaitForPublish`. However for STX, this will cause the app to wait until a `txHash` is available before returning a `txMeta`, which means we can't even use the `txMeta.id` to key a `BridgeHistoryItem`. If we use `addTransaction` this will allow us to receive a `txMeta` object back immediately and use `txMeta.id`. [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/28460?quickstart=1) ## **Related issues** Depends on MetaMask/core#4918 ## **Manual testing steps** 1. Add `BRIDGE_USE_DEV_APIS=1` to `.metamaskrc` 1. Go to Settings > Advanced, make sure Smart Transactions is on 2. Switch network to Ethereum 3. Go to Bridge 4. Selection source network, source token, dest network, dest token 5. Request a quote 6. Execute a bridge 7. Go to Activity 8. Click on the Bridge tx ## **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/364b93ec-3b54-4ce6-acd5-5001236c128c ## **Pre-merge author checklist** - [ ] 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). - [ ] 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.
- Loading branch information