diff --git a/CHANGELOG.md b/CHANGELOG.md index 28f656281c9..79be93b296d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,9 +2,12 @@ ## Unreleased +- changed: Various strings updated to UK compliance spec - changed: Wording in light account persistent notification - removed: Bank Wire Transfer Buy for Florida - removed: Paypal Sell for Canada +- removed: Moonpay, Simplex, and Paybis for UK +- removed: UK persistent investment risk banner ## 4.15.1 diff --git a/src/actions/FirstOpenActions.tsx b/src/actions/FirstOpenActions.tsx index 64340ed86a1..b0ba34f93b1 100644 --- a/src/actions/FirstOpenActions.tsx +++ b/src/actions/FirstOpenActions.tsx @@ -1,15 +1,17 @@ -import { asNumber, asObject, asString, asValue } from 'cleaners' +import { asNumber, asObject, asOptional, asString, asValue } from 'cleaners' import { makeReactNativeDisklet } from 'disklet' import { FIRST_OPEN } from '../constants/constantSettings' import { makeUuid } from '../util/rnUtils' +import { getCountryCodeByIp } from './AccountReferralActions' const firstOpenDisklet = makeReactNativeDisklet() const asFirstOpenInfo = asObject({ isFirstOpen: asValue('true', 'false'), deviceId: asString, - firstOpenEpoch: asNumber + firstOpenEpoch: asNumber, + countryCode: asOptional(asString) }) type FirstOpenInfo = ReturnType @@ -27,9 +29,15 @@ export const getFirstOpenInfo = async (): Promise => { firstOpenText = await firstOpenDisklet.getText(FIRST_OPEN) firstOpenInfo = asFirstOpenInfo(JSON.parse(firstOpenText)) firstOpenInfo.isFirstOpen = 'false' + + if (firstOpenInfo.countryCode == null) { + // Not critical if we can't get the country code + firstOpenInfo.countryCode = await getCountryCodeByIp().catch(() => undefined) + } } catch (error: any) { // Generate new values. firstOpenInfo = { + countryCode: await getCountryCodeByIp(), deviceId: await makeUuid(), firstOpenEpoch: Date.now(), // If firstOpen != null: This is not the first time they opened the app, diff --git a/src/actions/LoginActions.tsx b/src/actions/LoginActions.tsx index b58b932ab23..6c9d33b274b 100644 --- a/src/actions/LoginActions.tsx +++ b/src/actions/LoginActions.tsx @@ -10,7 +10,6 @@ import { readSyncedSettings } from '../actions/SettingsActions' import { ConfirmContinueModal } from '../components/modals/ConfirmContinueModal' import { FioCreateHandleModal } from '../components/modals/FioCreateHandleModal' import { SurveyModal } from '../components/modals/SurveyModal' -import { AlertDropdown } from '../components/navigation/AlertDropdown' import { Airship, showError } from '../components/services/AirshipInstance' import { ENV } from '../env' import { getExperimentConfig } from '../experimentConfig' @@ -23,8 +22,8 @@ import { NavigationBase, NavigationProp } from '../types/routerTypes' import { currencyCodesToEdgeAssets } from '../util/CurrencyInfoHelpers' import { logActivity } from '../util/logger' import { logEvent, trackError } from '../util/tracking' -import { openLink, runWithTimeout } from '../util/utils' -import { getCountryCodeByIp, loadAccountReferral, refreshAccountReferral } from './AccountReferralActions' +import { runWithTimeout } from '../util/utils' +import { loadAccountReferral, refreshAccountReferral } from './AccountReferralActions' import { getUniqueWalletName } from './CreateWalletActions' import { getDeviceSettings, writeIsSurveyDiscoverShown } from './DeviceSettingsActions' import { readLocalAccountSettings } from './LocalSettingsActions' @@ -267,20 +266,6 @@ export function initializeAccount(navigation: NavigationBase, account: EdgeAccou await Airship.show(bridge => ) await writeIsSurveyDiscoverShown(true) } - - if ((await getCountryCodeByIp()) === 'GB') { - await Airship.show(bridge => ( - { - await openLink('https://edge.app/due-diligence/') - }} - /> - )) - } } } diff --git a/src/actions/ScanActions.tsx b/src/actions/ScanActions.tsx index e990e839eb5..c435be6c7ca 100644 --- a/src/actions/ScanActions.tsx +++ b/src/actions/ScanActions.tsx @@ -19,9 +19,11 @@ import { getCurrencyCode } from '../util/CurrencyInfoHelpers' import { parseDeepLink } from '../util/DeepLinkParser' import { logActivity } from '../util/logger' import { makeCurrencyCodeTable, upgradeCurrencyCodes } from '../util/tokenIdTools' +import { getUkCompliantString } from '../util/ukComplianceUtils' import { getPluginIdFromChainCode, toListString, zeroString } from '../util/utils' import { cleanQueryFlags, openBrowserUri } from '../util/WebUtils' import { checkAndShowLightBackupModal } from './BackupModalActions' +import { getFirstOpenInfo } from './FirstOpenActions' /** * Handle Request for Address Links (WIP - pending refinement). @@ -340,6 +342,7 @@ const shownWalletGetCryptoModals: string[] = [] export function checkAndShowGetCryptoModal(navigation: NavigationBase, wallet: EdgeCurrencyWallet, tokenId: EdgeTokenId): ThunkAction> { return async dispatch => { try { + const { countryCode } = await getFirstOpenInfo() const currencyCode = getCurrencyCode(wallet, tokenId) // check if balance is zero const balance = wallet.balanceMap.get(tokenId) @@ -355,7 +358,7 @@ export function checkAndShowGetCryptoModal(navigation: NavigationBase, wallet: E title={lstrings.buy_crypto_modal_title} message={messageSyntax} buttons={{ - buy: { label: sprintf(lstrings.buy_crypto_modal_buy_action, currencyCode) }, + buy: { label: getUkCompliantString(countryCode, 'buy_1s', currencyCode) }, exchange: { label: lstrings.buy_crypto_modal_exchange, type: 'primary' }, decline: { label: lstrings.buy_crypto_decline } }} diff --git a/src/components/Main.tsx b/src/components/Main.tsx index f9f3853edee..f66d139da24 100644 --- a/src/components/Main.tsx +++ b/src/components/Main.tsx @@ -6,6 +6,7 @@ import * as React from 'react' import { Platform } from 'react-native' import { getDeviceSettings } from '../actions/DeviceSettingsActions' +import { getFirstOpenInfo } from '../actions/FirstOpenActions' import { SwapCreateScene as SwapCreateSceneComponent } from '../components/scenes/SwapCreateScene' import { ENV } from '../env' import { DEFAULT_EXPERIMENT_CONFIG, ExperimentConfig, getExperimentConfig } from '../experimentConfig' @@ -33,6 +34,7 @@ import { } from '../types/routerTypes' import { isMaestro } from '../util/maestro' import { logEvent } from '../util/tracking' +import { getUkCompliantString } from '../util/ukComplianceUtils' import { ifLoggedIn } from './hoc/IfLoggedIn' import { BackButton } from './navigation/BackButton' import { CurrencySettingsTitle } from './navigation/CurrencySettingsTitle' @@ -423,6 +425,16 @@ const EdgeTabs = () => { // ------------------------------------------------------------------------- const EdgeAppStack = () => { + const [countryCode, setCountryCode] = React.useState() + + useAsyncEffect( + async () => { + setCountryCode((await getFirstOpenInfo()).countryCode) + }, + [], + 'EdgeAppStack' + ) + return ( { name="earnScene" component={EarnScene} options={{ - title: lstrings.stake_earn_button_label + title: getUkCompliantString(countryCode, 'stake_earn_button_label') }} /> diff --git a/src/components/cards/StakingReturnsCard.tsx b/src/components/cards/StakingReturnsCard.tsx index 07596ba4467..556acea8d61 100644 --- a/src/components/cards/StakingReturnsCard.tsx +++ b/src/components/cards/StakingReturnsCard.tsx @@ -7,6 +7,7 @@ import { toPercentString } from '../../locales/intl' import { lstrings } from '../../locales/strings' import { StakePolicy } from '../../plugins/stake-plugins/types' import { getPolicyIconUris } from '../../util/stakeUtils' +import { getUkCompliantString } from '../../util/ukComplianceUtils' import { PairIcons } from '../icons/PairIcons' import { cacheStyles, Theme, useTheme } from '../services/ThemeContext' import { TitleText } from '../text/TitleText' @@ -17,6 +18,7 @@ interface Props { stakePolicy: StakePolicy wallet: EdgeCurrencyWallet + countryCode?: string /** If false, show "Stake"/"Earn" * If true, show "Staked"/"Earned" */ isOpenPosition?: boolean @@ -27,7 +29,7 @@ export function StakingReturnsCard(props: Props) { const theme = useTheme() const styles = getStyles(theme) - const { stakePolicy, wallet, isOpenPosition, onPress } = props + const { stakePolicy, wallet, isOpenPosition, countryCode, onPress } = props const { apy, yieldType, stakeProviderInfo } = stakePolicy const { stakeAssets, rewardAssets } = stakePolicy @@ -35,7 +37,9 @@ export function StakingReturnsCard(props: Props) { const rewardCurrencyCodes = rewardAssets.map(asset => asset.currencyCode).join(', ') const stakeText = sprintf(isOpenPosition ? lstrings.stake_staked_1s : lstrings.stake_stake_1s, stakeCurrencyCodes) - const rewardText = sprintf(isOpenPosition ? lstrings.stake_earning_1s : lstrings.stake_earn_1s, rewardCurrencyCodes) + const rewardText = isOpenPosition + ? sprintf(lstrings.stake_earning_1s, rewardCurrencyCodes) + : getUkCompliantString(countryCode, 'stake_earn_1s', rewardCurrencyCodes) const policyIcons = getPolicyIconUris(wallet.currencyInfo, stakePolicy) diff --git a/src/components/modals/InsufficientFeesModal.tsx b/src/components/modals/InsufficientFeesModal.tsx index d18e23a9c53..ac171a1d695 100644 --- a/src/components/modals/InsufficientFeesModal.tsx +++ b/src/components/modals/InsufficientFeesModal.tsx @@ -8,6 +8,7 @@ import { useHandler } from '../../hooks/useHandler' import { lstrings } from '../../locales/strings' import { NavigationBase } from '../../types/routerTypes' import { getCurrencyCode } from '../../util/CurrencyInfoHelpers' +import { getUkCompliantString } from '../../util/ukComplianceUtils' import { roundedFee } from '../../util/utils' import { ButtonsView } from '../buttons/ButtonsView' import { Paragraph } from '../themed/EdgeText' @@ -19,6 +20,7 @@ interface Props { navigation: NavigationBase wallet: EdgeCurrencyWallet + countryCode?: string // Called when the user wants to swap. // The default behavior is to navigate to the swap scene, // but the swap scene itself needs a different behavior here. @@ -29,7 +31,7 @@ interface Props { * Show this modal when the wallet doesn't have enough funds to cover fees. */ export function InsufficientFeesModal(props: Props) { - const { bridge, coreError, navigation, wallet, onSwap } = props + const { bridge, countryCode, coreError, navigation, wallet, onSwap } = props // Get the display amount: const { tokenId, networkFee = '' } = coreError @@ -59,7 +61,7 @@ export function InsufficientFeesModal(props: Props) { {message} diff --git a/src/components/scenes/GuiPluginListScene.tsx b/src/components/scenes/GuiPluginListScene.tsx index 63e64a0272b..0bd9463fbb5 100644 --- a/src/components/scenes/GuiPluginListScene.tsx +++ b/src/components/scenes/GuiPluginListScene.tsx @@ -6,7 +6,6 @@ import { Image, ListRenderItemInfo, Platform, View } from 'react-native' import { getBuildNumber, getVersion } from 'react-native-device-info' import FastImage from 'react-native-fast-image' import Animated from 'react-native-reanimated' -import { sprintf } from 'sprintf-js' import { checkAndShowLightBackupModal } from '../../actions/BackupModalActions' import { checkAndSetRegion, showCountrySelectionModal } from '../../actions/CountryListActions' @@ -37,6 +36,7 @@ import { filterGuiPluginJson } from '../../util/GuiPluginTools' import { infoServerData } from '../../util/network' import { bestOfPlugins } from '../../util/ReferralHelpers' import { logEvent, OnLogEvent } from '../../util/tracking' +import { getUkCompliantString } from '../../util/ukComplianceUtils' import { base58ToUuid, getOsVersion } from '../../util/utils' import { EdgeCard } from '../cards/EdgeCard' import { filterInfoCards } from '../cards/InfoCardCarousel' @@ -404,7 +404,7 @@ class GuiPluginList extends React.PureComponent { const titleAsset = forcedWalletResult == null || forcedWalletResult.type !== 'wallet' || forcedWallet == null ? lstrings.cryptocurrency - : getCurrencyCodeWithAccount(account, forcedWallet.currencyInfo.pluginId, forcedWalletResult.tokenId ?? null) + : getCurrencyCodeWithAccount(account, forcedWallet.currencyInfo.pluginId, forcedWalletResult.tokenId) ?? '' const countryCard = stateProvinceData == null ? ( @@ -419,7 +419,7 @@ class GuiPluginList extends React.PureComponent { <> diff --git a/src/components/scenes/MigrateWalletCalculateFeeScene.tsx b/src/components/scenes/MigrateWalletCalculateFeeScene.tsx index dbe6e809bc9..24fa3fba9a0 100644 --- a/src/components/scenes/MigrateWalletCalculateFeeScene.tsx +++ b/src/components/scenes/MigrateWalletCalculateFeeScene.tsx @@ -4,6 +4,7 @@ import * as React from 'react' import { ActivityIndicator, ListRenderItemInfo, View } from 'react-native' import { FlatList } from 'react-native-gesture-handler' +import { getFirstOpenInfo } from '../../actions/FirstOpenActions' import { SCROLL_INDICATOR_INSET_FIX } from '../../constants/constantSettings' import { SPECIAL_CURRENCY_INFO } from '../../constants/WalletAndCurrencyConstants' import { useAsyncEffect } from '../../hooks/useAsyncEffect' @@ -124,7 +125,8 @@ const MigrateWalletCalculateFeeComponent = (props: Props) => { }) const handleInsufficientFunds = useHandler(async (wallet, error) => { - await Airship.show(bridge => ) + const { countryCode } = await getFirstOpenInfo() + await Airship.show(bridge => ) }) const handleSlidingComplete = useHandler(() => { diff --git a/src/components/scenes/SendScene2.tsx b/src/components/scenes/SendScene2.tsx index a5cb44a973d..229b37ecdb4 100644 --- a/src/components/scenes/SendScene2.tsx +++ b/src/components/scenes/SendScene2.tsx @@ -16,6 +16,7 @@ import { ActivityIndicator, TextInput, View } from 'react-native' import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view' import { sprintf } from 'sprintf-js' +import { getFirstOpenInfo } from '../../actions/FirstOpenActions' import { showSendScamWarningModal } from '../../actions/ScamWarningActions' import { checkAndShowGetCryptoModal } from '../../actions/ScanActions' import { playSendSound } from '../../actions/SoundActions' @@ -215,7 +216,10 @@ const SendComponent = (props: Props) => { const pendingInsufficientFees = React.useRef(undefined) async function showInsufficientFeesModal(error: InsufficientFundsError): Promise { - await Airship.show(bridge => ) + const { countryCode } = await getFirstOpenInfo() + await Airship.show(bridge => ( + + )) } const handleChangeAddress = diff --git a/src/components/scenes/Staking/StakeOptionsScene.tsx b/src/components/scenes/Staking/StakeOptionsScene.tsx index af553a85202..02bddfbf2f2 100644 --- a/src/components/scenes/Staking/StakeOptionsScene.tsx +++ b/src/components/scenes/Staking/StakeOptionsScene.tsx @@ -4,7 +4,9 @@ import { View } from 'react-native' import { FlatList } from 'react-native-gesture-handler' import { sprintf } from 'sprintf-js' +import { getFirstOpenInfo } from '../../../actions/FirstOpenActions' import { SCROLL_INDICATOR_INSET_FIX } from '../../../constants/constantSettings' +import { useAsyncEffect } from '../../../hooks/useAsyncEffect' import { useIconColor } from '../../../hooks/useIconColor' import { lstrings } from '../../../locales/strings' import { StakePlugin, StakePolicy, StakePositionMap } from '../../../plugins/stake-plugins/types' @@ -46,6 +48,16 @@ const StakeOptionsSceneComponent = (props: Props) => { const tokenId = pluginId ? getTokenIdForced(account, pluginId, currencyCode) : null const iconColor = useIconColor({ pluginId, tokenId }) + const [countryCode, setCountryCode] = React.useState() + + useAsyncEffect( + async () => { + setCountryCode((await getFirstOpenInfo()).countryCode) + }, + [], + 'StakeOptionsSceneComponent' + ) + // // Handlers // @@ -64,7 +76,7 @@ const StakeOptionsSceneComponent = (props: Props) => { const renderOptions = ({ item }: { item: StakePolicy }) => { const primaryText = getPolicyAssetName(item, 'stakeAssets') - const secondaryText = getPolicyTitleName(item) + const secondaryText = getPolicyTitleName(item, countryCode) const key = [primaryText, secondaryText].join() const policyIcons = getPolicyIconUris(wallet.currencyInfo, item) return ( diff --git a/src/components/scenes/Staking/StakeOverviewScene.tsx b/src/components/scenes/Staking/StakeOverviewScene.tsx index a94b8f1d6d9..2d12892694e 100644 --- a/src/components/scenes/Staking/StakeOverviewScene.tsx +++ b/src/components/scenes/Staking/StakeOverviewScene.tsx @@ -4,6 +4,7 @@ import { View } from 'react-native' import { FlatList } from 'react-native-gesture-handler' import { sprintf } from 'sprintf-js' +import { getFirstOpenInfo } from '../../../actions/FirstOpenActions' import { SCROLL_INDICATOR_INSET_FIX } from '../../../constants/constantSettings' import { useAsyncEffect } from '../../../hooks/useAsyncEffect' import { lstrings } from '../../../locales/strings' @@ -60,6 +61,7 @@ const StakeOverviewSceneComponent = (props: Props) => { const [rewardAllocations, setRewardAllocations] = React.useState([]) const [unstakedAllocations, setUnstakedAllocations] = React.useState([]) const [stakePosition, setStakePosition] = React.useState(startingStakePosition) + const [countryCode, setCountryCode] = React.useState() // Background loop to force fetchStakePosition updates const [updateCounter, setUpdateCounter] = React.useState(0) @@ -73,6 +75,8 @@ const StakeOverviewSceneComponent = (props: Props) => { useAsyncEffect( async () => { + setCountryCode((await getFirstOpenInfo()).countryCode) + let sp: StakePosition try { if (stakePosition == null) { @@ -97,7 +101,7 @@ const StakeOverviewSceneComponent = (props: Props) => { // Handlers const handleModifyPress = (modification: ChangeQuoteRequest['action'] | 'unstakeAndClaim') => () => { const sceneTitleMap = { - stake: getPolicyTitleName(stakePolicy), + stake: getPolicyTitleName(stakePolicy, countryCode), claim: lstrings.stake_claim_rewards, unstake: lstrings.stake_unstake, unstakeAndClaim: lstrings.stake_unstake_claim, @@ -146,7 +150,7 @@ const StakeOverviewSceneComponent = (props: Props) => { return ( - + {stakePosition == null ? ( <> diff --git a/src/components/scenes/SwapProcessingScene.tsx b/src/components/scenes/SwapProcessingScene.tsx index 7c257a6f645..bab1dcf6271 100644 --- a/src/components/scenes/SwapProcessingScene.tsx +++ b/src/components/scenes/SwapProcessingScene.tsx @@ -12,6 +12,7 @@ import { import * as React from 'react' import { sprintf } from 'sprintf-js' +import { getFirstOpenInfo } from '../../actions/FirstOpenActions' import { useDisplayDenom } from '../../hooks/useDisplayDenom' import { lstrings } from '../../locales/strings' import { useSelector } from '../../types/reactRedux' @@ -67,8 +68,15 @@ export function SwapProcessingScene(props: Props) { const insufficientFunds = asMaybeInsufficientFundsError(error) if (insufficientFunds != null && swapRequest.fromTokenId !== insufficientFunds.tokenId) { + const { countryCode } = await getFirstOpenInfo() await Airship.show(bridge => ( - + )) } } diff --git a/src/components/scenes/SweepPrivateKeyCalculateFeeScene.tsx b/src/components/scenes/SweepPrivateKeyCalculateFeeScene.tsx index 9cc52ba773a..118b576ca3a 100644 --- a/src/components/scenes/SweepPrivateKeyCalculateFeeScene.tsx +++ b/src/components/scenes/SweepPrivateKeyCalculateFeeScene.tsx @@ -12,6 +12,7 @@ import * as React from 'react' import { ActivityIndicator, ListRenderItemInfo, View } from 'react-native' import { FlatList } from 'react-native-gesture-handler' +import { getFirstOpenInfo } from '../../actions/FirstOpenActions' import { SCROLL_INDICATOR_INSET_FIX } from '../../constants/constantSettings' import { useAsyncEffect } from '../../hooks/useAsyncEffect' import { useHandler } from '../../hooks/useHandler' @@ -110,7 +111,8 @@ const SweepPrivateKeyCalculateFeeComponent = (props: Props) => { }) const handleInsufficientFunds = useHandler(async (wallet, error) => { - await Airship.show(bridge => ) + const { countryCode } = await getFirstOpenInfo() + await Airship.show(bridge => ) }) const handleSlidingComplete = useHandler(() => { diff --git a/src/components/themed/TransactionListTop.tsx b/src/components/themed/TransactionListTop.tsx index 0292e809c3f..62e0a77de2f 100644 --- a/src/components/themed/TransactionListTop.tsx +++ b/src/components/themed/TransactionListTop.tsx @@ -11,6 +11,7 @@ import Ionicons from 'react-native-vector-icons/Ionicons' import { sprintf } from 'sprintf-js' import { checkAndShowLightBackupModal } from '../../actions/BackupModalActions' +import { getFirstOpenInfo } from '../../actions/FirstOpenActions' import { toggleAccountBalanceVisibility } from '../../actions/LocalSettingsActions' import { getFiatSymbol, SPECIAL_CURRENCY_INFO } from '../../constants/WalletAndCurrencyConstants' import { ENV } from '../../env' @@ -31,6 +32,7 @@ import { GuiExchangeRates } from '../../types/types' import { CryptoAmount } from '../../util/CryptoAmount' import { triggerHaptic } from '../../util/haptic' import { getFioStakingBalances, getPluginFromPolicy, getPositionAllocations } from '../../util/stakeUtils' +import { getUkCompliantString } from '../../util/ukComplianceUtils' import { convertNativeToDenomination, datelog, DECIMAL_PRECISION, removeIsoPrefix, zeroString } from '../../util/utils' import { IconButton } from '../buttons/IconButton' import { EdgeCard } from '../cards/EdgeCard' @@ -40,7 +42,7 @@ import { CryptoIcon } from '../icons/CryptoIcon' import { EdgeModal } from '../modals/EdgeModal' import { WalletListMenuModal } from '../modals/WalletListMenuModal' import { WalletListModal, WalletListResult } from '../modals/WalletListModal' -import { Airship, showError } from '../services/AirshipInstance' +import { Airship, showDevError, showError } from '../services/AirshipInstance' import { cacheStyles, Theme, ThemeProps, useTheme } from '../services/ThemeContext' import { DividerLine } from './DividerLine' import { EdgeText } from './EdgeText' @@ -95,6 +97,7 @@ interface DispatchProps { } interface State { + countryCode: string | undefined input: string stakePolicies: StakePolicy[] | null stakePlugins: StakePlugin[] | null @@ -108,6 +111,7 @@ export class TransactionListTopComponent extends React.PureComponent showError(err)) + getFirstOpenInfo() + .then(firstOpenInfo => this.setState({ countryCode: firstOpenInfo.countryCode })) + .catch(err => showDevError(err)) } updatePluginsAndPolicies = async () => { @@ -244,7 +251,7 @@ export class TransactionListTopComponent extends React.PureComponent this.handleTradeBuy(bridge)} icon={ @@ -255,7 +262,7 @@ export class TransactionListTopComponent extends React.PureComponent this.handleTradeSell(bridge)} icon={ @@ -525,7 +532,7 @@ export class TransactionListTopComponent extends React.PureComponent ) : ( isStakingAvailable && ( - + ) diff --git a/src/constants/txActionConstants.ts b/src/constants/txActionConstants.ts index fbca05b3f20..69a65edeb4b 100644 --- a/src/constants/txActionConstants.ts +++ b/src/constants/txActionConstants.ts @@ -3,10 +3,10 @@ import { EdgeAssetActionType } from 'edge-core-js' import { lstrings } from '../locales/strings' export const TX_ACTION_LABEL_MAP: Record = { - buy: lstrings.fiat_plugin_buy_currencycode, + buy: lstrings.transaction_details_bought_1s, claim: lstrings.transaction_details_claim, claimOrder: lstrings.transaction_details_claim_order, - sell: lstrings.fiat_plugin_sell_currencycode_s, + sell: lstrings.transaction_details_sold_1s, sellNetworkFee: lstrings.fiat_plugin_sell_network_fee, swap: lstrings.transaction_details_swap, swapNetworkFee: lstrings.transaction_details_swap_network_fee, diff --git a/src/locales/en_US.ts b/src/locales/en_US.ts index fe1af80e3b8..6f6460e2858 100644 --- a/src/locales/en_US.ts +++ b/src/locales/en_US.ts @@ -125,7 +125,6 @@ const strings = { warning_token_code_override_2s: 'The entered contract address differs from the contract address of built-in token %1$s. Please proceed with caution and verify the contract is legitimate as use of this token can result in loss of funds. If you have questions about this feature or contract please contact %2$s.', warning_token_exists_1s: 'The entered token already exists as a built-in token %1$s', - warning_uk_risk: `Don't invest unless you're prepared to lose all the money you invest. This is a high-risk investment and you should not expect to be protected if something goes wrong. Take 2 min to learn more.`, warning_battery_saver: `Battery Saver mode detected. Balances and transactions may be inaccurate`, // Alert component: @@ -654,10 +653,10 @@ const strings = { title_edit_token: 'Edit Token', title_add_token: 'Add Token', title_password_recovery: 'Password Recovery', - title_plugin_buy_s: 'Buy %1$s', + transaction_details_bought_1s: 'Buy %1$s', title_select_region: 'Select Region', title_select_payment_method: 'Select Payment Method', - title_plugin_sell_s: 'Sell %1$s', + transaction_details_sold_1s: 'Sell %1$s', title_otp: '2-Factor Security', title_register_fio_address: 'Register FIO Address', title_register_fio_domain: 'Register FIO Domain', @@ -836,7 +835,8 @@ const strings = { buy_parent_crypto_modal_message_3s: '%1$s%2$s (on %3$s) is required to send this transaction. Would you like to buy %2$s or exchange another crypto into %2$s?', buy_crypto_decline: 'Not at this time', - buy_crypto_modal_buy_action: 'Buy %s', + buy_1s: 'Buy %1$s', + sell_1s: 'Sell %1$s', buy_crypto_modal_exchange: 'Exchange', exchange_crypto_modal_message: 'Your %s wallet is empty. Would you like to exchange another crypto into %s?', private_key_modal_sweep_from_private_address: 'Sweep Funds From Private Key', @@ -1441,8 +1441,6 @@ const strings = { fiat_plugin_select_asset_to_purchase: 'Select Asset to Purchase', fiat_plugin_select_asset_to_sell: 'Select Asset to Sell', - fiat_plugin_buy_currencycode: 'Buy %s', // TODO: string key convention - fiat_plugin_sell_currencycode_s: 'Sell %s', fiat_plugin_sell_network_fee: 'Sell Network Fee', fiat_plugin_amount_currencycode: 'Amount %s', fiat_plugin_buy_amount_over_limit: 'Max purchase amount is %s', @@ -1637,6 +1635,13 @@ const strings = { // #endregion Home + // #region UK Compliance + + uk_ways_to_buy_1s: 'Ways to Buy %1$s', + uk_ways_to_sell_1s: 'Ways to Sell %1$s', + + // #endregion UK Compliance + redacted_placeholder: '●●●●', insufficient_funds_2s: 'Insufficient %1$s (%2$s).', split_from_1s: 'Split from %1$s', diff --git a/src/locales/strings/de.json b/src/locales/strings/de.json index ee9fc90a3ef..f880b8ffe3e 100644 --- a/src/locales/strings/de.json +++ b/src/locales/strings/de.json @@ -586,10 +586,10 @@ "title_edit_token": "Token hinzufügen", "title_add_token": "Token hinzufügen", "title_password_recovery": "Passwort-Wiederherstellung", - "title_plugin_buy_s": "Buy %1$s", + "transaction_details_bought_1s": "Buy %1$s", "title_select_region": "Select Region", "title_select_payment_method": "Select Payment Method", - "title_plugin_sell_s": "Sell %1$s", + "transaction_details_sold_1s": "Sell %1$s", "title_otp": "2-Faktor Sicherheit", "title_register_fio_address": "FIO-Adresse registrieren", "title_register_fio_domain": "FIO-Domain registrieren", @@ -745,7 +745,8 @@ "buy_parent_crypto_modal_message_2s": "%1$s%2$s is required to send this transaction. Would you like to buy %2$s or exchange another crypto into %2$s?", "buy_parent_crypto_modal_message_3s": "%1$s%2$s (on %3$s) is required to send this transaction. Would you like to buy %2$s or exchange another crypto into %2$s?", "buy_crypto_decline": "Momentan nicht", - "buy_crypto_modal_buy_action": "%s Kaufen ", + "buy_1s": "%1$s Kaufen", + "sell_1s": "Sell %1$s", "buy_crypto_modal_exchange": "Tauschen", "exchange_crypto_modal_message": "Deine %s -Wallet ist leer. Möchtest du eine andere Kryptowährung in %s tauschen?", "private_key_modal_sweep_from_private_address": "Guthaben vom privaten Schlüssel verwerfen", diff --git a/src/locales/strings/enUS.json b/src/locales/strings/enUS.json index 52ca4bc2902..8d72caa8852 100644 --- a/src/locales/strings/enUS.json +++ b/src/locales/strings/enUS.json @@ -80,7 +80,6 @@ "warning_scam_message_yes_1s": "Please proceed with caution! Assistance with account creation has the potential for fraud. Users should never share passwords or private keys. Social media and chat platforms have been involved in attacks. Do not send cryptocurrency to strangers. If you believe you’re being taken advantage of, please contact our support team at %1$s.", "warning_token_code_override_2s": "The entered contract address differs from the contract address of built-in token %1$s. Please proceed with caution and verify the contract is legitimate as use of this token can result in loss of funds. If you have questions about this feature or contract please contact %2$s.", "warning_token_exists_1s": "The entered token already exists as a built-in token %1$s", - "warning_uk_risk": "Don't invest unless you're prepared to lose all the money you invest. This is a high-risk investment and you should not expect to be protected if something goes wrong. Take 2 min to learn more.", "warning_battery_saver": "Battery Saver mode detected. Balances and transactions may be inaccurate", "alert_dropdown_alert": "Alert! ", "alert_dropdown_warning": "Warning! ", @@ -586,10 +585,10 @@ "title_edit_token": "Edit Token", "title_add_token": "Add Token", "title_password_recovery": "Password Recovery", - "title_plugin_buy_s": "Buy %1$s", + "transaction_details_bought_1s": "Buy %1$s", "title_select_region": "Select Region", "title_select_payment_method": "Select Payment Method", - "title_plugin_sell_s": "Sell %1$s", + "transaction_details_sold_1s": "Sell %1$s", "title_otp": "2-Factor Security", "title_register_fio_address": "Register FIO Address", "title_register_fio_domain": "Register FIO Domain", @@ -745,7 +744,8 @@ "buy_parent_crypto_modal_message_2s": "%1$s%2$s is required to send this transaction. Would you like to buy %2$s or exchange another crypto into %2$s?", "buy_parent_crypto_modal_message_3s": "%1$s%2$s (on %3$s) is required to send this transaction. Would you like to buy %2$s or exchange another crypto into %2$s?", "buy_crypto_decline": "Not at this time", - "buy_crypto_modal_buy_action": "Buy %s", + "buy_1s": "Buy %1$s", + "sell_1s": "Sell %1$s", "buy_crypto_modal_exchange": "Exchange", "exchange_crypto_modal_message": "Your %s wallet is empty. Would you like to exchange another crypto into %s?", "private_key_modal_sweep_from_private_address": "Sweep Funds From Private Key", @@ -1270,8 +1270,6 @@ "stake_resource_energy": "Energy", "fiat_plugin_select_asset_to_purchase": "Select Asset to Purchase", "fiat_plugin_select_asset_to_sell": "Select Asset to Sell", - "fiat_plugin_buy_currencycode": "Buy %s", - "fiat_plugin_sell_currencycode_s": "Sell %s", "fiat_plugin_sell_network_fee": "Sell Network Fee", "fiat_plugin_amount_currencycode": "Amount %s", "fiat_plugin_buy_amount_over_limit": "Max purchase amount is %s", @@ -1368,7 +1366,8 @@ "backup_web3_handle_warning_message": "Without a backup, you risk losing your web3 handle!", "tap_to_learn_more": "Tap to learn more.", "backup_for_transfer_message": "To buy, sell, and receive funds, please create a full account. %1$s full accounts require no personal information and use a familiar username and password method that will safeguard your assets and help prevent loss of funds.\n\nNever share your username and password, and store your credentials securely!", - "backup_notification_body": "Funds will be lost if your device is lost, stolen, or %1$s is uninstalled. Create a username and password to secure your funds.", + "backup_notification_title": "Create Username & Password", + "backup_notification_body": "Funds will be lost if your device is lost or %1$s is uninstalled.", "backup_title": "Create Full Account", "backup_message": "Create a username and password to continue.", "backup_message_subtext": "Creating a full account ensures you can safely recover your funds in the event that you lose access to your device.", @@ -1415,6 +1414,8 @@ "title_support": "Need Support?", "body_support": "Contact our team of experts to troubleshoot your crypto needs", "button_support": "Contact Support", + "uk_ways_to_buy_1s": "Ways to Buy %1$s", + "uk_ways_to_sell_1s": "Ways to Sell %1$s", "redacted_placeholder": "●●●●", "insufficient_funds_2s": "Insufficient %1$s (%2$s).", "split_from_1s": "Split from %1$s", diff --git a/src/locales/strings/es.json b/src/locales/strings/es.json index a13670ed3f4..a3b9d2ba873 100644 --- a/src/locales/strings/es.json +++ b/src/locales/strings/es.json @@ -586,10 +586,10 @@ "title_edit_token": "Editar token", "title_add_token": "Añadir Token", "title_password_recovery": "Recuperación de contraseña", - "title_plugin_buy_s": "Buy %1$s", + "transaction_details_bought_1s": "Buy %1$s", "title_select_region": "Select Region", "title_select_payment_method": "Select Payment Method", - "title_plugin_sell_s": "Sell %1$s", + "transaction_details_sold_1s": "Sell %1$s", "title_otp": "Seguridad de 2 factores", "title_register_fio_address": "Registrar dirección FIO", "title_register_fio_domain": "Registrar dominio FIO", @@ -745,7 +745,8 @@ "buy_parent_crypto_modal_message_2s": "%1$s%2$s is required to send this transaction. Would you like to buy %2$s or exchange another crypto into %2$s?", "buy_parent_crypto_modal_message_3s": "%1$s%2$s (on %3$s) is required to send this transaction. Would you like to buy %2$s or exchange another crypto into %2$s?", "buy_crypto_decline": "No en este momento", - "buy_crypto_modal_buy_action": "Comprar %s", + "buy_1s": "Comprar %1$s", + "sell_1s": "Sell %1$s", "buy_crypto_modal_exchange": "Cambiar", "exchange_crypto_modal_message": "Tu cartera %s está vacía. ¿Quieres cambiar otra cripto a %s?", "private_key_modal_sweep_from_private_address": "Barrer fondos de clave privada", diff --git a/src/locales/strings/esMX.json b/src/locales/strings/esMX.json index d98af4ce87c..0268f30f9e7 100644 --- a/src/locales/strings/esMX.json +++ b/src/locales/strings/esMX.json @@ -586,10 +586,10 @@ "title_edit_token": "Editar token", "title_add_token": "Añadir token", "title_password_recovery": "Recuperación de contraseña", - "title_plugin_buy_s": "Comprar %1$s", + "transaction_details_bought_1s": "Comprar %1$s", "title_select_region": "Seleccionar región", "title_select_payment_method": "Seleccione el método de pago", - "title_plugin_sell_s": "Enviado %1$s", + "transaction_details_sold_1s": "Enviado %1$s", "title_otp": "Seguridad de 2 factores", "title_register_fio_address": "Registrar dirección FIO", "title_register_fio_domain": "Registrar dominio FIO", @@ -745,7 +745,8 @@ "buy_parent_crypto_modal_message_2s": "Se requiere %1$s%2$s para enviar esta transacción. ¿Te gustaría comprar %2$s o cambiar otra criptomoneda por %2$s?", "buy_parent_crypto_modal_message_3s": "Se requiere %1$s%2$s (en %3$s) para enviar esta transacción. ¿Te gustaría comprar %2$s o cambiar otra criptomoneda por %2$s?", "buy_crypto_decline": "No en este momento", - "buy_crypto_modal_buy_action": "Comprar %s", + "buy_1s": "Comprar %1$s", + "sell_1s": "Sell %1$s", "buy_crypto_modal_exchange": "Cambiar", "exchange_crypto_modal_message": "Tu cartera %s está vacía. ¿Quieres cambiar otra cripto a %s?", "private_key_modal_sweep_from_private_address": "Barrer fondos de clave privada", diff --git a/src/locales/strings/fr.json b/src/locales/strings/fr.json index 7badf842654..228633391d7 100644 --- a/src/locales/strings/fr.json +++ b/src/locales/strings/fr.json @@ -586,10 +586,10 @@ "title_edit_token": "Modifier les Tokens", "title_add_token": "Ajouter les tokens", "title_password_recovery": "Récupération du mot de passe", - "title_plugin_buy_s": "Buy %1$s", + "transaction_details_bought_1s": "Buy %1$s", "title_select_region": "Select Region", "title_select_payment_method": "Select Payment Method", - "title_plugin_sell_s": "Sell %1$s", + "transaction_details_sold_1s": "Sell %1$s", "title_otp": "2-Factor Security", "title_register_fio_address": "Register FIO Address", "title_register_fio_domain": "Register FIO Domain", @@ -745,7 +745,7 @@ "buy_parent_crypto_modal_message_2s": "%1$s%2$s is required to send this transaction. Would you like to buy %2$s or exchange another crypto into %2$s?", "buy_parent_crypto_modal_message_3s": "%1$s%2$s (on %3$s) is required to send this transaction. Would you like to buy %2$s or exchange another crypto into %2$s?", "buy_crypto_decline": "Pas cette fois", - "buy_crypto_modal_buy_action": "Acheter %s", + "buy_1s": "Acheter %s", "buy_crypto_modal_exchange": "Echange", "exchange_crypto_modal_message": "Votre portefeuille %s est vide. Voulez-vous échanger un autre crypto dans %s?", "private_key_modal_sweep_from_private_address": "Effacer complétement vos fonds de la clé privée ", diff --git a/src/locales/strings/it.json b/src/locales/strings/it.json index 03f8ea1543d..1ea61ea49f3 100644 --- a/src/locales/strings/it.json +++ b/src/locales/strings/it.json @@ -586,10 +586,10 @@ "title_edit_token": "Modifica token", "title_add_token": "Aggiungi token", "title_password_recovery": "Recupero password", - "title_plugin_buy_s": "Compra %1$s", + "transaction_details_bought_1s": "Compra %1$s", "title_select_region": "Seleziona la regione", "title_select_payment_method": "Seleziona un metodo di pagamento", - "title_plugin_sell_s": "Vendi %1$s", + "transaction_details_sold_1s": "Vendi %1$s", "title_otp": "Sicurezza a 2 fattori (2FA)", "title_register_fio_address": "Registra un indirizzo FIO", "title_register_fio_domain": "Registra un dominio FIO", @@ -745,7 +745,8 @@ "buy_parent_crypto_modal_message_2s": "%1$s%2$s necessari per inviare questa transazione. Vuoi acquistare %2$s o scambiare un'altra criptovaluta in %2$s?", "buy_parent_crypto_modal_message_3s": "%1$s%2$s (su %3$s) necessari per inviare questa transazione. Vuoi comprare %2$s o scambiare un'altra cripto per %2$s?", "buy_crypto_decline": "Non ora", - "buy_crypto_modal_buy_action": "Compra %s", + "buy_1s": "Compra %1$s", + "sell_1s": "Vendi %1$s", "buy_crypto_modal_exchange": "Scambia", "exchange_crypto_modal_message": "Il tuo portafoglio %s è vuoto. Vuoi scambiare delle criptovalute per %s?", "private_key_modal_sweep_from_private_address": "Importa fondi da chiave privata", diff --git a/src/locales/strings/ja.json b/src/locales/strings/ja.json index bbc21df67ef..e4439c778f0 100644 --- a/src/locales/strings/ja.json +++ b/src/locales/strings/ja.json @@ -586,10 +586,10 @@ "title_edit_token": "トークンを編集", "title_add_token": "トークンを追加", "title_password_recovery": "パスワード復元", - "title_plugin_buy_s": "Buy %1$s", + "transaction_details_bought_1s": "Buy %1$s", "title_select_region": "Select Region", "title_select_payment_method": "Select Payment Method", - "title_plugin_sell_s": "Sell %1$s", + "transaction_details_sold_1s": "Sell %1$s", "title_otp": "二段階認証", "title_register_fio_address": "FIOアドレスを登録", "title_register_fio_domain": "FIOドメインを登録", @@ -745,7 +745,8 @@ "buy_parent_crypto_modal_message_2s": "このトランザクションを送信するには、%1$s%2$s が必要です。 %2$s を購入するか、別の暗号通貨を %2$s に交換しますか?", "buy_parent_crypto_modal_message_3s": "%1$s%2$s (on %3$s) is required to send this transaction. Would you like to buy %2$s or exchange another crypto into %2$s?", "buy_crypto_decline": "キャンセル", - "buy_crypto_modal_buy_action": "%sを購入", + "buy_1s": "%sを購入", + "sell_1s": "%sを売却", "buy_crypto_modal_exchange": "取引所", "exchange_crypto_modal_message": "あなたの%sウォレットは空です。 別の暗号資産を%sに交換しますか?", "private_key_modal_sweep_from_private_address": "プライベートキーから資産をスウィープする", diff --git a/src/locales/strings/kaa.json b/src/locales/strings/kaa.json index 736dc2f3b43..79b429330f0 100644 --- a/src/locales/strings/kaa.json +++ b/src/locales/strings/kaa.json @@ -586,10 +586,10 @@ "title_edit_token": "Edit Token", "title_add_token": "Add Token", "title_password_recovery": "Password Recovery", - "title_plugin_buy_s": "Buy %1$s", + "transaction_details_bought_1s": "Buy %1$s", "title_select_region": "Select Region", "title_select_payment_method": "Select Payment Method", - "title_plugin_sell_s": "Sell %1$s", + "transaction_details_sold_1s": "Sell %1$s", "title_otp": "2-Factor Security", "title_register_fio_address": "Register FIO Address", "title_register_fio_domain": "Register FIO Domain", @@ -745,7 +745,8 @@ "buy_parent_crypto_modal_message_2s": "%1$s%2$s is required to send this transaction. Would you like to buy %2$s or exchange another crypto into %2$s?", "buy_parent_crypto_modal_message_3s": "%1$s%2$s (on %3$s) is required to send this transaction. Would you like to buy %2$s or exchange another crypto into %2$s?", "buy_crypto_decline": "Not at this time", - "buy_crypto_modal_buy_action": "Satıp alıw %s", + "buy_1s": "Satıp alıw %s", + "sell_1s": "Sell %1$s", "buy_crypto_modal_exchange": "Exchange", "exchange_crypto_modal_message": "Your %s wallet is empty. Would you like to exchange another crypto into %s?", "private_key_modal_sweep_from_private_address": "Sweep Funds From Private Key", diff --git a/src/locales/strings/ko.json b/src/locales/strings/ko.json index 1551f8c2a70..c202d17af61 100644 --- a/src/locales/strings/ko.json +++ b/src/locales/strings/ko.json @@ -586,10 +586,10 @@ "title_edit_token": "토큰 편집", "title_add_token": "토큰 추가", "title_password_recovery": "암호 복구", - "title_plugin_buy_s": "Buy %1$s", + "transaction_details_bought_1s": "Buy %1$s", "title_select_region": "Select Region", "title_select_payment_method": "Select Payment Method", - "title_plugin_sell_s": "Sell %1$s", + "transaction_details_sold_1s": "Sell %1$s", "title_otp": "2-Factor Security", "title_register_fio_address": "Register FIO Address", "title_register_fio_domain": "Register FIO Domain", @@ -745,7 +745,7 @@ "buy_parent_crypto_modal_message_2s": "%1$s%2$s is required to send this transaction. Would you like to buy %2$s or exchange another crypto into %2$s?", "buy_parent_crypto_modal_message_3s": "%1$s%2$s (on %3$s) is required to send this transaction. Would you like to buy %2$s or exchange another crypto into %2$s?", "buy_crypto_decline": "현재 불가한 동작입니다.", - "buy_crypto_modal_buy_action": "%s 구매", + "buy_1s": "%s 구매", "buy_crypto_modal_exchange": "거래", "exchange_crypto_modal_message": "고객님의 %s 월릿은 현재 비어있는 상태입니다. 다른 가상화폐를 %s 로 교환하시겠습니까?", "private_key_modal_sweep_from_private_address": "개인 키에서 자산을 스윕 (Sweep)", diff --git a/src/locales/strings/pt.json b/src/locales/strings/pt.json index 06c4c99da21..57b282ae653 100644 --- a/src/locales/strings/pt.json +++ b/src/locales/strings/pt.json @@ -586,10 +586,10 @@ "title_edit_token": "Editar Token", "title_add_token": "Adicionar Token", "title_password_recovery": "Recuperação de Senha", - "title_plugin_buy_s": "Buy %1$s", + "transaction_details_bought_1s": "Buy %1$s", "title_select_region": "Select Region", "title_select_payment_method": "Select Payment Method", - "title_plugin_sell_s": "Sell %1$s", + "transaction_details_sold_1s": "Sell %1$s", "title_otp": "Segurança de 2 fatores", "title_register_fio_address": "Registar Endereço FIO", "title_register_fio_domain": "Registrar Domínio FIO", @@ -745,7 +745,8 @@ "buy_parent_crypto_modal_message_2s": "%1$s%2$s é necessário para enviar esta transação. Gostaria de comprar %2$s ou trocar outra criptomoeda por %2$s?", "buy_parent_crypto_modal_message_3s": "%1$s%2$s (on %3$s) is required to send this transaction. Would you like to buy %2$s or exchange another crypto into %2$s?", "buy_crypto_decline": "Agora não", - "buy_crypto_modal_buy_action": "Comprar %s", + "buy_1s": "Comprar %1$s", + "sell_1s": "Vender %1$s", "buy_crypto_modal_exchange": "Exchange", "exchange_crypto_modal_message": "A sua carteira %s está vazia. Gostaria de trocar outra criptomoeda por %s?", "private_key_modal_sweep_from_private_address": "Resgatar Fundos da Chave Privada", diff --git a/src/locales/strings/ru.json b/src/locales/strings/ru.json index bf395bbfca7..db746901642 100644 --- a/src/locales/strings/ru.json +++ b/src/locales/strings/ru.json @@ -586,10 +586,10 @@ "title_edit_token": "Редактировать токен", "title_add_token": "Добавить токен", "title_password_recovery": "Восстановление пароля", - "title_plugin_buy_s": "Buy %1$s", + "transaction_details_bought_1s": "Buy %1$s", "title_select_region": "Select Region", "title_select_payment_method": "Select Payment Method", - "title_plugin_sell_s": "Sell %1$s", + "transaction_details_sold_1s": "Sell %1$s", "title_otp": "2-факторная безопасность", "title_register_fio_address": "Регистрация адреса FIO", "title_register_fio_domain": "Регистрация домена FIO", @@ -745,7 +745,7 @@ "buy_parent_crypto_modal_message_2s": "%1$s%2$s is required to send this transaction. Would you like to buy %2$s or exchange another crypto into %2$s?", "buy_parent_crypto_modal_message_3s": "%1$s%2$s (on %3$s) is required to send this transaction. Would you like to buy %2$s or exchange another crypto into %2$s?", "buy_crypto_decline": "Не в этот раз", - "buy_crypto_modal_buy_action": "Купить %s", + "buy_1s": "Купить %s", "buy_crypto_modal_exchange": "Обмен", "exchange_crypto_modal_message": "Ваш кошелек %s пуст. Вы хотели бы обменять другую валюту на %s?", "private_key_modal_sweep_from_private_address": "Перевести средства с приватного ключа", diff --git a/src/locales/strings/vi.json b/src/locales/strings/vi.json index 40486dd1c7c..7bf05a66413 100644 --- a/src/locales/strings/vi.json +++ b/src/locales/strings/vi.json @@ -586,10 +586,10 @@ "title_edit_token": "Chỉnh sửa mã thông báo", "title_add_token": "Thêm mã thông báo", "title_password_recovery": "Khôi phục mật khẩu", - "title_plugin_buy_s": "Buy %1$s", + "transaction_details_bought_1s": "Buy %1$s", "title_select_region": "Select Region", "title_select_payment_method": "Select Payment Method", - "title_plugin_sell_s": "Sell %1$s", + "transaction_details_sold_1s": "Sell %1$s", "title_otp": "2-Factor Security", "title_register_fio_address": "Register FIO Address", "title_register_fio_domain": "Register FIO Domain", @@ -745,7 +745,7 @@ "buy_parent_crypto_modal_message_2s": "%1$s%2$s is required to send this transaction. Would you like to buy %2$s or exchange another crypto into %2$s?", "buy_parent_crypto_modal_message_3s": "%1$s%2$s (on %3$s) is required to send this transaction. Would you like to buy %2$s or exchange another crypto into %2$s?", "buy_crypto_decline": "Không phải lúc này", - "buy_crypto_modal_buy_action": "Mua %s", + "buy_1s": "Mua %s", "buy_crypto_modal_exchange": "Chuyển đổi", "exchange_crypto_modal_message": "Ví %s của bạn trống. Bạn có muốn mua %s hay chuyển đổi crypto khác vào ví?", "private_key_modal_sweep_from_private_address": "Quét số tiền từ khóa riêng", diff --git a/src/locales/strings/zh.json b/src/locales/strings/zh.json index ecaaf226723..3bf1cd4de62 100644 --- a/src/locales/strings/zh.json +++ b/src/locales/strings/zh.json @@ -586,10 +586,10 @@ "title_edit_token": "编辑代币", "title_add_token": "添加代币", "title_password_recovery": "密码复原", - "title_plugin_buy_s": "Buy %1$s", + "transaction_details_bought_1s": "Buy %1$s", "title_select_region": "Select Region", "title_select_payment_method": "Select Payment Method", - "title_plugin_sell_s": "Sell %1$s", + "transaction_details_sold_1s": "Sell %1$s", "title_otp": "2-Factor Security", "title_register_fio_address": "Register FIO Address", "title_register_fio_domain": "Register FIO Domain", @@ -745,7 +745,7 @@ "buy_parent_crypto_modal_message_2s": "%1$s%2$s is required to send this transaction. Would you like to buy %2$s or exchange another crypto into %2$s?", "buy_parent_crypto_modal_message_3s": "%1$s%2$s (on %3$s) is required to send this transaction. Would you like to buy %2$s or exchange another crypto into %2$s?", "buy_crypto_decline": "不是在这个时候", - "buy_crypto_modal_buy_action": "购买 %s", + "buy_1s": "购买 %s", "buy_crypto_modal_exchange": "交易", "exchange_crypto_modal_message": "您的 %s 钱包现在是空的。您想将另一个加密产品兑转换成 %s?", "private_key_modal_sweep_from_private_address": "从私钥移除资金", diff --git a/src/plugins/gui/amountQuotePlugin.ts b/src/plugins/gui/amountQuotePlugin.ts index 116f789d357..160ea5cbb4f 100644 --- a/src/plugins/gui/amountQuotePlugin.ts +++ b/src/plugins/gui/amountQuotePlugin.ts @@ -2,6 +2,7 @@ import { div, eq, gt, round, toFixed } from 'biggystring' import { asNumber, asObject } from 'cleaners' import { sprintf } from 'sprintf-js' +import { getFirstOpenInfo } from '../../actions/FirstOpenActions' import { formatNumber, isValidInput } from '../../locales/intl' import { lstrings } from '../../locales/strings' import { EdgeAsset } from '../../types/types' @@ -10,6 +11,7 @@ import { getCurrencyCode } from '../../util/CurrencyInfoHelpers' import { getHistoricalRate } from '../../util/exchangeRates' import { infoServerData } from '../../util/network' import { logEvent } from '../../util/tracking' +import { getUkCompliantString } from '../../util/ukComplianceUtils' import { DECIMAL_PRECISION, fuzzyTimeout, removeIsoPrefix } from '../../util/utils' import { FiatPlugin, FiatPluginFactory, FiatPluginFactoryArgs, FiatPluginStartParams } from './fiatPluginTypes' import { FiatProvider, FiatProviderAssetMap, FiatProviderGetQuoteParams, FiatProviderQuote } from './fiatProviderTypes' @@ -127,6 +129,8 @@ export const amountQuoteFiatPlugin: FiatPluginFactory = async (params: FiatPlugi pluginId, startPlugin: async (params: FiatPluginStartParams) => { const { defaultIsoFiat, direction, defaultFiatAmount, forceFiatCurrencyCode, regionCode, paymentTypes, pluginPromotion, providerId } = params + const { countryCode } = await getFirstOpenInfo() + // TODO: Address 'paymentTypes' vs 'paymentType'. Both are defined in the // buy/sellPluginList.jsons. if (paymentTypes.length === 0) console.warn('No payment types given to FiatPlugin: ' + pluginId) @@ -260,7 +264,7 @@ export const amountQuoteFiatPlugin: FiatPluginFactory = async (params: FiatPlugi // Navigate to scene to have user enter amount const enterAmount: InternalFiatPluginEnterAmountParams = { disableInput, - headerTitle: isBuy ? sprintf(lstrings.fiat_plugin_buy_currencycode, currencyCode) : sprintf(lstrings.fiat_plugin_sell_currencycode_s, currencyCode), + headerTitle: isBuy ? getUkCompliantString(countryCode, 'buy_1s', currencyCode) : getUkCompliantString(countryCode, 'sell_1s', currencyCode), initState: { value1: initialValue1, statusText: initialValue1 == null ? { content: lstrings.enter_amount_label } : { content: '' } diff --git a/src/plugins/gui/providers/moonpayProvider.ts b/src/plugins/gui/providers/moonpayProvider.ts index 1d53724e5ba..255326388c9 100644 --- a/src/plugins/gui/providers/moonpayProvider.ts +++ b/src/plugins/gui/providers/moonpayProvider.ts @@ -203,7 +203,7 @@ export const moonpayProvider: FiatProviderFactory = { // Return nothing if paymentTypes are not supported by this provider const assetMap = allowedCurrencyCodes[direction][paymentType] - if (assetMap == null) throw new FiatProviderError({ providerId, errorType: 'paymentUnsupported' }) + if (assetMap == null || regionCode.countryCode === 'GB') throw new FiatProviderError({ providerId, errorType: 'paymentUnsupported' }) if (Object.keys(assetMap.crypto).length === 0 || isDailyCheckDue(lastChecked)) { const response = await fetch(`https://api.moonpay.com/v3/currencies?apiKey=${apiKey}`).catch(e => undefined) diff --git a/src/plugins/gui/providers/paybisProvider.ts b/src/plugins/gui/providers/paybisProvider.ts index 9059aef6ed5..b0c93f808f9 100644 --- a/src/plugins/gui/providers/paybisProvider.ts +++ b/src/plugins/gui/providers/paybisProvider.ts @@ -350,8 +350,8 @@ export const paybisProvider: FiatProviderFactory = { partnerIcon, pluginDisplayName, getSupportedAssets: async ({ direction, paymentTypes, regionCode }): Promise => { - // Do not allow sell to debit in US - if (direction === 'sell' && paymentTypes.includes('credit') && regionCode.countryCode === 'US') { + // Do not allow sell to debit in US, disable all UK + if (regionCode.countryCode === 'GB' || (direction === 'sell' && paymentTypes.includes('credit') && regionCode.countryCode === 'US')) { throw new FiatProviderError({ providerId, errorType: 'paymentUnsupported' }) } validateRegion(providerId, regionCode, SUPPORTED_REGIONS) diff --git a/src/plugins/gui/providers/simplexProvider.ts b/src/plugins/gui/providers/simplexProvider.ts index bfcd3c1b48d..259cd5c9628 100644 --- a/src/plugins/gui/providers/simplexProvider.ts +++ b/src/plugins/gui/providers/simplexProvider.ts @@ -200,7 +200,7 @@ export const simplexProvider: FiatProviderFactory = { partnerIcon, pluginDisplayName, getSupportedAssets: async ({ direction, regionCode, paymentTypes }): Promise => { - if (direction !== 'buy') { + if (direction !== 'buy' || regionCode.countryCode === 'GB') { throw new FiatProviderError({ providerId, errorType: 'paymentUnsupported' }) } diff --git a/src/util/stakeUtils.ts b/src/util/stakeUtils.ts index 5638e404310..a723c8033d9 100644 --- a/src/util/stakeUtils.ts +++ b/src/util/stakeUtils.ts @@ -6,6 +6,7 @@ import { formatTimeDate } from '../locales/intl' import { lstrings } from '../locales/strings' import { PositionAllocation, StakePlugin, StakePolicy, StakePosition } from '../plugins/stake-plugins/types' import { getCurrencyIconUris } from './CdnUris' +import { getUkCompliantString } from './ukComplianceUtils' /** * Returns an array of all currency codes for a particular asset type @@ -41,7 +42,7 @@ export const getPolicyAssetName = (stakePolicy: StakePolicy, assetType: 'stakeAs /** * Returns the policy title */ -export const getPolicyTitleName = (stakePolicy: StakePolicy) => { +export const getPolicyTitleName = (stakePolicy: StakePolicy, countryCode?: string) => { const stakeCurrencyCodes = getAssetDisplayName(stakePolicy, 'stakeAssets') const rewardCurrencyCodes = getAssetDisplayName(stakePolicy, 'rewardAssets') @@ -52,7 +53,7 @@ export const getPolicyTitleName = (stakePolicy: StakePolicy) => { const yieldText = yieldType === 'stable' ? ` ${lstrings.stake_stable_yield}` : yieldType === 'variable' ? ` ${lstrings.stake_variable_yield}` : '' - return `${sprintf(lstrings.stake_x_to_earn_y, stakeName, rewardName)}${yieldText}` + return `${getUkCompliantString(countryCode, 'stake_x_to_earn_y', stakeName, rewardName)}${yieldText}` } /** diff --git a/src/util/ukComplianceUtils.ts b/src/util/ukComplianceUtils.ts new file mode 100644 index 00000000000..b4db84ff434 --- /dev/null +++ b/src/util/ukComplianceUtils.ts @@ -0,0 +1,19 @@ +import { LocaleStringKey } from '../locales/en_US' +import { lstrings } from '../locales/strings' + +const UK_COMPLIANT_STRING_MAP: { [key: string]: LocaleStringKey } = { + buy_1s: 'uk_ways_to_buy_1s', + sell_1s: 'uk_ways_to_sell_1s', + stake_earn_1s: 'stake_stake_1s', + stake_earn_button_label: 'fragment_stake_label', + stake_x_to_earn_y: 'transaction_details_stake_subcat_1s' +} + +const formatString = (template: string, values: string[]): string => { + return template.replace(/%(\d+)\$s/g, (_, index) => values[parseInt(index) - 1] || '') +} + +export const getUkCompliantString = (countryCode: string | undefined, key: LocaleStringKey, ...values: string[]): string => { + const template = countryCode === 'GB' ? lstrings[UK_COMPLIANT_STRING_MAP[key]] : lstrings[key] + return formatString(template, values) +}