From 2c542d08eb39b9434ddbd24bd875501a5dcfbc34 Mon Sep 17 00:00:00 2001 From: Satish Ravi Date: Fri, 6 Dec 2024 15:38:29 -0800 Subject: [PATCH] refactor(fiatExchanges): remove coinbase pay section (#6307) ### Description Coinbase now shows up as one of the regular providers in the different sections. This is no longer needed ### Test plan CI, manually check coinbase still shows up ### Related issues - Part of ACT-1421 ### Backwards compatibility Yes ### Network scalability N/A --- package.json | 1 - src/app/selectors.ts | 2 - src/fiatExchanges/CoinbasePayScreen.test.tsx | 32 ----- src/fiatExchanges/CoinbasePayScreen.tsx | 22 ---- .../CoinbasePaymentSection.test.tsx | 117 ----------------- src/fiatExchanges/CoinbasePaymentSection.tsx | 113 ----------------- src/fiatExchanges/SelectProvider.test.tsx | 118 ------------------ src/fiatExchanges/SelectProvider.tsx | 32 +---- src/fiatExchanges/quotes/ExternalQuote.ts | 1 - src/fiatExchanges/types.ts | 2 - src/fiatExchanges/utils.test.ts | 8 +- src/fiatExchanges/utils.tsx | 12 -- src/navigator/Navigator.tsx | 9 +- src/navigator/Screens.tsx | 1 - src/navigator/types.tsx | 1 - test/RootStateSchema.json | 2 - test/values.ts | 6 +- yarn.lock | 36 +----- 18 files changed, 8 insertions(+), 507 deletions(-) delete mode 100644 src/fiatExchanges/CoinbasePayScreen.test.tsx delete mode 100644 src/fiatExchanges/CoinbasePayScreen.tsx delete mode 100644 src/fiatExchanges/CoinbasePaymentSection.test.tsx delete mode 100644 src/fiatExchanges/CoinbasePaymentSection.tsx diff --git a/package.json b/package.json index 613c0e7ae52..625863c80bf 100644 --- a/package.json +++ b/package.json @@ -72,7 +72,6 @@ }, "dependencies": { "@badrap/result": "~0.2.13", - "@coinbase/cbpay-js": "^2.4.0", "@crowdin/ota-client": "^0.7.0", "@fiatconnect/fiatconnect-sdk": "^0.5.62", "@fiatconnect/fiatconnect-types": "^13.3.8", diff --git a/src/app/selectors.ts b/src/app/selectors.ts index 48d8e24fee8..bbaa84d766c 100644 --- a/src/app/selectors.ts +++ b/src/app/selectors.ts @@ -49,8 +49,6 @@ export const fiatConnectCashInEnabledSelector = (state: RootState) => export const fiatConnectCashOutEnabledSelector = (state: RootState) => state.app.fiatConnectCashOutEnabled -export const coinbasePayEnabledSelector = (state: RootState) => state.app.coinbasePayEnabled - export const maxSwapSlippagePercentageSelector = (state: RootState) => state.app.maxSwapSlippagePercentage diff --git a/src/fiatExchanges/CoinbasePayScreen.test.tsx b/src/fiatExchanges/CoinbasePayScreen.test.tsx deleted file mode 100644 index 9db0080ac53..00000000000 --- a/src/fiatExchanges/CoinbasePayScreen.test.tsx +++ /dev/null @@ -1,32 +0,0 @@ -import { fireEvent, render } from '@testing-library/react-native' -import * as React from 'react' -import { Provider } from 'react-redux' -import { CoinbasePayEvents } from 'src/analytics/Events' -import AppAnalytics from 'src/analytics/AppAnalytics' -import CoinbasePayScreen from 'src/fiatExchanges/CoinbasePayScreen' -import { waitFor } from 'src/redux/sagas-helpers' -import MockedNavigator from 'test/MockedNavigator' -import { createMockStore } from 'test/utils' - -const MOCK_COINBASE_PAY_URI = 'https://www.google.com' - -jest.mock('src/analytics/AppAnalytics') - -describe('CoinbasePayScreen', () => { - it('check for analytics event', async () => { - const { getByText } = render( - - - - ) - fireEvent.press(getByText('close')) - await waitFor(() => { - expect(AppAnalytics.track).toBeCalledWith(CoinbasePayEvents.coinbase_pay_flow_exit) - }) - }) -}) diff --git a/src/fiatExchanges/CoinbasePayScreen.tsx b/src/fiatExchanges/CoinbasePayScreen.tsx deleted file mode 100644 index 34b7bb6e7ed..00000000000 --- a/src/fiatExchanges/CoinbasePayScreen.tsx +++ /dev/null @@ -1,22 +0,0 @@ -import { NativeStackScreenProps } from '@react-navigation/native-stack' -import React, { useEffect } from 'react' -import { CoinbasePayEvents } from 'src/analytics/Events' -import AppAnalytics from 'src/analytics/AppAnalytics' -import { Screens } from 'src/navigator/Screens' -import { StackParamList } from 'src/navigator/types' -import WebViewScreen from 'src/webview/WebViewScreen' - -type RouteProps = NativeStackScreenProps -type Props = RouteProps - -// Created specifically to hook into the removal of CBPay Screen for analytics -function CoinbasePayScreen({ route, navigation }: Props) { - useEffect(() => { - navigation.addListener('beforeRemove', () => { - AppAnalytics.track(CoinbasePayEvents.coinbase_pay_flow_exit) - }) - }, []) - return -} - -export default CoinbasePayScreen diff --git a/src/fiatExchanges/CoinbasePaymentSection.test.tsx b/src/fiatExchanges/CoinbasePaymentSection.test.tsx deleted file mode 100644 index 7d3ad21f3a3..00000000000 --- a/src/fiatExchanges/CoinbasePaymentSection.test.tsx +++ /dev/null @@ -1,117 +0,0 @@ -import { generateOnRampURL } from '@coinbase/cbpay-js' -import { fireEvent, render, waitFor } from '@testing-library/react-native' -import * as React from 'react' -import { Provider } from 'react-redux' -import { MockStoreEnhanced } from 'redux-mock-store' -import AppAnalytics from 'src/analytics/AppAnalytics' -import { CoinbasePayEvents } from 'src/analytics/Events' -import { - CoinbasePaymentSection, - CoinbasePaymentSectionProps, -} from 'src/fiatExchanges/CoinbasePaymentSection' -import { PaymentMethod } from 'src/fiatExchanges/types' -import { navigate } from 'src/navigator/NavigationService' -import { createMockStore } from 'test/utils' -import { - mockAccount, - mockCeloTokenId, - mockEthTokenId, - mockProviderSelectionAnalyticsData, - mockProviders, - mockTokenBalances, -} from 'test/values' - -const FAKE_APP_ID = 'fake app id' -const FAKE_URL = 'www.coinbasepay.test' - -jest.mock('src/analytics/AppAnalytics') - -jest.mock('@coinbase/cbpay-js', () => ({ - generateOnRampURL: jest.fn(), -})) - -describe('CoinbasePaymentSection', () => { - let props: CoinbasePaymentSectionProps - let mockStore: MockStoreEnhanced - beforeEach(() => { - jest.useRealTimers() - jest.clearAllMocks() - props = { - cryptoAmount: 10, - coinbaseProvider: mockProviders.find((quote) => - quote.paymentMethods.includes(PaymentMethod.Coinbase) - )!, - appId: FAKE_APP_ID, - analyticsData: mockProviderSelectionAnalyticsData, - tokenId: mockCeloTokenId, - } - mockStore = createMockStore({ - tokens: { - tokenBalances: mockTokenBalances, - }, - }) - }) - - it.each([ - { - tokenId: mockCeloTokenId, - supportedNetworks: ['celo'], - assets: ['CGLD'], - }, - { - tokenId: mockEthTokenId, - supportedNetworks: ['ethereum'], - assets: ['ETH'], - }, - ])( - 'calls generateOnRampURL with correct params for $tokenId', - async ({ tokenId, supportedNetworks, assets }) => { - jest.mocked(generateOnRampURL).mockReturnValue(FAKE_URL) - render( - - - - ) - expect(generateOnRampURL).toHaveBeenCalledWith({ - appId: FAKE_APP_ID, - destinationWallets: [ - { - address: mockAccount.toLowerCase(), - supportedNetworks, - assets, - }, - ], - presetCryptoAmount: 10, - }) - } - ) - - it('navigates to coinbase flow when card is pressed', async () => { - jest.mocked(generateOnRampURL).mockReturnValue(FAKE_URL) - const { getByTestId, queryByText } = render( - - - - ) - expect(generateOnRampURL).toHaveBeenCalledWith({ - appId: FAKE_APP_ID, - destinationWallets: [ - { - address: mockAccount.toLowerCase(), - supportedNetworks: ['celo'], - assets: ['CGLD'], - }, - ], - presetCryptoAmount: 10, - }) - await waitFor(() => expect(queryByText('Coinbase Pay')).toBeTruthy()) - fireEvent.press(getByTestId('coinbasePayCard')) - await waitFor(() => { - expect(AppAnalytics.track).toBeCalledWith( - CoinbasePayEvents.coinbase_pay_flow_start, - mockProviderSelectionAnalyticsData - ) - expect(navigate).toBeCalled() - }) - }) -}) diff --git a/src/fiatExchanges/CoinbasePaymentSection.tsx b/src/fiatExchanges/CoinbasePaymentSection.tsx deleted file mode 100644 index d01cfba58f1..00000000000 --- a/src/fiatExchanges/CoinbasePaymentSection.tsx +++ /dev/null @@ -1,113 +0,0 @@ -import React from 'react' - -import { generateOnRampURL } from '@coinbase/cbpay-js' -import { useTranslation } from 'react-i18next' -import { Image, StyleSheet, Text, View } from 'react-native' -import { CoinbasePayEvents } from 'src/analytics/Events' -import AppAnalytics from 'src/analytics/AppAnalytics' -import Touchable from 'src/components/Touchable' -import { ProviderSelectionAnalyticsData } from 'src/fiatExchanges/types' -import { FetchProvidersOutput } from 'src/fiatExchanges/utils' -import { navigate } from 'src/navigator/NavigationService' -import { Screens } from 'src/navigator/Screens' -import { useSelector } from 'src/redux/hooks' -import colors from 'src/styles/colors' -import { typeScale } from 'src/styles/fonts' -import { useTokenInfo } from 'src/tokens/hooks' -import Logger from 'src/utils/Logger' -import { networkIdToNetwork } from 'src/web3/networkConfig' -import { walletAddressSelector } from 'src/web3/selectors' - -export interface CoinbasePaymentSectionProps { - cryptoAmount: number - coinbaseProvider: FetchProvidersOutput - appId: string - analyticsData: ProviderSelectionAnalyticsData - tokenId: string -} - -export function CoinbasePaymentSection({ - cryptoAmount, - coinbaseProvider, - appId, - analyticsData, - tokenId, -}: CoinbasePaymentSectionProps) { - const { t } = useTranslation() - const walletAddress = useSelector(walletAddressSelector)! - const tokenInfo = useTokenInfo(tokenId) - - if (!tokenInfo) { - // should never happen - Logger.debug('CoinbasePaymentSection', 'Token info not found for token: ' + tokenId) - return null - } - - const network = networkIdToNetwork[tokenInfo.networkId] - // Coinbase still thinks CELO is CGLD - const symbol = tokenInfo.symbol === 'CELO' ? 'CGLD' : tokenInfo.symbol - - const coinbasePayURL = generateOnRampURL({ - appId, - destinationWallets: [ - { address: walletAddress, supportedNetworks: [network], assets: [symbol] }, - ], - presetCryptoAmount: cryptoAmount, - }) - - const navigateCoinbasePayFlow = () => { - AppAnalytics.track(CoinbasePayEvents.coinbase_pay_flow_start, analyticsData) - navigate(Screens.CoinbasePayScreen, { uri: coinbasePayURL }) - } - - return ( - - - - - Coinbase Pay - - {t('selectProviderScreen.feesVary')} - - - - - - - - - ) -} - -const styles = StyleSheet.create({ - container: { - borderBottomWidth: 1, - borderBottomColor: colors.gray2, - }, - providerImage: { - flex: 1, - width: 160, - height: 40, - resizeMode: 'contain', - }, - innerContainer: { - paddingHorizontal: 16, - justifyContent: 'space-between', - flexDirection: 'row', - alignItems: 'center', - }, - left: { - flex: 1, - }, - right: { - flexDirection: 'column', - justifyContent: 'center', - }, - category: { - ...typeScale.bodySmall, - }, - fee: { - ...typeScale.labelSemiBoldSmall, - marginTop: 4, - }, -}) diff --git a/src/fiatExchanges/SelectProvider.test.tsx b/src/fiatExchanges/SelectProvider.test.tsx index 7d2d89a56b3..ed912f0b0e9 100644 --- a/src/fiatExchanges/SelectProvider.test.tsx +++ b/src/fiatExchanges/SelectProvider.test.tsx @@ -29,8 +29,6 @@ import { CiCoCurrency } from 'src/utils/currencies' import { createMockStore, getMockStackScreenProps } from 'test/utils' import { mockAccount, - mockCeloTokenId, - mockCeurTokenId, mockCusdTokenId, mockExchanges, mockFiatConnectQuotes, @@ -41,7 +39,6 @@ import mocked = jest.mocked const AMOUNT_TO_CASH_IN = 100 const MOCK_IP_ADDRESS = '1.1.1.7' const FAKE_APP_ID = 'fake app id' -const restrictedCurrenciesTokenIds = [mockCeurTokenId, mockCusdTokenId] jest.mock('./utils', () => ({ ...(jest.requireActual('./utils') as any), @@ -51,10 +48,6 @@ jest.mock('./utils', () => ({ getProviderSelectionAnalyticsData: jest.fn(), })) -jest.mock('@coinbase/cbpay-js', () => { - return { generateOnRampURL: jest.fn() } -}) - jest.mock('src/firebase/firebase', () => ({ readOnceFromFirebase: jest.fn().mockResolvedValue(FAKE_APP_ID), })) @@ -121,9 +114,6 @@ const MOCK_STORE_DATA = { quotesLoading: false, quotes: [], }, - app: { - coinbasePayEnabled: false, - }, } describe(SelectProviderScreen, () => { @@ -210,13 +200,11 @@ describe(SelectProviderScreen, () => { it('publishes analytics event if quotes done loading', async () => { const mockAnalyticsData = { centralizedExchangesAvailable: true, - coinbasePayAvailable: false, totalOptions: 1, paymentMethodsAvailable: { [PaymentMethod.Bank]: false, [PaymentMethod.Card]: false, [PaymentMethod.MobileMoney]: false, - [PaymentMethod.Coinbase]: false, [PaymentMethod.FiatConnectMobileMoney]: false, [PaymentMethod.Airtime]: false, }, @@ -426,110 +414,4 @@ describe(SelectProviderScreen, () => { }) }) }) - - describe('SelectProviderScreen CBPay Card', () => { - beforeEach(() => { - jest.useRealTimers() - jest.clearAllMocks() - jest.mocked(fetchLegacyMobileMoneyProviders).mockResolvedValue(mockLegacyProviders) - jest.mocked(fetchExchanges).mockResolvedValue(mockExchanges) - }) - it('does not show coinbase card if coinbase is restricted and feature flag is false', async () => { - const mockProvidersAdjusted = mockProviders - mockProvidersAdjusted.find((provider) => provider.name === 'CoinbasePay')!.restricted = true - jest.mocked(fetchProviders).mockResolvedValue(mockProvidersAdjusted) - - const { queryByText } = render( - - - - ) - await waitFor(() => expect(queryByText('Coinbase Pay')).toBeFalsy()) - }) - it('does not show coinbase card if coinbase is not restricted but feature flag is false', async () => { - const mockProvidersAdjusted = mockProviders - mockProvidersAdjusted.find((provider) => provider.name === 'CoinbasePay')!.restricted = false - jest.mocked(fetchProviders).mockResolvedValue(mockProvidersAdjusted) - const { queryByText } = render( - - - - ) - await waitFor(() => expect(queryByText('Coinbase Pay')).toBeFalsy()) - }) - it('does not show coinbase card if coinbase is restricted and feature flag is true', async () => { - const mockProvidersAdjusted = mockProviders - mockProvidersAdjusted.find((provider) => provider.name === 'CoinbasePay')!.restricted = true - jest.mocked(fetchProviders).mockResolvedValue(mockProvidersAdjusted) - mockStore = createMockStore({ - ...MOCK_STORE_DATA, - app: { - coinbasePayEnabled: true, - }, - }) - const { queryByText } = render( - - - - ) - await waitFor(() => expect(queryByText('Coinbase Pay')).toBeFalsy()) - }) - it('shows coinbase card if coinbase is not restricted, feature flag is true, and CELO is selected', async () => { - const mockProvidersAdjusted = mockProviders - mockProvidersAdjusted.find((provider) => provider.name === 'CoinbasePay')!.restricted = false - jest.mocked(fetchProviders).mockResolvedValue(mockProvidersAdjusted) - mockStore = createMockStore({ - ...mockStore, - app: { - coinbasePayEnabled: true, - }, - }) - const { queryByText } = render( - - - - ) - await waitFor(() => expect(queryByText('Coinbase Pay')).toBeTruthy()) - }) - - it.each(restrictedCurrenciesTokenIds)( - 'does not show coinbase card if %s is selected', - async (tokenId) => { - const mockProvidersAdjusted = mockProviders - mockProvidersAdjusted.find((provider) => provider.name === 'CoinbasePay')!.restricted = - false - jest.mocked(fetchProviders).mockResolvedValue(mockProvidersAdjusted) - mockStore = createMockStore({ - ...mockStore, - app: { - coinbasePayEnabled: true, - }, - }) - const { queryByText } = render( - - - - ) - await waitFor(() => expect(queryByText('Coinbase Pay')).toBeFalsy()) - } - ) - - it('does not show coinbase pay card in withdraw flow', async () => { - const mockProvidersAdjusted = mockProviders - mockProvidersAdjusted.find((provider) => provider.name === 'CoinbasePay')!.restricted = false - jest.mocked(fetchProviders).mockResolvedValue(mockProvidersAdjusted) - mockStore = createMockStore({ - ...mockStore, - app: { - coinbasePayEnabled: true, - }, - }) - const { queryByText } = render( - - - - ) - await waitFor(() => expect(queryByText('Coinbase Pay')).toBeFalsy()) - }) - }) }) diff --git a/src/fiatExchanges/SelectProvider.tsx b/src/fiatExchanges/SelectProvider.tsx index 55b16bc115b..cb3489d4fcd 100644 --- a/src/fiatExchanges/SelectProvider.tsx +++ b/src/fiatExchanges/SelectProvider.tsx @@ -10,13 +10,11 @@ import { showError } from 'src/alert/actions' import AppAnalytics from 'src/analytics/AppAnalytics' import { FiatExchangeEvents } from 'src/analytics/Events' import { ErrorMessages } from 'src/app/ErrorMessages' -import { coinbasePayEnabledSelector } from 'src/app/selectors' import BackButton from 'src/components/BackButton' import Dialog from 'src/components/Dialog' import TextButton from 'src/components/TextButton' import Touchable from 'src/components/Touchable' import { FETCH_FIATCONNECT_QUOTES } from 'src/config' -import { CoinbasePaymentSection } from 'src/fiatExchanges/CoinbasePaymentSection' import { ExternalExchangeProvider } from 'src/fiatExchanges/ExternalExchanges' import { PaymentMethodSection, @@ -38,7 +36,6 @@ import { fetchLegacyMobileMoneyProviders, fetchProviders, filterLegacyMobileMoneyProviders, - filterProvidersByPaymentMethod, getProviderSelectionAnalyticsData, } from 'src/fiatExchanges/utils' import { @@ -48,7 +45,6 @@ import { selectFiatConnectQuoteLoadingSelector, } from 'src/fiatconnect/selectors' import { fetchFiatConnectQuotes } from 'src/fiatconnect/slice' -import { readOnceFromFirebase } from 'src/firebase/firebase' import { getDefaultLocalCurrencyCode, getLocalCurrencyCode, @@ -111,9 +107,6 @@ export default function SelectProviderScreen({ route, navigation }: Props) { } const { t } = useTranslation() - const coinbasePayEnabled = useSelector(coinbasePayEnabledSelector) - const appIdResponse = useAsync(async () => readOnceFromFirebase('coinbasePay/appId'), []) - const appId = appIdResponse.result const insets = useSafeAreaInsets() useEffect(() => { @@ -208,22 +201,9 @@ export default function SelectProviderScreen({ route, navigation }: Props) { const exchanges = asyncExchanges.result ?? [] const legacyMobileMoneyProviders = asyncProviders.result?.legacyMobileMoneyProviders - const coinbaseProvider = filterProvidersByPaymentMethod( - PaymentMethod.Coinbase, - asyncProviders.result?.externalProviders - ) - const coinbasePayVisible = - flow === CICOFlow.CashIn && - coinbaseProvider && - !coinbaseProvider.restricted && - coinbasePayEnabled && - appId const anyProviders = - normalizedQuotes.length || - coinbasePayVisible || - exchanges.length || - legacyMobileMoneyProviders?.length + normalizedQuotes.length || exchanges.length || legacyMobileMoneyProviders?.length const analyticsData = getProviderSelectionAnalyticsData({ normalizedQuotes, @@ -231,7 +211,6 @@ export default function SelectProviderScreen({ route, navigation }: Props) { usdToLocalRate, tokenInfo, centralizedExchanges: exchanges, - coinbasePayAvailable: coinbasePayVisible, transferCryptoAmount: cryptoAmount, cryptoType: tokenInfo.symbol, }) @@ -326,15 +305,6 @@ export default function SelectProviderScreen({ route, navigation }: Props) { analyticsData={analyticsData} /> )} - {coinbaseProvider && coinbasePayVisible && ( - - )} diff --git a/src/fiatExchanges/types.ts b/src/fiatExchanges/types.ts index 9c5c999e71e..f59513e93a6 100644 --- a/src/fiatExchanges/types.ts +++ b/src/fiatExchanges/types.ts @@ -10,7 +10,6 @@ export enum SelectProviderExchangesLink { export interface ProviderSelectionAnalyticsData { centralizedExchangesAvailable: boolean - coinbasePayAvailable: boolean totalOptions: number paymentMethodsAvailable: Record transferCryptoAmount: number @@ -36,7 +35,6 @@ export enum CICOFlow { export enum PaymentMethod { Bank = 'Bank', Card = 'Card', - Coinbase = 'Coinbase', MobileMoney = 'MobileMoney', // legacy mobile money FiatConnectMobileMoney = 'FiatConnectMobileMoney', Airtime = 'Airtime', diff --git a/src/fiatExchanges/utils.test.ts b/src/fiatExchanges/utils.test.ts index 81a98b52831..1825821f454 100644 --- a/src/fiatExchanges/utils.test.ts +++ b/src/fiatExchanges/utils.test.ts @@ -79,7 +79,6 @@ describe('fiatExchanges utils', () => { usdToLocalRate, legacyMobileMoneyProviders: [mockLegacyMobileMoneyProvider], centralizedExchanges: mockExchanges, - coinbasePayAvailable: true, transferCryptoAmount, cryptoType: CiCoCurrency.cUSD, tokenInfo: { @@ -93,9 +92,8 @@ describe('fiatExchanges utils', () => { expect(analyticsOutput).toStrictEqual({ transferCryptoAmount, centralizedExchangesAvailable: true, - coinbasePayAvailable: true, cryptoType: CiCoCurrency.cUSD, - totalOptions: 7, // centralized exchanges counts as 1, plus 1 legacy mobile money provider, 1 coinbase pay and 4 normalized quotes + totalOptions: 6, // centralized exchanges counts as 1, plus 1 legacy mobile money provider, and 4 normalized quotes lowestFeeCryptoAmount: 1.0, lowestFeeKycRequired: true, lowestFeePaymentMethod: 'Card', @@ -105,7 +103,6 @@ describe('fiatExchanges utils', () => { Bank: true, Card: true, MobileMoney: true, - Coinbase: true, FiatConnectMobileMoney: true, }, networkId: 'celo-alfajores', @@ -118,7 +115,6 @@ describe('fiatExchanges utils', () => { usdToLocalRate, legacyMobileMoneyProviders: [], centralizedExchanges: [], - coinbasePayAvailable: false, transferCryptoAmount, cryptoType: CiCoCurrency.cUSD, tokenInfo: { @@ -132,7 +128,6 @@ describe('fiatExchanges utils', () => { expect(analyticsOutput).toStrictEqual({ transferCryptoAmount, centralizedExchangesAvailable: false, - coinbasePayAvailable: false, cryptoType: CiCoCurrency.cUSD, totalOptions: 4, // 4 normalized quotes only lowestFeeCryptoAmount: 1.0, @@ -144,7 +139,6 @@ describe('fiatExchanges utils', () => { Bank: true, Card: true, MobileMoney: false, - Coinbase: false, FiatConnectMobileMoney: true, }, networkId: 'celo-alfajores', diff --git a/src/fiatExchanges/utils.tsx b/src/fiatExchanges/utils.tsx index a8a2e715330..f8f42c40fe3 100644 --- a/src/fiatExchanges/utils.tsx +++ b/src/fiatExchanges/utils.tsx @@ -250,13 +250,6 @@ export async function fetchExchanges( } } -export const filterProvidersByPaymentMethod = ( - paymentMethod: PaymentMethod, - externalProviders: FetchProvidersOutput[] | undefined -) => { - return externalProviders?.find((quote) => quote.paymentMethods.includes(paymentMethod)) -} - export const isUserInputCrypto = (flow: CICOFlow): boolean => flow === CICOFlow.CashOut /** @@ -271,7 +264,6 @@ export function getProviderSelectionAnalyticsData({ tokenInfo, legacyMobileMoneyProviders, centralizedExchanges, - coinbasePayAvailable, transferCryptoAmount, cryptoType, }: { @@ -280,7 +272,6 @@ export function getProviderSelectionAnalyticsData({ tokenInfo?: TokenBalance legacyMobileMoneyProviders?: LegacyMobileMoneyProvider[] centralizedExchanges?: ExternalExchangeProvider[] - coinbasePayAvailable: boolean transferCryptoAmount: number cryptoType: string }): ProviderSelectionAnalyticsData { @@ -293,7 +284,6 @@ export function getProviderSelectionAnalyticsData({ [PaymentMethod.Bank]: false, [PaymentMethod.Card]: false, [PaymentMethod.FiatConnectMobileMoney]: false, - [PaymentMethod.Coinbase]: coinbasePayAvailable, [PaymentMethod.MobileMoney]: !!legacyMobileMoneyProviders && legacyMobileMoneyProviders.length > 0, [PaymentMethod.Airtime]: false, @@ -320,12 +310,10 @@ export function getProviderSelectionAnalyticsData({ lowestFeeProvider, lowestFeeKycRequired, centralizedExchangesAvailable, - coinbasePayAvailable, lowestFeeCryptoAmount: lowestFeeCryptoAmount?.toNumber(), // counts centralized exchanges as single option, since that's how they appear on the Select Providers screen totalOptions: (centralizedExchangesAvailable ? 1 : 0) + - (coinbasePayAvailable ? 1 : 0) + (legacyMobileMoneyProviders?.length ?? 0) + normalizedQuotes.length, networkId: tokenInfo?.networkId, diff --git a/src/navigator/Navigator.tsx b/src/navigator/Navigator.tsx index cccf7254dc8..de6e46a45d0 100644 --- a/src/navigator/Navigator.tsx +++ b/src/navigator/Navigator.tsx @@ -39,7 +39,6 @@ import EarnInfoScreen from 'src/earn/EarnInfoScreen' import EarnPoolInfoScreen from 'src/earn/poolInfoScreen/EarnPoolInfoScreen' import BidaliScreen from 'src/fiatExchanges/BidaliScreen' import CashInSuccess from 'src/fiatExchanges/CashInSuccess' -import CoinbasePayScreen from 'src/fiatExchanges/CoinbasePayScreen' import ExchangeQR from 'src/fiatExchanges/ExchangeQR' import ExternalExchanges, { externalExchangesScreenOptions, @@ -74,6 +73,7 @@ import KeylessBackupProgress from 'src/keylessBackup/KeylessBackupProgress' import LinkPhoneNumber from 'src/keylessBackup/LinkPhoneNumber' import SignInWithEmail from 'src/keylessBackup/SignInWithEmail' import WalletSecurityPrimer from 'src/keylessBackup/WalletSecurityPrimer' +import { KeylessBackupFlow, KeylessBackupOrigin } from 'src/keylessBackup/types' import Language from 'src/language/Language' import SelectLocalCurrency from 'src/localCurrency/SelectLocalCurrency' import { @@ -125,7 +125,6 @@ import VerificationStartScreen from 'src/verify/VerificationStartScreen' import WalletConnectSessionsScreen from 'src/walletConnect/screens/Sessions' import WalletConnectRequest from 'src/walletConnect/screens/WalletConnectRequest' import WebViewScreen from 'src/webview/WebViewScreen' -import { KeylessBackupFlow, KeylessBackupOrigin } from 'src/keylessBackup/types' const TAG = 'Navigator' @@ -424,12 +423,6 @@ const settingsScreens = (Navigator: typeof Stack) => ( name={Screens.BidaliScreen} component={BidaliScreen} /> -