diff --git a/src/analytics/Properties.tsx b/src/analytics/Properties.tsx index 660852cc47e..d4842720813 100644 --- a/src/analytics/Properties.tsx +++ b/src/analytics/Properties.tsx @@ -55,8 +55,12 @@ import { AddAssetsActionType } from 'src/components/AddAssetsBottomSheet' import { TokenPickerOrigin } from 'src/components/TokenBottomSheet' import { DappSection } from 'src/dapps/types' import { BeforeDepositActionName, EarnActiveMode, SerializableRewardsInfo } from 'src/earn/types' -import { ProviderSelectionAnalyticsData } from 'src/fiatExchanges/types' -import { CICOFlow, FiatExchangeFlow, PaymentMethod } from 'src/fiatExchanges/utils' +import { + CICOFlow, + FiatExchangeFlow, + PaymentMethod, + ProviderSelectionAnalyticsData, +} from 'src/fiatExchanges/types' import { HomeActionName, NotificationBannerCTATypes, NotificationType } from 'src/home/types' import { KeylessBackupFlow, diff --git a/src/app/saga.test.ts b/src/app/saga.test.ts index 30452573d02..6e7344a75a3 100644 --- a/src/app/saga.test.ts +++ b/src/app/saga.test.ts @@ -31,7 +31,7 @@ import { } from 'src/app/selectors' import { DEEP_LINK_URL_SCHEME } from 'src/config' import { activeDappSelector } from 'src/dapps/selectors' -import { FiatExchangeFlow } from 'src/fiatExchanges/utils' +import { FiatExchangeFlow } from 'src/fiatExchanges/types' import { initI18n } from 'src/i18n' import { allowOtaTranslationsSelector, diff --git a/src/app/saga.ts b/src/app/saga.ts index 760cc282f40..d553c1856d9 100644 --- a/src/app/saga.ts +++ b/src/app/saga.ts @@ -32,7 +32,7 @@ import { } from 'src/app/selectors' import { CeloNewsConfig } from 'src/celoNews/types' import { DEFAULT_APP_LANGUAGE, FETCH_TIMEOUT_DURATION, isE2EEnv } from 'src/config' -import { FiatExchangeFlow } from 'src/fiatExchanges/utils' +import { FiatExchangeFlow } from 'src/fiatExchanges/types' import { FiatAccountSchemaCountryOverrides } from 'src/fiatconnect/types' import { fetchRemoteConfigValues } from 'src/firebase/firebase' import { initI18n } from 'src/i18n' diff --git a/src/earn/EarnConfirmationScreen.tsx b/src/earn/EarnConfirmationScreen.tsx index 1c168ee1e96..ea8fe390d5e 100644 --- a/src/earn/EarnConfirmationScreen.tsx +++ b/src/earn/EarnConfirmationScreen.tsx @@ -15,7 +15,7 @@ import { withdrawStatusSelector } from 'src/earn/selectors' import { withdrawStart } from 'src/earn/slice' import { EarnActiveMode } from 'src/earn/types' import { getEarnPositionBalanceValues, isGasSubsidizedForNetwork } from 'src/earn/utils' -import { CICOFlow } from 'src/fiatExchanges/utils' +import { CICOFlow } from 'src/fiatExchanges/types' import { navigate } from 'src/navigator/NavigationService' import { Screens } from 'src/navigator/Screens' import { StackParamList } from 'src/navigator/types' diff --git a/src/earn/EarnEnterAmount.test.tsx b/src/earn/EarnEnterAmount.test.tsx index 43198bca142..1093e753463 100644 --- a/src/earn/EarnEnterAmount.test.tsx +++ b/src/earn/EarnEnterAmount.test.tsx @@ -8,7 +8,7 @@ import AppAnalytics from 'src/analytics/AppAnalytics' import { EarnEvents } from 'src/analytics/Events' import EarnEnterAmount from 'src/earn/EarnEnterAmount' import { usePrepareEnterAmountTransactionsCallback } from 'src/earn/hooks' -import { CICOFlow } from 'src/fiatExchanges/utils' +import { CICOFlow } from 'src/fiatExchanges/types' import { navigate } from 'src/navigator/NavigationService' import { Screens } from 'src/navigator/Screens' import { getFeatureGate } from 'src/statsig' diff --git a/src/earn/EarnEnterAmount.tsx b/src/earn/EarnEnterAmount.tsx index 7c1652c590c..382708529a1 100644 --- a/src/earn/EarnEnterAmount.tsx +++ b/src/earn/EarnEnterAmount.tsx @@ -22,7 +22,7 @@ import CustomHeader from 'src/components/header/CustomHeader' import EarnDepositBottomSheet from 'src/earn/EarnDepositBottomSheet' import { usePrepareEnterAmountTransactionsCallback } from 'src/earn/hooks' import { getSwapToAmountInDecimals } from 'src/earn/utils' -import { CICOFlow } from 'src/fiatExchanges/utils' +import { CICOFlow } from 'src/fiatExchanges/types' import ArrowRightThick from 'src/icons/ArrowRightThick' import DownArrowIcon from 'src/icons/DownArrowIcon' import { LocalCurrencySymbol } from 'src/localCurrency/consts' diff --git a/src/earn/poolInfoScreen/BeforeDepositBottomSheet.tsx b/src/earn/poolInfoScreen/BeforeDepositBottomSheet.tsx index fc48240539a..69e5a56ecf6 100644 --- a/src/earn/poolInfoScreen/BeforeDepositBottomSheet.tsx +++ b/src/earn/poolInfoScreen/BeforeDepositBottomSheet.tsx @@ -8,7 +8,7 @@ import BottomSheet, { BottomSheetModalRefType } from 'src/components/BottomSheet import { ActionCard } from 'src/earn/ActionCard' import { BeforeDepositAction } from 'src/earn/types' import { ExternalExchangeProvider } from 'src/fiatExchanges/ExternalExchanges' -import { CICOFlow } from 'src/fiatExchanges/utils' +import { CICOFlow } from 'src/fiatExchanges/types' import QuickActionsAdd from 'src/icons/quick-actions/Add' import QuickActionsSend from 'src/icons/quick-actions/Send' import SwapAndDeposit from 'src/icons/SwapAndDeposit' diff --git a/src/earn/poolInfoScreen/EarnPoolInfoScreen.test.tsx b/src/earn/poolInfoScreen/EarnPoolInfoScreen.test.tsx index 8618813c6f7..ea06df79aa1 100644 --- a/src/earn/poolInfoScreen/EarnPoolInfoScreen.test.tsx +++ b/src/earn/poolInfoScreen/EarnPoolInfoScreen.test.tsx @@ -4,7 +4,7 @@ import { Provider } from 'react-redux' import AppAnalytics from 'src/analytics/AppAnalytics' import { EarnEvents } from 'src/analytics/Events' import EarnPoolInfoScreen from 'src/earn/poolInfoScreen/EarnPoolInfoScreen' -import { CICOFlow } from 'src/fiatExchanges/utils' +import { CICOFlow } from 'src/fiatExchanges/types' import { navigate } from 'src/navigator/NavigationService' import { Screens } from 'src/navigator/Screens' import { EarnPosition } from 'src/positions/types' diff --git a/src/fiatExchanges/CoinbasePaymentSection.test.tsx b/src/fiatExchanges/CoinbasePaymentSection.test.tsx index f425f5bc82d..7d3ad21f3a3 100644 --- a/src/fiatExchanges/CoinbasePaymentSection.test.tsx +++ b/src/fiatExchanges/CoinbasePaymentSection.test.tsx @@ -3,13 +3,13 @@ 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 { CoinbasePayEvents } from 'src/analytics/Events' import AppAnalytics from 'src/analytics/AppAnalytics' +import { CoinbasePayEvents } from 'src/analytics/Events' import { CoinbasePaymentSection, CoinbasePaymentSectionProps, } from 'src/fiatExchanges/CoinbasePaymentSection' -import { PaymentMethod } from 'src/fiatExchanges/utils' +import { PaymentMethod } from 'src/fiatExchanges/types' import { navigate } from 'src/navigator/NavigationService' import { createMockStore } from 'test/utils' import { diff --git a/src/fiatExchanges/ExchangeQR.test.tsx b/src/fiatExchanges/ExchangeQR.test.tsx index 38f723ec8fe..258e200c98b 100644 --- a/src/fiatExchanges/ExchangeQR.test.tsx +++ b/src/fiatExchanges/ExchangeQR.test.tsx @@ -2,11 +2,11 @@ import Clipboard from '@react-native-clipboard/clipboard' import { fireEvent, render } from '@testing-library/react-native' import * as React from 'react' import { Provider } from 'react-redux' -import { FiatExchangeEvents } from 'src/analytics/Events' import AppAnalytics from 'src/analytics/AppAnalytics' +import { FiatExchangeEvents } from 'src/analytics/Events' import ExchangeQR from 'src/fiatExchanges/ExchangeQR' import { ExternalExchangeProvider } from 'src/fiatExchanges/ExternalExchanges' -import { CICOFlow } from 'src/fiatExchanges/utils' +import { CICOFlow } from 'src/fiatExchanges/types' import { navigate } from 'src/navigator/NavigationService' import { Screens } from 'src/navigator/Screens' import { createMockStore, getMockStackScreenProps } from 'test/utils' diff --git a/src/fiatExchanges/ExchangeQR.tsx b/src/fiatExchanges/ExchangeQR.tsx index 784698761d1..cb4aab45107 100644 --- a/src/fiatExchanges/ExchangeQR.tsx +++ b/src/fiatExchanges/ExchangeQR.tsx @@ -1,10 +1,11 @@ import { RouteProp } from '@react-navigation/native' import { NativeStackScreenProps } from '@react-navigation/native-stack' import React, { useLayoutEffect, useRef } from 'react' -import { FiatExchangeEvents } from 'src/analytics/Events' import AppAnalytics from 'src/analytics/AppAnalytics' +import { FiatExchangeEvents } from 'src/analytics/Events' import BackButton from 'src/components/BackButton' import { ExternalExchangeProvider } from 'src/fiatExchanges/ExternalExchanges' +import { CICOFlow } from 'src/fiatExchanges/types' import i18n from 'src/i18n' import Share from 'src/icons/Share' import { emptyHeader } from 'src/navigator/Headers' @@ -14,7 +15,6 @@ import { StackParamList } from 'src/navigator/types' import QRCode from 'src/qrcode/QRCode' import { useDispatch } from 'src/redux/hooks' import { SVG, shareQRCode } from 'src/send/actions' -import { CICOFlow } from './utils' type Props = NativeStackScreenProps diff --git a/src/fiatExchanges/FiatExchangeAmount.test.tsx b/src/fiatExchanges/FiatExchangeAmount.test.tsx index 252d62f548f..c8da0b7da84 100644 --- a/src/fiatExchanges/FiatExchangeAmount.test.tsx +++ b/src/fiatExchanges/FiatExchangeAmount.test.tsx @@ -5,6 +5,7 @@ import { Provider } from 'react-redux' import { showError } from 'src/alert/actions' import { ErrorMessages } from 'src/app/ErrorMessages' import FiatExchangeAmount from 'src/fiatExchanges/FiatExchangeAmount' +import { CICOFlow } from 'src/fiatExchanges/types' import { attemptReturnUserFlow } from 'src/fiatconnect/slice' import { LocalCurrencyCode } from 'src/localCurrency/consts' import { navigate } from 'src/navigator/NavigationService' @@ -22,7 +23,6 @@ import { mockCusdTokenId, mockEthTokenId, } from 'test/values' -import { CICOFlow } from './utils' jest.mock('src/statsig', () => ({ getFeatureGate: jest.fn(), diff --git a/src/fiatExchanges/FiatExchangeAmount.tsx b/src/fiatExchanges/FiatExchangeAmount.tsx index e2e9774c780..e5e0798763c 100644 --- a/src/fiatExchanges/FiatExchangeAmount.tsx +++ b/src/fiatExchanges/FiatExchangeAmount.tsx @@ -22,6 +22,8 @@ import { cachedFiatAccountUsesSelector, } from 'src/fiatconnect/selectors' import { attemptReturnUserFlow } from 'src/fiatconnect/slice' +import { CICOFlow } from 'src/fiatExchanges/types' +import { isUserInputCrypto } from 'src/fiatExchanges/utils' import i18n from 'src/i18n' import { LocalCurrencyCode, LocalCurrencySymbol } from 'src/localCurrency/consts' import { useLocalCurrencyCode } from 'src/localCurrency/hooks' @@ -40,7 +42,6 @@ import { tokenSymbolToAnalyticsCurrency } from 'src/utils/currencies' import { roundUp } from 'src/utils/formatting' import { parseInputAmount } from 'src/utils/parsing' import networkConfig from 'src/web3/networkConfig' -import { CICOFlow, isUserInputCrypto } from './utils' const { decimalSeparator } = getNumberFormatSettings() diff --git a/src/fiatExchanges/FiatExchangeCurrencyBottomSheet.test.tsx b/src/fiatExchanges/FiatExchangeCurrencyBottomSheet.test.tsx index 4ffd0141e94..daa6b598948 100644 --- a/src/fiatExchanges/FiatExchangeCurrencyBottomSheet.test.tsx +++ b/src/fiatExchanges/FiatExchangeCurrencyBottomSheet.test.tsx @@ -2,7 +2,7 @@ import { fireEvent, render, within } from '@testing-library/react-native' import React from 'react' import { Provider } from 'react-redux' import FiatExchangeCurrencyBottomSheet from 'src/fiatExchanges/FiatExchangeCurrencyBottomSheet' -import { FiatExchangeFlow } from 'src/fiatExchanges/utils' +import { FiatExchangeFlow } from 'src/fiatExchanges/types' import { getDynamicConfigParams, getFeatureGate, getMultichainFeatures } from 'src/statsig' import { DynamicConfigs } from 'src/statsig/constants' import { diff --git a/src/fiatExchanges/FiatExchangeCurrencyBottomSheet.tsx b/src/fiatExchanges/FiatExchangeCurrencyBottomSheet.tsx index 4ef5dfb3f5a..10ee474eba5 100644 --- a/src/fiatExchanges/FiatExchangeCurrencyBottomSheet.tsx +++ b/src/fiatExchanges/FiatExchangeCurrencyBottomSheet.tsx @@ -4,6 +4,7 @@ import { useTranslation } from 'react-i18next' import { FilterChip } from 'src/components/FilterChipsCarousel' import TokenBottomSheet, { TokenPickerOrigin } from 'src/components/TokenBottomSheet' import { fetchFiatConnectProviders } from 'src/fiatconnect/slice' +import { CICOFlow, FiatExchangeFlow } from 'src/fiatExchanges/types' import { navigate } from 'src/navigator/NavigationService' import { Screens } from 'src/navigator/Screens' import { StackParamList } from 'src/navigator/types' @@ -17,7 +18,6 @@ import { TokenBalance } from 'src/tokens/slice' import { sortCicoTokens } from 'src/tokens/utils' import { NetworkId } from 'src/transactions/types' import { resolveCurrency } from 'src/utils/currencies' -import { CICOFlow, FiatExchangeFlow } from './utils' type Props = BottomSheetScreenProps diff --git a/src/fiatExchanges/PaymentMethodSection.test.tsx b/src/fiatExchanges/PaymentMethodSection.test.tsx index d3e08772d92..e649eb0bafb 100644 --- a/src/fiatExchanges/PaymentMethodSection.test.tsx +++ b/src/fiatExchanges/PaymentMethodSection.test.tsx @@ -1,13 +1,13 @@ import { fireEvent, render, waitFor } from '@testing-library/react-native' import * as React from 'react' import { Provider } from 'react-redux' +import { FiatConnectQuoteSuccess } from 'src/fiatconnect' import { PaymentMethodSection, PaymentMethodSectionProps, } from 'src/fiatExchanges/PaymentMethodSection' import { normalizeQuotes } from 'src/fiatExchanges/quotes/normalizeQuotes' -import { CICOFlow, PaymentMethod } from 'src/fiatExchanges/utils' -import { FiatConnectQuoteSuccess } from 'src/fiatconnect' +import { CICOFlow, PaymentMethod } from 'src/fiatExchanges/types' import { LocalCurrencyCode } from 'src/localCurrency/consts' import { getFeatureGate } from 'src/statsig' import { NetworkId } from 'src/transactions/types' diff --git a/src/fiatExchanges/PaymentMethodSection.tsx b/src/fiatExchanges/PaymentMethodSection.tsx index 5c8155852d1..37b337a5bfb 100644 --- a/src/fiatExchanges/PaymentMethodSection.tsx +++ b/src/fiatExchanges/PaymentMethodSection.tsx @@ -10,8 +10,7 @@ import { CryptoAmount, FiatAmount } from 'src/fiatExchanges/amount' import NormalizedQuote from 'src/fiatExchanges/quotes/NormalizedQuote' import { SettlementEstimation, SettlementTime } from 'src/fiatExchanges/quotes/constants' import { getSettlementTimeString } from 'src/fiatExchanges/quotes/utils' -import { ProviderSelectionAnalyticsData } from 'src/fiatExchanges/types' -import { CICOFlow, PaymentMethod } from 'src/fiatExchanges/utils' +import { CICOFlow, PaymentMethod, ProviderSelectionAnalyticsData } from 'src/fiatExchanges/types' import InfoIcon from 'src/icons/InfoIcon' import { getLocalCurrencyCode, usdToLocalCurrencyRateSelector } from 'src/localCurrency/selectors' import { useDispatch, useSelector } from 'src/redux/hooks' diff --git a/src/fiatExchanges/SelectProvider.test.tsx b/src/fiatExchanges/SelectProvider.test.tsx index 135cd9cf46a..7d2d89a56b3 100644 --- a/src/fiatExchanges/SelectProvider.test.tsx +++ b/src/fiatExchanges/SelectProvider.test.tsx @@ -6,7 +6,19 @@ import { MockStoreEnhanced } from 'redux-mock-store' import AppAnalytics from 'src/analytics/AppAnalytics' import { FiatExchangeEvents } from 'src/analytics/Events' import SelectProviderScreen from 'src/fiatExchanges/SelectProvider' -import { SelectProviderExchangesLink, SelectProviderExchangesText } from 'src/fiatExchanges/types' +import { + CICOFlow, + PaymentMethod, + SelectProviderExchangesLink, + SelectProviderExchangesText, +} from 'src/fiatExchanges/types' +import { + LegacyMobileMoneyProvider, + fetchExchanges, + fetchLegacyMobileMoneyProviders, + fetchProviders, + getProviderSelectionAnalyticsData, +} from 'src/fiatExchanges/utils' import { LocalCurrencyCode } from 'src/localCurrency/consts' import { navigate } from 'src/navigator/NavigationService' import { Screens } from 'src/navigator/Screens' @@ -24,15 +36,6 @@ import { mockFiatConnectQuotes, mockProviders, } from 'test/values' -import { - CICOFlow, - LegacyMobileMoneyProvider, - PaymentMethod, - fetchExchanges, - fetchLegacyMobileMoneyProviders, - fetchProviders, - getProviderSelectionAnalyticsData, -} from './utils' import mocked = jest.mocked const AMOUNT_TO_CASH_IN = 100 diff --git a/src/fiatExchanges/SelectProvider.tsx b/src/fiatExchanges/SelectProvider.tsx index 5a64b7a9ed1..55b16bc115b 100644 --- a/src/fiatExchanges/SelectProvider.tsx +++ b/src/fiatExchanges/SelectProvider.tsx @@ -25,10 +25,22 @@ import { import { CryptoAmount, FiatAmount } from 'src/fiatExchanges/amount' import { normalizeQuotes } from 'src/fiatExchanges/quotes/normalizeQuotes' import { + CICOFlow, + FiatExchangeFlow, + PaymentMethod, ProviderSelectionAnalyticsData, SelectProviderExchangesLink, SelectProviderExchangesText, } from 'src/fiatExchanges/types' +import { + LegacyMobileMoneyProvider, + fetchExchanges, + fetchLegacyMobileMoneyProviders, + fetchProviders, + filterLegacyMobileMoneyProviders, + filterProvidersByPaymentMethod, + getProviderSelectionAnalyticsData, +} from 'src/fiatExchanges/utils' import { fiatConnectQuotesErrorSelector, fiatConnectQuotesLoadingSelector, @@ -61,18 +73,6 @@ import Logger from 'src/utils/Logger' import { navigateToURI } from 'src/utils/linking' import networkConfig from 'src/web3/networkConfig' import { currentAccountSelector } from 'src/web3/selectors' -import { - CICOFlow, - FiatExchangeFlow, - LegacyMobileMoneyProvider, - PaymentMethod, - fetchExchanges, - fetchLegacyMobileMoneyProviders, - fetchProviders, - filterLegacyMobileMoneyProviders, - filterProvidersByPaymentMethod, - getProviderSelectionAnalyticsData, -} from './utils' const TAG = 'SelectProviderScreen' diff --git a/src/fiatExchanges/SimplexScreen.test.tsx b/src/fiatExchanges/SimplexScreen.test.tsx index 4b1fe1b3234..9bf11416fba 100644 --- a/src/fiatExchanges/SimplexScreen.test.tsx +++ b/src/fiatExchanges/SimplexScreen.test.tsx @@ -5,13 +5,13 @@ import { Provider } from 'react-redux' import AppAnalytics from 'src/analytics/AppAnalytics' import { FiatExchangeEvents } from 'src/analytics/Events' import SimplexScreen from 'src/fiatExchanges/SimplexScreen' +import { SimplexQuote } from 'src/fiatExchanges/types' import { LocalCurrencyCode } from 'src/localCurrency/consts' import { Screens } from 'src/navigator/Screens' import { CiCoCurrency } from 'src/utils/currencies' import { createMockStore, getMockStackScreenProps } from 'test/utils' import { mockAccount, mockCusdTokenId, mockE164Number } from 'test/values' import { v4 as uuidv4 } from 'uuid' -import { SimplexQuote } from './utils' const mockUserIpAddress = '1.1.1.1.1.1.0' diff --git a/src/fiatExchanges/WithdrawSpend.tsx b/src/fiatExchanges/WithdrawSpend.tsx index 5afbfe03cfe..633c6f24ca0 100644 --- a/src/fiatExchanges/WithdrawSpend.tsx +++ b/src/fiatExchanges/WithdrawSpend.tsx @@ -7,7 +7,7 @@ import { FiatExchangeEvents } from 'src/analytics/Events' import { AppState } from 'src/app/actions' import ListItem from 'src/components/ListItem' import { FiatExchangeTokenBalance } from 'src/components/TokenBalance' -import { FiatExchangeFlow } from 'src/fiatExchanges/utils' +import { FiatExchangeFlow } from 'src/fiatExchanges/types' import { fiatExchange } from 'src/images/Images' import { navigate } from 'src/navigator/NavigationService' import { Screens } from 'src/navigator/Screens' diff --git a/src/fiatExchanges/quotes/ExternalQuote.test.ts b/src/fiatExchanges/quotes/ExternalQuote.test.ts index 6d83f05586b..e9cb5dd9031 100644 --- a/src/fiatExchanges/quotes/ExternalQuote.test.ts +++ b/src/fiatExchanges/quotes/ExternalQuote.test.ts @@ -2,7 +2,8 @@ import BigNumber from 'bignumber.js' import AppAnalytics from 'src/analytics/AppAnalytics' import ExternalQuote from 'src/fiatExchanges/quotes/ExternalQuote' import { SettlementTime } from 'src/fiatExchanges/quotes/constants' -import { CICOFlow, PaymentMethod, RawProviderQuote, SimplexQuote } from 'src/fiatExchanges/utils' +import { CICOFlow, PaymentMethod, SimplexQuote } from 'src/fiatExchanges/types' +import { RawProviderQuote } from 'src/fiatExchanges/utils' import { navigate } from 'src/navigator/NavigationService' import { NetworkId } from 'src/transactions/types' import { navigateToURI } from 'src/utils/linking' diff --git a/src/fiatExchanges/quotes/ExternalQuote.ts b/src/fiatExchanges/quotes/ExternalQuote.ts index b959561850b..fe65bc731ec 100644 --- a/src/fiatExchanges/quotes/ExternalQuote.ts +++ b/src/fiatExchanges/quotes/ExternalQuote.ts @@ -7,13 +7,8 @@ import { SettlementEstimation, } from 'src/fiatExchanges/quotes/constants' import NormalizedQuote from 'src/fiatExchanges/quotes/NormalizedQuote' -import { - CICOFlow, - FetchProvidersOutput, - PaymentMethod, - RawProviderQuote, - SimplexQuote, -} from 'src/fiatExchanges/utils' +import { CICOFlow, PaymentMethod, SimplexQuote } from 'src/fiatExchanges/types' +import { FetchProvidersOutput, RawProviderQuote } from 'src/fiatExchanges/utils' import i18n from 'src/i18n' import { navigate } from 'src/navigator/NavigationService' import { Screens } from 'src/navigator/Screens' diff --git a/src/fiatExchanges/quotes/FiatConnectQuote.test.ts b/src/fiatExchanges/quotes/FiatConnectQuote.test.ts index 98e9d565a8f..ca09dba76ea 100644 --- a/src/fiatExchanges/quotes/FiatConnectQuote.test.ts +++ b/src/fiatExchanges/quotes/FiatConnectQuote.test.ts @@ -6,15 +6,15 @@ import { } from '@fiatconnect/fiatconnect-types' import BigNumber from 'bignumber.js' import _ from 'lodash' -import { FiatExchangeEvents } from 'src/analytics/Events' import AppAnalytics from 'src/analytics/AppAnalytics' +import { FiatExchangeEvents } from 'src/analytics/Events' import FiatConnectQuote from 'src/fiatExchanges/quotes/FiatConnectQuote' import { DEFAULT_BANK_SETTLEMENT_ESTIMATION, DEFAULT_MOBILE_MONEY_SETTLEMENT_ESTIMATION, SettlementTime, } from 'src/fiatExchanges/quotes/constants' -import { CICOFlow, PaymentMethod } from 'src/fiatExchanges/utils' +import { CICOFlow, PaymentMethod } from 'src/fiatExchanges/types' import { FiatConnectQuoteSuccess } from 'src/fiatconnect' import { selectFiatConnectQuote } from 'src/fiatconnect/slice' import { NetworkId } from 'src/transactions/types' diff --git a/src/fiatExchanges/quotes/FiatConnectQuote.ts b/src/fiatExchanges/quotes/FiatConnectQuote.ts index 0c75ddf859a..9a9a6c663b1 100644 --- a/src/fiatExchanges/quotes/FiatConnectQuote.ts +++ b/src/fiatExchanges/quotes/FiatConnectQuote.ts @@ -6,8 +6,8 @@ import { QuoteResponseFiatAccountSchema, QuoteResponseKycSchema, } from '@fiatconnect/fiatconnect-types' -import BigNumber from 'bignumber.js' import { Dispatch } from '@reduxjs/toolkit' +import BigNumber from 'bignumber.js' import { FiatConnectProviderInfo, FiatConnectQuoteSuccess } from 'src/fiatconnect' import { selectFiatConnectQuote } from 'src/fiatconnect/slice' import { @@ -18,7 +18,7 @@ import { SettlementTime, } from 'src/fiatExchanges/quotes/constants' import NormalizedQuote from 'src/fiatExchanges/quotes/NormalizedQuote' -import { CICOFlow, PaymentMethod } from 'src/fiatExchanges/utils' +import { CICOFlow, PaymentMethod } from 'src/fiatExchanges/types' import i18n from 'src/i18n' import { TokenBalance } from 'src/tokens/slice' import { convertLocalToTokenAmount, convertTokenToLocalAmount } from 'src/tokens/utils' diff --git a/src/fiatExchanges/quotes/NormalizedQuote.ts b/src/fiatExchanges/quotes/NormalizedQuote.ts index 4499068d729..1d9a8c7802c 100644 --- a/src/fiatExchanges/quotes/NormalizedQuote.ts +++ b/src/fiatExchanges/quotes/NormalizedQuote.ts @@ -1,10 +1,9 @@ -import BigNumber from 'bignumber.js' import { Dispatch } from '@reduxjs/toolkit' -import { FiatExchangeEvents } from 'src/analytics/Events' +import BigNumber from 'bignumber.js' import AppAnalytics from 'src/analytics/AppAnalytics' +import { FiatExchangeEvents } from 'src/analytics/Events' import { SettlementEstimation } from 'src/fiatExchanges/quotes/constants' -import { ProviderSelectionAnalyticsData } from 'src/fiatExchanges/types' -import { CICOFlow, PaymentMethod } from 'src/fiatExchanges/utils' +import { CICOFlow, PaymentMethod, ProviderSelectionAnalyticsData } from 'src/fiatExchanges/types' import { TokenBalance } from 'src/tokens/slice' export default abstract class NormalizedQuote { diff --git a/src/fiatExchanges/quotes/normalizeQuotes.test.ts b/src/fiatExchanges/quotes/normalizeQuotes.test.ts index f240b075bf7..a80ef9628bf 100644 --- a/src/fiatExchanges/quotes/normalizeQuotes.test.ts +++ b/src/fiatExchanges/quotes/normalizeQuotes.test.ts @@ -3,7 +3,7 @@ import { normalizeFiatConnectQuotes, normalizeQuotes, } from 'src/fiatExchanges/quotes/normalizeQuotes' -import { CICOFlow, PaymentMethod } from 'src/fiatExchanges/utils' +import { CICOFlow, PaymentMethod } from 'src/fiatExchanges/types' import { getFeatureGate } from 'src/statsig' import Logger from 'src/utils/Logger' import { mockCusdTokenId, mockFiatConnectQuotes, mockProviders } from 'test/values' diff --git a/src/fiatExchanges/quotes/normalizeQuotes.ts b/src/fiatExchanges/quotes/normalizeQuotes.ts index 6200b0407f4..c4138e112e7 100644 --- a/src/fiatExchanges/quotes/normalizeQuotes.ts +++ b/src/fiatExchanges/quotes/normalizeQuotes.ts @@ -4,12 +4,8 @@ import { FiatConnectQuoteError, FiatConnectQuoteSuccess } from 'src/fiatconnect' import ExternalQuote from 'src/fiatExchanges/quotes/ExternalQuote' import FiatConnectQuote from 'src/fiatExchanges/quotes/FiatConnectQuote' import NormalizedQuote from 'src/fiatExchanges/quotes/NormalizedQuote' -import { - CICOFlow, - FetchProvidersOutput, - RawProviderQuote, - SimplexQuote, -} from 'src/fiatExchanges/utils' +import { CICOFlow, SimplexQuote } from 'src/fiatExchanges/types' +import { FetchProvidersOutput, RawProviderQuote } from 'src/fiatExchanges/utils' import Logger from 'src/utils/Logger' const TAG = 'NormalizeQuotes' diff --git a/src/fiatExchanges/types.ts b/src/fiatExchanges/types.ts index 2c6372f6db3..9c5c999e71e 100644 --- a/src/fiatExchanges/types.ts +++ b/src/fiatExchanges/types.ts @@ -1,5 +1,3 @@ -import { PaymentMethod } from 'src/fiatExchanges/utils' - export enum SelectProviderExchangesText { CryptoExchange = 'CryptoExchange', DepositFrom = 'DepositFrom', @@ -23,3 +21,40 @@ export interface ProviderSelectionAnalyticsData { lowestFeePaymentMethod: PaymentMethod | undefined networkId: string | undefined } + +export enum FiatExchangeFlow { + CashIn = 'CashIn', + CashOut = 'CashOut', + Spend = 'Spend', +} + +export enum CICOFlow { + CashIn = 'CashIn', + CashOut = 'CashOut', +} + +export enum PaymentMethod { + Bank = 'Bank', + Card = 'Card', + Coinbase = 'Coinbase', + MobileMoney = 'MobileMoney', // legacy mobile money + FiatConnectMobileMoney = 'FiatConnectMobileMoney', + Airtime = 'Airtime', +} + +export type SimplexQuote = { + user_id: string + quote_id: string + wallet_id: string + digital_money: { + currency: string + amount: number + } + fiat_money: { + currency: string + base_amount: number + total_amount: number + } + valid_until: string + supported_digital_currencies: string[] +} diff --git a/src/fiatExchanges/utils.test.ts b/src/fiatExchanges/utils.test.ts index 2da2ebf8f40..81a98b52831 100644 --- a/src/fiatExchanges/utils.test.ts +++ b/src/fiatExchanges/utils.test.ts @@ -1,15 +1,16 @@ import BigNumber from 'bignumber.js' +import NormalizedQuote from 'src/fiatExchanges/quotes/NormalizedQuote' +import { PaymentMethod } from 'src/fiatExchanges/types' +import { fetchExchanges, getProviderSelectionAnalyticsData } from 'src/fiatExchanges/utils' +import { CiCoCurrency } from 'src/utils/currencies' import { fetchWithTimeout } from 'src/utils/fetchWithTimeout' +import networkConfig from 'src/web3/networkConfig' import { mockCusdTokenId, mockExchanges, mockLegacyMobileMoneyProvider, mockTokenBalances, -} from '../../test/values' -import { CiCoCurrency } from '../utils/currencies' -import NormalizedQuote from './quotes/NormalizedQuote' -import { PaymentMethod, fetchExchanges, getProviderSelectionAnalyticsData } from './utils' -import networkConfig from 'src/web3/networkConfig' +} from 'test/values' class MockNormalizedQuote extends NormalizedQuote { getCryptoType = jest.fn() diff --git a/src/fiatExchanges/utils.tsx b/src/fiatExchanges/utils.tsx index 6c286d20760..a8a2e715330 100644 --- a/src/fiatExchanges/utils.tsx +++ b/src/fiatExchanges/utils.tsx @@ -4,7 +4,12 @@ import { default as DeviceInfo } from 'react-native-device-info' import { FIREBASE_ENABLED } from 'src/config' import { ExternalExchangeProvider } from 'src/fiatExchanges/ExternalExchanges' import NormalizedQuote from 'src/fiatExchanges/quotes/NormalizedQuote' -import { ProviderSelectionAnalyticsData } from 'src/fiatExchanges/types' +import { + CICOFlow, + PaymentMethod, + ProviderSelectionAnalyticsData, + SimplexQuote, +} from 'src/fiatExchanges/types' import { LocalCurrencyCode } from 'src/localCurrency/consts' import { UserLocationData } from 'src/networkInfo/saga' import { getDynamicConfigParams } from 'src/statsig' @@ -18,33 +23,6 @@ import networkConfig from 'src/web3/networkConfig' const TAG = 'fiatExchanges:utils' -export enum FiatExchangeFlow { - CashIn = 'CashIn', - CashOut = 'CashOut', - Spend = 'Spend', -} - -export enum CICOFlow { - CashIn = 'CashIn', - CashOut = 'CashOut', -} - -export enum PaymentMethod { - Bank = 'Bank', - Card = 'Card', - Coinbase = 'Coinbase', - MobileMoney = 'MobileMoney', // legacy mobile money - FiatConnectMobileMoney = 'FiatConnectMobileMoney', - Airtime = 'Airtime', -} - -export enum CloudFunctionDigitalAsset { - CELO = 'CELO', - CUSD = 'CUSD', - CEUR = 'CEUR', - CREAL = 'CREAL', - ETH = 'ETH', -} interface ProviderRequestData { userLocation: UserLocationData walletAddress: string @@ -69,12 +47,6 @@ export interface FetchProvidersOutput { cashOut: boolean } -export interface UserAccountCreationData { - ipAddress: string - timestamp: string - userAgent: string -} - export interface RawProviderQuote { paymentMethod: PaymentMethod digitalAsset: string @@ -106,40 +78,6 @@ interface SimplexPaymentData { checkoutHtml: string } -export interface ProviderInfo { - name: string - logoWide: string - logo: string -} - -export type ProviderQuote = RawProviderQuote & { - cashIn: boolean - cashOut: boolean - url: string -} - -export type SimplexQuote = { - user_id: string - quote_id: string - wallet_id: string - digital_money: { - currency: string - amount: number - } - fiat_money: { - currency: string - base_amount: number - total_amount: number - } - valid_until: string - supported_digital_currencies: string[] -} - -export interface CicoQuote { - quote: ProviderQuote | SimplexQuote - provider: ProviderInfo -} - const composePostObject = (body: any) => ({ method: 'POST', headers: { diff --git a/src/fiatconnect/FiatDetailsScreen.test.tsx b/src/fiatconnect/FiatDetailsScreen.test.tsx index be468394446..fca1826b523 100644 --- a/src/fiatconnect/FiatDetailsScreen.test.tsx +++ b/src/fiatconnect/FiatDetailsScreen.test.tsx @@ -4,10 +4,10 @@ import { fireEvent, render } from '@testing-library/react-native' import _ from 'lodash' import * as React from 'react' import { Provider } from 'react-redux' -import { FiatExchangeEvents } from 'src/analytics/Events' import AppAnalytics from 'src/analytics/AppAnalytics' +import { FiatExchangeEvents } from 'src/analytics/Events' import FiatConnectQuote from 'src/fiatExchanges/quotes/FiatConnectQuote' -import { CICOFlow } from 'src/fiatExchanges/utils' +import { CICOFlow } from 'src/fiatExchanges/types' import { FiatConnectQuoteSuccess } from 'src/fiatconnect' import { SendingFiatAccountStatus, submitFiatAccount } from 'src/fiatconnect/slice' import { FiatAccountSchemaCountryOverrides } from 'src/fiatconnect/types' diff --git a/src/fiatconnect/KycLanding.test.tsx b/src/fiatconnect/KycLanding.test.tsx index 443fcaa8d8a..9be97756abd 100644 --- a/src/fiatconnect/KycLanding.test.tsx +++ b/src/fiatconnect/KycLanding.test.tsx @@ -3,13 +3,13 @@ import { fireEvent, render } from '@testing-library/react-native' import React from 'react' import { Provider } from 'react-redux' import { KycStatus } from 'src/account/reducer' -import { CICOEvents } from 'src/analytics/Events' import AppAnalytics from 'src/analytics/AppAnalytics' +import { CICOEvents } from 'src/analytics/Events' import { FiatConnectQuoteSuccess } from 'src/fiatconnect' import KycLanding from 'src/fiatconnect/KycLanding' import { personaFinished, personaStarted, postKyc } from 'src/fiatconnect/slice' import FiatConnectQuote from 'src/fiatExchanges/quotes/FiatConnectQuote' -import { CICOFlow } from 'src/fiatExchanges/utils' +import { CICOFlow } from 'src/fiatExchanges/types' import { Screens } from 'src/navigator/Screens' import { createMockStore, getMockStackScreenProps } from 'test/utils' import { mockCusdTokenId, mockFiatConnectQuotes } from 'test/values' diff --git a/src/fiatconnect/KycLanding.tsx b/src/fiatconnect/KycLanding.tsx index b0d04e506d3..ca3e2bb6ae9 100644 --- a/src/fiatconnect/KycLanding.tsx +++ b/src/fiatconnect/KycLanding.tsx @@ -19,7 +19,7 @@ import AppAnalytics from 'src/analytics/AppAnalytics' import { CICOEvents, FiatExchangeEvents } from 'src/analytics/Events' import BackButton from 'src/components/BackButton' import FiatConnectQuote from 'src/fiatExchanges/quotes/FiatConnectQuote' -import { CICOFlow } from 'src/fiatExchanges/utils' +import { CICOFlow } from 'src/fiatExchanges/types' import { LinkAccountSection, getTranslationStrings } from 'src/fiatconnect/LinkAccountScreen' import { personaInProgressSelector } from 'src/fiatconnect/selectors' import { personaFinished, personaStarted, postKyc } from 'src/fiatconnect/slice' diff --git a/src/fiatconnect/LinkAccountScreen.test.tsx b/src/fiatconnect/LinkAccountScreen.test.tsx index ad74ad30f54..00f80731be6 100644 --- a/src/fiatconnect/LinkAccountScreen.test.tsx +++ b/src/fiatconnect/LinkAccountScreen.test.tsx @@ -6,7 +6,7 @@ import { Provider } from 'react-redux' import { FiatConnectQuoteSuccess } from 'src/fiatconnect' import FiatConnectLinkAccountScreen from 'src/fiatconnect/LinkAccountScreen' import FiatConnectQuote from 'src/fiatExchanges/quotes/FiatConnectQuote' -import { CICOFlow } from 'src/fiatExchanges/utils' +import { CICOFlow } from 'src/fiatExchanges/types' import { navigate } from 'src/navigator/NavigationService' import { Screens } from 'src/navigator/Screens' import { createMockStore, getMockStackScreenProps } from 'test/utils' diff --git a/src/fiatconnect/LinkAccountScreen.tsx b/src/fiatconnect/LinkAccountScreen.tsx index c32fc31f27f..68302be0fe8 100644 --- a/src/fiatconnect/LinkAccountScreen.tsx +++ b/src/fiatconnect/LinkAccountScreen.tsx @@ -9,7 +9,7 @@ import { FiatExchangeEvents } from 'src/analytics/Events' import BackButton from 'src/components/BackButton' import Button, { BtnSizes, BtnTypes } from 'src/components/Button' import FiatConnectQuote from 'src/fiatExchanges/quotes/FiatConnectQuote' -import { CICOFlow } from 'src/fiatExchanges/utils' +import { CICOFlow } from 'src/fiatExchanges/types' import i18n from 'src/i18n' import { emptyHeader } from 'src/navigator/Headers' import { navigate } from 'src/navigator/NavigationService' diff --git a/src/fiatconnect/RefetchQuoteScreen.test.tsx b/src/fiatconnect/RefetchQuoteScreen.test.tsx index 6bd60dbd217..72b214f02fd 100644 --- a/src/fiatconnect/RefetchQuoteScreen.test.tsx +++ b/src/fiatconnect/RefetchQuoteScreen.test.tsx @@ -4,7 +4,7 @@ import * as React from 'react' import { Provider } from 'react-redux' import FiatConnectRefetchQuoteScreen from 'src/fiatconnect/RefetchQuoteScreen' import { refetchQuote } from 'src/fiatconnect/slice' -import { CICOFlow } from 'src/fiatExchanges/utils' +import { CICOFlow } from 'src/fiatExchanges/types' import { navigate, navigateHome } from 'src/navigator/NavigationService' import { Screens } from 'src/navigator/Screens' import { CiCoCurrency } from 'src/utils/currencies' diff --git a/src/fiatconnect/ReviewScreen.test.tsx b/src/fiatconnect/ReviewScreen.test.tsx index 4b475889113..4073d6a3c40 100644 --- a/src/fiatconnect/ReviewScreen.test.tsx +++ b/src/fiatconnect/ReviewScreen.test.tsx @@ -4,7 +4,7 @@ import _ from 'lodash' import * as React from 'react' import { Provider } from 'react-redux' import FiatConnectQuote from 'src/fiatExchanges/quotes/FiatConnectQuote' -import { CICOFlow } from 'src/fiatExchanges/utils' +import { CICOFlow } from 'src/fiatExchanges/types' import { FiatConnectQuoteSuccess } from 'src/fiatconnect' import FiatConnectReviewScreen from 'src/fiatconnect/ReviewScreen' import { FiatAccount, createFiatConnectTransfer, refetchQuote } from 'src/fiatconnect/slice' diff --git a/src/fiatconnect/ReviewScreen.tsx b/src/fiatconnect/ReviewScreen.tsx index eeeb72ce48e..c72ce1d49fa 100644 --- a/src/fiatconnect/ReviewScreen.tsx +++ b/src/fiatconnect/ReviewScreen.tsx @@ -17,7 +17,7 @@ import LineItemRow from 'src/components/LineItemRow' import Touchable from 'src/components/Touchable' import { CryptoAmount, FiatAmount } from 'src/fiatExchanges/amount' import FiatConnectQuote from 'src/fiatExchanges/quotes/FiatConnectQuote' -import { CICOFlow } from 'src/fiatExchanges/utils' +import { CICOFlow } from 'src/fiatExchanges/types' import { convertToFiatConnectFiatCurrency } from 'src/fiatconnect' import { fiatConnectQuotesErrorSelector, diff --git a/src/fiatconnect/TransferStatusScreen.test.tsx b/src/fiatconnect/TransferStatusScreen.test.tsx index cf1388cf3b1..dab69c2bba2 100644 --- a/src/fiatconnect/TransferStatusScreen.test.tsx +++ b/src/fiatconnect/TransferStatusScreen.test.tsx @@ -3,11 +3,11 @@ import { fireEvent, render } from '@testing-library/react-native' import React from 'react' import { Provider } from 'react-redux' import { act } from 'react-test-renderer' -import { FiatExchangeEvents } from 'src/analytics/Events' import AppAnalytics from 'src/analytics/AppAnalytics' +import { FiatExchangeEvents } from 'src/analytics/Events' import FiatConnectQuote from 'src/fiatExchanges/quotes/FiatConnectQuote' import { SettlementEstimation, SettlementTime } from 'src/fiatExchanges/quotes/constants' -import { CICOFlow } from 'src/fiatExchanges/utils' +import { CICOFlow } from 'src/fiatExchanges/types' import { FiatConnectQuoteSuccess } from 'src/fiatconnect' import TransferStatusScreen from 'src/fiatconnect/TransferStatusScreen' import { FiatConnectTransfer, SendingTransferStatus } from 'src/fiatconnect/slice' diff --git a/src/fiatconnect/TransferStatusScreen.tsx b/src/fiatconnect/TransferStatusScreen.tsx index 185036bb77d..7e20f9afb04 100644 --- a/src/fiatconnect/TransferStatusScreen.tsx +++ b/src/fiatconnect/TransferStatusScreen.tsx @@ -11,7 +11,7 @@ import Touchable from 'src/components/Touchable' import FiatConnectQuote from 'src/fiatExchanges/quotes/FiatConnectQuote' import { SettlementEstimation, SettlementTime } from 'src/fiatExchanges/quotes/constants' import { getSettlementTimeString } from 'src/fiatExchanges/quotes/utils' -import { CICOFlow } from 'src/fiatExchanges/utils' +import { CICOFlow } from 'src/fiatExchanges/types' import { fiatConnectTransferSelector } from 'src/fiatconnect/selectors' import { FiatAccount, SendingTransferStatus } from 'src/fiatconnect/slice' import Checkmark from 'src/icons/Checkmark' diff --git a/src/fiatconnect/index.test.ts b/src/fiatconnect/index.test.ts index 5144c140f26..ddc1da781fc 100644 --- a/src/fiatconnect/index.test.ts +++ b/src/fiatconnect/index.test.ts @@ -1,5 +1,5 @@ import { FetchMock } from 'jest-fetch-mock' -import { CICOFlow } from 'src/fiatExchanges/utils' +import { CICOFlow } from 'src/fiatExchanges/types' import { LocalCurrencyCode } from 'src/localCurrency/consts' import Logger from 'src/utils/Logger' import { CiCoCurrency } from 'src/utils/currencies' diff --git a/src/fiatconnect/index.ts b/src/fiatconnect/index.ts index 2c3139e9af7..cd0b96ecf51 100644 --- a/src/fiatconnect/index.ts +++ b/src/fiatconnect/index.ts @@ -1,6 +1,7 @@ import { CreateQuoteParams } from '@fiatconnect/fiatconnect-sdk' import { FiatType, QuoteErrorResponse, QuoteResponse } from '@fiatconnect/fiatconnect-types' -import { CICOFlow, isUserInputCrypto } from 'src/fiatExchanges/utils' +import { CICOFlow } from 'src/fiatExchanges/types' +import { isUserInputCrypto } from 'src/fiatExchanges/utils' import { WALLET_CRYPTO_TO_FIATCONNECT_CRYPTO } from 'src/fiatconnect/consts' import { LocalCurrencyCode } from 'src/localCurrency/consts' import { getDynamicConfigParams } from 'src/statsig' diff --git a/src/fiatconnect/kyc/KycDenied.test.tsx b/src/fiatconnect/kyc/KycDenied.test.tsx index 85af5371009..2e1a45120d8 100644 --- a/src/fiatconnect/kyc/KycDenied.test.tsx +++ b/src/fiatconnect/kyc/KycDenied.test.tsx @@ -2,10 +2,10 @@ import { FiatAccountType, KycStatus as FiatConnectKycStatus } from '@fiatconnect import { fireEvent, render } from '@testing-library/react-native' import React from 'react' import { Provider } from 'react-redux' -import { FiatExchangeEvents } from 'src/analytics/Events' import AppAnalytics from 'src/analytics/AppAnalytics' +import { FiatExchangeEvents } from 'src/analytics/Events' import FiatConnectQuote from 'src/fiatExchanges/quotes/FiatConnectQuote' -import { CICOFlow } from 'src/fiatExchanges/utils' +import { CICOFlow } from 'src/fiatExchanges/types' import { FiatConnectQuoteSuccess } from 'src/fiatconnect' import KycDenied from 'src/fiatconnect/kyc/KycDenied' import getNavigationOptions from 'src/fiatconnect/kyc/getNavigationOptions' diff --git a/src/fiatconnect/kyc/KycExpired.test.tsx b/src/fiatconnect/kyc/KycExpired.test.tsx index b18b0b8526d..ffc56ead674 100644 --- a/src/fiatconnect/kyc/KycExpired.test.tsx +++ b/src/fiatconnect/kyc/KycExpired.test.tsx @@ -2,10 +2,10 @@ import { FiatAccountType, KycStatus as FiatConnectKycStatus } from '@fiatconnect import { fireEvent, render } from '@testing-library/react-native' import React from 'react' import { Provider } from 'react-redux' -import { FiatExchangeEvents } from 'src/analytics/Events' import AppAnalytics from 'src/analytics/AppAnalytics' +import { FiatExchangeEvents } from 'src/analytics/Events' import FiatConnectQuote from 'src/fiatExchanges/quotes/FiatConnectQuote' -import { CICOFlow } from 'src/fiatExchanges/utils' +import { CICOFlow } from 'src/fiatExchanges/types' import { FiatConnectQuoteSuccess } from 'src/fiatconnect' import KycExpired from 'src/fiatconnect/kyc/KycExpired' import getNavigationOptions from 'src/fiatconnect/kyc/getNavigationOptions' diff --git a/src/fiatconnect/kyc/KycPending.test.tsx b/src/fiatconnect/kyc/KycPending.test.tsx index 8e10e1be6cc..c45b88cacba 100644 --- a/src/fiatconnect/kyc/KycPending.test.tsx +++ b/src/fiatconnect/kyc/KycPending.test.tsx @@ -2,10 +2,10 @@ import { FiatAccountType, KycStatus as FiatConnectKycStatus } from '@fiatconnect import { fireEvent, render } from '@testing-library/react-native' import React from 'react' import { Provider } from 'react-redux' -import { FiatExchangeEvents } from 'src/analytics/Events' import AppAnalytics from 'src/analytics/AppAnalytics' +import { FiatExchangeEvents } from 'src/analytics/Events' import FiatConnectQuote from 'src/fiatExchanges/quotes/FiatConnectQuote' -import { CICOFlow } from 'src/fiatExchanges/utils' +import { CICOFlow } from 'src/fiatExchanges/types' import { FiatConnectQuoteSuccess } from 'src/fiatconnect' import KycPending from 'src/fiatconnect/kyc/KycPending' import getNavigationOptions from 'src/fiatconnect/kyc/getNavigationOptions' diff --git a/src/fiatconnect/saga.test.ts b/src/fiatconnect/saga.test.ts index 321321a35e9..fc2fd3dbfd4 100644 --- a/src/fiatconnect/saga.test.ts +++ b/src/fiatconnect/saga.test.ts @@ -25,7 +25,7 @@ import { } from 'src/app/selectors' import FiatConnectQuote from 'src/fiatExchanges/quotes/FiatConnectQuote' import { normalizeFiatConnectQuotes } from 'src/fiatExchanges/quotes/normalizeQuotes' -import { CICOFlow } from 'src/fiatExchanges/utils' +import { CICOFlow } from 'src/fiatExchanges/types' import { FiatConnectProviderInfo, FiatConnectQuoteSuccess, diff --git a/src/fiatconnect/saga.ts b/src/fiatconnect/saga.ts index bbc2de7c697..b22b042a612 100644 --- a/src/fiatconnect/saga.ts +++ b/src/fiatconnect/saga.ts @@ -22,7 +22,7 @@ import { } from 'src/app/selectors' import FiatConnectQuote from 'src/fiatExchanges/quotes/FiatConnectQuote' import { normalizeFiatConnectQuotes } from 'src/fiatExchanges/quotes/normalizeQuotes' -import { CICOFlow } from 'src/fiatExchanges/utils' +import { CICOFlow } from 'src/fiatExchanges/types' import { FiatConnectProviderInfo, FiatConnectQuoteError, diff --git a/src/fiatconnect/slice.test.ts b/src/fiatconnect/slice.test.ts index c97eb733876..fc65d3fc044 100644 --- a/src/fiatconnect/slice.test.ts +++ b/src/fiatconnect/slice.test.ts @@ -1,6 +1,6 @@ import { FiatAccountType, FiatType, KycSchema } from '@fiatconnect/fiatconnect-types' import FiatConnectQuote from 'src/fiatExchanges/quotes/FiatConnectQuote' -import { CICOFlow } from 'src/fiatExchanges/utils' +import { CICOFlow } from 'src/fiatExchanges/types' import { FiatConnectQuoteSuccess } from 'src/fiatconnect' import { CiCoCurrency } from 'src/utils/currencies' import { mockCusdTokenId, mockFiatConnectQuotes } from 'test/values' diff --git a/src/fiatconnect/slice.ts b/src/fiatconnect/slice.ts index bb3d42013ad..d2a5b59e3c9 100644 --- a/src/fiatconnect/slice.ts +++ b/src/fiatconnect/slice.ts @@ -16,7 +16,7 @@ import { } from 'src/fiatconnect' import { FiatAccountSchemaCountryOverrides } from 'src/fiatconnect/types' import FiatConnectQuote from 'src/fiatExchanges/quotes/FiatConnectQuote' -import { CICOFlow } from 'src/fiatExchanges/utils' +import { CICOFlow } from 'src/fiatExchanges/types' import { getRehydratePayload, REHYDRATE, RehydrateAction } from 'src/redux/persist-helper' import { NetworkId } from 'src/transactions/types' import { CiCoCurrency } from 'src/utils/currencies' diff --git a/src/home/ActionsCarousel.test.tsx b/src/home/ActionsCarousel.test.tsx index 9eb8d3912cf..aa1b8c4bff4 100644 --- a/src/home/ActionsCarousel.test.tsx +++ b/src/home/ActionsCarousel.test.tsx @@ -5,7 +5,7 @@ import { MockStoreEnhanced } from 'redux-mock-store' import AppAnalytics from 'src/analytics/AppAnalytics' import { HomeEvents } from 'src/analytics/Events' import * as config from 'src/config' -import { FiatExchangeFlow } from 'src/fiatExchanges/utils' +import { FiatExchangeFlow } from 'src/fiatExchanges/types' import ActionsCarousel from 'src/home/ActionsCarousel' import { HomeActionName } from 'src/home/types' import { navigate } from 'src/navigator/NavigationService' diff --git a/src/home/ActionsCarousel.tsx b/src/home/ActionsCarousel.tsx index 10dbf6a18ba..7af077e8546 100644 --- a/src/home/ActionsCarousel.tsx +++ b/src/home/ActionsCarousel.tsx @@ -6,7 +6,7 @@ import { HomeEvents } from 'src/analytics/Events' import Card from 'src/components/Card' import Touchable from 'src/components/Touchable' import { ENABLED_QUICK_ACTIONS } from 'src/config' -import { FiatExchangeFlow } from 'src/fiatExchanges/utils' +import { FiatExchangeFlow } from 'src/fiatExchanges/types' import { HomeActionName } from 'src/home/types' import QuickActionsAdd from 'src/icons/quick-actions/Add' import QuickActionsReceive from 'src/icons/quick-actions/Receive' diff --git a/src/home/GetStarted.tsx b/src/home/GetStarted.tsx index eca9b7c6bdf..9c1a3ad6e12 100644 --- a/src/home/GetStarted.tsx +++ b/src/home/GetStarted.tsx @@ -4,7 +4,7 @@ import { StyleSheet, Text, View } from 'react-native' import AppAnalytics from 'src/analytics/AppAnalytics' import { FiatExchangeEvents } from 'src/analytics/Events' import Touchable from 'src/components/Touchable' -import { FiatExchangeFlow } from 'src/fiatExchanges/utils' +import { FiatExchangeFlow } from 'src/fiatExchanges/types' import CircledIcon from 'src/icons/CircledIcon' import EarnCoins from 'src/icons/EarnCoins' import ExploreTokens from 'src/icons/ExploreTokens' diff --git a/src/jumpstart/JumpstartIntro.tsx b/src/jumpstart/JumpstartIntro.tsx index 2a7b5ff6825..c6cdf8a8e4f 100644 --- a/src/jumpstart/JumpstartIntro.tsx +++ b/src/jumpstart/JumpstartIntro.tsx @@ -10,7 +10,7 @@ import BackButton from 'src/components/BackButton' import { BottomSheetModalRefType } from 'src/components/BottomSheet' import Button, { BtnSizes, BtnTypes } from 'src/components/Button' import CustomHeader, { CUSTOM_HEADER_HEIGHT } from 'src/components/header/CustomHeader' -import { CICOFlow, FiatExchangeFlow } from 'src/fiatExchanges/utils' +import { CICOFlow, FiatExchangeFlow } from 'src/fiatExchanges/types' import Leaf from 'src/images/Leaf' import WaveCurve from 'src/images/WaveCurve' import { jumpstartIntroSeen } from 'src/jumpstart/slice' diff --git a/src/navigator/types.tsx b/src/navigator/types.tsx index e49625b51bb..c5cfa95d6ef 100644 --- a/src/navigator/types.tsx +++ b/src/navigator/types.tsx @@ -3,7 +3,7 @@ import { SendOrigin, WalletConnectPairingOrigin } from 'src/analytics/types' import { EarnActiveMode, EarnTabType } from 'src/earn/types' import { ExternalExchangeProvider } from 'src/fiatExchanges/ExternalExchanges' import FiatConnectQuote from 'src/fiatExchanges/quotes/FiatConnectQuote' -import { CICOFlow, FiatExchangeFlow, SimplexQuote } from 'src/fiatExchanges/utils' +import { CICOFlow, FiatExchangeFlow, SimplexQuote } from 'src/fiatExchanges/types' import { Props as KycLandingProps } from 'src/fiatconnect/KycLanding' import { FiatAccount } from 'src/fiatconnect/slice' import { KeylessBackupFlow, KeylessBackupOrigin } from 'src/keylessBackup/types' diff --git a/src/onboarding/ChooseYourAdventure.test.tsx b/src/onboarding/ChooseYourAdventure.test.tsx index cdb23622d83..79d5ae268aa 100644 --- a/src/onboarding/ChooseYourAdventure.test.tsx +++ b/src/onboarding/ChooseYourAdventure.test.tsx @@ -4,7 +4,7 @@ import 'react-native' import { Provider } from 'react-redux' import AppAnalytics from 'src/analytics/AppAnalytics' import { OnboardingEvents } from 'src/analytics/Events' -import { FiatExchangeFlow } from 'src/fiatExchanges/utils' +import { FiatExchangeFlow } from 'src/fiatExchanges/types' import { navigate, navigateHome, diff --git a/src/onboarding/ChooseYourAdventure.tsx b/src/onboarding/ChooseYourAdventure.tsx index 04240eddb23..75959ae13aa 100644 --- a/src/onboarding/ChooseYourAdventure.tsx +++ b/src/onboarding/ChooseYourAdventure.tsx @@ -8,7 +8,7 @@ import Card from 'src/components/Card' import DevSkipButton from 'src/components/DevSkipButton' import TextButton from 'src/components/TextButton' import Touchable from 'src/components/Touchable' -import { FiatExchangeFlow } from 'src/fiatExchanges/utils' +import { FiatExchangeFlow } from 'src/fiatExchanges/types' import EarnCoins from 'src/icons/EarnCoins' import PlusIcon from 'src/icons/PlusIcon' import ProfilePlus from 'src/icons/ProfilePlus' diff --git a/src/tokens/TokenDetails.test.tsx b/src/tokens/TokenDetails.test.tsx index 26293e210d1..87ca26a156b 100644 --- a/src/tokens/TokenDetails.test.tsx +++ b/src/tokens/TokenDetails.test.tsx @@ -2,7 +2,7 @@ import { fireEvent, render, waitFor } from '@testing-library/react-native' import React from 'react' import { Provider } from 'react-redux' import AppAnalytics from 'src/analytics/AppAnalytics' -import { CICOFlow } from 'src/fiatExchanges/utils' +import { CICOFlow } from 'src/fiatExchanges/types' import { navigate } from 'src/navigator/NavigationService' import { Screens } from 'src/navigator/Screens' import { Price } from 'src/priceHistory/slice' diff --git a/src/tokens/TokenDetails.tsx b/src/tokens/TokenDetails.tsx index 8aa6db77736..b47096eef0f 100644 --- a/src/tokens/TokenDetails.tsx +++ b/src/tokens/TokenDetails.tsx @@ -15,7 +15,7 @@ import TokenDisplay from 'src/components/TokenDisplay' import TokenIcon, { IconSize } from 'src/components/TokenIcon' import Touchable from 'src/components/Touchable' import CustomHeader from 'src/components/header/CustomHeader' -import { CICOFlow } from 'src/fiatExchanges/utils' +import { CICOFlow } from 'src/fiatExchanges/types' import ArrowRightThick from 'src/icons/ArrowRightThick' import DataDown from 'src/icons/DataDown' import DataUp from 'src/icons/DataUp' diff --git a/src/transactions/feed/TransferFeedItem.test.tsx b/src/transactions/feed/TransferFeedItem.test.tsx index 55d3d4464d0..ecaef7fbd45 100644 --- a/src/transactions/feed/TransferFeedItem.test.tsx +++ b/src/transactions/feed/TransferFeedItem.test.tsx @@ -5,7 +5,7 @@ import { Provider } from 'react-redux' import { ReactTestInstance } from 'react-test-renderer' import { formatShortenedAddress } from 'src/components/ShortenedAddress' import FiatConnectQuote from 'src/fiatExchanges/quotes/FiatConnectQuote' -import { CICOFlow } from 'src/fiatExchanges/utils' +import { CICOFlow } from 'src/fiatExchanges/types' import { FiatConnectQuoteSuccess } from 'src/fiatconnect' import { LocalCurrencyCode } from 'src/localCurrency/consts' import { RootState } from 'src/redux/reducers' diff --git a/test/values.ts b/test/values.ts index 8e14ad89d5d..a312f8726e3 100644 --- a/test/values.ts +++ b/test/values.ts @@ -15,12 +15,8 @@ import { range } from 'lodash' import { MinimalContact } from 'react-native-contacts' import { Dapp, DappWithCategoryNames } from 'src/dapps/types' import { ExternalExchangeProvider } from 'src/fiatExchanges/ExternalExchanges' -import { ProviderSelectionAnalyticsData } from 'src/fiatExchanges/types' -import { - FetchProvidersOutput, - LegacyMobileMoneyProvider, - PaymentMethod, -} from 'src/fiatExchanges/utils' +import { PaymentMethod, ProviderSelectionAnalyticsData } from 'src/fiatExchanges/types' +import { FetchProvidersOutput, LegacyMobileMoneyProvider } from 'src/fiatExchanges/utils' import { FiatConnectProviderInfo, FiatConnectQuoteError,