[pull] main from MetaMask:main#85
Merged
Merged
Conversation
<!-- 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 aims to filter from account from the recipient list. It also implements that selected internal account will be defined by the selected token as we are listing account groups asset page. ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: ## **Related issues** Fixes: MetaMask/mobile-planning#2286 ## **Manual testing steps** ```gherkin Feature: my feature name Scenario: user [verb for user action] Given [describe expected initial app state] When user [verb for user action] Then [describe expected outcome] ``` ## **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** - [X] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.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-mobile/blob/main/.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.
<!--
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 the Add Funds bottom sheet experience by enhancing both
functionality and user interface elements.
**Functionality Improvements:**
- Extended deposit functionality to support USDT tokens, previously only
available for USDC
- Removed token restriction for deposit option by eliminating the
`SUPPORTED_BOTTOMSHEET_TOKENS_DEPOSIT` constant
- Simplified deposit enablement logic to be based on `isDepositEnabled`
hook rather than token-specific validation
- Universal token support: Both deposit and swap options are now
available for all supported tokens (USDC, USDT, ETH, etc.)
**UI/UX Improvements:**
- Enhanced option descriptions: Renamed Add Funds bottom sheet options
to provide clearer explanations of each funding method
- Improved iconography: Replaced the deposit option's plus sign (+) icon
with a bank icon for better visual clarity and user understanding
## **Changelog**
<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`
If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`
(This helps the Release Engineer do their job more quickly and
accurately)
-->
CHANGELOG entry: Enhanced Add Funds bottom sheet with USDT deposit
support, clearer option descriptions, and updated deposit icon to bank
symbol
## **Related issues**
Fixes:
## **Manual testing steps**
```gherkin
Feature: Add Funds Bottom Sheet Improvements
Background:
Given the user has a MetaMask Card
And the user is on the Card Home screen
Scenario Outline: User with USDC or USDT sees enhanced bottom sheet
Given the user has <token> as their priority token
And both deposit and swap are enabled
When the user taps "Add Funds"
Then the Add Funds bottom sheet should open with clearer option descriptions
And the user should see both "Deposit" and "Swap" options
And the deposit option should show a bank icon instead of a plus sign
And the descriptions should mention <token>
Examples:
| token |
| USDC |
| USDT |
Scenario Outline: User with other tokens bypasses bottom sheet
Given the user has <token> as their priority token
And swap functionality is enabled
When the user taps "Add Funds"
Then the Add Funds bottom sheet should not appear
And the user should be redirected directly to the Swap screen
Examples:
| token |
| ETH |
| WETH |
| DAI |
Scenario: User selects deposit for USDC/USDT
Given the user has USDC as their priority token
And the Add Funds bottom sheet is open
When the user taps "Deposit" (with bank icon)
Then the bottom sheet should close
And the user should navigate to the Deposit screen
Scenario: User selects swap for USDC/USDT
Given the user has USDT as their priority token
And the Add Funds bottom sheet is open
When the user taps "Swap"
Then the bottom sheet should close
And the swap flow should be initiated
Scenario: Bottom sheet options based on availability
Given the user has USDC as their priority token
And the Add Funds bottom sheet is open
When deposit is disabled
Then only the "Swap" option should be visible
When swap is disabled
Then only the "Deposit" option should be visible
```
## **Screenshots/Recordings**
<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->
### **Before**
<!-- [screenshots/recordings] -->
<img width="300" height="900"
alt="simulator_screenshot_C890C6B3-AB34-42F0-9709-93B3569F7C17"
src="https://github.com/user-attachments/assets/f25d83f4-a9c5-4013-a55f-3a9c61f5734b"
/>
### **After**
<!-- [screenshots/recordings] -->
<img width="300" height="900"
alt="simulator_screenshot_62CA5CBE-8772-448C-B208-4B937C900B70"
src="https://github.com/user-attachments/assets/67239753-14a5-4744-9dd6-db041051879b"
/>
#### Automatically change the network and selected account
https://github.com/user-attachments/assets/3b246320-44b1-4f64-876c-5a0d4287104f
## **Pre-merge author checklist**
- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.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-mobile/blob/main/.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
---------
Co-authored-by: metamaskbot <metamaskbot@users.noreply.github.com>
…s feedback (#18463) <!-- 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** This PR cleans up the Perps codebase by removing the original deposit flow implementation that was bypassed in favor of using the standard confirmation screens owned by the confirmations team, and adds proper deposit status feedback with toast notifications. **Reason for change:** - The Perps feature initially implemented custom deposit tracking and transaction handling - The team decided to use the existing confirmation screens infrastructure instead - The old deposit code was left in place but unused, creating technical debt - Success toasts were appearing before user confirmation due to timing issues **Improvements:** - Removes ~1000+ lines of unused deposit-related code - Simplifies state management by removing complex deposit tracking - Adds deposit status monitoring with proper toast notifications via new `usePerpsDepositStatus` hook - Fixes timing issue where success toast appeared before user confirmation (500ms delay to detect actual submission vs cancellation) - Updates success message to indicate "Your balance will update in a few moments" (sets proper expectations for HyperLiquid websocket delay) - Maintains `depositWithConfirmation()` method that integrates with confirmation screens ## **Changelog** CHANGELOG entry: null ## **Related issues** Fixes: N/A (Technical debt cleanup) ## **Manual testing steps** ```gherkin Feature: Perps deposit via confirmation screens Scenario: User initiates a deposit to Perps trading account Given user is on the Perps trading screen And user has USDC balance on Arbitrum When user taps on the deposit button And enters a deposit amount And confirms the deposit Then the standard confirmation screen is displayed And depositInProgress state is true during the process And a "Processing deposit" toast appears And after transaction completes, a "Deposit Complete" toast appears And the toast indicates "Your balance will update in a few moments" And depositInProgress state is false after completion Scenario: User cancels deposit before confirmation Given user is on the Perps trading screen When user initiates a deposit But cancels before confirming the transaction Then no success or error toast appears And depositInProgress remains false Scenario: Verify removed deposit methods are not called Given user is using the Perps feature When user performs any Perps operations Then no errors occur from missing deposit methods And the app continues to function normally ``` ## **Screenshots/Recordings** ### **Before** - PerpsController had complex deposit state tracking: - `depositStatus: DepositStatus` - `currentDepositTxHash: string | null` - `depositError: string | null` - `activeDepositTransactions: Record<string, DepositInfo>` - Multiple deposit methods and transaction event handlers - ~1000+ lines of deposit-related code ### **After** - Simplified to: - `depositInProgress: boolean` - `lastDepositResult: { success: boolean; txHash?: string; error?: string } | null` - Removed methods: - `deposit()` - 850+ lines - `executeDirectDeposit()` - `submitDirectDepositTransaction()` - `resetDepositState()` - `getDepositRoutes()` - Removed all transaction event subscriptions - Added `usePerpsDepositStatus` hook for toast notifications - Updated success messaging to set proper expectations about balance update delay - Clean, maintainable code focused on current architecture https://github.com/user-attachments/assets/f22ca8c7-4408-448d-8d02-a8a132c18d5e ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.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-mobile/blob/main/.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.
<!-- 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** Pretty self-explanatory: the purpose of this PR is to fix the confirmation tests that rely on tapping the activity button after submitting a txn. This PR just adds a delay before tapping. See passing confirmations pipeline here: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/17c96ec9-a3b5-4533-8ea1-586f2494a649 ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: ## **Related issues** Fixes: ## **Manual testing steps** ```gherkin Feature: my feature name Scenario: user [verb for user action] Given [describe expected initial app state] When user [verb for user action] Then [describe expected outcome] ``` ## **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 Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.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-mobile/blob/main/.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.
<!-- 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 fixes an issue where the app would crash when `quote.gasFee.effective.amount` was in scientific notation. You could observe this on networks such as Optimism. ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: null ## **Related issues** Fixes: #18454 ## **Manual testing steps** ```gherkin Feature: Getting quotes on Optimism Scenario: user requests a quote on Optimism Given user has requested a quote When user requests a quote Then they should receive a quote and app should not crash ``` ## **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/ca420125-5d07-4b10-9283-bedc5aff585f ## **Pre-merge author checklist** - [x] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.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-mobile/blob/main/.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.
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.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.3)
Can you help keep this open source service alive? 💖 Please sponsor : )