You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(bridge): add solana chain support and improve bridge state management (#14713)
<!--
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**
The PR focuses on:
1. Improving error handling and state management in the bridge feature
2. Adding support for Solana chain destination addresses
3. Simplifying the code by removing unnecessary state and effects
4. Improving the user experience with better keypad and layout handling
## Changes
### Bridge View Component Changes
- Simplified state management by removing `isWaitingForInitialQuote` and
related effects
- Improved error handling logic
- Added new state `isNoQuotesAvailable` to better handle quote
availability
- Refactored keypad display logic
- Improved layout and styling for dynamic content
### Bridge Quote Request Hook Changes
- Removed try-catch block in `useBridgeQuoteRequest` for cleaner error
propagation
- Added support for Solana chain destination addresses
- Added `destWalletAddress` parameter that uses:
- `destAddress` for Solana chains
- `walletAddress` for other chains
### Bridge Quote Data Hook Changes
- Added `isNoQuotesAvailable` state to better track quote availability
- Updated tests to reflect new state handling
- Improved error state management
## **Related issues**
Fixes:
[MMS-1914](https://consensyssoftware.atlassian.net/browse/MMS-1914)
Fixes:
[MMS-1915](https://consensyssoftware.atlassian.net/browse/MMS-1915)
## **Manual testing steps**
1. Open Bridge and verify the layout spacing and padding look correct
2. Test keypad behavior:
- Tap input field, verify keypad appears
- Enter valid amount, verify keypad behavior
- Clear input, verify keypad state
3. Test Solana quote fetching:
- Select Solana as source chain, enter amount, check quote
- Select any chain → Solana, enter amount, check quote
4. Test error handling:
- Enter invalid amounts
## **Screenshots/Recordings**
https://github.com/user-attachments/assets/349010b4-6734-44f4-9fda-6d8e5ea4a8c4
## **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.
[MMS-1914]:
https://consensyssoftware.atlassian.net/browse/MMS-1914?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
[MMS-1915]:
https://consensyssoftware.atlassian.net/browse/MMS-1915?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
0 commit comments