chore(ramps): remove UB2 feature flag and legacy buy stack#31768
Conversation
Unified Buy V2 (UB2) is now always enabled. Remove the remote feature flag, selector, hooks, and all conditional V1 fallbacks across ramp navigation, deeplinks, order notifications, token buyability, and analytics. RampsController now initializes unconditionally at startup. Update unit tests, E2E fixtures, feature-flag registry, and docs to match the simplified always-on behavior. Co-authored-by: Amitabh Aggarwal <amitabh94@users.noreply.github.com>
- Remove goToDeposit and Deposit stack from MainNavigator; UB2 buy flow uses Ramp/Views routes exclusively - Delete legacy Deposit Views, routes, hooks, and SDK wiring that duplicated the UB2 NativeFlow screens - Keep shared Deposit utilities (styles, components, orderProcessor, DepositOrderDetails) still used by Ramp/Views/NativeFlow - Extract transakNativeForms and legacyNavigation types; route modals via Routes.RAMP.MODALS - Update tests and remove obsolete DepositPhoneField/StateSelector wrappers Co-authored-by: Amitabh Aggarwal <amitabh94@users.noreply.github.com>
- Remove app/components/UI/Ramp/Deposit/ entirely - Move shared code to Ramp/constants, hooks, utils, components, sdk, testUtils, assets, and types - Co-locate NativeFlow styles under Views/NativeFlow/ - Move SsnInfoModal to Views/Modals and DepositOrderDetails to Views/OrderDetails - Delete dead Deposit orphans (duplicate TruncatedError, unused hooks, orphan style files, legacy SDK provider) - Update all import paths across Ramp, Card, TokenDetails, Auth, and Nav Co-authored-by: Amitabh Aggarwal <amitabh94@users.noreply.github.com>
Drop @consensys/native-ramps-sdk from package.json and inline legacy deposit types locally. Legacy DEPOSIT orders no longer poll via NativeRampsSdk.getOrder; they retain last-known Redux state like other static providers. Co-authored-by: Cursor <cursoragent@cursor.com>
|
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. |
Merge origin/main into UB2 removal branch. Resolve Checkout and Authentication.test conflicts, regenerate yarn.lock, and redirect Ramp/Deposit/types/analytics imports to Ramp/types/depositAnalytics. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Co-authored-by: Cursor <cursoragent@cursor.com>
Use interfaces in transakNativeForms for eslint, restore card provider type field lost in merge, and update RampsController fixture for countries loading state when init runs at Engine startup. Co-authored-by: Cursor <cursoragent@cursor.com>
Resolve useDepositEnabled conflict using shared hasMinimumRequiredVersion helper from main while keeping Ramp/ consolidated import paths. Co-authored-by: Cursor <cursoragent@cursor.com>
V2 amount input shows $ prefix, not literal USD text. Match on-network subtitle instead. Co-authored-by: Amitabh Aggarwal <amitabh94@users.noreply.github.com>
⚡ Performance Test Results
❌ 3 tests failed · 20 tests · 1 device 📱 Devices tested (1)Android: Google Pixel 8 Pro (v14.0) ❌ Failed Tests (3)
@metamask-mobile-platform
@metamask-onboarding-team
✅ Passed Tests (17)
Branch: |
The spec targeted legacy buy UI and lacked V2 quote mocks; V2 routing is covered by handleRampUrl unit tests and onramp-unified-buy smoke. Co-authored-by: Cursor <cursoragent@cursor.com>
🔍 Smart E2E Test Selection⏭️ Smart E2E selection skipped - skip-smart-e2e-selection label found All E2E tests pre-selected. |
|



Description
Unified Buy V2 (UB2) is always on in production (TRAM-3559). This PR removes the
rampsUnifiedBuyV2remote feature flag and all V1 fallback paths, deletes the legacy Deposit navigator stack, consolidates remainingDeposit/code underRamp/, and removes@consensys/native-ramps-sdk(legacy deposit orders no longer poll; they display last-known Redux state).Key changes:
RampsControllerat Engine startupRamp/Views/*onlyRamp/Ramp/types/legacyDeposit.ts; stop legacy order pollingReview note
This is an intentionally large cleanup PR . It removes the UB2 flag and the legacy buy/Deposit stack so Ramps runs on a single V2 path.
Why one PR: Flag removal and legacy stack removal need to land together. A split merge leaves a dual-stack middle state (two routing models, two test matrices, two places for bugs). We are finishing the UB2 rollout in one atomic step.
Why this matters:
Expected user impact: Low for users already on UB2 (production default). Behavioral change is removing the unused fork, not redesigning buy.
Suggested review focus (if time is limited):
handleRampUrl, ramp routes)Review on a PR this size is appreciated — happy to walk through structure if useful.
Changelog
CHANGELOG entry: null
Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/TRAM-3559
Manual testing steps
Screenshots/Recordings
N/A — internal cleanup and dead-code removal; no intentional user-visible UI change.
Before
N/A
After
All testing has been done on RC builds generated from this branch, using real funds in production. Build tested: 8.1.0 (5631).
Transak Order
trim.3CA4848F-AA89-4E5B-9975-DBE82F58D964.MOV
Coinbase Order
trim.0623273C-7B94-4FEB-92F6-08688DB0D5CC.MOV
Moonpay Order
trim.78A4480F-7CD0-420D-B931-A3289403AB0B.MOV
Pre-merge author checklist
Performance checks (if applicable)
trace()for usage andaddTokenfor an examplePre-merge reviewer checklist
Note
High Risk
Large routing and navigation refactor across buy/deposit entry points, order history, and deleted legacy flows; wrong wiring could strand users or break legacy order display.
Overview
Removes the Unified Buy V2 feature flag and all V1 buy/deposit routing so every “add funds” / buy entry point goes through
goToBuyand analytics always tagsUNIFIED_BUY_2.Navigation: Drops the
DepositRoutesstack fromMainNavigator;DepositOrderDetailsmoves underRamp/Views/OrderDetails(legacy order history only). In-progress deposit orders in CREATED state now resume viagoToBuy()instead ofgoToDeposit().Code deletion / consolidation: Deletes the legacy
Ramp/Deposit/navigator screens (e.g. BuildQuote, BankDetails, BasicInfo, KYC flows) and related tests; relocates shared pieces (e.g.depositUtils,DepositDateField, network filters) intoRamp/. Types that lived on@consensys/native-ramps-sdkshift toRamp/types/legacyDeposit(and related legacy navigation types).UX cleanup: Removes aggregator settings paths to “more ways to buy” / legacy deposit; ramp settings region UI is V2-only (change region, no legacy reset).
useMusdCtaVisibilitytests align withuseRampsTokensinstead of the old ramp-token + flag matrix.Reviewed by Cursor Bugbot for commit 53bb0ec. Bugbot is set up for automated code reviews on this repo. Configure here.