Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: smart-transactions code domain (#26948)
## **Description** This PR establishes the `ui/pages/smart-transactions` code domain, following the guidance in [this proposal](https://docs.google.com/document/d/1dzgWc1LCkYz2lZZ6X8SOaj23iaGYVQ2zJ1FVpOxsU-o/edit). Moved | To ui/pages/smart-transactions/ -- | -- ui/components/app/smart-transactions/smart-transactions-opt-in-modal.tsx | components/smart-transactions-opt-in-modal.tsx The following files will be left in place. | Left in place | Reason | |---------------------------------------------------------------------------------------|-------------------------------------------------------------------------------| app/scripts/lib/transaction/smart-transactions.ts | background code shared/constants/smartTransactions.ts | shared with background | `ui/components/app/transaction-list-item/smart-transaction-list-item.component.js` | Specific to the transaction list. | | `ui/pages/confirmations/confirmation/templates/smart-transaction-status-page.js` | Belongs with other confirmation templates. | | `ui/pages/swaps/smart-transaction-status/smart-transaction-status.js` | Swaps-focused. Will be replaced by regular STX status screen once swaps moves to regular STX. | ### STX-related code in other files The following files contain stx-related code, which may be extracted and moved into the smart-transactions code domain at a later time. | Path | STX-Related Code | |------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------| | `app/scripts/metamask-controller.js` | We use the STX controller there `new SmartTransactionsController`. `*// Smart Transactions` section* | | `ui/ducks/swaps/swaps.js` | A few functions related to STX: `fetchSmartTransactionsLiveness`, `signAndSendSmartTransaction`, `setSmartTransactionsRefreshInterval`, etc. | | `ui/store/actions.ts` | `fetchSmartTransactionsLiveness` and other STX functions | | `ui/pages/confirmations/confirm-transaction-base/confirm-transaction-base.container.js` | STX is used from this component | | `ui/pages/settings/advanced-tab/advanced-tab.component.js` | Advanced Settings that include STX option | | `ui/pages/swaps/swaps.util.ts` | `getFeeForSmartTransaction` | | `ui/pages/swaps/prepare-swap-page/review-quote.js` | Uses STX in Swaps | | `ui/selectors/transactions.js` | `allowedSwapsSmartTransactionStatusesForActivityList` | <!-- 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/26948?quickstart=1) ## **Related issues** Fixes: ## **Manual testing steps** 1. Installed extension 2. Added account with crypto 3. Verify STX opt-in-modal 4. Send a smart transaction ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After**     ## **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