Skip to content
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
f1cd989
Remove rampsUnifiedBuyV2 feature flag and legacy buy paths
cursoragent Jun 15, 2026
c4b974a
Remove legacy Deposit navigator stack and dead UB2 routing
cursoragent Jun 16, 2026
bd4d215
Consolidate Deposit remnants into Ramp utils, hooks, and components
cursoragent Jun 16, 2026
6f88d95
chore(ramps): remove native-ramps-sdk and legacy deposit order polling
amitabh94 Jun 18, 2026
33f04a3
merge: resolve main conflicts and fix Deposit analytics imports
amitabh94 Jun 18, 2026
8faaa77
chore: dedupe @babel/runtime after main merge
amitabh94 Jun 18, 2026
333db41
fix(ramps): resolve CI lint and Engine fixture after UB2 always-on init
amitabh94 Jun 18, 2026
67bd897
merge: update UB2 removal branch with latest main
amitabh94 Jun 22, 2026
b8d1052
fix(ramps): point useFiatFunnelMetrics imports at depositAnalytics types
amitabh94 Jun 22, 2026
afde881
fix(ramps): stop polling legacy deposit order details without SDK
amitabh94 Jun 22, 2026
e3e4938
refactor(ramps): make DepositOrderDetails read-only for legacy orders
amitabh94 Jun 22, 2026
df4d162
merge: resolve main conflicts on UB2 removal branch
amitabh94 Jun 22, 2026
f97f422
test(ramps): remove unnecessary material-textfield mock from MainNavi…
amitabh94 Jun 22, 2026
c89a7f3
Merge branch 'main' into cursor/remove-ub2-feature-flag-bb04
amitabh94 Jun 22, 2026
f1d5d0d
chore(ramps): remove dead Deposit SDK test helpers and types
amitabh94 Jun 22, 2026
d706bab
test(ramps): update buy deeplink smoke tests for V2-only flow
amitabh94 Jun 22, 2026
1019163
test(ramps): drop back-navigation token switch from ETH deeplink smoke
cursoragent Jun 22, 2026
5b507f7
test(ramps): assert V2 BuildQuote network subtitle in ETH deeplink smoke
cursoragent Jun 23, 2026
53bb0ec
test(ramps): remove obsolete V1 buy deeplink smoke spec
amitabh94 Jun 23, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ const utilNumberImportBurndownFiles = [
'app/components/UI/Ramp/Aggregator/hooks/useHandleSuccessfulOrder.ts',
'app/components/UI/Ramp/Aggregator/hooks/useIntentAmount.ts',
'app/components/UI/Ramp/Aggregator/utils/index.ts',
'app/components/UI/Ramp/Deposit/utils/index.ts',
'app/components/UI/Ramp/utils/depositUtils.ts',
'app/components/UI/Ramp/utils/getOrderAmount.ts',
'app/components/UI/Ramp/utils/v2OrderToast.ts',
'app/components/UI/Stake/components/StakingBalance/StakingBanners/ClaimBanner/ClaimBanner.tsx',
Expand Down
4 changes: 1 addition & 3 deletions app/components/Nav/Main/MainNavigator.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,12 @@ import RampActivationKeyForm from '../../UI/Ramp/Aggregator/Views/Settings/Activ
import RampHeadlessPlayground from '../../UI/Ramp/Views/HeadlessPlayground';
import TokenListRoutes from '../../UI/Ramp/routes';

import DepositRoutes from '../../UI/Ramp/Deposit/routes';
import V2BankDetails from '../../UI/Ramp/Views/NativeFlow/BankDetails';

import { colors as importedColors } from '../../../styles/common';
import OrderDetails from '../../UI/Ramp/Aggregator/Views/OrderDetails';
import RampsOrderDetails from '../../UI/Ramp/Views/OrderDetails';
import DepositOrderDetails from '../../UI/Ramp/Deposit/Views/DepositOrderDetails/DepositOrderDetails';
import DepositOrderDetails from '../../UI/Ramp/Views/OrderDetails/DepositOrderDetails/DepositOrderDetails';
import ProcessingInfoModal from '../../UI/Ramp/Views/Modals/ProcessingInfoModal/ProcessingInfoModal';
import SendTransaction from '../../UI/Ramp/Aggregator/Views/SendTransaction';
import TabBar from '../../../component-library/components/Navigation/TabBar';
Expand Down Expand Up @@ -1179,7 +1178,6 @@ const MainNavigator = () => {
>
{() => <RampRoutes rampType={RampType.SELL} />}
</NativeStack.Screen>
<NativeStack.Screen name={Routes.DEPOSIT.ID} component={DepositRoutes} />
<NativeStack.Screen
name={Routes.BRIDGE.ROOT}
component={BridgeScreenStack}
Expand Down
13 changes: 0 additions & 13 deletions app/components/Nav/Main/MainNavigator.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -538,19 +538,6 @@ describe('MainNavigator', () => {
expect(rampSellScreen).toBeDefined();
});

it('includes Deposit route', () => {
const container = renderWithProvider(<MainNavigator />, {
state: initialRootState,
});

const screenProps = getScreenProps(container);
const depositScreen = screenProps?.find(
(screen) => screen?.name === Routes.DEPOSIT.ID,
);

expect(depositScreen).toBeDefined();
});

it('includes Settings view route', () => {
const container = renderWithProvider(<MainNavigator />, {
state: initialRootState,
Expand Down
27 changes: 1 addition & 26 deletions app/components/Nav/Main/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,12 @@ import initialRootState from '../../../util/test/initial-root-state';
const mockReact = React;
const mockView = View;

// Mock Ramp SDK dependencies to prevent SdkEnvironment.Production errors
// Mock Ramp shell to avoid deep dependency graph in Main mount test
jest.mock('../../../components/UI/Ramp', () => ({
__esModule: true,
default: () => mockReact.createElement('RampOrdersMock'),
}));

jest.mock('../../../components/UI/Ramp/Deposit/sdk', () => ({
DepositSDKProvider: ({ children }: { children: React.ReactNode }) => children,
DepositSDKContext: {
Provider: ({ children }: { children: React.ReactNode }) => children,
},
}));

jest.mock('../../../components/UI/Ramp/Deposit/orderProcessor', () => ({}));

jest.mock('react-native-device-info', () => ({
getVersion: jest.fn(() => '0.0.0'),
getBuildNumber: jest.fn(() => '0'),
Expand Down Expand Up @@ -109,22 +100,6 @@ jest.mock('../../../util/transaction-controller', () => ({
stopIncomingTransactionPolling: jest.fn(),
}));

jest.mock('@consensys/native-ramps-sdk', () => ({
SdkEnvironment: {
Production: 'production',
Staging: 'staging',
},
Context: {
MobileIOS: 'mobile-ios',
MobileAndroid: 'mobile-android',
},
DepositPaymentMethodDuration: {
instant: 'instant',
oneToTwoDays: '1_to_2_days',
},
NativeRampsSdk: jest.fn(),
}));

describe('Main', () => {
beforeEach(() => {
jest.clearAllMocks();
Expand Down
34 changes: 1 addition & 33 deletions app/components/UI/BalanceEmptyState/BalanceEmptyState.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,6 @@ jest.mock('../Ramp/hooks/useRampsButtonClickData', () => ({
useRampsButtonClickData: jest.fn(() => mockButtonClickData),
}));

const mockUseRampsUnifiedV2Enabled = jest.fn();
jest.mock('../Ramp/hooks/useRampsUnifiedV2Enabled', () => ({
__esModule: true,
default: () => mockUseRampsUnifiedV2Enabled(),
}));

const mockTrackEvent = jest.fn();
const mockCreateEventBuilder = jest.fn();
const mockEventBuilder = {
Expand All @@ -54,7 +48,6 @@ describe('BalanceEmptyState', () => {
createEventBuilder: mockCreateEventBuilder,
}),
);
mockUseRampsUnifiedV2Enabled.mockReturnValue(false);
});

const renderComponent = (props: Partial<BalanceEmptyStateProps> = {}) =>
Expand Down Expand Up @@ -92,32 +85,7 @@ describe('BalanceEmptyState', () => {
expect(mockGoToBuy).toHaveBeenCalled();
});

it('tracks RAMPS_BUTTON_CLICKED event with ramp_type BUY when unified V2 is disabled', () => {
mockUseRampsUnifiedV2Enabled.mockReturnValue(false);
const { getByTestId } = renderComponent();
const actionButton = getByTestId('balance-empty-state-action-button');

fireEvent.press(actionButton);

expect(mockCreateEventBuilder).toHaveBeenCalledWith(
MetaMetricsEvents.RAMPS_BUTTON_CLICKED,
);
expect(mockEventBuilder.addProperties).toHaveBeenCalledWith(
expect.objectContaining({
button_text: 'Add funds',
location: 'BalanceEmptyState',
chain_id_destination: 1,
ramp_type: 'BUY',
is_authenticated: false,
preferred_provider: undefined,
order_count: 0,
}),
);
expect(mockTrackEvent).toHaveBeenCalled();
});

it('tracks RAMPS_BUTTON_CLICKED event with ramp_type UNIFIED_BUY_2 when unified V2 is enabled', () => {
mockUseRampsUnifiedV2Enabled.mockReturnValue(true);
it('tracks RAMPS_BUTTON_CLICKED event with ramp_type UNIFIED_BUY_2', () => {
const { getByTestId } = renderComponent();
const actionButton = getByTestId('balance-empty-state-action-button');

Expand Down
4 changes: 1 addition & 3 deletions app/components/UI/BalanceEmptyState/BalanceEmptyState.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import { BalanceEmptyStateProps } from './BalanceEmptyState.types';
import bankTransferImage from '../../../images/bank-transfer.png';
import { getDetectedGeolocation } from '../../../reducers/fiatOrders';
import { useRampsButtonClickData } from '../Ramp/hooks/useRampsButtonClickData';
import useRampsUnifiedV2Enabled from '../Ramp/hooks/useRampsUnifiedV2Enabled';

/**
* BalanceEmptyState smart component displays an empty state for wallet balance
Expand All @@ -42,7 +41,6 @@ const BalanceEmptyState: React.FC<BalanceEmptyStateProps> = ({
const rampGeodetectedRegion = useSelector(getDetectedGeolocation);
const { goToBuy } = useRampNavigation();
const buttonClickData = useRampsButtonClickData();
const isV2UnifiedEnabled = useRampsUnifiedV2Enabled();

const handleAction = () => {
goToBuy();
Expand All @@ -53,7 +51,7 @@ const BalanceEmptyState: React.FC<BalanceEmptyStateProps> = ({
button_text: 'Add funds',
location: 'BalanceEmptyState',
chain_id_destination: getDecimalChainId(chainId),
ramp_type: isV2UnifiedEnabled ? 'UNIFIED_BUY_2' : 'BUY',
ramp_type: 'UNIFIED_BUY_2',
region: rampGeodetectedRegion,
is_authenticated: buttonClickData.is_authenticated,
preferred_provider: buttonClickData.preferred_provider,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import { fireEvent } from '@testing-library/react-native';
import AddFundsBottomSheet from './AddFundsBottomSheet';
import { useOpenSwaps } from '../../hooks/useOpenSwaps';
import useDepositEnabled from '../../../Ramp/Deposit/hooks/useDepositEnabled';
import useDepositEnabled from '../../../Ramp/hooks/useDepositEnabled';
import { isBridgeAllowed } from '../../../Bridge/utils';
import { MetaMetricsEvents } from '../../../../../core/Analytics';
import { useAnalytics } from '../../../../hooks/useAnalytics/useAnalytics';
Expand All @@ -12,7 +12,6 @@ import { CardFundingToken, FundingStatus } from '../../types';
import { renderScreen } from '../../../../../util/test/renderWithProvider';
import { backgroundState } from '../../../../../util/test/initial-root-state';
import { useRampNavigation } from '../../../Ramp/hooks/useRampNavigation';
import useRampsUnifiedV2Enabled from '../../../Ramp/hooks/useRampsUnifiedV2Enabled';
import { CardHomeSelectors } from '../../Views/CardHome/CardHome.testIds';
import { RampsButtonClickData } from '../../../Ramp/hooks/useRampsButtonClickData';

Expand All @@ -21,15 +20,14 @@ const mockUseParams = jest.fn();
const mockGoBack = jest.fn();
const mockNavigate = jest.fn();
const mockGoToBuy = jest.fn();
const mockGoToDeposit = jest.fn();

// Mock dependencies
jest.mock('../../../Ramp/hooks/useRampNavigation');
jest.mock('../../hooks/useOpenSwaps', () => ({
useOpenSwaps: jest.fn(),
}));

jest.mock('../../../Ramp/Deposit/hooks/useDepositEnabled', () => ({
jest.mock('../../../Ramp/hooks/useDepositEnabled', () => ({
__esModule: true,
default: jest.fn(),
}));
Expand Down Expand Up @@ -85,8 +83,6 @@ jest.mock('../../../Ramp/hooks/useRampsButtonClickData', () => ({
useRampsButtonClickData: jest.fn(() => mockButtonClickData),
}));

jest.mock('../../../Ramp/hooks/useRampsUnifiedV2Enabled');

jest.mock('@react-navigation/native', () => ({
...jest.requireActual('@react-navigation/native'),
useNavigation: () => ({
Expand Down Expand Up @@ -150,13 +146,8 @@ describe('AddFundsBottomSheet', () => {

(useRampNavigation as jest.Mock).mockReturnValue({
goToBuy: mockGoToBuy,
goToDeposit: mockGoToDeposit,
});

// Default V2 enabled — the whole point of this migration is UB2 routing.
// Individual tests override to false where they need to assert V1 fallback.
(useRampsUnifiedV2Enabled as jest.Mock).mockReturnValue(true);

(useDepositEnabled as jest.Mock).mockReturnValue({
isDepositEnabled: true,
});
Expand Down Expand Up @@ -257,20 +248,6 @@ describe('AddFundsBottomSheet', () => {
});
});

it('tags analytics with ramp_type DEPOSIT when the UB2 feature flag is disabled', () => {
(useRampsUnifiedV2Enabled as jest.Mock).mockReturnValue(false);

const { getByText } = setupComponent();

fireEvent.press(getByText('Fund with cash'));

expect(mockEventBuilder.addProperties).toHaveBeenCalledWith(
expect.objectContaining({
ramp_type: 'DEPOSIT',
}),
);
});

it('handles swap option press correctly', () => {
const { getByText } = setupComponent();

Expand Down Expand Up @@ -354,16 +331,6 @@ describe('AddFundsBottomSheet', () => {
});
});

it('does NOT call the deprecated goToDeposit (UB1) when Fund with cash is pressed', () => {
// Regression guard: this entry point was migrated off goToDeposit (UB1)
// to goToBuy (UB2-aware). If someone reverts that, this test goes red.
const { getByText } = setupComponent();

fireEvent.press(getByText('Fund with cash'));

expect(mockGoToDeposit).not.toHaveBeenCalled();
});

it('falls back to goToBuy() with no intent when the priority token has no address', () => {
// No assetId → useRampNavigation routes UB2 to TokenSelection
// (see useRampNavigation.ts, 'V2: If no assetId and V2 is enabled').
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { View } from 'react-native';
import { CardFundingToken } from '../../types';
import AppConstants from '../../../../../core/AppConstants';
import { isBridgeAllowed } from '../../../Bridge/utils';
import useDepositEnabled from '../../../Ramp/Deposit/hooks/useDepositEnabled';
import useDepositEnabled from '../../../Ramp/hooks/useDepositEnabled';
import { getDecimalChainId } from '../../../../../util/networks';
import { trace, TraceName } from '../../../../../util/trace';
import { useOpenSwaps } from '../../hooks/useOpenSwaps';
Expand All @@ -35,7 +35,6 @@ import { useRampNavigation } from '../../../Ramp/hooks/useRampNavigation';
import { safeFormatChainIdToHex } from '../../util/safeFormatChainIdToHex';
import { getDetectedGeolocation } from '../../../../../reducers/fiatOrders';
import { useRampsButtonClickData } from '../../../Ramp/hooks/useRampsButtonClickData';
import useRampsUnifiedV2Enabled from '../../../Ramp/hooks/useRampsUnifiedV2Enabled';
import {
createNavigationDetails,
useParams,
Expand Down Expand Up @@ -67,7 +66,6 @@ const AddFundsBottomSheet: React.FC = () => {
const rampGeodetectedRegion = useSelector(getDetectedGeolocation);
const { goToBuy } = useRampNavigation();
const buttonClickData = useRampsButtonClickData();
const isV2UnifiedEnabled = useRampsUnifiedV2Enabled();

const closeBottomSheetAndNavigate = useCallback(
(navigateFunc: () => void) => {
Expand Down Expand Up @@ -104,7 +102,7 @@ const AddFundsBottomSheet: React.FC = () => {
button_text: 'Fund with cash',
location: 'CardHome',
chain_id_destination: getDecimalChainId(priorityToken?.caipChainId),
ramp_type: isV2UnifiedEnabled ? 'UNIFIED_BUY_2' : 'DEPOSIT',
ramp_type: 'UNIFIED_BUY_2',
region: rampGeodetectedRegion,
is_authenticated: buttonClickData.is_authenticated,
preferred_provider: buttonClickData.preferred_provider,
Expand All @@ -124,7 +122,6 @@ const AddFundsBottomSheet: React.FC = () => {
createEventBuilder,
priorityToken,
buttonClickData,
isV2UnifiedEnabled,
]);

const options = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ jest.mock('../../../../../component-library/components/Buttons/Button', () => {
};
});

jest.mock('../../../Ramp/Deposit/components/DepositDateField', () => {
jest.mock('../../../Ramp/components/DepositDateField', () => {
const React = jest.requireActual('react');
const { TextInput } = jest.requireActual('react-native');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import Routes from '../../../../../constants/navigation/Routes';
import { strings } from '../../../../../../locales/i18n';
import OnboardingStep from './OnboardingStep';
import SelectField from './SelectField';
import DepositDateField from '../../../Ramp/Deposit/components/DepositDateField';
import DepositDateField from '../../../Ramp/components/DepositDateField';
import {
resetOnboardingState,
selectOnboardingId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { configureStore } from '@reduxjs/toolkit';
import { useNavigation } from '@react-navigation/native';
import useEmailVerificationSend from '../../hooks/useEmailVerificationSend';
import { useDebouncedValue } from '../../../../hooks/useDebouncedValue';
import { validateEmail } from '../../../Ramp/Deposit/utils';
import { validateEmail } from '../../../Ramp/utils/depositUtils';
import { validatePassword } from '../../util/validatePassword';
import SignUp from './SignUp';
import Routes from '../../../../../constants/navigation/Routes';
Expand Down Expand Up @@ -57,7 +57,7 @@ jest.mock('../../hooks/useRegions', () => ({
jest.mock('../../../../hooks/useDebouncedValue');

// Mock utility functions
jest.mock('../../../Ramp/Deposit/utils');
jest.mock('../../../Ramp/utils/depositUtils');
jest.mock('../../util/validatePassword');

// Mock Engine
Expand Down
2 changes: 1 addition & 1 deletion app/components/UI/Card/components/Onboarding/SignUp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import TextField from '../../../../../component-library/components/Form/TextFiel
import Routes from '../../../../../constants/navigation/Routes';
import { strings } from '../../../../../../locales/i18n';
import OnboardingStep from './OnboardingStep';
import { validateEmail } from '../../../Ramp/Deposit/utils';
import { validateEmail } from '../../../Ramp/utils/depositUtils';
import { useDebouncedValue } from '../../../../hooks/useDebouncedValue';
import useEmailVerificationSend from '../../hooks/useEmailVerificationSend';
import useRegions from '../../hooks/useRegions';
Expand Down
2 changes: 1 addition & 1 deletion app/components/UI/Card/hooks/useAssetBalances.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jest.mock('../../../../core/Engine', () => ({
jest.mock('@metamask/bridge-controller', () => ({
isSolanaChainId: jest.fn((chainId: string) => chainId.startsWith('solana:')),
}));
jest.mock('../../Ramp/Deposit/constants/networks', () => ({
jest.mock('../../Ramp/constants/networks', () => ({
SOLANA_MAINNET: {
chainId: 'solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,6 @@ describe('EarnMusdConversionEducationView', () => {
goToBuy: jest.fn(),
goToAggregator: mockGoToAggregator,
goToSell: jest.fn(),
goToDeposit: jest.fn(),
});
mockSelectMoneyHubEnabledFlag.mockReturnValue(false);

Expand Down Expand Up @@ -505,7 +504,6 @@ describe('EarnMusdConversionEducationView', () => {
goToBuy: mockGoToBuy,
goToAggregator: mockGoToAggregator,
goToSell: jest.fn(),
goToDeposit: jest.fn(),
});

mockUseMusdConversionFlowData.mockReturnValue({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ describe('MusdConversionAssetListCta', () => {
goToBuy: mockGoToBuy,
goToAggregator: jest.fn(),
goToSell: jest.fn(),
goToDeposit: jest.fn(),
});

(
Expand Down
Loading
Loading