@@ -77,15 +77,6 @@ exports[`Token Cell should match snapshot 1`] = `
diff --git a/ui/helpers/constants/settings.js b/ui/helpers/constants/settings.js
index 568f4a5290ea..d80f1c25d28d 100644
--- a/ui/helpers/constants/settings.js
+++ b/ui/helpers/constants/settings.js
@@ -219,6 +219,13 @@ export const SETTINGS_CONSTANTS = [
icon: 'fa fa-flask',
featureFlag: 'NFTS_V1',
},
+ {
+ tabMessage: (t) => t('securityAndPrivacy'),
+ sectionMessage: (t) => t('currencyRateCheckToggle'),
+ descriptionMessage: (t) => t('currencyRateCheckToggleDescription'),
+ route: `${SECURITY_ROUTE}#price-checker`,
+ icon: 'fa fa-lock',
+ },
{
tabMessage: (t) => t('alerts'),
sectionMessage: (t) => t('alertSettingsUnconnectedAccount'),
diff --git a/ui/helpers/utils/settings-search.test.js b/ui/helpers/utils/settings-search.test.js
index 683bd014e337..7152d4451c97 100644
--- a/ui/helpers/utils/settings-search.test.js
+++ b/ui/helpers/utils/settings-search.test.js
@@ -137,6 +137,10 @@ const t = (key) => {
return 'Contact us';
case 'snaps':
return 'Snaps';
+ case 'currencyRateCheckToggle':
+ return 'Show balance and token price checker';
+ case 'currencyRateCheckToggleDescription':
+ return 'We use Coingecko and CryptoCompare APIs to display your balance and token price. Privacy Policy';
default:
return '';
}
@@ -165,7 +169,7 @@ describe('Settings Search Utils', () => {
it('should get good security & privacy section number', () => {
expect(
getNumberOfSettingsInSection(t, t('securityAndPrivacy')),
- ).toStrictEqual(9);
+ ).toStrictEqual(10);
});
it('should get good alerts section number', () => {
diff --git a/ui/pages/confirm-transaction-base/confirm-transaction-base.component.js b/ui/pages/confirm-transaction-base/confirm-transaction-base.component.js
index 2d1e66c60574..974a287e2283 100644
--- a/ui/pages/confirm-transaction-base/confirm-transaction-base.component.js
+++ b/ui/pages/confirm-transaction-base/confirm-transaction-base.component.js
@@ -160,6 +160,7 @@ export default class ConfirmTransactionBase extends Component {
insightSnaps: PropTypes.arrayOf(PropTypes.object),
///: END:ONLY_INCLUDE_IN
assetStandard: PropTypes.string,
+ useCurrencyRateCheck: PropTypes.bool,
};
state = {
@@ -349,6 +350,7 @@ export default class ConfirmTransactionBase extends Component {
isMultiLayerFeeNetwork,
nativeCurrency,
isBuyableChain,
+ useCurrencyRateCheck,
} = this.props;
const { t } = this.context;
const { userAcknowledgedGasMissing } = this.state;
@@ -511,14 +513,16 @@ export default class ConfirmTransactionBase extends Component {
)
}
detailText={
-
- {renderHeartBeatIfNotInTest()}
-
-
+ useCurrencyRateCheck && (
+
+ {renderHeartBeatIfNotInTest()}
+
+
+ )
}
detailTotal={
@@ -637,7 +641,7 @@ export default class ConfirmTransactionBase extends Component {
{
///: BEGIN:ONLY_INCLUDE_IN(flask)
insightSnaps,
///: END:ONLY_INCLUDE_IN
+ useCurrencyRateCheck: getUseCurrencyRateCheck(state),
};
};
diff --git a/ui/pages/onboarding-flow/privacy-settings/privacy-settings.js b/ui/pages/onboarding-flow/privacy-settings/privacy-settings.js
index 41b9eff91477..aeb166621780 100644
--- a/ui/pages/onboarding-flow/privacy-settings/privacy-settings.js
+++ b/ui/pages/onboarding-flow/privacy-settings/privacy-settings.js
@@ -22,13 +22,20 @@ import {
showModal,
setIpfsGateway,
showNetworkDropdown,
+ setUseCurrencyRateCheck,
} from '../../../store/actions';
import { ONBOARDING_PIN_EXTENSION_ROUTE } from '../../../helpers/constants/routes';
import { Icon, TextField } from '../../../components/component-library';
import NetworkDropdown from '../../../components/app/dropdowns/network-dropdown';
import NetworkDisplay from '../../../components/app/network-display/network-display';
+import {
+ COINGECKO_LINK,
+ CRYPTOCOMPARE_LINK,
+ PRIVACY_POLICY_LINK,
+} from '../../../../shared/lib/ui-utils';
import { MetaMetricsContext } from '../../../contexts/metametrics';
import { EVENT_NAMES, EVENT } from '../../../../shared/constants/metametrics';
+
import { Setting } from './setting';
export default function PrivacySettings() {
@@ -37,6 +44,7 @@ export default function PrivacySettings() {
const history = useHistory();
const [usePhishingDetection, setUsePhishingDetection] = useState(true);
const [turnOnTokenDetection, setTurnOnTokenDetection] = useState(true);
+ const [turnOnCurrencyRateCheck, setTurnOnCurrencyRateCheck] = useState(true);
const [showIncomingTransactions, setShowIncomingTransactions] =
useState(true);
const [
@@ -60,6 +68,7 @@ export default function PrivacySettings() {
dispatch(
setUseMultiAccountBalanceChecker(isMultiAccountBalanceCheckerEnabled),
);
+ dispatch(setUseCurrencyRateCheck(turnOnCurrencyRateCheck));
dispatch(setCompletedOnboarding());
if (ipfsURL && !ipfsError) {
@@ -254,6 +263,37 @@ export default function PrivacySettings() {
>
}
/>
+
+ {t('coingecko')}
+ ,
+
+ {t('cryptoCompare')}
+ ,
+
+ {t('privacyMsg')}
+ ,
+ ])}
+ />