diff --git a/.depcheckrc.yml b/.depcheckrc.yml
index babe74bcd3a..df73bd5e8ad 100644
--- a/.depcheckrc.yml
+++ b/.depcheckrc.yml
@@ -6,6 +6,7 @@ ignores:
- '@react-native-community/slider'
- 'patch-package'
- '@lavamoat/allow-scripts'
+ - '@lavamoat/git-safe-dependencies'
- 'babel-plugin-inline-import'
# This is used on the patch for TokenRatesController of Assets controllers, for we to be able to use the last version of it
- cockatiel
diff --git a/.eslintrc.js b/.eslintrc.js
index 21a0949d4ea..70565eb4945 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -76,6 +76,7 @@ module.exports = {
{
files: [
'app/components/UI/Name/**/*.{js,ts,tsx}',
+ 'app/components/UI/SimulationDetails/**/*.{js,ts,tsx}',
'app/components/hooks/DisplayName/**/*.{js,ts,tsx}'
],
rules: {
diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
index 9576fde1dd0..58ceabd2486 100644
--- a/.github/CODEOWNERS
+++ b/.github/CODEOWNERS
@@ -23,6 +23,7 @@ app/store/migrations/ @MetaMask/mobile-pla
bitrise.yml @MetaMask/mobile-platform
yarn.lock @MetaMask/mobile-platform
ios/Podfile.lock @MetaMask/mobile-platform
+app/components/Views/BrowserTab/BrowserTab.tsx @MetaMask/mobile-platform
# Ramps Team
app/components/UI/Ramp/ @MetaMask/ramp
@@ -76,6 +77,9 @@ patches/react-native+0.*.patch @MetaMask/supply-chain
**/snaps/** @MetaMask/snaps-devs
**/Snaps/** @MetaMask/snaps-devs
+# Wallet API Platform Team
+ app/core/RPCMethods/ @MetaMask/wallet-api-platform-engineers
+
# Staking Team
app/components/UI/Stake @MetaMask/metamask-staking
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index c453cc01200..71c11d98d64 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -48,6 +48,17 @@ jobs:
echo "Duplicate dependencies detected; run 'yarn deduplicate' to remove them"
exit 1
fi
+ git-safe-dependencies:
+ runs-on: ubuntu-20.04
+ steps:
+ - uses: actions/checkout@v3
+ - uses: actions/setup-node@v3
+ with:
+ node-version-file: '.nvmrc'
+ cache: yarn
+ - run: yarn setup --node
+ - name: Run @lavamoat/git-safe-dependencies
+ run: yarn git-safe-dependencies
scripts:
runs-on: ubuntu-20.04
strategy:
@@ -323,4 +334,4 @@ jobs:
else
echo "All jobs passed step skipped. Block PR."
exit 1
- fi
\ No newline at end of file
+ fi
diff --git a/.js.env.example b/.js.env.example
index 56c7c1bb865..325ee52559d 100644
--- a/.js.env.example
+++ b/.js.env.example
@@ -97,7 +97,10 @@ export MM_ENABLE_SETTINGS_PAGE_DEV_OPTIONS="true"
# Per dapp selected network (Amon Hen) feature flag
export MM_PER_DAPP_SELECTED_NETWORK=""
-export MM_CHAIN_PERMISSIONS=""
+# Multichain permissions now set to true in production via the CI
+# MM_MULTICHAIN_V1_ENABLED is the UI, and MM_CHAIN_PERMISSIONS is the engine
+export MM_MULTICHAIN_V1_ENABLED="true"
+export MM_CHAIN_PERMISSIONS="true"
# Multichain feature flag specific to UI changes
export MM_MULTICHAIN_V1_ENABLED=""
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 155b760639f..0cfee4c59bf 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,12 @@
## Current Main Branch
+## 7.37.1 - Dec 16, 2024
+### Fixed
+- [#12577](https://github.com/MetaMask/metamask-mobile/pull/12577): chore: bump {gas-fee,network,selected-network,notification-services,profile-sync,signature}-controller (#12577)
+- [#12694](https://github.com/MetaMask/metamask-mobile/pull/12694): fix: small refactoring of the latest migration script + add a new migration case (#12694)
+- [#12664](https://github.com/MetaMask/metamask-mobile/pull/12664): fix: mark transactions as failed for cancelled / unknown smart transactions (#12664)
+
## 7.37.0 - Nov 28, 2024
### Added
- [#12091](https://github.com/MetaMask/metamask-mobile/pull/12091): feat: 2020 Add a performance test for iOS in Bitrise (#12091)
diff --git a/android/app/build.gradle b/android/app/build.gradle
index c856cc0492f..5692a52de02 100644
--- a/android/app/build.gradle
+++ b/android/app/build.gradle
@@ -178,8 +178,8 @@ android {
applicationId "io.metamask"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
- versionName "7.37.0"
- versionCode 1512
+ versionName "7.37.1"
+ versionCode 1520
testBuildType System.getProperty('testBuildType', 'debug')
missingDimensionStrategy 'react-native-camera', 'general'
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
diff --git a/app/component-library/components-temp/CustomSpendCap/__snapshots__/CustomSpendCap.test.tsx.snap b/app/component-library/components-temp/CustomSpendCap/__snapshots__/CustomSpendCap.test.tsx.snap
index 4ab88b6f6bc..2bdc8856035 100644
--- a/app/component-library/components-temp/CustomSpendCap/__snapshots__/CustomSpendCap.test.tsx.snap
+++ b/app/component-library/components-temp/CustomSpendCap/__snapshots__/CustomSpendCap.test.tsx.snap
@@ -113,9 +113,9 @@ exports[`CustomSpendCap should match snapshot 1`] = `
style={
{
"color": "#0376c9",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -249,9 +249,9 @@ exports[`CustomSpendCap should match snapshot 1`] = `
style={
{
"color": "#0376c9",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
diff --git a/app/component-library/components/Banners/Banner/__snapshots__/Banner.test.tsx.snap b/app/component-library/components/Banners/Banner/__snapshots__/Banner.test.tsx.snap
index d44a93288b1..39786758805 100644
--- a/app/component-library/components/Banners/Banner/__snapshots__/Banner.test.tsx.snap
+++ b/app/component-library/components/Banners/Banner/__snapshots__/Banner.test.tsx.snap
@@ -177,9 +177,9 @@ exports[`Banner should render correctly with a close button 1`] = `
style={
{
"color": "#0376c9",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -412,9 +412,9 @@ exports[`Banner should render correctly with an action button 1`] = `
style={
{
"color": "#0376c9",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
diff --git a/app/component-library/components/Banners/Banner/variants/BannerAlert/__snapshots__/BannerAlert.test.tsx.snap b/app/component-library/components/Banners/Banner/variants/BannerAlert/__snapshots__/BannerAlert.test.tsx.snap
index 158cd1452b7..e50a3856875 100644
--- a/app/component-library/components/Banners/Banner/variants/BannerAlert/__snapshots__/BannerAlert.test.tsx.snap
+++ b/app/component-library/components/Banners/Banner/variants/BannerAlert/__snapshots__/BannerAlert.test.tsx.snap
@@ -96,9 +96,9 @@ exports[`BannerAlert should render BannerAlert 1`] = `
style={
{
"color": "#0376c9",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
diff --git a/app/component-library/components/Banners/Banner/variants/BannerTip/__snapshots__/BannerTip.test.tsx.snap b/app/component-library/components/Banners/Banner/variants/BannerTip/__snapshots__/BannerTip.test.tsx.snap
index e53f453ee7b..767da37e674 100644
--- a/app/component-library/components/Banners/Banner/variants/BannerTip/__snapshots__/BannerTip.test.tsx.snap
+++ b/app/component-library/components/Banners/Banner/variants/BannerTip/__snapshots__/BannerTip.test.tsx.snap
@@ -106,9 +106,9 @@ exports[`BannerTip should render default settings correctly 1`] = `
style={
{
"color": "#0376c9",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
diff --git a/app/component-library/components/BottomSheets/BottomSheetFooter/__snapshots__/BottomSheetFooter.test.tsx.snap b/app/component-library/components/BottomSheets/BottomSheetFooter/__snapshots__/BottomSheetFooter.test.tsx.snap
index 5d640d9987e..57b01074ef4 100644
--- a/app/component-library/components/BottomSheets/BottomSheetFooter/__snapshots__/BottomSheetFooter.test.tsx.snap
+++ b/app/component-library/components/BottomSheets/BottomSheetFooter/__snapshots__/BottomSheetFooter.test.tsx.snap
@@ -41,9 +41,9 @@ exports[`BottomSheetFooter should render snapshot correctly 1`] = `
style={
{
"color": "#0376c9",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -81,9 +81,9 @@ exports[`BottomSheetFooter should render snapshot correctly 1`] = `
style={
{
"color": "#ffffff",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
diff --git a/app/component-library/components/BottomSheets/BottomSheetHeader/__snapshots__/BottomSheetHeader.test.tsx.snap b/app/component-library/components/BottomSheets/BottomSheetHeader/__snapshots__/BottomSheetHeader.test.tsx.snap
index bda8377bdd9..03389274972 100644
--- a/app/component-library/components/BottomSheets/BottomSheetHeader/__snapshots__/BottomSheetHeader.test.tsx.snap
+++ b/app/component-library/components/BottomSheets/BottomSheetHeader/__snapshots__/BottomSheetHeader.test.tsx.snap
@@ -4,7 +4,6 @@ exports[`BottomSheetHeader should render snapshot correctly 1`] = `
Click me!
@@ -81,7 +81,7 @@ exports[`ButtonBase should render correctly when disabled 1`] = `
"color": "#141618",
}
}
- variant="sBodyMD"
+ variant="sBodyMDMedium"
>
Click me!
diff --git a/app/component-library/components/Buttons/Button/variants/ButtonLink/__snapshots__/ButtonLink.test.tsx.snap b/app/component-library/components/Buttons/Button/variants/ButtonLink/__snapshots__/ButtonLink.test.tsx.snap
index 1c09de8a64e..d636f704af6 100644
--- a/app/component-library/components/Buttons/Button/variants/ButtonLink/__snapshots__/ButtonLink.test.tsx.snap
+++ b/app/component-library/components/Buttons/Button/variants/ButtonLink/__snapshots__/ButtonLink.test.tsx.snap
@@ -25,9 +25,9 @@ exports[`ButtonLink should render correctly 1`] = `
style={
{
"color": "#0376c9",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
diff --git a/app/component-library/components/Buttons/Button/variants/ButtonPrimary/__snapshots__/ButtonPrimary.test.tsx.snap b/app/component-library/components/Buttons/Button/variants/ButtonPrimary/__snapshots__/ButtonPrimary.test.tsx.snap
index 44b2bd653b5..74f4e35aa52 100644
--- a/app/component-library/components/Buttons/Button/variants/ButtonPrimary/__snapshots__/ButtonPrimary.test.tsx.snap
+++ b/app/component-library/components/Buttons/Button/variants/ButtonPrimary/__snapshots__/ButtonPrimary.test.tsx.snap
@@ -40,9 +40,9 @@ exports[`ButtonPrimary render matches latest snapshot 1`] = `
style={
{
"color": "#ffffff",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
diff --git a/app/component-library/components/Buttons/Button/variants/ButtonSecondary/__snapshots__/ButtonSecondary.test.tsx.snap b/app/component-library/components/Buttons/Button/variants/ButtonSecondary/__snapshots__/ButtonSecondary.test.tsx.snap
index 5b5db9487c7..d35a16c686b 100644
--- a/app/component-library/components/Buttons/Button/variants/ButtonSecondary/__snapshots__/ButtonSecondary.test.tsx.snap
+++ b/app/component-library/components/Buttons/Button/variants/ButtonSecondary/__snapshots__/ButtonSecondary.test.tsx.snap
@@ -41,9 +41,9 @@ exports[`ButtonSecondary should render correctly 1`] = `
style={
{
"color": "#0376c9",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
diff --git a/app/component-library/components/HeaderBase/HeaderBase.styles.ts b/app/component-library/components/HeaderBase/HeaderBase.styles.ts
index 0b31674f3e2..fb481958a19 100644
--- a/app/component-library/components/HeaderBase/HeaderBase.styles.ts
+++ b/app/component-library/components/HeaderBase/HeaderBase.styles.ts
@@ -31,7 +31,6 @@ const styleSheet = (params: {
{
backgroundColor: theme.colors.background.default,
flexDirection: 'row',
- alignItems: 'center',
} as ViewStyle,
style,
) as ViewStyle,
diff --git a/app/component-library/components/HeaderBase/__snapshots__/HeaderBase.test.tsx.snap b/app/component-library/components/HeaderBase/__snapshots__/HeaderBase.test.tsx.snap
index a7b90f3404d..898e43f05c4 100644
--- a/app/component-library/components/HeaderBase/__snapshots__/HeaderBase.test.tsx.snap
+++ b/app/component-library/components/HeaderBase/__snapshots__/HeaderBase.test.tsx.snap
@@ -4,7 +4,6 @@ exports[`HeaderBase should render snapshot correctly 1`] = `
{
base: {
flexDirection: 'row',
alignItems: 'center',
- height: Device.isAndroid() ? 62 : 48,
+ height: TAB_BAR_HEIGHT,
paddingHorizontal: 16,
marginBottom: bottomInset,
backgroundColor: colors.background.default,
diff --git a/app/component-library/components/Toast/Toast.tsx b/app/component-library/components/Toast/Toast.tsx
index 170b7543897..8c23d38b46d 100644
--- a/app/component-library/components/Toast/Toast.tsx
+++ b/app/component-library/components/Toast/Toast.tsx
@@ -40,6 +40,7 @@ import {
import styles from './Toast.styles';
import { ToastSelectorsIDs } from '../../../../e2e/selectors/wallet/ToastModal.selectors';
import { ButtonProps } from '../Buttons/Button/Button.types';
+import { TAB_BAR_HEIGHT } from '../Navigation/TabBar/TabBar.constants';
const visibilityDuration = 2750;
const animationDuration = 250;
@@ -53,7 +54,7 @@ const Toast = forwardRef((_, ref: React.ForwardedRef) => {
const { bottom: bottomNotchSpacing } = useSafeAreaInsets();
const translateYProgress = useSharedValue(screenHeight);
const animatedStyle = useAnimatedStyle(() => ({
- transform: [{ translateY: translateYProgress.value }],
+ transform: [{ translateY: translateYProgress.value - TAB_BAR_HEIGHT }],
}));
const baseStyle: StyleProp>> =
useMemo(
diff --git a/app/components/Approvals/SwitchChainApproval/SwitchChainApproval.test.tsx b/app/components/Approvals/SwitchChainApproval/SwitchChainApproval.test.tsx
index 4630f1984cc..1b1483b2dcc 100644
--- a/app/components/Approvals/SwitchChainApproval/SwitchChainApproval.test.tsx
+++ b/app/components/Approvals/SwitchChainApproval/SwitchChainApproval.test.tsx
@@ -5,13 +5,26 @@ import { ApprovalTypes } from '../../../core/RPCMethods/RPCMethodMiddleware';
import { ApprovalRequest } from '@metamask/approval-controller';
import SwitchChainApproval from './SwitchChainApproval';
import { networkSwitched } from '../../../actions/onboardNetwork';
+// eslint-disable-next-line import/no-namespace
+import * as networks from '../../../util/networks';
+import Engine from '../../../core/Engine';
+const { PreferencesController } = Engine.context;
jest.mock('../../Views/confirmations/hooks/useApprovalRequest');
jest.mock('../../../actions/onboardNetwork');
+jest.mock('../../../core/Engine', () => ({
+ context: {
+ PreferencesController: {
+ setTokenNetworkFilter: jest.fn(),
+ },
+ },
+}));
+
jest.mock('react-redux', () => ({
...jest.requireActual('react-redux'),
useDispatch: () => jest.fn(),
+ useSelector: jest.fn(),
}));
const URL_MOCK = 'test.com';
@@ -32,6 +45,7 @@ const mockApprovalRequest = (approvalRequest?: ApprovalRequest) => {
describe('SwitchChainApproval', () => {
beforeEach(() => {
jest.resetAllMocks();
+ jest.spyOn(networks, 'isPortfolioViewEnabled').mockReturnValue(false);
});
it('renders', () => {
@@ -81,4 +95,29 @@ describe('SwitchChainApproval', () => {
networkStatus: true,
});
});
+
+ it('invokes network switched on confirm when portfolio view is enabled', () => {
+ jest.spyOn(networks, 'isPortfolioViewEnabled').mockReturnValue(true);
+ const tokenNetworkFilterSpy = jest.spyOn(
+ PreferencesController,
+ 'setTokenNetworkFilter',
+ );
+ mockApprovalRequest({
+ type: ApprovalTypes.SWITCH_ETHEREUM_CHAIN,
+ requestData: {
+ rpcUrl: URL_MOCK,
+ },
+ } as ApprovalRequest<{
+ rpcUrl: string;
+ }>);
+
+ const wrapper = shallow();
+ wrapper.find('SwitchCustomNetwork').simulate('confirm');
+ expect(tokenNetworkFilterSpy).toHaveBeenCalledTimes(1);
+ expect(networkSwitched).toHaveBeenCalledTimes(1);
+ expect(networkSwitched).toHaveBeenCalledWith({
+ networkUrl: URL_MOCK,
+ networkStatus: true,
+ });
+ });
});
diff --git a/app/components/Approvals/SwitchChainApproval/SwitchChainApproval.tsx b/app/components/Approvals/SwitchChainApproval/SwitchChainApproval.tsx
index 9a3310addf9..ff4a9814ce1 100644
--- a/app/components/Approvals/SwitchChainApproval/SwitchChainApproval.tsx
+++ b/app/components/Approvals/SwitchChainApproval/SwitchChainApproval.tsx
@@ -4,7 +4,11 @@ import { ApprovalTypes } from '../../../core/RPCMethods/RPCMethodMiddleware';
import ApprovalModal from '../ApprovalModal';
import SwitchCustomNetwork from '../../UI/SwitchCustomNetwork';
import { networkSwitched } from '../../../actions/onboardNetwork';
-import { useDispatch } from 'react-redux';
+import { useDispatch, useSelector } from 'react-redux';
+import Engine from '../../../core/Engine';
+import { selectIsAllNetworks } from '../../../selectors/networkController';
+import { selectTokenNetworkFilter } from '../../../selectors/preferencesController';
+import { isPortfolioViewEnabled } from '../../../util/networks';
const SwitchChainApproval = () => {
const {
@@ -15,17 +19,34 @@ const SwitchChainApproval = () => {
} = useApprovalRequest();
const dispatch = useDispatch();
+ const isAllNetworks = useSelector(selectIsAllNetworks);
+ const tokenNetworkFilter = useSelector(selectTokenNetworkFilter);
const onConfirm = useCallback(() => {
defaultOnConfirm();
+ // If portfolio view is enabled should set network filter
+ if (isPortfolioViewEnabled()) {
+ const { PreferencesController } = Engine.context;
+ PreferencesController.setTokenNetworkFilter({
+ ...(isAllNetworks ? tokenNetworkFilter : {}),
+ [approvalRequest?.requestData?.chainId]: true,
+ });
+ }
+
dispatch(
networkSwitched({
networkUrl: approvalRequest?.requestData?.rpcUrl,
networkStatus: true,
}),
);
- }, [approvalRequest, defaultOnConfirm, dispatch]);
+ }, [
+ approvalRequest,
+ defaultOnConfirm,
+ dispatch,
+ isAllNetworks,
+ tokenNetworkFilter,
+ ]);
if (approvalRequest?.type !== ApprovalTypes.SWITCH_ETHEREUM_CHAIN)
return null;
diff --git a/app/components/UI/AddCustomToken/__snapshots__/index.test.tsx.snap b/app/components/UI/AddCustomToken/__snapshots__/index.test.tsx.snap
index 4ad291a7d08..d2af139ec0f 100644
--- a/app/components/UI/AddCustomToken/__snapshots__/index.test.tsx.snap
+++ b/app/components/UI/AddCustomToken/__snapshots__/index.test.tsx.snap
@@ -232,9 +232,9 @@ exports[`AddCustomToken render matches previous snapshot 1`] = `
style={
{
"color": "#ffffff",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
diff --git a/app/components/UI/ApprovalTagUrl/ApprovalTagUrl.test.tsx b/app/components/UI/ApprovalTagUrl/ApprovalTagUrl.test.tsx
index 415cff34f01..0b260915412 100644
--- a/app/components/UI/ApprovalTagUrl/ApprovalTagUrl.test.tsx
+++ b/app/components/UI/ApprovalTagUrl/ApprovalTagUrl.test.tsx
@@ -1,10 +1,12 @@
import React from 'react';
import renderWithProvider from '../../../util/test/renderWithProvider';
-import ApprovalTagUrl from './ApprovalTagUrl';
+import ApprovalTagUrl, { APPROVAL_TAG_URL_ORIGIN_PILL } from './ApprovalTagUrl';
import { backgroundState } from '../../../util/test/initial-root-state';
+import { INTERNAL_ORIGINS } from '../../../constants/transaction';
const ADDRESS_MOCK = '0x1234567890abcdef1234567890abcdef12345678';
const DOMAIN_MOCK = 'metamask.github.io';
+
const mockInitialState = {
settings: {},
engine: {
@@ -19,7 +21,7 @@ const mockInitialState = {
describe('ApprovalTagUrl', () => {
it('renders correctly', () => {
- const { toJSON } = renderWithProvider(
+ const { toJSON, getByTestId } = renderWithProvider(
{
);
expect(toJSON()).toMatchSnapshot();
+ expect(getByTestId(APPROVAL_TAG_URL_ORIGIN_PILL)).toBeDefined();
+ });
+
+ it('does not render when origin is an internal origin', () => {
+ const { queryByTestId } = renderWithProvider(
+ ,
+ { state: mockInitialState },
+ );
+
+ expect(queryByTestId(APPROVAL_TAG_URL_ORIGIN_PILL)).toBeNull();
});
});
diff --git a/app/components/UI/ApprovalTagUrl/ApprovalTagUrl.tsx b/app/components/UI/ApprovalTagUrl/ApprovalTagUrl.tsx
index 48ca00125da..dc7ebc8aa2d 100644
--- a/app/components/UI/ApprovalTagUrl/ApprovalTagUrl.tsx
+++ b/app/components/UI/ApprovalTagUrl/ApprovalTagUrl.tsx
@@ -11,6 +11,7 @@ import { selectAccountsByChainId } from '../../../selectors/accountTrackerContro
import { getHost, prefixUrlWithProtocol } from '../../../util/browser';
import useFavicon from '../../hooks/useFavicon/useFavicon';
import stylesheet from './ApprovalTagUrl.styles';
+import { INTERNAL_ORIGINS } from '../../../constants/transaction';
const { ORIGIN_DEEPLINK, ORIGIN_QR_CODE } = AppConstants.DEEPLINKS;
export const APPROVAL_TAG_URL_ORIGIN_PILL = 'APPROVAL_TAG_URL_ORIGIN_PILL';
@@ -76,7 +77,9 @@ const ApprovalTagUrl = ({
uri: '',
};
- if (origin && !isOriginDeepLink) {
+ const showOrigin = origin && !isOriginDeepLink && !INTERNAL_ORIGINS.includes(origin);
+
+ if (showOrigin) {
return (
= ({
? (asset.chainId as Hex)
: selectedChainId;
const ticker = isPortfolioViewEnabled() ? nativeCurrency : selectedTicker;
+ const selectedNetworkClientId = useSelector(selectSelectedNetworkClientId);
let currentAddress: Hex;
@@ -136,12 +138,12 @@ const AssetOverview: React.FC = ({
const dispatch = useDispatch();
useEffect(() => {
- const { SwapsController: SwapsControllerFromEngine } = Engine.context as {
- SwapsController: SwapsController;
- };
+ const { SwapsController } = Engine.context;
const fetchTokenWithCache = async () => {
try {
- await SwapsControllerFromEngine.fetchTokenWithCache();
+ await SwapsController.fetchTokenWithCache({
+ networkClientId: selectedNetworkClientId,
+ });
// TODO: Replace "any" with type
// eslint-disable-next-line @typescript-eslint/no-explicit-any
} catch (error: any) {
@@ -152,7 +154,7 @@ const AssetOverview: React.FC = ({
}
};
fetchTokenWithCache();
- }, []);
+ }, [selectedNetworkClientId]);
const onReceive = () => {
navigation.navigate(Routes.QR_TAB_SWITCHER, {
diff --git a/app/components/UI/BasicFunctionality/BasicFunctionalityModal/__snapshots__/BasicFunctionalityModal.test.js.snap b/app/components/UI/BasicFunctionality/BasicFunctionalityModal/__snapshots__/BasicFunctionalityModal.test.js.snap
index 42798823837..f896d299399 100644
--- a/app/components/UI/BasicFunctionality/BasicFunctionalityModal/__snapshots__/BasicFunctionalityModal.test.js.snap
+++ b/app/components/UI/BasicFunctionality/BasicFunctionalityModal/__snapshots__/BasicFunctionalityModal.test.js.snap
@@ -266,9 +266,9 @@ exports[`BasicFunctionalityModal should render correctly 1`] = `
style={
{
"color": "#0376c9",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -312,9 +312,9 @@ exports[`BasicFunctionalityModal should render correctly 1`] = `
style={
{
"color": "#ffffff",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
diff --git a/app/components/UI/CollectibleModal/__snapshots__/CollectibleModal.test.tsx.snap b/app/components/UI/CollectibleModal/__snapshots__/CollectibleModal.test.tsx.snap
index 0506e53601f..af8283d43f7 100644
--- a/app/components/UI/CollectibleModal/__snapshots__/CollectibleModal.test.tsx.snap
+++ b/app/components/UI/CollectibleModal/__snapshots__/CollectibleModal.test.tsx.snap
@@ -216,9 +216,9 @@ exports[`CollectibleModal should render correctly 1`] = `
style={
{
"color": "#0376c9",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
diff --git a/app/components/UI/ConfirmAddAsset/__snapshots__/ConfirmAddAsset.test.tsx.snap b/app/components/UI/ConfirmAddAsset/__snapshots__/ConfirmAddAsset.test.tsx.snap
index 6819273801b..7115fb243ce 100644
--- a/app/components/UI/ConfirmAddAsset/__snapshots__/ConfirmAddAsset.test.tsx.snap
+++ b/app/components/UI/ConfirmAddAsset/__snapshots__/ConfirmAddAsset.test.tsx.snap
@@ -328,9 +328,9 @@ exports[`ConfirmAddAsset render matches previous snapshot 1`] = `
style={
{
"color": "#0376c9",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -368,9 +368,9 @@ exports[`ConfirmAddAsset render matches previous snapshot 1`] = `
style={
{
"color": "#ffffff",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
diff --git a/app/components/UI/EnableAutomaticSecurityChecksModal/__snapshots__/EnableAutomaticSecurityChecksModal.test.tsx.snap b/app/components/UI/EnableAutomaticSecurityChecksModal/__snapshots__/EnableAutomaticSecurityChecksModal.test.tsx.snap
index c7e04d7fef6..7b8944b808c 100644
--- a/app/components/UI/EnableAutomaticSecurityChecksModal/__snapshots__/EnableAutomaticSecurityChecksModal.test.tsx.snap
+++ b/app/components/UI/EnableAutomaticSecurityChecksModal/__snapshots__/EnableAutomaticSecurityChecksModal.test.tsx.snap
@@ -477,9 +477,9 @@ exports[`EnableAutomaticSecurityChecksModal should render correctly 1`] = `
style={
{
"color": "#ffffff",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -514,9 +514,9 @@ exports[`EnableAutomaticSecurityChecksModal should render correctly 1`] = `
style={
{
"color": "#0376c9",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
diff --git a/app/components/UI/Navbar/index.js b/app/components/UI/Navbar/index.js
index 8c8d941b7bb..435f30d5fe3 100644
--- a/app/components/UI/Navbar/index.js
+++ b/app/components/UI/Navbar/index.js
@@ -63,6 +63,7 @@ import { toChecksumHexAddress } from '@metamask/controller-utils';
///: BEGIN:ONLY_INCLUDE_IF(keyring-snaps)
import { isBtcAccount } from '../../../core/Multichain/utils';
///: END:ONLY_INCLUDE_IF
+import { withMetaMetrics } from '../Stake/utils/metaMetrics/withMetaMetrics';
const trackEvent = (event, params = {}) => {
MetaMetrics.getInstance().trackEvent(event);
@@ -1949,16 +1950,23 @@ export const getSettingsNavigationOptions = (title, themeColors) => {
* @param {String} title - Navbar Title.
* @param {NavigationProp} navigation Navigation object returned from useNavigation hook.
* @param {ThemeColors} themeColors theme.colors returned from useStyles hook.
- * @param {{ backgroundColor?: string, hasCancelButton?: boolean, hasBackButton?: boolean }} [options] - Optional options for navbar.
+ * @param {{ backgroundColor?: string, hasCancelButton?: boolean, hasBackButton?: boolean }} [navBarOptions] - Optional navbar options.
+ * @param {{ cancelButtonEvent?: { event: IMetaMetricsEvent, properties: Record }, backButtonEvent?: { event: IMetaMetricsEvent, properties: Record} }} [metricsOptions] - Optional metrics options.
* @returns Staking Navbar Component.
*/
-export function getStakingNavbar(title, navigation, themeColors, options) {
- const { hasBackButton = true, hasCancelButton = true } = options ?? {};
+export function getStakingNavbar(
+ title,
+ navigation,
+ themeColors,
+ navBarOptions,
+ metricsOptions,
+) {
+ const { hasBackButton = true, hasCancelButton = true } = navBarOptions ?? {};
const innerStyles = StyleSheet.create({
headerStyle: {
backgroundColor:
- options?.backgroundColor ?? themeColors.background.default,
+ navBarOptions?.backgroundColor ?? themeColors.background.default,
shadowOffset: null,
},
headerLeft: {
@@ -1978,6 +1986,28 @@ export function getStakingNavbar(title, navigation, themeColors, options) {
navigation.goBack();
}
+ function handleBackPress() {
+ if (metricsOptions?.backButtonEvent) {
+ withMetaMetrics(navigationPop, {
+ event: metricsOptions.backButtonEvent.event,
+ properties: metricsOptions.backButtonEvent.properties,
+ });
+ } else {
+ navigationPop();
+ }
+ }
+
+ function handleCancelPress() {
+ if (metricsOptions?.cancelButtonEvent) {
+ withMetaMetrics(navigationPop, {
+ event: metricsOptions.cancelButtonEvent.event,
+ properties: metricsOptions.cancelButtonEvent.properties,
+ });
+ } else {
+ navigationPop();
+ }
+ }
+
return {
headerTitle: () => (
@@ -1990,7 +2020,7 @@ export function getStakingNavbar(title, navigation, themeColors, options) {
) : (
@@ -1999,7 +2029,7 @@ export function getStakingNavbar(title, navigation, themeColors, options) {
headerRight: () =>
hasCancelButton ? (
navigation.dangerouslyGetParent()?.pop()}
+ onPress={handleCancelPress}
style={styles.closeButton}
>
diff --git a/app/components/UI/NavbarTitle/index.js b/app/components/UI/NavbarTitle/index.js
index d1ce5408209..30b05eb77ae 100644
--- a/app/components/UI/NavbarTitle/index.js
+++ b/app/components/UI/NavbarTitle/index.js
@@ -14,6 +14,7 @@ import { selectProviderConfig } from '../../../selectors/networkController';
import { withMetricsAwareness } from '../../../components/hooks/useMetrics';
import Text, {
TextVariant,
+ TextColor,
} from '../../../component-library/components/Texts/Text';
const createStyles = (colors) =>
@@ -21,38 +22,11 @@ const createStyles = (colors) =>
wrapper: {
justifyContent: 'center',
alignItems: 'center',
- flex: 1,
},
network: {
flexDirection: 'row',
alignItems: 'center',
},
- networkName: {
- fontSize: 11,
- color: colors.text.alternative,
- ...fontStyles.normal,
- },
- networkIcon: {
- width: 5,
- height: 5,
- borderRadius: 100,
- marginRight: 5,
- },
- title: {
- fontSize: scale(14),
- ...fontStyles.normal,
- color: colors.text.default,
- },
- children: {
- ...fontStyles.normal,
- color: colors.text.default,
- fontWeight: 'bold',
- },
- otherNetworkIcon: {
- backgroundColor: importedColors.transparent,
- borderColor: colors.border.default,
- borderWidth: 1,
- },
});
/**
@@ -163,26 +137,22 @@ class NavbarTitle extends PureComponent {
activeOpacity={this.props.disableNetwork ? 1 : 0.2}
>
{title ? (
-
+
{realTitle}
) : null}
{typeof children === 'string' ? (
-
- {strings(children)}
-
+ {strings(children)}
) : (
children
)}
{showSelectedNetwork ? (
-
-
+
{name}
diff --git a/app/components/UI/NetworkModal/NetworkAdded/index.tsx b/app/components/UI/NetworkModal/NetworkAdded/index.tsx
index 299781879c2..8a00786072f 100644
--- a/app/components/UI/NetworkModal/NetworkAdded/index.tsx
+++ b/app/components/UI/NetworkModal/NetworkAdded/index.tsx
@@ -1,15 +1,30 @@
import React from 'react';
import { StyleSheet, View } from 'react-native';
-import StyledButton from '../../StyledButton';
import { strings } from '../../../../../locales/i18n';
-import Text from '../../../Base/Text';
-import { useTheme } from '../../../../util/theme';
import { NetworkAddedBottomSheetSelectorsIDs } from '../../../../../e2e/selectors/Network/NetworkAddedBottomSheet.selectors';
+import BottomSheetHeader from '../../../../component-library/components/BottomSheets/BottomSheetHeader';
+import Text, {
+ TextVariant,
+} from '../../../../component-library/components/Texts/Text';
+import BottomSheetFooter, {
+ ButtonsAlignment,
+} from '../../../../component-library/components/BottomSheets/BottomSheetFooter';
+import {
+ ButtonProps,
+ ButtonVariants,
+ ButtonSize,
+} from '../../../../component-library/components/Buttons/Button/Button.types';
// TODO: Replace "any" with type
// eslint-disable-next-line @typescript-eslint/no-explicit-any
-const createStyles = (colors: any) =>
+const createStyles = () =>
StyleSheet.create({
+ header: {
+ padding: 0,
+ },
+ content: {
+ paddingVertical: 16,
+ },
buttonView: {
flexDirection: 'row',
paddingVertical: 16,
@@ -17,19 +32,6 @@ const createStyles = (colors: any) =>
base: {
padding: 16,
},
- button: {
- flex: 1,
- },
- cancel: {
- marginRight: 8,
- backgroundColor: colors.background.default,
- borderColor: colors.border.default,
-
- borderWidth: 1,
- },
- confirm: {
- marginLeft: 8,
- },
});
interface NetworkAddedProps {
@@ -40,38 +42,45 @@ interface NetworkAddedProps {
const NetworkAdded = (props: NetworkAddedProps) => {
const { nickname, closeModal, switchNetwork } = props;
- const { colors } = useTheme();
- const styles = createStyles(colors);
+ const styles = createStyles();
+ const buttonProps: ButtonProps[] = [
+ {
+ variant: ButtonVariants.Secondary,
+ size: ButtonSize.Lg,
+ onPress: closeModal,
+ label: strings('networks.close'),
+ testID: NetworkAddedBottomSheetSelectorsIDs.CLOSE_NETWORK_BUTTON,
+ },
+ {
+ variant: ButtonVariants.Primary,
+ size: ButtonSize.Lg,
+ onPress: switchNetwork,
+ label: strings('networks.switch_network'),
+ testID: NetworkAddedBottomSheetSelectorsIDs.SWITCH_NETWORK_BUTTON,
+ },
+ ];
return (
-
+
{strings('networks.new_network')}
-
-
- {`"${strings('networks.network_name', {
- networkName: nickname ?? '',
- })}"`}
- {strings('networks.network_added')}
-
-
-
- {strings('networks.close')}
-
-
- {strings('networks.switch_network')}
-
+
+
+
+
+ {`"${strings('networks.network_name', {
+ networkName: nickname ?? '',
+ })}"`}
+
+
+ {strings('networks.network_added')}
+
+
+
);
};
diff --git a/app/components/UI/NetworkModal/__snapshots__/index.test.tsx.snap b/app/components/UI/NetworkModal/__snapshots__/index.test.tsx.snap
index fb2c30e33a1..39fba53e6c6 100644
--- a/app/components/UI/NetworkModal/__snapshots__/index.test.tsx.snap
+++ b/app/components/UI/NetworkModal/__snapshots__/index.test.tsx.snap
@@ -146,7 +146,6 @@ exports[`NetworkDetails renders correctly 1`] = `
onSelectNetwork?.(id, isSelectedNetwork)}
- avatarProps={{
- variant: AvatarVariant.Network,
- name,
- imageSource: imageSource as ImageSourcePropType,
- size: AvatarSize.Sm,
- }}
- disabled={isDisabled}
+
- {renderRightAccessory?.(id, name)}
-
+ onSelectNetwork?.(id, isSelectedNetwork)}
+ avatarProps={{
+ variant: AvatarVariant.Network,
+ name,
+ imageSource: imageSource as ImageSourcePropType,
+ size: AvatarSize.Sm,
+ }}
+ disabled={isDisabled}
+ >
+ {renderRightAccessory?.(id, name)}
+ |
+
);
},
[
diff --git a/app/components/UI/NetworkVerificationInfo/__snapshots__/NetworkVerificationInfo.test.tsx.snap b/app/components/UI/NetworkVerificationInfo/__snapshots__/NetworkVerificationInfo.test.tsx.snap
index 7b3fccd6bdf..e1174c3ee36 100644
--- a/app/components/UI/NetworkVerificationInfo/__snapshots__/NetworkVerificationInfo.test.tsx.snap
+++ b/app/components/UI/NetworkVerificationInfo/__snapshots__/NetworkVerificationInfo.test.tsx.snap
@@ -7,7 +7,6 @@ exports[`NetworkVerificationInfo renders correctly 1`] = `
-
@@ -858,7 +842,6 @@ exports[`BuildQuote View Crypto Currency Data renders a special error page if cr
style={
{
"alignItems": "center",
- "flex": 1,
"justifyContent": "center",
}
}
@@ -869,9 +852,9 @@ exports[`BuildQuote View Crypto Currency Data renders a special error page if cr
style={
{
"color": "#141618",
- "fontFamily": "EuclidCircularB-Regular",
- "fontSize": 30,
- "fontWeight": "400",
+ "fontFamily": "EuclidCircularB-Bold",
+ "fontSize": 14,
+ "fontWeight": "700",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -887,21 +870,6 @@ exports[`BuildQuote View Crypto Currency Data renders a special error page if cr
}
}
>
-
@@ -1559,7 +1527,6 @@ exports[`BuildQuote View Crypto Currency Data renders an error page when there i
style={
{
"alignItems": "center",
- "flex": 1,
"justifyContent": "center",
}
}
@@ -1570,9 +1537,9 @@ exports[`BuildQuote View Crypto Currency Data renders an error page when there i
style={
{
"color": "#141618",
- "fontFamily": "EuclidCircularB-Regular",
- "fontSize": 30,
- "fontWeight": "400",
+ "fontFamily": "EuclidCircularB-Bold",
+ "fontSize": 14,
+ "fontWeight": "700",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -1588,21 +1555,6 @@ exports[`BuildQuote View Crypto Currency Data renders an error page when there i
}
}
>
-
@@ -2231,7 +2183,6 @@ exports[`BuildQuote View Crypto Currency Data renders the loading page when cryp
style={
{
"alignItems": "center",
- "flex": 1,
"justifyContent": "center",
}
}
@@ -2242,9 +2193,9 @@ exports[`BuildQuote View Crypto Currency Data renders the loading page when cryp
style={
{
"color": "#141618",
- "fontFamily": "EuclidCircularB-Regular",
- "fontSize": 30,
- "fontWeight": "400",
+ "fontFamily": "EuclidCircularB-Bold",
+ "fontSize": 14,
+ "fontWeight": "700",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -2260,21 +2211,6 @@ exports[`BuildQuote View Crypto Currency Data renders the loading page when cryp
}
}
>
-
@@ -3179,7 +3115,6 @@ exports[`BuildQuote View Fiat Currency Data renders an error page when there is
style={
{
"alignItems": "center",
- "flex": 1,
"justifyContent": "center",
}
}
@@ -3190,9 +3125,9 @@ exports[`BuildQuote View Fiat Currency Data renders an error page when there is
style={
{
"color": "#141618",
- "fontFamily": "EuclidCircularB-Regular",
- "fontSize": 30,
- "fontWeight": "400",
+ "fontFamily": "EuclidCircularB-Bold",
+ "fontSize": 14,
+ "fontWeight": "700",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -3208,21 +3143,6 @@ exports[`BuildQuote View Fiat Currency Data renders an error page when there is
}
}
>
-
@@ -3851,7 +3771,6 @@ exports[`BuildQuote View Fiat Currency Data renders the loading page when fiats
style={
{
"alignItems": "center",
- "flex": 1,
"justifyContent": "center",
}
}
@@ -3862,9 +3781,9 @@ exports[`BuildQuote View Fiat Currency Data renders the loading page when fiats
style={
{
"color": "#141618",
- "fontFamily": "EuclidCircularB-Regular",
- "fontSize": 30,
- "fontWeight": "400",
+ "fontFamily": "EuclidCircularB-Bold",
+ "fontSize": 14,
+ "fontWeight": "700",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -3880,21 +3799,6 @@ exports[`BuildQuote View Fiat Currency Data renders the loading page when fiats
}
}
>
-
@@ -4799,7 +4703,6 @@ exports[`BuildQuote View Payment Method Data renders an error page when there is
style={
{
"alignItems": "center",
- "flex": 1,
"justifyContent": "center",
}
}
@@ -4810,9 +4713,9 @@ exports[`BuildQuote View Payment Method Data renders an error page when there is
style={
{
"color": "#141618",
- "fontFamily": "EuclidCircularB-Regular",
- "fontSize": 30,
- "fontWeight": "400",
+ "fontFamily": "EuclidCircularB-Bold",
+ "fontSize": 14,
+ "fontWeight": "700",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -4828,21 +4731,6 @@ exports[`BuildQuote View Payment Method Data renders an error page when there is
}
}
>
-
@@ -5471,7 +5359,6 @@ exports[`BuildQuote View Payment Method Data renders the loading page when payme
style={
{
"alignItems": "center",
- "flex": 1,
"justifyContent": "center",
}
}
@@ -5482,9 +5369,9 @@ exports[`BuildQuote View Payment Method Data renders the loading page when payme
style={
{
"color": "#141618",
- "fontFamily": "EuclidCircularB-Regular",
- "fontSize": 30,
- "fontWeight": "400",
+ "fontFamily": "EuclidCircularB-Bold",
+ "fontSize": 14,
+ "fontWeight": "700",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -5500,21 +5387,6 @@ exports[`BuildQuote View Payment Method Data renders the loading page when payme
}
}
>
-
@@ -6419,7 +6291,6 @@ exports[`BuildQuote View Regions data renders an error page when there is a regi
style={
{
"alignItems": "center",
- "flex": 1,
"justifyContent": "center",
}
}
@@ -6430,9 +6301,9 @@ exports[`BuildQuote View Regions data renders an error page when there is a regi
style={
{
"color": "#141618",
- "fontFamily": "EuclidCircularB-Regular",
- "fontSize": 30,
- "fontWeight": "400",
+ "fontFamily": "EuclidCircularB-Bold",
+ "fontSize": 14,
+ "fontWeight": "700",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -6448,21 +6319,6 @@ exports[`BuildQuote View Regions data renders an error page when there is a regi
}
}
>
-
@@ -7091,7 +6947,6 @@ exports[`BuildQuote View Regions data renders the loading page when regions are
style={
{
"alignItems": "center",
- "flex": 1,
"justifyContent": "center",
}
}
@@ -7102,9 +6957,9 @@ exports[`BuildQuote View Regions data renders the loading page when regions are
style={
{
"color": "#141618",
- "fontFamily": "EuclidCircularB-Regular",
- "fontSize": 30,
- "fontWeight": "400",
+ "fontFamily": "EuclidCircularB-Bold",
+ "fontSize": 14,
+ "fontWeight": "700",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -7120,21 +6975,6 @@ exports[`BuildQuote View Regions data renders the loading page when regions are
}
}
>
-
@@ -8039,7 +7879,6 @@ exports[`BuildQuote View renders correctly 1`] = `
style={
{
"alignItems": "center",
- "flex": 1,
"justifyContent": "center",
}
}
@@ -8050,9 +7889,9 @@ exports[`BuildQuote View renders correctly 1`] = `
style={
{
"color": "#141618",
- "fontFamily": "EuclidCircularB-Regular",
- "fontSize": 30,
- "fontWeight": "400",
+ "fontFamily": "EuclidCircularB-Bold",
+ "fontSize": 14,
+ "fontWeight": "700",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -8068,21 +7907,6 @@ exports[`BuildQuote View renders correctly 1`] = `
}
}
>
-
@@ -11094,7 +10918,6 @@ exports[`BuildQuote View renders correctly 2`] = `
style={
{
"alignItems": "center",
- "flex": 1,
"justifyContent": "center",
}
}
@@ -11105,9 +10928,9 @@ exports[`BuildQuote View renders correctly 2`] = `
style={
{
"color": "#141618",
- "fontFamily": "EuclidCircularB-Regular",
- "fontSize": 30,
- "fontWeight": "400",
+ "fontFamily": "EuclidCircularB-Bold",
+ "fontSize": 14,
+ "fontWeight": "700",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -11123,21 +10946,6 @@ exports[`BuildQuote View renders correctly 2`] = `
}
}
>
-
@@ -14129,7 +13937,6 @@ exports[`BuildQuote View renders correctly when sdkError is present 1`] = `
style={
{
"alignItems": "center",
- "flex": 1,
"justifyContent": "center",
}
}
@@ -14140,9 +13947,9 @@ exports[`BuildQuote View renders correctly when sdkError is present 1`] = `
style={
{
"color": "#141618",
- "fontFamily": "EuclidCircularB-Regular",
- "fontSize": 30,
- "fontWeight": "400",
+ "fontFamily": "EuclidCircularB-Bold",
+ "fontSize": 14,
+ "fontWeight": "700",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -14158,21 +13965,6 @@ exports[`BuildQuote View renders correctly when sdkError is present 1`] = `
}
}
>
-
@@ -14801,7 +14593,6 @@ exports[`BuildQuote View renders correctly when sdkError is present 2`] = `
style={
{
"alignItems": "center",
- "flex": 1,
"justifyContent": "center",
}
}
@@ -14812,9 +14603,9 @@ exports[`BuildQuote View renders correctly when sdkError is present 2`] = `
style={
{
"color": "#141618",
- "fontFamily": "EuclidCircularB-Regular",
- "fontSize": 30,
- "fontWeight": "400",
+ "fontFamily": "EuclidCircularB-Bold",
+ "fontSize": 14,
+ "fontWeight": "700",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -14830,21 +14621,6 @@ exports[`BuildQuote View renders correctly when sdkError is present 2`] = `
}
}
>
-
diff --git a/app/components/UI/Ramp/Views/GetStarted/__snapshots__/GetStarted.test.tsx.snap b/app/components/UI/Ramp/Views/GetStarted/__snapshots__/GetStarted.test.tsx.snap
index 747b1d55068..c19b71c5914 100644
--- a/app/components/UI/Ramp/Views/GetStarted/__snapshots__/GetStarted.test.tsx.snap
+++ b/app/components/UI/Ramp/Views/GetStarted/__snapshots__/GetStarted.test.tsx.snap
@@ -134,7 +134,6 @@ exports[`GetStarted renders correctly 1`] = `
style={
{
"alignItems": "center",
- "flex": 1,
"justifyContent": "center",
}
}
@@ -145,9 +144,9 @@ exports[`GetStarted renders correctly 1`] = `
style={
{
"color": "#141618",
- "fontFamily": "EuclidCircularB-Regular",
- "fontSize": 30,
- "fontWeight": "400",
+ "fontFamily": "EuclidCircularB-Bold",
+ "fontSize": 14,
+ "fontWeight": "700",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -163,21 +162,6 @@ exports[`GetStarted renders correctly 1`] = `
}
}
>
-
@@ -807,7 +791,6 @@ exports[`GetStarted renders correctly 2`] = `
style={
{
"alignItems": "center",
- "flex": 1,
"justifyContent": "center",
}
}
@@ -818,9 +801,9 @@ exports[`GetStarted renders correctly 2`] = `
style={
{
"color": "#141618",
- "fontFamily": "EuclidCircularB-Regular",
- "fontSize": 30,
- "fontWeight": "400",
+ "fontFamily": "EuclidCircularB-Bold",
+ "fontSize": 14,
+ "fontWeight": "700",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -836,21 +819,6 @@ exports[`GetStarted renders correctly 2`] = `
}
}
>
-
@@ -1480,7 +1448,6 @@ exports[`GetStarted renders correctly when getStarted is true 1`] = `
style={
{
"alignItems": "center",
- "flex": 1,
"justifyContent": "center",
}
}
@@ -1491,9 +1458,9 @@ exports[`GetStarted renders correctly when getStarted is true 1`] = `
style={
{
"color": "#141618",
- "fontFamily": "EuclidCircularB-Regular",
- "fontSize": 30,
- "fontWeight": "400",
+ "fontFamily": "EuclidCircularB-Bold",
+ "fontSize": 14,
+ "fontWeight": "700",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -1509,21 +1476,6 @@ exports[`GetStarted renders correctly when getStarted is true 1`] = `
}
}
>
-
@@ -1923,7 +1875,6 @@ exports[`GetStarted renders correctly when sdkError is present 1`] = `
style={
{
"alignItems": "center",
- "flex": 1,
"justifyContent": "center",
}
}
@@ -1934,9 +1885,9 @@ exports[`GetStarted renders correctly when sdkError is present 1`] = `
style={
{
"color": "#141618",
- "fontFamily": "EuclidCircularB-Regular",
- "fontSize": 30,
- "fontWeight": "400",
+ "fontFamily": "EuclidCircularB-Bold",
+ "fontSize": 14,
+ "fontWeight": "700",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -1952,21 +1903,6 @@ exports[`GetStarted renders correctly when sdkError is present 1`] = `
}
}
>
-
diff --git a/app/components/UI/Ramp/Views/NetworkSwitcher/NetworkSwitcher.test.tsx b/app/components/UI/Ramp/Views/NetworkSwitcher/NetworkSwitcher.test.tsx
index f9921440bd4..5ae44ae8a59 100644
--- a/app/components/UI/Ramp/Views/NetworkSwitcher/NetworkSwitcher.test.tsx
+++ b/app/components/UI/Ramp/Views/NetworkSwitcher/NetworkSwitcher.test.tsx
@@ -181,6 +181,7 @@ const mockuseRampSDKInitialValues: Partial = {
isBuy: true,
isSell: false,
rampType: RampType.BUY,
+ setIntent: jest.fn(),
};
let mockUseRampSDKValues: Partial = {
@@ -275,12 +276,12 @@ describe('NetworkSwitcher View', () => {
expect(cancelButtons3.length).toBe(1);
});
- it('switches network by calling setProviderType', async () => {
+ it('switches network by calling setActiveNetwork', async () => {
render(NetworkSwitcher);
const lineaNetworkText = screen.getByText('Linea Main Network');
fireEvent.press(lineaNetworkText);
expect(
- (Engine.context.NetworkController.setProviderType as jest.Mock).mock
+ (Engine.context.NetworkController.setActiveNetwork as jest.Mock).mock
.calls,
).toMatchInlineSnapshot(`
[
@@ -290,6 +291,7 @@ describe('NetworkSwitcher View', () => {
]
`);
+ jest.clearAllMocks();
render(NetworkSwitcher);
const polygonNetworkTest = screen.getByText('Polygon Mainnet');
fireEvent.press(polygonNetworkTest);
diff --git a/app/components/UI/Ramp/Views/NetworkSwitcher/NetworkSwitcher.tsx b/app/components/UI/Ramp/Views/NetworkSwitcher/NetworkSwitcher.tsx
index bd41a45d241..6dbf9289fb9 100644
--- a/app/components/UI/Ramp/Views/NetworkSwitcher/NetworkSwitcher.tsx
+++ b/app/components/UI/Ramp/Views/NetworkSwitcher/NetworkSwitcher.tsx
@@ -59,7 +59,7 @@ function NetworkSwitcher() {
} = useRampNetworksDetail();
const supportedNetworks = useSelector(getRampNetworks);
const [isCurrentNetworkRampSupported] = useRampNetwork();
- const { selectedChainId, isBuy, intent } = useRampSDK();
+ const { selectedChainId, isBuy, intent, setIntent } = useRampSDK();
const networkConfigurations = useSelector(selectNetworkConfigurations);
const [networkToBeAdded, setNetworkToBeAdded] = useState();
@@ -145,7 +145,7 @@ function NetworkSwitcher() {
const switchToMainnet = useCallback(
(type: 'mainnet' | 'linea-mainnet') => {
const { NetworkController } = Engine.context;
- NetworkController.setProviderType(type);
+ NetworkController.setActiveNetwork(type);
navigateToGetStarted();
},
[navigateToGetStarted],
@@ -173,13 +173,23 @@ function NetworkSwitcher() {
const handleNetworkPress = useCallback(
(networkConfiguration) => {
+ setIntent((prevIntent) => ({
+ ...prevIntent,
+ chainId: networkConfiguration.chainId,
+ }));
+
+ const networkConfigurationWithHexChainId = {
+ ...networkConfiguration,
+ chainId: toHex(networkConfiguration.chainId),
+ };
+
if (networkConfiguration.isAdded) {
- switchNetwork(networkConfiguration);
+ switchNetwork(networkConfigurationWithHexChainId);
} else {
- setNetworkToBeAdded(networkConfiguration);
+ setNetworkToBeAdded(networkConfigurationWithHexChainId);
}
},
- [switchNetwork],
+ [setIntent, switchNetwork],
);
const handleIntentChainId = useCallback(
@@ -199,7 +209,8 @@ function NetworkSwitcher() {
(networkConfiguration) => {
const isAdded = Object.values(networkConfigurations).some(
(savedNetwork) =>
- savedNetwork.chainId === networkConfiguration.chainId,
+ toHex(savedNetwork.chainId) ===
+ toHex(networkConfiguration.chainId),
);
return {
...networkConfiguration,
diff --git a/app/components/UI/Ramp/Views/NetworkSwitcher/__snapshots__/NetworkSwitcher.test.tsx.snap b/app/components/UI/Ramp/Views/NetworkSwitcher/__snapshots__/NetworkSwitcher.test.tsx.snap
index a55851ee09d..bb6a19b863d 100644
--- a/app/components/UI/Ramp/Views/NetworkSwitcher/__snapshots__/NetworkSwitcher.test.tsx.snap
+++ b/app/components/UI/Ramp/Views/NetworkSwitcher/__snapshots__/NetworkSwitcher.test.tsx.snap
@@ -134,7 +134,6 @@ exports[`NetworkSwitcher View renders and dismisses network modal when pressing
style={
{
"alignItems": "center",
- "flex": 1,
"justifyContent": "center",
}
}
@@ -145,9 +144,9 @@ exports[`NetworkSwitcher View renders and dismisses network modal when pressing
style={
{
"color": "#141618",
- "fontFamily": "EuclidCircularB-Regular",
- "fontSize": 30,
- "fontWeight": "400",
+ "fontFamily": "EuclidCircularB-Bold",
+ "fontSize": 14,
+ "fontWeight": "700",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -163,21 +162,6 @@ exports[`NetworkSwitcher View renders and dismisses network modal when pressing
}
}
>
-
@@ -978,7 +962,6 @@ exports[`NetworkSwitcher View renders and dismisses network modal when pressing
-
@@ -3037,7 +3004,6 @@ exports[`NetworkSwitcher View renders correctly 1`] = `
style={
{
"alignItems": "center",
- "flex": 1,
"justifyContent": "center",
}
}
@@ -3048,9 +3014,9 @@ exports[`NetworkSwitcher View renders correctly 1`] = `
style={
{
"color": "#141618",
- "fontFamily": "EuclidCircularB-Regular",
- "fontSize": 30,
- "fontWeight": "400",
+ "fontFamily": "EuclidCircularB-Bold",
+ "fontSize": 14,
+ "fontWeight": "700",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -3066,21 +3032,6 @@ exports[`NetworkSwitcher View renders correctly 1`] = `
}
}
>
-
@@ -4192,7 +4143,6 @@ exports[`NetworkSwitcher View renders correctly 2`] = `
style={
{
"alignItems": "center",
- "flex": 1,
"justifyContent": "center",
}
}
@@ -4203,9 +4153,9 @@ exports[`NetworkSwitcher View renders correctly 2`] = `
style={
{
"color": "#141618",
- "fontFamily": "EuclidCircularB-Regular",
- "fontSize": 30,
- "fontWeight": "400",
+ "fontFamily": "EuclidCircularB-Bold",
+ "fontSize": 14,
+ "fontWeight": "700",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -4221,21 +4171,6 @@ exports[`NetworkSwitcher View renders correctly 2`] = `
}
}
>
-
@@ -5347,7 +5282,6 @@ exports[`NetworkSwitcher View renders correctly while loading 1`] = `
style={
{
"alignItems": "center",
- "flex": 1,
"justifyContent": "center",
}
}
@@ -5358,9 +5292,9 @@ exports[`NetworkSwitcher View renders correctly while loading 1`] = `
style={
{
"color": "#141618",
- "fontFamily": "EuclidCircularB-Regular",
- "fontSize": 30,
- "fontWeight": "400",
+ "fontFamily": "EuclidCircularB-Bold",
+ "fontSize": 14,
+ "fontWeight": "700",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -5376,21 +5310,6 @@ exports[`NetworkSwitcher View renders correctly while loading 1`] = `
}
}
>
-
@@ -6690,7 +6609,6 @@ exports[`NetworkSwitcher View renders correctly while loading 2`] = `
style={
{
"alignItems": "center",
- "flex": 1,
"justifyContent": "center",
}
}
@@ -6701,9 +6619,9 @@ exports[`NetworkSwitcher View renders correctly while loading 2`] = `
style={
{
"color": "#141618",
- "fontFamily": "EuclidCircularB-Regular",
- "fontSize": 30,
- "fontWeight": "400",
+ "fontFamily": "EuclidCircularB-Bold",
+ "fontSize": 14,
+ "fontWeight": "700",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -6719,21 +6637,6 @@ exports[`NetworkSwitcher View renders correctly while loading 2`] = `
}
}
>
-
@@ -8033,7 +7936,6 @@ exports[`NetworkSwitcher View renders correctly with errors 1`] = `
style={
{
"alignItems": "center",
- "flex": 1,
"justifyContent": "center",
}
}
@@ -8044,9 +7946,9 @@ exports[`NetworkSwitcher View renders correctly with errors 1`] = `
style={
{
"color": "#141618",
- "fontFamily": "EuclidCircularB-Regular",
- "fontSize": 30,
- "fontWeight": "400",
+ "fontFamily": "EuclidCircularB-Bold",
+ "fontSize": 14,
+ "fontWeight": "700",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -8062,21 +7964,6 @@ exports[`NetworkSwitcher View renders correctly with errors 1`] = `
}
}
>
-
@@ -8682,7 +8569,6 @@ exports[`NetworkSwitcher View renders correctly with errors 2`] = `
style={
{
"alignItems": "center",
- "flex": 1,
"justifyContent": "center",
}
}
@@ -8693,9 +8579,9 @@ exports[`NetworkSwitcher View renders correctly with errors 2`] = `
style={
{
"color": "#141618",
- "fontFamily": "EuclidCircularB-Regular",
- "fontSize": 30,
- "fontWeight": "400",
+ "fontFamily": "EuclidCircularB-Bold",
+ "fontSize": 14,
+ "fontWeight": "700",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -8711,21 +8597,6 @@ exports[`NetworkSwitcher View renders correctly with errors 2`] = `
}
}
>
-
@@ -9331,7 +9202,6 @@ exports[`NetworkSwitcher View renders correctly with no data 1`] = `
style={
{
"alignItems": "center",
- "flex": 1,
"justifyContent": "center",
}
}
@@ -9342,9 +9212,9 @@ exports[`NetworkSwitcher View renders correctly with no data 1`] = `
style={
{
"color": "#141618",
- "fontFamily": "EuclidCircularB-Regular",
- "fontSize": 30,
- "fontWeight": "400",
+ "fontFamily": "EuclidCircularB-Bold",
+ "fontSize": 14,
+ "fontWeight": "700",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -9360,21 +9230,6 @@ exports[`NetworkSwitcher View renders correctly with no data 1`] = `
}
}
>
-
diff --git a/app/components/UI/Ramp/Views/OrderDetails/__snapshots__/OrderDetails.test.tsx.snap b/app/components/UI/Ramp/Views/OrderDetails/__snapshots__/OrderDetails.test.tsx.snap
index 9d129bacdfa..f25e42498a0 100644
--- a/app/components/UI/Ramp/Views/OrderDetails/__snapshots__/OrderDetails.test.tsx.snap
+++ b/app/components/UI/Ramp/Views/OrderDetails/__snapshots__/OrderDetails.test.tsx.snap
@@ -157,7 +157,6 @@ exports[`OrderDetails renders a cancelled order 1`] = `
style={
{
"alignItems": "center",
- "flex": 1,
"justifyContent": "center",
}
}
@@ -168,9 +167,9 @@ exports[`OrderDetails renders a cancelled order 1`] = `
style={
{
"color": "#141618",
- "fontFamily": "EuclidCircularB-Regular",
- "fontSize": 30,
- "fontWeight": "400",
+ "fontFamily": "EuclidCircularB-Bold",
+ "fontSize": 14,
+ "fontWeight": "700",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -186,21 +185,6 @@ exports[`OrderDetails renders a cancelled order 1`] = `
}
}
>
-
@@ -1659,7 +1643,6 @@ exports[`OrderDetails renders a completed order 1`] = `
style={
{
"alignItems": "center",
- "flex": 1,
"justifyContent": "center",
}
}
@@ -1670,9 +1653,9 @@ exports[`OrderDetails renders a completed order 1`] = `
style={
{
"color": "#141618",
- "fontFamily": "EuclidCircularB-Regular",
- "fontSize": 30,
- "fontWeight": "400",
+ "fontFamily": "EuclidCircularB-Bold",
+ "fontSize": 14,
+ "fontWeight": "700",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -1688,21 +1671,6 @@ exports[`OrderDetails renders a completed order 1`] = `
}
}
>
-
@@ -3172,7 +3140,6 @@ exports[`OrderDetails renders a created order 1`] = `
style={
{
"alignItems": "center",
- "flex": 1,
"justifyContent": "center",
}
}
@@ -3183,9 +3150,9 @@ exports[`OrderDetails renders a created order 1`] = `
style={
{
"color": "#141618",
- "fontFamily": "EuclidCircularB-Regular",
- "fontSize": 30,
- "fontWeight": "400",
+ "fontFamily": "EuclidCircularB-Bold",
+ "fontSize": 14,
+ "fontWeight": "700",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -3201,21 +3168,6 @@ exports[`OrderDetails renders a created order 1`] = `
}
}
>
-
@@ -4646,7 +4598,6 @@ exports[`OrderDetails renders a failed order 1`] = `
style={
{
"alignItems": "center",
- "flex": 1,
"justifyContent": "center",
}
}
@@ -4657,9 +4608,9 @@ exports[`OrderDetails renders a failed order 1`] = `
style={
{
"color": "#141618",
- "fontFamily": "EuclidCircularB-Regular",
- "fontSize": 30,
- "fontWeight": "400",
+ "fontFamily": "EuclidCircularB-Bold",
+ "fontSize": 14,
+ "fontWeight": "700",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -4675,21 +4626,6 @@ exports[`OrderDetails renders a failed order 1`] = `
}
}
>
-
@@ -6148,7 +6084,6 @@ exports[`OrderDetails renders a pending order 1`] = `
style={
{
"alignItems": "center",
- "flex": 1,
"justifyContent": "center",
}
}
@@ -6159,9 +6094,9 @@ exports[`OrderDetails renders a pending order 1`] = `
style={
{
"color": "#141618",
- "fontFamily": "EuclidCircularB-Regular",
- "fontSize": 30,
- "fontWeight": "400",
+ "fontFamily": "EuclidCircularB-Bold",
+ "fontSize": 14,
+ "fontWeight": "700",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -6177,21 +6112,6 @@ exports[`OrderDetails renders a pending order 1`] = `
}
}
>
-
@@ -7622,7 +7542,6 @@ exports[`OrderDetails renders an empty screen layout if there is no order 1`] =
style={
{
"alignItems": "center",
- "flex": 1,
"justifyContent": "center",
}
}
@@ -7633,9 +7552,9 @@ exports[`OrderDetails renders an empty screen layout if there is no order 1`] =
style={
{
"color": "#141618",
- "fontFamily": "EuclidCircularB-Regular",
- "fontSize": 30,
- "fontWeight": "400",
+ "fontFamily": "EuclidCircularB-Bold",
+ "fontSize": 14,
+ "fontWeight": "700",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -7651,21 +7570,6 @@ exports[`OrderDetails renders an empty screen layout if there is no order 1`] =
}
}
>
-
@@ -8065,7 +7969,6 @@ exports[`OrderDetails renders an error screen if a CREATED order cannot be polle
style={
{
"alignItems": "center",
- "flex": 1,
"justifyContent": "center",
}
}
@@ -8076,9 +7979,9 @@ exports[`OrderDetails renders an error screen if a CREATED order cannot be polle
style={
{
"color": "#141618",
- "fontFamily": "EuclidCircularB-Regular",
- "fontSize": 30,
- "fontWeight": "400",
+ "fontFamily": "EuclidCircularB-Bold",
+ "fontSize": 14,
+ "fontWeight": "700",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -8094,21 +7997,6 @@ exports[`OrderDetails renders an error screen if a CREATED order cannot be polle
}
}
>
-
@@ -8714,7 +8602,6 @@ exports[`OrderDetails renders non-transacted orders 1`] = `
style={
{
"alignItems": "center",
- "flex": 1,
"justifyContent": "center",
}
}
@@ -8725,9 +8612,9 @@ exports[`OrderDetails renders non-transacted orders 1`] = `
style={
{
"color": "#141618",
- "fontFamily": "EuclidCircularB-Regular",
- "fontSize": 30,
- "fontWeight": "400",
+ "fontFamily": "EuclidCircularB-Bold",
+ "fontSize": 14,
+ "fontWeight": "700",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -8743,21 +8630,6 @@ exports[`OrderDetails renders non-transacted orders 1`] = `
}
}
>
-
@@ -10270,7 +10142,6 @@ exports[`OrderDetails renders the support links if the provider has them 1`] = `
style={
{
"alignItems": "center",
- "flex": 1,
"justifyContent": "center",
}
}
@@ -10281,9 +10152,9 @@ exports[`OrderDetails renders the support links if the provider has them 1`] = `
style={
{
"color": "#141618",
- "fontFamily": "EuclidCircularB-Regular",
- "fontSize": 30,
- "fontWeight": "400",
+ "fontFamily": "EuclidCircularB-Bold",
+ "fontSize": 14,
+ "fontWeight": "700",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -10299,21 +10170,6 @@ exports[`OrderDetails renders the support links if the provider has them 1`] = `
}
}
>
-
@@ -11831,7 +11687,6 @@ exports[`OrderDetails renders transacted orders that do not have timeDescription
style={
{
"alignItems": "center",
- "flex": 1,
"justifyContent": "center",
}
}
@@ -11842,9 +11697,9 @@ exports[`OrderDetails renders transacted orders that do not have timeDescription
style={
{
"color": "#141618",
- "fontFamily": "EuclidCircularB-Regular",
- "fontSize": 30,
- "fontWeight": "400",
+ "fontFamily": "EuclidCircularB-Bold",
+ "fontSize": 14,
+ "fontWeight": "700",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -11860,21 +11715,6 @@ exports[`OrderDetails renders transacted orders that do not have timeDescription
}
}
>
-
@@ -13305,7 +13145,6 @@ exports[`OrderDetails renders transacted orders that have timeDescriptionPending
style={
{
"alignItems": "center",
- "flex": 1,
"justifyContent": "center",
}
}
@@ -13316,9 +13155,9 @@ exports[`OrderDetails renders transacted orders that have timeDescriptionPending
style={
{
"color": "#141618",
- "fontFamily": "EuclidCircularB-Regular",
- "fontSize": 30,
- "fontWeight": "400",
+ "fontFamily": "EuclidCircularB-Bold",
+ "fontSize": 14,
+ "fontWeight": "700",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -13334,21 +13173,6 @@ exports[`OrderDetails renders transacted orders that have timeDescriptionPending
}
}
>
-
diff --git a/app/components/UI/Ramp/Views/OrdersList/__snapshots__/OrdersList.test.tsx.snap b/app/components/UI/Ramp/Views/OrdersList/__snapshots__/OrdersList.test.tsx.snap
index 66084c40e31..157da15f487 100644
--- a/app/components/UI/Ramp/Views/OrdersList/__snapshots__/OrdersList.test.tsx.snap
+++ b/app/components/UI/Ramp/Views/OrdersList/__snapshots__/OrdersList.test.tsx.snap
@@ -193,9 +193,9 @@ exports[`OrdersList renders buy only correctly when pressing buy filter 1`] = `
style={
{
"color": "#0376c9",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -231,9 +231,9 @@ exports[`OrdersList renders buy only correctly when pressing buy filter 1`] = `
style={
{
"color": "#ffffff",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -269,9 +269,9 @@ exports[`OrdersList renders buy only correctly when pressing buy filter 1`] = `
style={
{
"color": "#0376c9",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -1069,9 +1069,9 @@ exports[`OrdersList renders correctly 1`] = `
style={
{
"color": "#ffffff",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -1107,9 +1107,9 @@ exports[`OrdersList renders correctly 1`] = `
style={
{
"color": "#0376c9",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -1145,9 +1145,9 @@ exports[`OrdersList renders correctly 1`] = `
style={
{
"color": "#0376c9",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -2044,9 +2044,9 @@ exports[`OrdersList renders empty buy message 1`] = `
style={
{
"color": "#0376c9",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -2082,9 +2082,9 @@ exports[`OrdersList renders empty buy message 1`] = `
style={
{
"color": "#ffffff",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -2120,9 +2120,9 @@ exports[`OrdersList renders empty buy message 1`] = `
style={
{
"color": "#0376c9",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -2293,9 +2293,9 @@ exports[`OrdersList renders empty sell message 1`] = `
style={
{
"color": "#0376c9",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -2331,9 +2331,9 @@ exports[`OrdersList renders empty sell message 1`] = `
style={
{
"color": "#0376c9",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -2369,9 +2369,9 @@ exports[`OrdersList renders empty sell message 1`] = `
style={
{
"color": "#ffffff",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -2568,9 +2568,9 @@ exports[`OrdersList renders sell only correctly when pressing sell filter 1`] =
style={
{
"color": "#0376c9",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -2606,9 +2606,9 @@ exports[`OrdersList renders sell only correctly when pressing sell filter 1`] =
style={
{
"color": "#0376c9",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -2644,9 +2644,9 @@ exports[`OrdersList renders sell only correctly when pressing sell filter 1`] =
style={
{
"color": "#ffffff",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -3002,9 +3002,9 @@ exports[`OrdersList resets filter to all after other filter was set 1`] = `
style={
{
"color": "#0376c9",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -3040,9 +3040,9 @@ exports[`OrdersList resets filter to all after other filter was set 1`] = `
style={
{
"color": "#0376c9",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -3078,9 +3078,9 @@ exports[`OrdersList resets filter to all after other filter was set 1`] = `
style={
{
"color": "#ffffff",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -3500,9 +3500,9 @@ exports[`OrdersList resets filter to all after other filter was set 2`] = `
style={
{
"color": "#ffffff",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -3538,9 +3538,9 @@ exports[`OrdersList resets filter to all after other filter was set 2`] = `
style={
{
"color": "#0376c9",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -3576,9 +3576,9 @@ exports[`OrdersList resets filter to all after other filter was set 2`] = `
style={
{
"color": "#0376c9",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
diff --git a/app/components/UI/Ramp/Views/PaymentMethods/__snapshots__/PaymentMethods.test.tsx.snap b/app/components/UI/Ramp/Views/PaymentMethods/__snapshots__/PaymentMethods.test.tsx.snap
index 8137c427852..2e25a8d696d 100644
--- a/app/components/UI/Ramp/Views/PaymentMethods/__snapshots__/PaymentMethods.test.tsx.snap
+++ b/app/components/UI/Ramp/Views/PaymentMethods/__snapshots__/PaymentMethods.test.tsx.snap
@@ -157,7 +157,6 @@ exports[`PaymentMethods View renders correctly 1`] = `
style={
{
"alignItems": "center",
- "flex": 1,
"justifyContent": "center",
}
}
@@ -168,9 +167,9 @@ exports[`PaymentMethods View renders correctly 1`] = `
style={
{
"color": "#141618",
- "fontFamily": "EuclidCircularB-Regular",
- "fontSize": 30,
- "fontWeight": "400",
+ "fontFamily": "EuclidCircularB-Bold",
+ "fontSize": 14,
+ "fontWeight": "700",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -186,21 +185,6 @@ exports[`PaymentMethods View renders correctly 1`] = `
}
}
>
-
@@ -1620,7 +1604,6 @@ exports[`PaymentMethods View renders correctly for sell 1`] = `
style={
{
"alignItems": "center",
- "flex": 1,
"justifyContent": "center",
}
}
@@ -1631,9 +1614,9 @@ exports[`PaymentMethods View renders correctly for sell 1`] = `
style={
{
"color": "#141618",
- "fontFamily": "EuclidCircularB-Regular",
- "fontSize": 30,
- "fontWeight": "400",
+ "fontFamily": "EuclidCircularB-Bold",
+ "fontSize": 14,
+ "fontWeight": "700",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -1649,21 +1632,6 @@ exports[`PaymentMethods View renders correctly for sell 1`] = `
}
}
>
-
@@ -3083,7 +3051,6 @@ exports[`PaymentMethods View renders correctly while loading 1`] = `
style={
{
"alignItems": "center",
- "flex": 1,
"justifyContent": "center",
}
}
@@ -3094,9 +3061,9 @@ exports[`PaymentMethods View renders correctly while loading 1`] = `
style={
{
"color": "#141618",
- "fontFamily": "EuclidCircularB-Regular",
- "fontSize": 30,
- "fontWeight": "400",
+ "fontFamily": "EuclidCircularB-Bold",
+ "fontSize": 14,
+ "fontWeight": "700",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -3112,21 +3079,6 @@ exports[`PaymentMethods View renders correctly while loading 1`] = `
}
}
>
-
@@ -4324,7 +4276,6 @@ exports[`PaymentMethods View renders correctly with empty data 1`] = `
style={
{
"alignItems": "center",
- "flex": 1,
"justifyContent": "center",
}
}
@@ -4335,9 +4286,9 @@ exports[`PaymentMethods View renders correctly with empty data 1`] = `
style={
{
"color": "#141618",
- "fontFamily": "EuclidCircularB-Regular",
- "fontSize": 30,
- "fontWeight": "400",
+ "fontFamily": "EuclidCircularB-Bold",
+ "fontSize": 14,
+ "fontWeight": "700",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -4353,21 +4304,6 @@ exports[`PaymentMethods View renders correctly with empty data 1`] = `
}
}
>
-
@@ -4998,7 +4934,6 @@ exports[`PaymentMethods View renders correctly with empty data for sell 1`] = `
style={
{
"alignItems": "center",
- "flex": 1,
"justifyContent": "center",
}
}
@@ -5009,9 +4944,9 @@ exports[`PaymentMethods View renders correctly with empty data for sell 1`] = `
style={
{
"color": "#141618",
- "fontFamily": "EuclidCircularB-Regular",
- "fontSize": 30,
- "fontWeight": "400",
+ "fontFamily": "EuclidCircularB-Bold",
+ "fontSize": 14,
+ "fontWeight": "700",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -5027,21 +4962,6 @@ exports[`PaymentMethods View renders correctly with empty data for sell 1`] = `
}
}
>
-
@@ -5672,7 +5592,6 @@ exports[`PaymentMethods View renders correctly with error 1`] = `
style={
{
"alignItems": "center",
- "flex": 1,
"justifyContent": "center",
}
}
@@ -5683,9 +5602,9 @@ exports[`PaymentMethods View renders correctly with error 1`] = `
style={
{
"color": "#141618",
- "fontFamily": "EuclidCircularB-Regular",
- "fontSize": 30,
- "fontWeight": "400",
+ "fontFamily": "EuclidCircularB-Bold",
+ "fontSize": 14,
+ "fontWeight": "700",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -5701,21 +5620,6 @@ exports[`PaymentMethods View renders correctly with error 1`] = `
}
}
>
-
@@ -6344,7 +6248,6 @@ exports[`PaymentMethods View renders correctly with null data 1`] = `
style={
{
"alignItems": "center",
- "flex": 1,
"justifyContent": "center",
}
}
@@ -6355,9 +6258,9 @@ exports[`PaymentMethods View renders correctly with null data 1`] = `
style={
{
"color": "#141618",
- "fontFamily": "EuclidCircularB-Regular",
- "fontSize": 30,
- "fontWeight": "400",
+ "fontFamily": "EuclidCircularB-Bold",
+ "fontSize": 14,
+ "fontWeight": "700",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -6373,21 +6276,6 @@ exports[`PaymentMethods View renders correctly with null data 1`] = `
}
}
>
-
@@ -7585,7 +7473,6 @@ exports[`PaymentMethods View renders correctly with payment method with disclaim
style={
{
"alignItems": "center",
- "flex": 1,
"justifyContent": "center",
}
}
@@ -7596,9 +7483,9 @@ exports[`PaymentMethods View renders correctly with payment method with disclaim
style={
{
"color": "#141618",
- "fontFamily": "EuclidCircularB-Regular",
- "fontSize": 30,
- "fontWeight": "400",
+ "fontFamily": "EuclidCircularB-Bold",
+ "fontSize": 14,
+ "fontWeight": "700",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -7614,21 +7501,6 @@ exports[`PaymentMethods View renders correctly with payment method with disclaim
}
}
>
-
@@ -9106,7 +8978,6 @@ exports[`PaymentMethods View renders correctly with sdkError 1`] = `
style={
{
"alignItems": "center",
- "flex": 1,
"justifyContent": "center",
}
}
@@ -9117,9 +8988,9 @@ exports[`PaymentMethods View renders correctly with sdkError 1`] = `
style={
{
"color": "#141618",
- "fontFamily": "EuclidCircularB-Regular",
- "fontSize": 30,
- "fontWeight": "400",
+ "fontFamily": "EuclidCircularB-Bold",
+ "fontSize": 14,
+ "fontWeight": "700",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -9135,21 +9006,6 @@ exports[`PaymentMethods View renders correctly with sdkError 1`] = `
}
}
>
-
@@ -9755,7 +9611,6 @@ exports[`PaymentMethods View renders correctly with show back button false 1`] =
style={
{
"alignItems": "center",
- "flex": 1,
"justifyContent": "center",
}
}
@@ -9766,9 +9621,9 @@ exports[`PaymentMethods View renders correctly with show back button false 1`] =
style={
{
"color": "#141618",
- "fontFamily": "EuclidCircularB-Regular",
- "fontSize": 30,
- "fontWeight": "400",
+ "fontFamily": "EuclidCircularB-Bold",
+ "fontSize": 14,
+ "fontWeight": "700",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -9784,21 +9639,6 @@ exports[`PaymentMethods View renders correctly with show back button false 1`] =
}
}
>
-
diff --git a/app/components/UI/Ramp/Views/Quotes/__snapshots__/Quotes.test.tsx.snap b/app/components/UI/Ramp/Views/Quotes/__snapshots__/Quotes.test.tsx.snap
index 9240f96c2a9..3ad1e4f304e 100644
--- a/app/components/UI/Ramp/Views/Quotes/__snapshots__/Quotes.test.tsx.snap
+++ b/app/components/UI/Ramp/Views/Quotes/__snapshots__/Quotes.test.tsx.snap
@@ -681,7 +681,6 @@ exports[`Quotes renders animation on first fetching 1`] = `
style={
{
"alignItems": "center",
- "flex": 1,
"justifyContent": "center",
}
}
@@ -692,9 +691,9 @@ exports[`Quotes renders animation on first fetching 1`] = `
style={
{
"color": "#141618",
- "fontFamily": "EuclidCircularB-Regular",
- "fontSize": 30,
- "fontWeight": "400",
+ "fontFamily": "EuclidCircularB-Bold",
+ "fontSize": 14,
+ "fontWeight": "700",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -710,21 +709,6 @@ exports[`Quotes renders animation on first fetching 1`] = `
}
}
>
-
@@ -2920,7 +2904,6 @@ exports[`Quotes renders correctly after animation with quotes 1`] = `
style={
{
"alignItems": "center",
- "flex": 1,
"justifyContent": "center",
}
}
@@ -2931,9 +2914,9 @@ exports[`Quotes renders correctly after animation with quotes 1`] = `
style={
{
"color": "#141618",
- "fontFamily": "EuclidCircularB-Regular",
- "fontSize": 30,
- "fontWeight": "400",
+ "fontFamily": "EuclidCircularB-Bold",
+ "fontSize": 14,
+ "fontWeight": "700",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -2949,21 +2932,6 @@ exports[`Quotes renders correctly after animation with quotes 1`] = `
}
}
>
-
@@ -3315,7 +3283,6 @@ exports[`Quotes renders correctly after animation with quotes 1`] = `
-
@@ -4667,7 +4618,6 @@ exports[`Quotes renders correctly after animation with quotes and expanded 2`] =
-
@@ -6804,7 +6738,6 @@ exports[`Quotes renders correctly when fetching quotes errors 1`] = `
style={
{
"alignItems": "center",
- "flex": 1,
"justifyContent": "center",
}
}
@@ -6815,9 +6748,9 @@ exports[`Quotes renders correctly when fetching quotes errors 1`] = `
style={
{
"color": "#141618",
- "fontFamily": "EuclidCircularB-Regular",
- "fontSize": 30,
- "fontWeight": "400",
+ "fontFamily": "EuclidCircularB-Bold",
+ "fontSize": 14,
+ "fontWeight": "700",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -6833,21 +6766,6 @@ exports[`Quotes renders correctly when fetching quotes errors 1`] = `
}
}
>
-
@@ -7562,7 +7480,6 @@ exports[`Quotes renders correctly with sdkError 1`] = `
style={
{
"alignItems": "center",
- "flex": 1,
"justifyContent": "center",
}
}
@@ -7573,9 +7490,9 @@ exports[`Quotes renders correctly with sdkError 1`] = `
style={
{
"color": "#141618",
- "fontFamily": "EuclidCircularB-Regular",
- "fontSize": 30,
- "fontWeight": "400",
+ "fontFamily": "EuclidCircularB-Bold",
+ "fontSize": 14,
+ "fontWeight": "700",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -7591,21 +7508,6 @@ exports[`Quotes renders correctly with sdkError 1`] = `
}
}
>
-
@@ -8320,7 +8222,6 @@ exports[`Quotes renders quotes expired screen 1`] = `
style={
{
"alignItems": "center",
- "flex": 1,
"justifyContent": "center",
}
}
@@ -8331,9 +8232,9 @@ exports[`Quotes renders quotes expired screen 1`] = `
style={
{
"color": "#141618",
- "fontFamily": "EuclidCircularB-Regular",
- "fontSize": 30,
- "fontWeight": "400",
+ "fontFamily": "EuclidCircularB-Bold",
+ "fontSize": 14,
+ "fontWeight": "700",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -8349,21 +8250,6 @@ exports[`Quotes renders quotes expired screen 1`] = `
}
}
>
-
diff --git a/app/components/UI/Ramp/Views/Regions/__snapshots__/Regions.test.tsx.snap b/app/components/UI/Ramp/Views/Regions/__snapshots__/Regions.test.tsx.snap
index 5a5c62b514f..d181f8b8542 100644
--- a/app/components/UI/Ramp/Views/Regions/__snapshots__/Regions.test.tsx.snap
+++ b/app/components/UI/Ramp/Views/Regions/__snapshots__/Regions.test.tsx.snap
@@ -134,7 +134,6 @@ exports[`Regions View renders correctly 1`] = `
style={
{
"alignItems": "center",
- "flex": 1,
"justifyContent": "center",
}
}
@@ -145,9 +144,9 @@ exports[`Regions View renders correctly 1`] = `
style={
{
"color": "#141618",
- "fontFamily": "EuclidCircularB-Regular",
- "fontSize": 30,
- "fontWeight": "400",
+ "fontFamily": "EuclidCircularB-Bold",
+ "fontSize": 14,
+ "fontWeight": "700",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -163,21 +162,6 @@ exports[`Regions View renders correctly 1`] = `
}
}
>
-
@@ -950,7 +934,6 @@ exports[`Regions View renders correctly while loading 1`] = `
style={
{
"alignItems": "center",
- "flex": 1,
"justifyContent": "center",
}
}
@@ -961,9 +944,9 @@ exports[`Regions View renders correctly while loading 1`] = `
style={
{
"color": "#141618",
- "fontFamily": "EuclidCircularB-Regular",
- "fontSize": 30,
- "fontWeight": "400",
+ "fontFamily": "EuclidCircularB-Bold",
+ "fontSize": 14,
+ "fontWeight": "700",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -979,21 +962,6 @@ exports[`Regions View renders correctly while loading 1`] = `
}
}
>
-
@@ -1561,7 +1529,6 @@ exports[`Regions View renders correctly with error 1`] = `
style={
{
"alignItems": "center",
- "flex": 1,
"justifyContent": "center",
}
}
@@ -1572,9 +1539,9 @@ exports[`Regions View renders correctly with error 1`] = `
style={
{
"color": "#141618",
- "fontFamily": "EuclidCircularB-Regular",
- "fontSize": 30,
- "fontWeight": "400",
+ "fontFamily": "EuclidCircularB-Bold",
+ "fontSize": 14,
+ "fontWeight": "700",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -1590,21 +1557,6 @@ exports[`Regions View renders correctly with error 1`] = `
}
}
>
-
@@ -2210,7 +2162,6 @@ exports[`Regions View renders correctly with no data 1`] = `
style={
{
"alignItems": "center",
- "flex": 1,
"justifyContent": "center",
}
}
@@ -2221,9 +2172,9 @@ exports[`Regions View renders correctly with no data 1`] = `
style={
{
"color": "#141618",
- "fontFamily": "EuclidCircularB-Regular",
- "fontSize": 30,
- "fontWeight": "400",
+ "fontFamily": "EuclidCircularB-Bold",
+ "fontSize": 14,
+ "fontWeight": "700",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -2239,21 +2190,6 @@ exports[`Regions View renders correctly with no data 1`] = `
}
}
>
-
@@ -2821,7 +2757,6 @@ exports[`Regions View renders correctly with sdkError 1`] = `
style={
{
"alignItems": "center",
- "flex": 1,
"justifyContent": "center",
}
}
@@ -2832,9 +2767,9 @@ exports[`Regions View renders correctly with sdkError 1`] = `
style={
{
"color": "#141618",
- "fontFamily": "EuclidCircularB-Regular",
- "fontSize": 30,
- "fontWeight": "400",
+ "fontFamily": "EuclidCircularB-Bold",
+ "fontSize": 14,
+ "fontWeight": "700",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -2850,21 +2785,6 @@ exports[`Regions View renders correctly with sdkError 1`] = `
}
}
>
-
@@ -3470,7 +3390,6 @@ exports[`Regions View renders correctly with selectedRegion 1`] = `
style={
{
"alignItems": "center",
- "flex": 1,
"justifyContent": "center",
}
}
@@ -3481,9 +3400,9 @@ exports[`Regions View renders correctly with selectedRegion 1`] = `
style={
{
"color": "#141618",
- "fontFamily": "EuclidCircularB-Regular",
- "fontSize": 30,
- "fontWeight": "400",
+ "fontFamily": "EuclidCircularB-Bold",
+ "fontSize": 14,
+ "fontWeight": "700",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -3499,21 +3418,6 @@ exports[`Regions View renders correctly with selectedRegion 1`] = `
}
}
>
-
@@ -4284,7 +4188,6 @@ exports[`Regions View renders correctly with unsupportedRegion 1`] = `
style={
{
"alignItems": "center",
- "flex": 1,
"justifyContent": "center",
}
}
@@ -4295,9 +4198,9 @@ exports[`Regions View renders correctly with unsupportedRegion 1`] = `
style={
{
"color": "#141618",
- "fontFamily": "EuclidCircularB-Regular",
- "fontSize": 30,
- "fontWeight": "400",
+ "fontFamily": "EuclidCircularB-Bold",
+ "fontSize": 14,
+ "fontWeight": "700",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -4313,21 +4216,6 @@ exports[`Regions View renders correctly with unsupportedRegion 1`] = `
}
}
>
-
@@ -5473,7 +5361,6 @@ exports[`Regions View renders correctly with unsupportedRegion 2`] = `
style={
{
"alignItems": "center",
- "flex": 1,
"justifyContent": "center",
}
}
@@ -5484,9 +5371,9 @@ exports[`Regions View renders correctly with unsupportedRegion 2`] = `
style={
{
"color": "#141618",
- "fontFamily": "EuclidCircularB-Regular",
- "fontSize": 30,
- "fontWeight": "400",
+ "fontFamily": "EuclidCircularB-Bold",
+ "fontSize": 14,
+ "fontWeight": "700",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -5502,21 +5389,6 @@ exports[`Regions View renders correctly with unsupportedRegion 2`] = `
}
}
>
-
@@ -6662,7 +6534,6 @@ exports[`Regions View renders regions modal when pressing select button 1`] = `
style={
{
"alignItems": "center",
- "flex": 1,
"justifyContent": "center",
}
}
@@ -6673,9 +6544,9 @@ exports[`Regions View renders regions modal when pressing select button 1`] = `
style={
{
"color": "#141618",
- "fontFamily": "EuclidCircularB-Regular",
- "fontSize": 30,
- "fontWeight": "400",
+ "fontFamily": "EuclidCircularB-Bold",
+ "fontSize": 14,
+ "fontWeight": "700",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -6691,21 +6562,6 @@ exports[`Regions View renders regions modal when pressing select button 1`] = `
}
}
>
-
diff --git a/app/components/UI/Ramp/Views/SendTransaction/__snapshots__/SendTransaction.test.tsx.snap b/app/components/UI/Ramp/Views/SendTransaction/__snapshots__/SendTransaction.test.tsx.snap
index f3ad57c5056..2b0c2a89da8 100644
--- a/app/components/UI/Ramp/Views/SendTransaction/__snapshots__/SendTransaction.test.tsx.snap
+++ b/app/components/UI/Ramp/Views/SendTransaction/__snapshots__/SendTransaction.test.tsx.snap
@@ -157,7 +157,6 @@ exports[`SendTransaction View renders correctly 1`] = `
style={
{
"alignItems": "center",
- "flex": 1,
"justifyContent": "center",
}
}
@@ -168,9 +167,9 @@ exports[`SendTransaction View renders correctly 1`] = `
style={
{
"color": "#141618",
- "fontFamily": "EuclidCircularB-Regular",
- "fontSize": 30,
- "fontWeight": "400",
+ "fontFamily": "EuclidCircularB-Bold",
+ "fontSize": 14,
+ "fontWeight": "700",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -186,21 +185,6 @@ exports[`SendTransaction View renders correctly 1`] = `
}
}
>
-
@@ -972,7 +956,6 @@ exports[`SendTransaction View renders correctly for custom action payment method
style={
{
"alignItems": "center",
- "flex": 1,
"justifyContent": "center",
}
}
@@ -983,9 +966,9 @@ exports[`SendTransaction View renders correctly for custom action payment method
style={
{
"color": "#141618",
- "fontFamily": "EuclidCircularB-Regular",
- "fontSize": 30,
- "fontWeight": "400",
+ "fontFamily": "EuclidCircularB-Bold",
+ "fontSize": 14,
+ "fontWeight": "700",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -1001,21 +984,6 @@ exports[`SendTransaction View renders correctly for custom action payment method
}
}
>
-
@@ -1703,7 +1671,6 @@ exports[`SendTransaction View renders correctly for token 1`] = `
style={
{
"alignItems": "center",
- "flex": 1,
"justifyContent": "center",
}
}
@@ -1714,9 +1681,9 @@ exports[`SendTransaction View renders correctly for token 1`] = `
style={
{
"color": "#141618",
- "fontFamily": "EuclidCircularB-Regular",
- "fontSize": 30,
- "fontWeight": "400",
+ "fontFamily": "EuclidCircularB-Bold",
+ "fontSize": 14,
+ "fontWeight": "700",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -1732,21 +1699,6 @@ exports[`SendTransaction View renders correctly for token 1`] = `
}
}
>
-
diff --git a/app/components/UI/Ramp/Views/Settings/__snapshots__/ActivationKeyForm.test.tsx.snap b/app/components/UI/Ramp/Views/Settings/__snapshots__/ActivationKeyForm.test.tsx.snap
index 0d6c3a48b2c..8edd595884f 100644
--- a/app/components/UI/Ramp/Views/Settings/__snapshots__/ActivationKeyForm.test.tsx.snap
+++ b/app/components/UI/Ramp/Views/Settings/__snapshots__/ActivationKeyForm.test.tsx.snap
@@ -631,9 +631,9 @@ exports[`AddActivationKey renders correctly 1`] = `
style={
{
"color": "#0376c9",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -670,9 +670,9 @@ exports[`AddActivationKey renders correctly 1`] = `
style={
{
"color": "#ffffff",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
diff --git a/app/components/UI/Ramp/Views/Settings/__snapshots__/Settings.test.tsx.snap b/app/components/UI/Ramp/Views/Settings/__snapshots__/Settings.test.tsx.snap
index 32f2c554a75..1e3f8edc2fb 100644
--- a/app/components/UI/Ramp/Views/Settings/__snapshots__/Settings.test.tsx.snap
+++ b/app/components/UI/Ramp/Views/Settings/__snapshots__/Settings.test.tsx.snap
@@ -551,9 +551,9 @@ exports[`Settings Activation Keys renders correctly when is loading 1`] = `
style={
{
"color": "#0376c9",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -1129,9 +1129,9 @@ exports[`Settings Activation Keys renders correctly when is loading 1`] = `
style={
{
"color": "#0376c9",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -1711,9 +1711,9 @@ exports[`Settings Activation Keys renders correctly when there are no keys 1`] =
style={
{
"color": "#0376c9",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -1847,9 +1847,9 @@ exports[`Settings Activation Keys renders correctly when there are no keys 1`] =
style={
{
"color": "#0376c9",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -2972,9 +2972,9 @@ exports[`Settings Region renders correctly when region is set 1`] = `
style={
{
"color": "#0376c9",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -3553,9 +3553,9 @@ exports[`Settings renders correctly 1`] = `
style={
{
"color": "#0376c9",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -4134,9 +4134,9 @@ exports[`Settings renders correctly for internal builds 1`] = `
style={
{
"color": "#0376c9",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -4708,9 +4708,9 @@ exports[`Settings renders correctly for internal builds 1`] = `
style={
{
"color": "#0376c9",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
diff --git a/app/components/UI/ReceiveRequest/__snapshots__/index.test.tsx.snap b/app/components/UI/ReceiveRequest/__snapshots__/index.test.tsx.snap
index b2c8df927cf..281e45838f6 100644
--- a/app/components/UI/ReceiveRequest/__snapshots__/index.test.tsx.snap
+++ b/app/components/UI/ReceiveRequest/__snapshots__/index.test.tsx.snap
@@ -627,9 +627,9 @@ exports[`ReceiveRequest render matches snapshot 1`] = `
style={
{
"color": "#0376c9",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -1374,9 +1374,9 @@ exports[`ReceiveRequest render with different ticker matches snapshot 1`] = `
style={
{
"color": "#0376c9",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -2121,9 +2121,9 @@ exports[`ReceiveRequest render without buy matches snapshot 1`] = `
style={
{
"color": "#0376c9",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
diff --git a/app/components/UI/SearchTokenAutocomplete/__snapshots__/index.test.tsx.snap b/app/components/UI/SearchTokenAutocomplete/__snapshots__/index.test.tsx.snap
index ea010c44900..1c23219c4e0 100644
--- a/app/components/UI/SearchTokenAutocomplete/__snapshots__/index.test.tsx.snap
+++ b/app/components/UI/SearchTokenAutocomplete/__snapshots__/index.test.tsx.snap
@@ -484,9 +484,9 @@ exports[`SearchTokenAutocomplete should render correctly 1`] = `
style={
{
"color": "#ffffff",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
diff --git a/app/components/UI/SheetActionView/__snapshots__/SheetActionView.test.tsx.snap b/app/components/UI/SheetActionView/__snapshots__/SheetActionView.test.tsx.snap
index 40f30e85893..6661cd44052 100644
--- a/app/components/UI/SheetActionView/__snapshots__/SheetActionView.test.tsx.snap
+++ b/app/components/UI/SheetActionView/__snapshots__/SheetActionView.test.tsx.snap
@@ -38,9 +38,9 @@ exports[`SheetActionView should render correctly 1`] = `
style={
{
"color": "#0376c9",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -76,9 +76,9 @@ exports[`SheetActionView should render correctly 1`] = `
style={
{
"color": "#ffffff",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
diff --git a/app/components/UI/SimulationDetails/AmountPill/AmountPill.test.tsx b/app/components/UI/SimulationDetails/AmountPill/AmountPill.test.tsx
index 012f050320d..bf87cb1a899 100644
--- a/app/components/UI/SimulationDetails/AmountPill/AmountPill.test.tsx
+++ b/app/components/UI/SimulationDetails/AmountPill/AmountPill.test.tsx
@@ -5,25 +5,33 @@ import AmountPill from './AmountPill';
import {
AssetIdentifier,
AssetType,
- NATIVE_ASSET_IDENTIFIER,
+ NativeAssetIdentifier,
TokenAssetIdentifier,
} from '../types';
const TOKEN_ID_MOCK = '0xabc';
+const CHAIN_ID_MOCK = '0x123';
const ERC20_ASSET_MOCK: TokenAssetIdentifier = {
type: AssetType.ERC20,
address: '0x456',
+ chainId: CHAIN_ID_MOCK,
};
const ERC721_ASSET_MOCK: TokenAssetIdentifier = {
type: AssetType.ERC721,
address: '0x123',
tokenId: TOKEN_ID_MOCK,
+ chainId: CHAIN_ID_MOCK,
};
const ERC1155_ASSET_MOCK: TokenAssetIdentifier = {
type: AssetType.ERC1155,
address: '0x789',
tokenId: TOKEN_ID_MOCK,
+ chainId: CHAIN_ID_MOCK,
+};
+const NATIVE_ASSET_MOCK: NativeAssetIdentifier = {
+ type: AssetType.Native,
+ chainId: CHAIN_ID_MOCK,
};
const renderAndExpect = (
@@ -83,7 +91,7 @@ describe('AmountPill', () => {
it.each(nativeAndErc20Cases)(
'renders the correct sign and amount for $amount',
({ amount, expected }) => {
- renderAndExpect(NATIVE_ASSET_IDENTIFIER, amount, expected);
+ renderAndExpect(NATIVE_ASSET_MOCK, amount, expected);
},
);
});
diff --git a/app/components/UI/SimulationDetails/AssetPill/AssetPill.test.tsx b/app/components/UI/SimulationDetails/AssetPill/AssetPill.test.tsx
index 220dad70717..291d2087c78 100644
--- a/app/components/UI/SimulationDetails/AssetPill/AssetPill.test.tsx
+++ b/app/components/UI/SimulationDetails/AssetPill/AssetPill.test.tsx
@@ -1,18 +1,10 @@
import React from 'react';
-import { render } from '@testing-library/react-native';
import AssetPill from './AssetPill';
-import {
- selectChainId,
- selectTicker,
-} from '../../../../selectors/networkController';
import { AssetType, AssetIdentifier } from '../types';
+import renderWithProvider from '../../../../util/test/renderWithProvider';
+import { mockNetworkState } from '../../../../util/test/network';
-jest.mock('react-redux', () => ({
- ...jest.requireActual('react-redux'),
- useSelector: jest.fn().mockImplementation((selector) => selector()),
-}));
-jest.mock('../../../../selectors/networkController');
jest.mock(
'../../../../component-library/components/Avatars/Avatar/variants/AvatarNetwork',
() => 'AvatarNetwork',
@@ -22,18 +14,33 @@ jest.mock('../../../hooks/useStyles', () => ({
useStyles: () => ({ styles: {} }),
}));
-describe('AssetPill', () => {
- const selectChainIdMock = jest.mocked(selectChainId);
- const selectTickerMock = jest.mocked(selectTicker);
+const CHAIN_ID_MOCK = '0x123';
- beforeAll(() => {
- selectChainIdMock.mockReturnValue('0x1');
- selectTickerMock.mockReturnValue('ETH');
- });
+const STATE_MOCK = {
+ engine: {
+ backgroundState: {
+ NetworkController: {
+ ...mockNetworkState({
+ chainId: CHAIN_ID_MOCK,
+ }),
+ },
+ },
+ },
+};
+describe('AssetPill', () => {
it('renders correctly for native assets', () => {
- const asset = { type: AssetType.Native } as AssetIdentifier;
- const { getByText, getByTestId } = render();
+ const asset = {
+ type: AssetType.Native,
+ chainId: CHAIN_ID_MOCK,
+ } as AssetIdentifier;
+
+ const { getByText, getByTestId } = renderWithProvider(
+ ,
+ {
+ state: STATE_MOCK,
+ },
+ );
expect(
getByTestId('simulation-details-asset-pill-avatar-network'),
@@ -45,8 +52,12 @@ describe('AssetPill', () => {
const asset = {
type: AssetType.ERC20,
address: '0xabc123',
+ chainId: CHAIN_ID_MOCK,
} as AssetIdentifier;
- const { getByTestId } = render();
+
+ const { getByTestId } = renderWithProvider(, {
+ state: STATE_MOCK,
+ });
expect(getByTestId('simulation-details-asset-pill-name')).toBeTruthy();
});
diff --git a/app/components/UI/SimulationDetails/AssetPill/AssetPill.tsx b/app/components/UI/SimulationDetails/AssetPill/AssetPill.tsx
index 3399ed8b0d6..13e829b3795 100644
--- a/app/components/UI/SimulationDetails/AssetPill/AssetPill.tsx
+++ b/app/components/UI/SimulationDetails/AssetPill/AssetPill.tsx
@@ -9,16 +9,13 @@ import Text, {
} from '../../../../component-library/components/Texts/Text';
import AvatarNetwork from '../../../../component-library/components/Avatars/Avatar/variants/AvatarNetwork';
import { AvatarSize } from '../../../../component-library/components/Avatars/Avatar/Avatar.types';
-import {
- selectChainId,
- selectTicker,
-} from '../../../../selectors/networkController';
import { NetworkList } from '../../../../util/networks';
import { useStyles } from '../../../hooks/useStyles';
import Name from '../../Name/Name';
import { NameType } from '../../Name/Name.types';
import { AssetIdentifier, AssetType } from '../types';
import styleSheet from './AssetPill.styles';
+import { selectNetworkConfigurations } from '../../../../selectors/networkController';
interface AssetPillProperties extends ViewProps {
asset: AssetIdentifier;
@@ -35,21 +32,26 @@ const getNetworkImage = (chainId: Hex) => {
return network?.imageSource || null;
};
-const NativeAssetPill: React.FC = () => {
+const NativeAssetPill: React.FC = ({ asset }) => {
const { styles } = useStyles(styleSheet, {});
- const ticker = useSelector(selectTicker);
- const chainId = useSelector(selectChainId);
- const imageSource = getNetworkImage(chainId);
+ const imageSource = getNetworkImage(asset.chainId);
+
+ const networkConfigurationsByChainId = useSelector(
+ selectNetworkConfigurations,
+ );
+
+ const { nativeCurrency } =
+ networkConfigurationsByChainId[asset.chainId] || {};
return (
- {ticker}
+ {nativeCurrency}
);
};
@@ -57,20 +59,17 @@ const NativeAssetPill: React.FC = () => {
const AssetPill: React.FC = ({ asset }) => {
const { styles } = useStyles(styleSheet, {});
- // TODO: Remove global network selector usage once simulations refactored.
- const chainId = useSelector(selectChainId);
-
return (
{asset.type === AssetType.Native ? (
-
+
) : (
)}
diff --git a/app/components/UI/SimulationDetails/BalanceChangeList/BalanceChangeList.test.tsx b/app/components/UI/SimulationDetails/BalanceChangeList/BalanceChangeList.test.tsx
index dacf4df7de4..70ef9cb1116 100644
--- a/app/components/UI/SimulationDetails/BalanceChangeList/BalanceChangeList.test.tsx
+++ b/app/components/UI/SimulationDetails/BalanceChangeList/BalanceChangeList.test.tsx
@@ -14,11 +14,14 @@ jest.mock('../FiatDisplay/FiatDisplay', () => ({
TotalFiatDisplay: 'TotalFiatDisplay',
}));
+const CHAIN_ID_MOCK = '0x123';
+
const balanceChangesMock = [
{
asset: {
type: 'ERC20',
address: '0xabc123',
+ chainId: CHAIN_ID_MOCK,
},
amount: new BigNumber(100),
fiatAmount: 100,
@@ -68,6 +71,7 @@ describe('BalanceChangeList', () => {
asset: {
type: 'ERC20',
address: '0xabc123',
+ chainId: CHAIN_ID_MOCK,
},
amount: new BigNumber(100),
fiatAmount: 100,
diff --git a/app/components/UI/SimulationDetails/BalanceChangeRow/BalanceChangeRow.test.tsx b/app/components/UI/SimulationDetails/BalanceChangeRow/BalanceChangeRow.test.tsx
index ede8373ed23..3d95d368876 100644
--- a/app/components/UI/SimulationDetails/BalanceChangeRow/BalanceChangeRow.test.tsx
+++ b/app/components/UI/SimulationDetails/BalanceChangeRow/BalanceChangeRow.test.tsx
@@ -5,22 +5,24 @@ import { BigNumber } from 'bignumber.js';
import BalanceChangeRow from './BalanceChangeRow';
import { AssetType, BalanceChange } from '../types';
+jest.mock('../AmountPill/AmountPill', () => 'AmountPill');
+jest.mock('../AssetPill/AssetPill', () => 'AssetPill');
jest.mock('../FiatDisplay/FiatDisplay', () => ({
IndividualFiatDisplay: 'IndividualFiatDisplay',
}));
+const CHAIN_ID_MOCK = '0x123';
+
const balanceChangeMock: BalanceChange = {
asset: {
type: AssetType.ERC20,
address: '0xabc123',
+ chainId: CHAIN_ID_MOCK,
},
amount: new BigNumber(100),
fiatAmount: 0,
} as BalanceChange;
-jest.mock('../AmountPill/AmountPill', () => 'AmountPill');
-jest.mock('../AssetPill/AssetPill', () => 'AssetPill');
-
describe('BalanceChangeList', () => {
it('renders a balance change row', () => {
const { getByText, getByTestId } = render(
diff --git a/app/components/UI/SimulationDetails/SimulationDetails.stories.tsx b/app/components/UI/SimulationDetails/SimulationDetails.stories.tsx
index b5d8994e194..97a826f55f6 100644
--- a/app/components/UI/SimulationDetails/SimulationDetails.stories.tsx
+++ b/app/components/UI/SimulationDetails/SimulationDetails.stories.tsx
@@ -9,6 +9,8 @@ import {
SimulationErrorCode,
SimulationTokenStandard,
CHAIN_IDS,
+ TransactionMeta,
+ SimulationData,
} from '@metamask/transaction-controller';
import {
@@ -145,8 +147,20 @@ const meta: Meta = {
};
export default meta;
+function buildArgs({
+ simulationData,
+}: {
+ simulationData?: SimulationData;
+}): Partial {
+ return {
+ transaction: {
+ simulationData,
+ } as TransactionMeta,
+ };
+}
+
export const MultipleTokens: Story = {
- args: {
+ args: buildArgs({
simulationData: {
nativeBalanceChange: {
...DUMMY_BALANCE_CHANGE,
@@ -193,11 +207,11 @@ export const MultipleTokens: Story = {
},
],
},
- },
+ }),
};
export const SendSmallAmount: Story = {
- args: {
+ args: buildArgs({
simulationData: {
nativeBalanceChange: {
...DUMMY_BALANCE_CHANGE,
@@ -206,11 +220,11 @@ export const SendSmallAmount: Story = {
},
tokenBalanceChanges: [],
},
- },
+ }),
};
export const LongValuesAndNames: Story = {
- args: {
+ args: buildArgs({
simulationData: {
nativeBalanceChange: {
...DUMMY_BALANCE_CHANGE,
@@ -234,11 +248,11 @@ export const LongValuesAndNames: Story = {
},
],
},
- },
+ }),
};
export const PolygonNativeAsset: Story = {
- args: {
+ args: buildArgs({
simulationData: {
nativeBalanceChange: {
...DUMMY_BALANCE_CHANGE,
@@ -247,14 +261,14 @@ export const PolygonNativeAsset: Story = {
},
tokenBalanceChanges: [],
},
- },
+ }),
decorators: [
(story) => {story()},
],
};
export const ArbitrumNativeAsset: Story = {
- args: {
+ args: buildArgs({
simulationData: {
nativeBalanceChange: {
...DUMMY_BALANCE_CHANGE,
@@ -263,14 +277,14 @@ export const ArbitrumNativeAsset: Story = {
},
tokenBalanceChanges: [],
},
- },
+ }),
decorators: [
(story) => {story()},
],
};
export const ReceiveOnly: Story = {
- args: {
+ args: buildArgs({
simulationData: {
nativeBalanceChange: {
previousBalance: '0x2',
@@ -280,11 +294,11 @@ export const ReceiveOnly: Story = {
},
tokenBalanceChanges: [],
},
- },
+ }),
};
export const SendOnly: Story = {
- args: {
+ args: buildArgs({
simulationData: {
nativeBalanceChange: {
previousBalance: '0x1',
@@ -294,40 +308,40 @@ export const SendOnly: Story = {
},
tokenBalanceChanges: [],
},
- },
+ }),
};
export const NoBalanceChanges: Story = {
- args: {
+ args: buildArgs({
simulationData: {
nativeBalanceChange: undefined,
tokenBalanceChanges: [],
},
- },
+ }),
};
export const Loading: Story = {
- args: {
+ args: buildArgs({
simulationData: undefined,
- },
+ }),
};
export const TransactionReverted: Story = {
- args: {
+ args: buildArgs({
simulationData: {
error: { code: SimulationErrorCode.Reverted },
nativeBalanceChange: undefined,
tokenBalanceChanges: [],
},
- },
+ }),
};
export const GenericError: Story = {
- args: {
+ args: buildArgs({
simulationData: {
error: {},
nativeBalanceChange: undefined,
tokenBalanceChanges: [],
},
- },
+ }),
};
diff --git a/app/components/UI/SimulationDetails/SimulationDetails.test.tsx b/app/components/UI/SimulationDetails/SimulationDetails.test.tsx
index e4054925201..3b64269f9f3 100644
--- a/app/components/UI/SimulationDetails/SimulationDetails.test.tsx
+++ b/app/components/UI/SimulationDetails/SimulationDetails.test.tsx
@@ -6,6 +6,7 @@ import {
SimulationData,
SimulationErrorCode,
SimulationTokenStandard,
+ TransactionMeta,
} from '@metamask/transaction-controller';
import AnimatedSpinner from '../AnimatedSpinner';
@@ -21,6 +22,7 @@ const DUMMY_BALANCE_CHANGE = {
previousBalance: '0xIGNORED' as Hex,
newBalance: '0xIGNORED' as Hex,
};
+const CHAIN_ID_MOCK = '0x123';
const mockTransactionId = '0x1234567890';
const simulationDataMock = {
nativeBalanceChange: {
@@ -81,8 +83,12 @@ describe('SimulationDetails', () => {
render(
,
);
@@ -95,11 +101,15 @@ describe('SimulationDetails', () => {
expect(
render(
,
).toJSON(),
@@ -110,11 +120,15 @@ describe('SimulationDetails', () => {
expect(
render(
,
).toJSON(),
@@ -126,11 +140,15 @@ describe('SimulationDetails', () => {
it('if transaction will be reverted', () => {
const { getByText } = render(
,
);
@@ -141,11 +159,15 @@ describe('SimulationDetails', () => {
it('if simulation is failed', () => {
const { getByText } = render(
,
);
@@ -159,8 +181,12 @@ describe('SimulationDetails', () => {
it('renders if no balance change', () => {
const { getByText } = render(
,
);
@@ -175,7 +201,7 @@ describe('SimulationDetails', () => {
{
amount: new BigNumber('0x1', 16).times(-1),
fiatAmount: 10,
- asset: { type: AssetType.Native },
+ asset: { type: AssetType.Native, chainId: CHAIN_ID_MOCK },
},
{
amount: new BigNumber('0x123456', 16).times(1),
@@ -184,6 +210,7 @@ describe('SimulationDetails', () => {
address: FIRST_PARTY_CONTRACT_ADDRESS_1_MOCK,
tokenId: undefined,
type: AssetType.ERC20,
+ chainId: CHAIN_ID_MOCK,
},
},
{
@@ -193,6 +220,7 @@ describe('SimulationDetails', () => {
address: FIRST_PARTY_CONTRACT_ADDRESS_2_MOCK,
tokenId: undefined,
type: AssetType.ERC20,
+ chainId: CHAIN_ID_MOCK,
},
},
],
@@ -200,8 +228,12 @@ describe('SimulationDetails', () => {
const { getByTestId } = render(
,
);
diff --git a/app/components/UI/SimulationDetails/SimulationDetails.tsx b/app/components/UI/SimulationDetails/SimulationDetails.tsx
index 474bafc3ebe..04c8406b5e3 100644
--- a/app/components/UI/SimulationDetails/SimulationDetails.tsx
+++ b/app/components/UI/SimulationDetails/SimulationDetails.tsx
@@ -2,9 +2,9 @@
import React, { useState } from 'react';
import { View, Pressable } from 'react-native';
import {
- SimulationData,
SimulationErrorCode,
SimulationError,
+ TransactionMeta,
} from '@metamask/transaction-controller';
import { strings } from '../../../../locales/i18n';
@@ -25,8 +25,7 @@ import styleSheet from './SimulationDetails.styles';
import { useSimulationMetrics } from './useSimulationMetrics';
export interface SimulationDetailsProps {
- simulationData?: SimulationData;
- transactionId: string;
+ transaction: TransactionMeta;
enableMetrics: boolean;
}
@@ -140,12 +139,12 @@ const SimulationDetailsLayout: React.FC<{
* @returns The simulation details.
*/
export const SimulationDetails: React.FC = ({
- simulationData,
+ transaction,
enableMetrics = false,
- transactionId,
}: SimulationDetailsProps) => {
const { styles } = useStyles(styleSheet, {});
- const balanceChangesResult = useBalanceChanges(simulationData);
+ const { chainId, id: transactionId, simulationData } = transaction;
+ const balanceChangesResult = useBalanceChanges({ chainId, simulationData });
const loading = !simulationData || balanceChangesResult.pending;
useSimulationMetrics({
diff --git a/app/components/UI/SimulationDetails/types.ts b/app/components/UI/SimulationDetails/types.ts
index 9b87ad84af3..93468745472 100644
--- a/app/components/UI/SimulationDetails/types.ts
+++ b/app/components/UI/SimulationDetails/types.ts
@@ -8,10 +8,6 @@ export enum AssetType {
ERC1155 = 'ERC1155',
}
-export const NATIVE_ASSET_IDENTIFIER: NativeAssetIdentifier = {
- type: AssetType.Native,
-};
-
/**
* Describes an amount of fiat.
*/
@@ -23,18 +19,20 @@ export type FiatAmount = FiatAmountAvailable | typeof FIAT_UNAVAILABLE;
* Identifies the native asset of a chain.
*/
export interface NativeAssetIdentifier {
- type: AssetType.Native;
address?: undefined;
+ chainId: Hex;
tokenId?: undefined;
+ type: AssetType.Native;
}
/**
* Uniquely identifies a token asset on a chain.
*/
export interface TokenAssetIdentifier {
- type: Exclude;
address: Hex;
+ chainId: Hex;
tokenId?: Hex;
+ type: Exclude;
}
export type AssetIdentifier = Readonly<
diff --git a/app/components/UI/SimulationDetails/useBalanceChanges.test.ts b/app/components/UI/SimulationDetails/useBalanceChanges.test.ts
index 720c09c5397..16fe3af39e9 100644
--- a/app/components/UI/SimulationDetails/useBalanceChanges.test.ts
+++ b/app/components/UI/SimulationDetails/useBalanceChanges.test.ts
@@ -61,6 +61,8 @@ const DIFFERENCE_1_MOCK: Hex = '0x11';
const DIFFERENCE_2_MOCK: Hex = '0x2';
const DIFFERENCE_ETH_MOCK: Hex = '0x1234567890123456789';
+const CHAIN_ID_MOCK = '0x123';
+
const dummyBalanceChange = {
previousBalance: '0xIGNORE' as Hex,
newBalance: '0xIGNORE' as Hex,
@@ -98,7 +100,10 @@ describe('useBalanceChanges', () => {
describe('pending states', () => {
it('returns pending=true if no simulation data', async () => {
const { result, waitForNextUpdate } = renderHook(() =>
- useBalanceChanges(undefined),
+ useBalanceChanges({
+ chainId: CHAIN_ID_MOCK,
+ simulationData: undefined,
+ }),
);
expect(result.current).toEqual({ pending: true, value: [] });
await waitForNextUpdate();
@@ -119,7 +124,10 @@ describe('useBalanceChanges', () => {
],
};
const { result, unmount, waitForNextUpdate } = renderHook(() =>
- useBalanceChanges(simulationData),
+ useBalanceChanges({
+ chainId: CHAIN_ID_MOCK,
+ simulationData,
+ }),
);
await waitForNextUpdate();
@@ -143,7 +151,10 @@ describe('useBalanceChanges', () => {
],
};
const { result, unmount } = renderHook(() =>
- useBalanceChanges(simulationData),
+ useBalanceChanges({
+ chainId: CHAIN_ID_MOCK,
+ simulationData,
+ }),
);
expect(result.current).toEqual({ pending: true, value: [] });
@@ -159,7 +170,12 @@ describe('useBalanceChanges', () => {
nativeBalanceChange: undefined,
tokenBalanceChanges,
};
- return renderHook(() => useBalanceChanges(simulationData));
+ return renderHook(() =>
+ useBalanceChanges({
+ chainId: CHAIN_ID_MOCK,
+ simulationData,
+ }),
+ );
};
it('maps token balance changes correctly', async () => {
@@ -182,6 +198,7 @@ describe('useBalanceChanges', () => {
address: ERC20_TOKEN_ADDRESS_1_MOCK,
type: AssetType.ERC20,
tokenId: undefined,
+ chainId: CHAIN_ID_MOCK,
},
amount: new BigNumber('-0.017'),
fiatAmount: -0.0255,
@@ -238,6 +255,7 @@ describe('useBalanceChanges', () => {
address: NFT_TOKEN_ADDRESS_MOCK,
type: AssetType.ERC721,
tokenId: TOKEN_ID_1_MOCK,
+ chainId: CHAIN_ID_MOCK,
},
amount: new BigNumber('-1'),
fiatAmount: FIAT_UNAVAILABLE,
@@ -305,7 +323,12 @@ describe('useBalanceChanges', () => {
nativeBalanceChange,
tokenBalanceChanges: [],
};
- return renderHook(() => useBalanceChanges(simulationData));
+ return renderHook(() =>
+ useBalanceChanges({
+ chainId: CHAIN_ID_MOCK,
+ simulationData,
+ }),
+ );
};
it('maps native balance change correctly', async () => {
@@ -322,6 +345,7 @@ describe('useBalanceChanges', () => {
{
asset: {
type: AssetType.Native,
+ chainId: CHAIN_ID_MOCK,
},
amount: new BigNumber('-5373.003641998677469065'),
fiatAmount: Number('-16119.010925996032'),
@@ -367,7 +391,10 @@ describe('useBalanceChanges', () => {
],
};
const { result, waitForNextUpdate } = renderHook(() =>
- useBalanceChanges(simulationData),
+ useBalanceChanges({
+ chainId: CHAIN_ID_MOCK,
+ simulationData,
+ }),
);
await waitForNextUpdate();
@@ -376,6 +403,7 @@ describe('useBalanceChanges', () => {
expect(changes).toHaveLength(2);
expect(changes[0].asset).toEqual({
type: AssetType.Native,
+ chainId: CHAIN_ID_MOCK,
});
expect(changes[0].amount).toEqual(
new BigNumber('-5373.003641998677469065'),
@@ -384,6 +412,7 @@ describe('useBalanceChanges', () => {
expect(changes[1].asset).toEqual({
address: ERC20_TOKEN_ADDRESS_1_MOCK,
type: AssetType.ERC20,
+ chainId: CHAIN_ID_MOCK,
});
expect(changes[1].amount).toEqual(new BigNumber('0.002'));
});
diff --git a/app/components/UI/SimulationDetails/useBalanceChanges.ts b/app/components/UI/SimulationDetails/useBalanceChanges.ts
index faa7aeb14bf..e383058c0c4 100644
--- a/app/components/UI/SimulationDetails/useBalanceChanges.ts
+++ b/app/components/UI/SimulationDetails/useBalanceChanges.ts
@@ -15,17 +15,16 @@ import {
import {
BalanceChange,
- NATIVE_ASSET_IDENTIFIER,
TokenAssetIdentifier,
AssetType,
FIAT_UNAVAILABLE,
+ NativeAssetIdentifier,
} from './types';
import { getTokenDetails } from '../../../util/address';
import {
selectConversionRate,
selectCurrentCurrency,
} from '../../../selectors/currencyRateController';
-import { selectChainId } from '../../../selectors/networkController';
import { useAsyncResultOrThrow } from '../../hooks/useAsyncResult';
const NATIVE_DECIMALS = 18;
@@ -132,14 +131,20 @@ async function fetchTokenFiatRates(
function getNativeBalanceChange(
nativeBalanceChange: SimulationBalanceChange | undefined,
nativeFiatRate: number,
+ chainId: Hex,
): BalanceChange | undefined {
if (!nativeBalanceChange) {
return undefined;
}
- const asset = NATIVE_ASSET_IDENTIFIER;
- const amount = getAssetAmount(nativeBalanceChange, NATIVE_DECIMALS);
+ const asset: NativeAssetIdentifier = {
+ type: AssetType.Native,
+ chainId,
+ };
+
+ const amount = getAssetAmount(nativeBalanceChange, NATIVE_DECIMALS);
const fiatAmount = amount.times(nativeFiatRate).toNumber();
+
return { asset, amount, fiatAmount };
}
@@ -148,12 +153,14 @@ function getTokenBalanceChanges(
tokenBalanceChanges: SimulationTokenBalanceChange[],
erc20Decimals: Record,
erc20FiatRates: Partial>,
+ chainId: Hex,
): BalanceChange[] {
return tokenBalanceChanges.map((tokenBc) => {
const asset: TokenAssetIdentifier = {
type: convertStandard(tokenBc.standard),
address: tokenBc.address.toLowerCase() as Hex,
tokenId: tokenBc.id,
+ chainId,
};
const decimals =
@@ -172,12 +179,15 @@ function getTokenBalanceChanges(
}
// Compiles a list of balance changes from simulation data
-export default function useBalanceChanges(
- simulationData: SimulationData | undefined,
-): { pending: boolean; value: BalanceChange[] } {
+export default function useBalanceChanges({
+ chainId,
+ simulationData,
+}: {
+ chainId: Hex;
+ simulationData?: SimulationData;
+}): { pending: boolean; value: BalanceChange[] } {
const nativeFiatRate = useSelector(selectConversionRate) as number;
const fiatCurrency = useSelector(selectCurrentCurrency);
- const chainId = useSelector(selectChainId);
const { nativeBalanceChange, tokenBalanceChanges = [] } =
simulationData ?? {};
@@ -200,18 +210,21 @@ export default function useBalanceChanges(
[JSON.stringify(erc20TokenAddresses), chainId, fiatCurrency],
);
- if (erc20Decimals.pending || erc20FiatRates.pending || !simulationData ) {
+ if (erc20Decimals.pending || erc20FiatRates.pending || !simulationData) {
return { pending: true, value: [] };
}
const nativeChange = getNativeBalanceChange(
nativeBalanceChange,
nativeFiatRate,
+ chainId,
);
+
const tokenChanges = getTokenBalanceChanges(
tokenBalanceChanges,
erc20Decimals.value,
erc20FiatRates.value,
+ chainId,
);
const balanceChanges: BalanceChange[] = [
diff --git a/app/components/UI/SimulationDetails/useSimulationMetrics.test.ts b/app/components/UI/SimulationDetails/useSimulationMetrics.test.ts
index cf9eacf54a6..920aded4148 100644
--- a/app/components/UI/SimulationDetails/useSimulationMetrics.test.ts
+++ b/app/components/UI/SimulationDetails/useSimulationMetrics.test.ts
@@ -1,6 +1,5 @@
import { useEffect, useState } from 'react';
import {
- CHAIN_IDS,
SimulationData,
SimulationErrorCode,
} from '@metamask/transaction-controller';
@@ -23,7 +22,6 @@ import {
useSimulationMetrics,
} from './useSimulationMetrics';
import useLoadingTime from './useLoadingTime';
-import { selectChainId } from '../../../selectors/networkController';
import { MetricsEventBuilder } from '../../../core/Analytics/MetricsEventBuilder';
jest.mock('react-redux', () => ({
@@ -89,7 +87,6 @@ describe('useSimulationMetrics', () => {
const useDisplayNamesMock = jest.mocked(useDisplayNames);
const useLoadingTimeMock = jest.mocked(useLoadingTime);
const setLoadingCompleteMock = jest.fn();
- const selectChainIdMock = jest.mocked(selectChainId);
function expectUpdateTransactionMetricsCalled(
{
@@ -141,7 +138,6 @@ describe('useSimulationMetrics', () => {
loadingTime: LOADING_TIME_MOCK,
setLoadingComplete: setLoadingCompleteMock,
});
- selectChainIdMock.mockReturnValue(CHAIN_IDS.MAINNET);
});
describe('updates transaction simulation metrics', () => {
diff --git a/app/components/UI/SimulationDetails/useSimulationMetrics.ts b/app/components/UI/SimulationDetails/useSimulationMetrics.ts
index ed7e7f2f4c9..0d16524d9ff 100644
--- a/app/components/UI/SimulationDetails/useSimulationMetrics.ts
+++ b/app/components/UI/SimulationDetails/useSimulationMetrics.ts
@@ -1,5 +1,5 @@
import { useState, useEffect } from 'react';
-import { useDispatch, useSelector } from 'react-redux';
+import { useDispatch } from 'react-redux';
import {
SimulationData,
SimulationErrorCode,
@@ -17,7 +17,6 @@ import { NameType } from '../../UI/Name/Name.types';
import useLoadingTime from './useLoadingTime';
import { calculateTotalFiat } from './FiatDisplay/FiatDisplay';
import { BalanceChange } from './types';
-import { selectChainId } from '../../../selectors/networkController';
export interface UseSimulationMetricsProps {
balanceChanges: BalanceChange[];
@@ -50,9 +49,6 @@ export function useSimulationMetrics({
const { loadingTime, setLoadingComplete } = useLoadingTime();
const dispatch = useDispatch();
- // TODO: Remove global network selector usage once simulations refactored.
- const chainId = useSelector(selectChainId);
-
if (!loading) {
setLoadingComplete();
}
@@ -62,7 +58,7 @@ export function useSimulationMetrics({
value: asset.address ?? '',
type: NameType.EthereumAddress,
preferContractSymbol: true,
- variation: chainId,
+ variation: asset.chainId,
}),
);
diff --git a/app/components/UI/Stake/Views/StakeConfirmationView/StakeConfirmationView.tsx b/app/components/UI/Stake/Views/StakeConfirmationView/StakeConfirmationView.tsx
index 0eb0e2ba8de..8a86705d0e8 100644
--- a/app/components/UI/Stake/Views/StakeConfirmationView/StakeConfirmationView.tsx
+++ b/app/components/UI/Stake/Views/StakeConfirmationView/StakeConfirmationView.tsx
@@ -13,6 +13,8 @@ import { strings } from '../../../../../../locales/i18n';
import { FooterButtonGroupActions } from '../../components/StakingConfirmation/ConfirmationFooter/FooterButtonGroup/FooterButtonGroup.types';
import UnstakingTimeCard from '../../components/StakingConfirmation/UnstakeTimeCard/UnstakeTimeCard';
import { ScrollView } from 'react-native-gesture-handler';
+import { MetaMetricsEvents } from '../../../../hooks/useMetrics';
+import { EVENT_LOCATIONS, EVENT_PROVIDERS } from '../../constants/events';
const MOCK_STAKING_CONTRACT_NAME = 'MM Pooled Staking';
@@ -23,10 +25,24 @@ const StakeConfirmationView = ({ route }: StakeConfirmationViewProps) => {
useEffect(() => {
navigation.setOptions(
- getStakingNavbar(strings('stake.stake'), navigation, theme.colors, {
- backgroundColor: theme.colors.background.alternative,
- hasCancelButton: false,
- }),
+ getStakingNavbar(
+ strings('stake.stake'),
+ navigation,
+ theme.colors,
+ {
+ backgroundColor: theme.colors.background.alternative,
+ hasCancelButton: false,
+ },
+ {
+ backButtonEvent: {
+ event: MetaMetricsEvents.STAKE_CONFIRMATION_BACK_CLICKED,
+ properties: {
+ selected_provider: EVENT_PROVIDERS.CONSENSYS,
+ location: EVENT_LOCATIONS.STAKE_CONFIRMATION_VIEW,
+ },
+ },
+ },
+ ),
);
}, [navigation, theme.colors]);
diff --git a/app/components/UI/Stake/Views/StakeInputView/StakeInputView.test.tsx b/app/components/UI/Stake/Views/StakeInputView/StakeInputView.test.tsx
index 650343c3958..559c068e427 100644
--- a/app/components/UI/Stake/Views/StakeInputView/StakeInputView.test.tsx
+++ b/app/components/UI/Stake/Views/StakeInputView/StakeInputView.test.tsx
@@ -246,6 +246,8 @@ describe('StakeInputView', () => {
annualRewardRate: '2.5%',
annualRewardsETH: '0.00938 ETH',
annualRewardsFiat: '18.75 USD',
+ estimatedGasFee: '0.25',
+ estimatedGasFeePercentage: '66%',
},
});
});
diff --git a/app/components/UI/Stake/Views/StakeInputView/StakeInputView.tsx b/app/components/UI/Stake/Views/StakeInputView/StakeInputView.tsx
index ead9d7016c8..3ae652a718b 100644
--- a/app/components/UI/Stake/Views/StakeInputView/StakeInputView.tsx
+++ b/app/components/UI/Stake/Views/StakeInputView/StakeInputView.tsx
@@ -20,6 +20,8 @@ import useStakingInputHandlers from '../../hooks/useStakingInput';
import InputDisplay from '../../components/InputDisplay';
import { MetaMetricsEvents, useMetrics } from '../../../../hooks/useMetrics';
import { withMetaMetrics } from '../../utils/metaMetrics/withMetaMetrics';
+import { formatEther } from 'ethers/lib/utils';
+import { EVENT_PROVIDERS, EVENT_LOCATIONS } from '../../constants/events';
const StakeInputView = () => {
const title = strings('stake.stake_eth');
@@ -49,6 +51,8 @@ const StakeInputView = () => {
handleMax,
balanceValue,
isHighGasCostImpact,
+ getDepositTxGasPercentage,
+ estimatedGasFeeWei,
isLoadingStakingGasFee,
} = useStakingInputHandlers();
@@ -60,6 +64,21 @@ const StakeInputView = () => {
const handleStakePress = useCallback(() => {
if (isHighGasCostImpact()) {
+ trackEvent(
+ createEventBuilder(
+ MetaMetricsEvents.STAKE_GAS_COST_IMPACT_WARNING_TRIGGERED,
+ )
+ .addProperties({
+ selected_provider: EVENT_PROVIDERS.CONSENSYS,
+ location: EVENT_LOCATIONS.STAKE_INPUT_VIEW,
+ tokens_to_stake_native_value: amountEth,
+ tokens_to_stake_usd_value: fiatAmount,
+ estimated_gas_fee: formatEther(estimatedGasFeeWei.toString()),
+ estimated_gas_percentage_of_deposit: `${getDepositTxGasPercentage()}%`,
+ })
+ .build(),
+ );
+
navigation.navigate('StakeModals', {
screen: Routes.STAKING.MODALS.GAS_IMPACT,
params: {
@@ -68,6 +87,8 @@ const StakeInputView = () => {
annualRewardsETH,
annualRewardsFiat,
annualRewardRate,
+ estimatedGasFee: formatEther(estimatedGasFeeWei.toString()),
+ estimatedGasFeePercentage: `${getDepositTxGasPercentage()}%`,
},
});
return;
@@ -86,7 +107,7 @@ const StakeInputView = () => {
trackEvent(
createEventBuilder(MetaMetricsEvents.REVIEW_STAKE_BUTTON_CLICKED)
.addProperties({
- selected_provider: 'consensys',
+ selected_provider: EVENT_PROVIDERS.CONSENSYS,
tokens_to_stake_native_value: amountEth,
tokens_to_stake_usd_value: fiatAmount,
})
@@ -103,6 +124,8 @@ const StakeInputView = () => {
trackEvent,
createEventBuilder,
amountEth,
+ estimatedGasFeeWei,
+ getDepositTxGasPercentage,
]);
const handleMaxButtonPress = () => {
@@ -124,9 +147,23 @@ const StakeInputView = () => {
useEffect(() => {
navigation.setOptions(
- getStakingNavbar(title, navigation, theme.colors, {
- hasBackButton: false,
- }),
+ getStakingNavbar(
+ title,
+ navigation,
+ theme.colors,
+ {
+ hasBackButton: false,
+ },
+ {
+ cancelButtonEvent: {
+ event: MetaMetricsEvents.STAKE_CANCEL_CLICKED,
+ properties: {
+ selected_provider: EVENT_PROVIDERS.CONSENSYS,
+ location: EVENT_LOCATIONS.STAKE_INPUT_VIEW,
+ },
+ },
+ },
+ ),
);
}, [navigation, theme.colors, title]);
@@ -148,9 +185,9 @@ const StakeInputView = () => {
handleCurrencySwitch={withMetaMetrics(handleCurrencySwitch, {
event: MetaMetricsEvents.STAKE_INPUT_CURRENCY_SWITCH_CLICKED,
properties: {
- selected_provider: 'consensys',
+ selected_provider: EVENT_PROVIDERS.CONSENSYS,
text: 'Currency Switch Trigger',
- location: 'Stake Input View',
+ location: EVENT_LOCATIONS.STAKE_INPUT_VIEW,
// We want to track the currency switching to. Not the current currency.
currency_type: isEth ? 'fiat' : 'native',
},
@@ -163,9 +200,9 @@ const StakeInputView = () => {
onIconPress={withMetaMetrics(navigateToLearnMoreModal, {
event: MetaMetricsEvents.TOOLTIP_OPENED,
properties: {
- selected_provider: 'consensys',
+ selected_provider: EVENT_PROVIDERS.CONSENSYS,
text: 'Tooltip Opened',
- location: 'Stake Input View',
+ location: EVENT_LOCATIONS.STAKE_INPUT_VIEW,
tooltip_name: 'MetaMask Pool Estimated Rewards',
},
})}
@@ -178,7 +215,7 @@ const StakeInputView = () => {
withMetaMetrics(handleQuickAmountPress, {
event: MetaMetricsEvents.STAKE_INPUT_QUICK_AMOUNT_CLICKED,
properties: {
- location: 'StakeInputView',
+ location: EVENT_LOCATIONS.STAKE_INPUT_VIEW,
amount: value,
// onMaxPress is called instead when it's defined and the max is clicked.
is_max: false,
@@ -189,7 +226,7 @@ const StakeInputView = () => {
onMaxPress={withMetaMetrics(handleMaxButtonPress, {
event: MetaMetricsEvents.STAKE_INPUT_QUICK_AMOUNT_CLICKED,
properties: {
- location: 'StakeInputView',
+ location: EVENT_LOCATIONS.STAKE_INPUT_VIEW,
is_max: true,
mode: isEth ? 'native' : 'fiat',
},
diff --git a/app/components/UI/Stake/Views/StakeInputView/__snapshots__/StakeInputView.test.tsx.snap b/app/components/UI/Stake/Views/StakeInputView/__snapshots__/StakeInputView.test.tsx.snap
index fb47e1bf1c1..b4e933be952 100644
--- a/app/components/UI/Stake/Views/StakeInputView/__snapshots__/StakeInputView.test.tsx.snap
+++ b/app/components/UI/Stake/Views/StakeInputView/__snapshots__/StakeInputView.test.tsx.snap
@@ -1629,9 +1629,9 @@ exports[`StakeInputView render matches snapshot 1`] = `
style={
{
"color": "#ffffff",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
diff --git a/app/components/UI/Stake/Views/UnstakeConfirmationView/UnstakeConfirmationView.tsx b/app/components/UI/Stake/Views/UnstakeConfirmationView/UnstakeConfirmationView.tsx
index 1a78eab35e5..4c3a94084a3 100644
--- a/app/components/UI/Stake/Views/UnstakeConfirmationView/UnstakeConfirmationView.tsx
+++ b/app/components/UI/Stake/Views/UnstakeConfirmationView/UnstakeConfirmationView.tsx
@@ -11,6 +11,8 @@ import TokenValueStack from '../../components/StakingConfirmation/TokenValueStac
import AccountCard from '../../components/StakingConfirmation/AccountCard/AccountCard';
import ConfirmationFooter from '../../components/StakingConfirmation/ConfirmationFooter/ConfirmationFooter';
import { FooterButtonGroupActions } from '../../components/StakingConfirmation/ConfirmationFooter/FooterButtonGroup/FooterButtonGroup.types';
+import { MetaMetricsEvents } from '../../../../hooks/useMetrics';
+import { EVENT_LOCATIONS, EVENT_PROVIDERS } from '../../constants/events';
const MOCK_STAKING_CONTRACT_NAME = 'MM Pooled Staking';
@@ -21,10 +23,24 @@ const UnstakeConfirmationView = ({ route }: UnstakeConfirmationViewProps) => {
useEffect(() => {
navigation.setOptions(
- getStakingNavbar(strings('stake.unstake'), navigation, theme.colors, {
- backgroundColor: theme.colors.background.alternative,
- hasCancelButton: false,
- }),
+ getStakingNavbar(
+ strings('stake.unstake'),
+ navigation,
+ theme.colors,
+ {
+ backgroundColor: theme.colors.background.alternative,
+ hasCancelButton: false,
+ },
+ {
+ backButtonEvent: {
+ event: MetaMetricsEvents.UNSTAKE_CONFIRMATION_BACK_CLICKED,
+ properties: {
+ selected_provider: EVENT_PROVIDERS.CONSENSYS,
+ location: EVENT_LOCATIONS.UNSTAKE_CONFIRMATION_VIEW,
+ },
+ },
+ },
+ ),
);
}, [navigation, theme.colors]);
diff --git a/app/components/UI/Stake/Views/UnstakeInputView/UnstakeInputView.tsx b/app/components/UI/Stake/Views/UnstakeInputView/UnstakeInputView.tsx
index b27bbbe07e0..1786301fb0e 100644
--- a/app/components/UI/Stake/Views/UnstakeInputView/UnstakeInputView.tsx
+++ b/app/components/UI/Stake/Views/UnstakeInputView/UnstakeInputView.tsx
@@ -20,6 +20,7 @@ import Routes from '../../../../../constants/navigation/Routes';
import { MetaMetricsEvents, useMetrics } from '../../../../hooks/useMetrics';
import useUnstakingInputHandlers from '../../hooks/useUnstakingInput';
import { withMetaMetrics } from '../../utils/metaMetrics/withMetaMetrics';
+import { EVENT_LOCATIONS, EVENT_PROVIDERS } from '../../constants/events';
const UnstakeInputView = () => {
const title = strings('stake.unstake_eth');
@@ -54,9 +55,23 @@ const UnstakeInputView = () => {
useEffect(() => {
navigation.setOptions(
- getStakingNavbar(title, navigation, theme.colors, {
- hasBackButton: false,
- }),
+ getStakingNavbar(
+ title,
+ navigation,
+ theme.colors,
+ {
+ hasBackButton: false,
+ },
+ {
+ cancelButtonEvent: {
+ event: MetaMetricsEvents.UNSTAKE_CANCEL_CLICKED,
+ properties: {
+ selected_provider: EVENT_PROVIDERS.CONSENSYS,
+ location: EVENT_LOCATIONS.UNSTAKE_INPUT_VIEW,
+ },
+ },
+ },
+ ),
);
}, [navigation, theme.colors, title]);
@@ -71,7 +86,7 @@ const UnstakeInputView = () => {
trackEvent(
createEventBuilder(MetaMetricsEvents.REVIEW_UNSTAKE_BUTTON_CLICKED)
.addProperties({
- selected_provider: 'consensys',
+ selected_provider: EVENT_PROVIDERS.CONSENSYS,
tokens_to_stake_native_value: amountEth,
tokens_to_stake_usd_value: fiatAmount,
})
@@ -100,9 +115,9 @@ const UnstakeInputView = () => {
handleCurrencySwitch={withMetaMetrics(handleCurrencySwitch, {
event: MetaMetricsEvents.UNSTAKE_INPUT_CURRENCY_SWITCH_CLICKED,
properties: {
- selected_provider: 'consensys',
+ selected_provider: EVENT_PROVIDERS.CONSENSYS,
text: 'Currency Switch Trigger',
- location: 'Unstake Input View',
+ location: EVENT_LOCATIONS.UNSTAKE_INPUT_VIEW,
// We want to track the currency switching to. Not the current currency.
currency_type: isEth ? 'fiat' : 'native',
},
@@ -116,7 +131,7 @@ const UnstakeInputView = () => {
withMetaMetrics(handleQuickAmountPress, {
event: MetaMetricsEvents.UNSTAKE_INPUT_QUICK_AMOUNT_CLICKED,
properties: {
- location: 'UnstakeInputView',
+ location: EVENT_LOCATIONS.UNSTAKE_INPUT_VIEW,
amount: value,
is_max: value === 1,
mode: isEth ? 'native' : 'fiat',
diff --git a/app/components/UI/Stake/Views/UnstakeInputView/__snapshots__/UnstakeInputView.test.tsx.snap b/app/components/UI/Stake/Views/UnstakeInputView/__snapshots__/UnstakeInputView.test.tsx.snap
index 5235c2f45c8..1d62ee385fe 100644
--- a/app/components/UI/Stake/Views/UnstakeInputView/__snapshots__/UnstakeInputView.test.tsx.snap
+++ b/app/components/UI/Stake/Views/UnstakeInputView/__snapshots__/UnstakeInputView.test.tsx.snap
@@ -1573,9 +1573,9 @@ exports[`UnstakeInputView render matches snapshot 1`] = `
style={
{
"color": "#ffffff",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
diff --git a/app/components/UI/Stake/components/GasImpactModal/GasImpactModal.test.tsx b/app/components/UI/Stake/components/GasImpactModal/GasImpactModal.test.tsx
index 7018981373c..f6eca2e2f22 100644
--- a/app/components/UI/Stake/components/GasImpactModal/GasImpactModal.test.tsx
+++ b/app/components/UI/Stake/components/GasImpactModal/GasImpactModal.test.tsx
@@ -29,6 +29,8 @@ const props: GasImpactModalProps = {
annualRewardRate: '2.5%',
annualRewardsETH: '2.5 ETH',
annualRewardsFiat: '$5000',
+ estimatedGasFee: '0.009171428571428572',
+ estimatedGasFeePercentage: '35%',
},
name: 'params',
},
diff --git a/app/components/UI/Stake/components/GasImpactModal/GasImpactModal.types.ts b/app/components/UI/Stake/components/GasImpactModal/GasImpactModal.types.ts
index a00204cfbee..7a1d9441615 100644
--- a/app/components/UI/Stake/components/GasImpactModal/GasImpactModal.types.ts
+++ b/app/components/UI/Stake/components/GasImpactModal/GasImpactModal.types.ts
@@ -6,6 +6,8 @@ interface GasImpactModalRouteParams {
annualRewardsETH: string;
annualRewardsFiat: string;
annualRewardRate: string;
+ estimatedGasFee: string;
+ estimatedGasFeePercentage: string;
}
export interface GasImpactModalProps {
diff --git a/app/components/UI/Stake/components/GasImpactModal/__snapshots__/GasImpactModal.test.tsx.snap b/app/components/UI/Stake/components/GasImpactModal/__snapshots__/GasImpactModal.test.tsx.snap
index 4050753f14d..1643b96b393 100644
--- a/app/components/UI/Stake/components/GasImpactModal/__snapshots__/GasImpactModal.test.tsx.snap
+++ b/app/components/UI/Stake/components/GasImpactModal/__snapshots__/GasImpactModal.test.tsx.snap
@@ -136,7 +136,6 @@ exports[`GasImpactModal render matches snapshot 1`] = `
{
const { styles } = useStyles(styleSheet, {});
const { navigate } = useNavigation();
+ const { trackEvent, createEventBuilder } = useMetrics();
+
const sheetRef = useRef(null);
+ const {
+ amountWei,
+ annualRewardRate,
+ annualRewardsFiat,
+ annualRewardsETH,
+ amountFiat,
+ estimatedGasFee,
+ estimatedGasFeePercentage,
+ } = route.params;
+
+ const metricsEvent = useCallback(
+ (
+ eventName:
+ | typeof MetaMetricsEvents.STAKE_GAS_COST_IMPACT_CANCEL_CLICKED
+ | typeof MetaMetricsEvents.STAKE_GAS_COST_IMPACT_PROCEEDED_CLICKED,
+ ) => {
+ trackEvent(
+ createEventBuilder(eventName)
+ .addProperties({
+ selected_provider: EVENT_PROVIDERS.CONSENSYS,
+ location: EVENT_LOCATIONS.GAS_IMPACT_MODAL,
+ tokens_to_stake_native_value: formatEther(amountWei),
+ tokens_to_stake_usd_value: amountFiat,
+ estimated_gas_fee: estimatedGasFee,
+ estimated_gas_percentage_of_deposit: estimatedGasFeePercentage,
+ })
+ .build(),
+ );
+ },
+ [
+ amountFiat,
+ amountWei,
+ createEventBuilder,
+ estimatedGasFee,
+ estimatedGasFeePercentage,
+ trackEvent,
+ ],
+ );
+
const handleClose = () => {
+ metricsEvent(MetaMetricsEvents.STAKE_GAS_COST_IMPACT_CANCEL_CLICKED);
sheetRef.current?.onCloseBottomSheet();
};
const handleNavigateToStakeReviewScreen = () => {
- const {
- amountWei,
- annualRewardRate,
- annualRewardsFiat,
- annualRewardsETH,
- amountFiat,
- } = route.params;
-
+ metricsEvent(MetaMetricsEvents.STAKE_GAS_COST_IMPACT_PROCEEDED_CLICKED);
navigate('StakeScreens', {
screen: Routes.STAKING.STAKE_CONFIRMATION,
params: {
diff --git a/app/components/UI/Stake/components/LearnMoreModal/__snapshots__/LearnMoreModal.test.tsx.snap b/app/components/UI/Stake/components/LearnMoreModal/__snapshots__/LearnMoreModal.test.tsx.snap
index 4d38fcb293a..0a7dc9ddf69 100644
--- a/app/components/UI/Stake/components/LearnMoreModal/__snapshots__/LearnMoreModal.test.tsx.snap
+++ b/app/components/UI/Stake/components/LearnMoreModal/__snapshots__/LearnMoreModal.test.tsx.snap
@@ -653,9 +653,9 @@ exports[`LearnMoreModal render matches snapshot 1`] = `
style={
{
"color": "#0376c9",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -697,9 +697,9 @@ exports[`LearnMoreModal render matches snapshot 1`] = `
style={
{
"color": "#ffffff",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
diff --git a/app/components/UI/Stake/components/LearnMoreModal/index.tsx b/app/components/UI/Stake/components/LearnMoreModal/index.tsx
index eb321f8d238..5d6d4b6677d 100644
--- a/app/components/UI/Stake/components/LearnMoreModal/index.tsx
+++ b/app/components/UI/Stake/components/LearnMoreModal/index.tsx
@@ -19,6 +19,7 @@ import { POOLED_STAKING_FAQ_URL } from '../../constants';
import createLearnMoreModalStyles from './LearnMoreModal.styles';
import { MetaMetricsEvents } from '../../../../hooks/useMetrics';
import { withMetaMetrics } from '../../utils/metaMetrics/withMetaMetrics';
+import { EVENT_LOCATIONS, EVENT_PROVIDERS } from '../../constants/events';
const styles = createLearnMoreModalStyles();
@@ -99,9 +100,9 @@ const LearnMoreModal = () => {
onPress={withMetaMetrics(handleLearnMoreBrowserRedirect, {
event: MetaMetricsEvents.STAKE_LEARN_MORE_CLICKED,
properties: {
- selected_provider: 'consensys',
+ selected_provider: EVENT_PROVIDERS.CONSENSYS,
text: 'Learn More',
- location: 'Learn More Modal',
+ location: EVENT_LOCATIONS.LEARN_MORE_MODAL,
},
})}
label={strings('stake.learn_more')}
diff --git a/app/components/UI/Stake/components/MaxInputModal/__snapshots__/MaxInputModal.test.tsx.snap b/app/components/UI/Stake/components/MaxInputModal/__snapshots__/MaxInputModal.test.tsx.snap
index c3aa8b2abf5..763f17ac839 100644
--- a/app/components/UI/Stake/components/MaxInputModal/__snapshots__/MaxInputModal.test.tsx.snap
+++ b/app/components/UI/Stake/components/MaxInputModal/__snapshots__/MaxInputModal.test.tsx.snap
@@ -426,7 +426,6 @@ exports[`MaxInputModal render matches snapshot 1`] = `
{
createEventBuilder(MetaMetricsEvents.STAKE_BUTTON_CLICKED)
.addProperties({
chain_id: getDecimalChainId(chainId),
- location: 'Home Screen',
+ location: EVENT_LOCATIONS.HOME_SCREEN,
text: 'Stake',
token_symbol: asset.symbol,
url: AppConstants.STAKE.URL,
diff --git a/app/components/UI/Stake/components/StakingBalance/StakingBalance.tsx b/app/components/UI/Stake/components/StakingBalance/StakingBalance.tsx
index 1d41646bc3c..ce12aec48e7 100644
--- a/app/components/UI/Stake/components/StakingBalance/StakingBalance.tsx
+++ b/app/components/UI/Stake/components/StakingBalance/StakingBalance.tsx
@@ -1,4 +1,4 @@
-import React, { useMemo } from 'react';
+import React, { useEffect, useMemo, useState } from 'react';
import Badge, {
BadgeVariant,
} from '../../../../../component-library/components/Badges/Badge';
@@ -44,6 +44,8 @@ import useBalance from '../../hooks/useBalance';
import { NetworkBadgeSource } from '../../../AssetOverview/Balance/Balance';
import { selectChainId } from '../../../../../selectors/networkController';
import SkeletonPlaceholder from 'react-native-skeleton-placeholder';
+import { MetaMetricsEvents, useMetrics } from '../../../../hooks/useMetrics';
+import { EVENT_LOCATIONS, EVENT_PROVIDERS } from '../../constants/events';
export interface StakingBalanceProps {
asset: TokenI;
@@ -51,6 +53,12 @@ export interface StakingBalanceProps {
const StakingBalanceContent = ({ asset }: StakingBalanceProps) => {
const { styles } = useStyles(styleSheet, {});
+
+ const [
+ hasSentViewingStakingRewardsMetric,
+ setHasSentViewingStakingRewardsMetric,
+ ] = useState(false);
+
const chainId = useSelector(selectChainId);
const networkName = useSelector(selectNetworkName);
@@ -58,6 +66,8 @@ const StakingBalanceContent = ({ asset }: StakingBalanceProps) => {
const { isStakingSupportedChain } = useStakingChain();
+ const { trackEvent, createEventBuilder } = useMetrics();
+
const {
pooledStakesData,
exchangeRate,
@@ -92,6 +102,28 @@ const StakingBalanceContent = ({ asset }: StakingBalanceProps) => {
const hasClaimableEth = !!Number(claimableEth);
+ useEffect(() => {
+ if (hasStakedPositions && !hasSentViewingStakingRewardsMetric) {
+ trackEvent(
+ createEventBuilder(
+ MetaMetricsEvents.VISITED_ETH_OVERVIEW_WITH_STAKED_POSITIONS,
+ )
+ .addProperties({
+ selected_provider: EVENT_PROVIDERS.CONSENSYS,
+ location: EVENT_LOCATIONS.STAKING_BALANCE,
+ })
+ .build(),
+ );
+
+ setHasSentViewingStakingRewardsMetric(true);
+ }
+ }, [
+ createEventBuilder,
+ hasSentViewingStakingRewardsMetric,
+ hasStakedPositions,
+ trackEvent,
+ ]);
+
if (!isStakingSupportedChain) {
return <>>;
}
diff --git a/app/components/UI/Stake/components/StakingBalance/StakingBanners/ClaimBanner/ClaimBanner.tsx b/app/components/UI/Stake/components/StakingBalance/StakingBanners/ClaimBanner/ClaimBanner.tsx
index 3a13ee588ca..e99f93880c0 100644
--- a/app/components/UI/Stake/components/StakingBalance/StakingBanners/ClaimBanner/ClaimBanner.tsx
+++ b/app/components/UI/Stake/components/StakingBalance/StakingBanners/ClaimBanner/ClaimBanner.tsx
@@ -23,6 +23,7 @@ import {
MetaMetricsEvents,
useMetrics,
} from '../../../../../../hooks/useMetrics';
+import { EVENT_LOCATIONS } from '../../../../constants/events';
type StakeBannerProps = Pick & {
claimableAmount: string;
@@ -48,7 +49,7 @@ const ClaimBanner = ({ claimableAmount, style }: StakeBannerProps) => {
trackEvent(
createEventBuilder(MetaMetricsEvents.STAKE_CLAIM_BUTTON_CLICKED)
.addProperties({
- location: 'Token Details',
+ location: EVENT_LOCATIONS.TOKEN_DETAILS,
})
.build(),
);
diff --git a/app/components/UI/Stake/components/StakingBalance/StakingButtons/StakingButtons.tsx b/app/components/UI/Stake/components/StakingBalance/StakingButtons/StakingButtons.tsx
index e6245f6506a..a87ea82fc06 100644
--- a/app/components/UI/Stake/components/StakingBalance/StakingButtons/StakingButtons.tsx
+++ b/app/components/UI/Stake/components/StakingBalance/StakingButtons/StakingButtons.tsx
@@ -11,6 +11,7 @@ import Routes from '../../../../../../constants/navigation/Routes';
import { useMetrics, MetaMetricsEvents } from '../../../../../hooks/useMetrics';
import { useSelector } from 'react-redux';
import { selectChainId } from '../../../../../../selectors/networkController';
+import { EVENT_LOCATIONS } from '../../../constants/events';
interface StakingButtonsProps extends Pick {
hasStakedPositions: boolean;
@@ -34,7 +35,7 @@ const StakingButtons = ({
trackEvent(
createEventBuilder(MetaMetricsEvents.STAKE_WITHDRAW_BUTTON_CLICKED)
.addProperties({
- location: 'Token Details',
+ location: EVENT_LOCATIONS.TOKEN_DETAILS,
text: 'Unstake',
token_symbol: 'ETH',
chain_id: chainId,
@@ -48,7 +49,7 @@ const StakingButtons = ({
trackEvent(
createEventBuilder(MetaMetricsEvents.STAKE_BUTTON_CLICKED)
.addProperties({
- location: 'Token Details',
+ location: EVENT_LOCATIONS.TOKEN_DETAILS,
text: 'Stake',
token_symbol: 'ETH',
chain_id: chainId,
diff --git a/app/components/UI/Stake/components/StakingBalance/StakingCta/StakingCta.tsx b/app/components/UI/Stake/components/StakingBalance/StakingCta/StakingCta.tsx
index a6e2f4efca0..d292873ef5e 100644
--- a/app/components/UI/Stake/components/StakingBalance/StakingCta/StakingCta.tsx
+++ b/app/components/UI/Stake/components/StakingBalance/StakingCta/StakingCta.tsx
@@ -13,6 +13,7 @@ import { strings } from '../../../../../../../locales/i18n';
import { useNavigation } from '@react-navigation/native';
import Routes from '../../../../../../constants/navigation/Routes';
import { MetaMetricsEvents, useMetrics } from '../../../../../hooks/useMetrics';
+import { EVENT_LOCATIONS, EVENT_PROVIDERS } from '../../../constants/events';
interface StakingCtaProps extends Pick {
estimatedRewardRate: string;
@@ -30,9 +31,9 @@ const StakingCta = ({ estimatedRewardRate, style }: StakingCtaProps) => {
trackEvent(
createEventBuilder(MetaMetricsEvents.STAKE_LEARN_MORE_CLICKED)
.addProperties({
- selected_provider: 'consensys',
+ selected_provider: EVENT_PROVIDERS.CONSENSYS,
text: 'Learn More',
- location: 'Token Details',
+ location: EVENT_LOCATIONS.TOKEN_DETAILS,
})
.build(),
);
diff --git a/app/components/UI/Stake/components/StakingBalance/StakingCta/__snapshots__/StakingCta.test.tsx.snap b/app/components/UI/Stake/components/StakingBalance/StakingCta/__snapshots__/StakingCta.test.tsx.snap
index 3d013662beb..7c98e55808b 100644
--- a/app/components/UI/Stake/components/StakingBalance/StakingCta/__snapshots__/StakingCta.test.tsx.snap
+++ b/app/components/UI/Stake/components/StakingBalance/StakingCta/__snapshots__/StakingCta.test.tsx.snap
@@ -98,9 +98,9 @@ exports[`StakingCta render matches snapshot 1`] = `
style={
{
"color": "#0376c9",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
diff --git a/app/components/UI/Stake/components/StakingBalance/__snapshots__/StakingBalance.test.tsx.snap b/app/components/UI/Stake/components/StakingBalance/__snapshots__/StakingBalance.test.tsx.snap
index 61fe94e4e3f..12d5815c0fb 100644
--- a/app/components/UI/Stake/components/StakingBalance/__snapshots__/StakingBalance.test.tsx.snap
+++ b/app/components/UI/Stake/components/StakingBalance/__snapshots__/StakingBalance.test.tsx.snap
@@ -413,477 +413,9 @@ exports[`StakingBalance render matches snapshot 1`] = `
style={
{
"color": "#0376c9",
- "fontFamily": "EuclidCircularB-Regular",
- "fontSize": 14,
- "fontWeight": "400",
- "letterSpacing": 0,
- "lineHeight": 22,
- }
- }
- >
- Unstake
-
-
-
-
- Stake more
-
-
-
-
-
-`;
-
-exports[`StakingBalance should match the snapshot when portfolio view is enabled 1`] = `
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Staked Ethereum
-
-
-
-
-
-
-
-
-
-
- Unstaking 0.0010 ETH in progress. Come back in a few days to claim it.
-
-
-
-
-
-
-
-
-
- You can claim 0.00214 ETH. Once claimed, you'll get ETH back in your wallet.
-
-
-
- Claim
- ETH
-
-
-
-
-
-
-
+> = {
+ STAKE: {
+ APPROVED: MetaMetricsEvents.STAKE_TRANSACTION_APPROVED,
+ REJECTED: MetaMetricsEvents.STAKE_TRANSACTION_REJECTED,
+ CONFIRMED: MetaMetricsEvents.STAKE_TRANSACTION_CONFIRMED,
+ FAILED: MetaMetricsEvents.STAKE_TRANSACTION_FAILED,
+ SUBMITTED: MetaMetricsEvents.STAKE_TRANSACTION_SUBMITTED,
+ },
+ UNSTAKE: {
+ APPROVED: MetaMetricsEvents.UNSTAKE_TRANSACTION_APPROVED,
+ REJECTED: MetaMetricsEvents.UNSTAKE_TRANSACTION_REJECTED,
+ CONFIRMED: MetaMetricsEvents.UNSTAKE_TRANSACTION_CONFIRMED,
+ FAILED: MetaMetricsEvents.UNSTAKE_TRANSACTION_FAILED,
+ SUBMITTED: MetaMetricsEvents.UNSTAKE_TRANSACTION_SUBMITTED,
+ },
+};
const FooterButtonGroup = ({ valueWei, action }: FooterButtonGroupProps) => {
const { styles } = useStyles(styleSheet, {});
@@ -31,6 +61,8 @@ const FooterButtonGroup = ({ valueWei, action }: FooterButtonGroupProps) => {
const navigation = useNavigation();
const { navigate } = navigation;
+ const { trackEvent, createEventBuilder } = useMetrics();
+
const activeAccount = useSelector(selectSelectedInternalAccount);
const { attemptDepositTransaction } = usePoolStakedDeposit();
@@ -40,13 +72,49 @@ const FooterButtonGroup = ({ valueWei, action }: FooterButtonGroupProps) => {
const [didSubmitTransaction, setDidSubmitTransaction] = useState(false);
+ const isStaking = useMemo(
+ () => action === FooterButtonGroupActions.STAKE,
+ [action],
+ );
+
+ const submitTxMetaMetric = useCallback(
+ (txEventName: IMetaMetricsEvent) => {
+ const { STAKE_CONFIRMATION_VIEW, UNSTAKE_CONFIRMATION_VIEW } =
+ EVENT_LOCATIONS;
+
+ const location = isStaking
+ ? STAKE_CONFIRMATION_VIEW
+ : UNSTAKE_CONFIRMATION_VIEW;
+
+ return trackEvent(
+ createEventBuilder(txEventName)
+ .addProperties({
+ selected_provider: EVENT_PROVIDERS.CONSENSYS,
+ location,
+ transaction_amount_eth: formatEther(valueWei),
+ })
+ .build(),
+ );
+ },
+ [createEventBuilder, isStaking, trackEvent, valueWei],
+ );
+
const listenForTransactionEvents = useCallback(
(transactionId?: string) => {
if (!transactionId) return;
+ Engine.controllerMessenger.subscribeOnceIf(
+ 'TransactionController:transactionApproved',
+ () => {
+ submitTxMetaMetric(STAKING_TX_METRIC_EVENTS[action].APPROVED);
+ },
+ ({ transactionMeta }) => transactionMeta.id === transactionId,
+ );
+
Engine.controllerMessenger.subscribeOnceIf(
'TransactionController:transactionSubmitted',
() => {
+ submitTxMetaMetric(STAKING_TX_METRIC_EVENTS[action].SUBMITTED);
setDidSubmitTransaction(false);
navigate(Routes.TRANSACTIONS_VIEW);
},
@@ -56,6 +124,7 @@ const FooterButtonGroup = ({ valueWei, action }: FooterButtonGroupProps) => {
Engine.controllerMessenger.subscribeOnceIf(
'TransactionController:transactionFailed',
() => {
+ submitTxMetaMetric(STAKING_TX_METRIC_EVENTS[action].FAILED);
setDidSubmitTransaction(false);
},
({ transactionMeta }) => transactionMeta.id === transactionId,
@@ -64,6 +133,7 @@ const FooterButtonGroup = ({ valueWei, action }: FooterButtonGroupProps) => {
Engine.controllerMessenger.subscribeOnceIf(
'TransactionController:transactionRejected',
() => {
+ submitTxMetaMetric(STAKING_TX_METRIC_EVENTS[action].REJECTED);
setDidSubmitTransaction(false);
},
({ transactionMeta }) => transactionMeta.id === transactionId,
@@ -72,12 +142,13 @@ const FooterButtonGroup = ({ valueWei, action }: FooterButtonGroupProps) => {
Engine.controllerMessenger.subscribeOnceIf(
'TransactionController:transactionConfirmed',
() => {
+ submitTxMetaMetric(STAKING_TX_METRIC_EVENTS[action].CONFIRMED);
refreshPooledStakes();
},
(transactionMeta) => transactionMeta.id === transactionId,
);
},
- [navigate, refreshPooledStakes],
+ [action, navigate, refreshPooledStakes, submitTxMetaMetric],
);
const handleConfirmation = async () => {
@@ -86,17 +157,36 @@ const FooterButtonGroup = ({ valueWei, action }: FooterButtonGroupProps) => {
setDidSubmitTransaction(true);
+ const metricsEvent = {
+ name: isStaking
+ ? MetaMetricsEvents.STAKE_TRANSACTION_INITIATED
+ : MetaMetricsEvents.UNSTAKE_TRANSACTION_INITIATED,
+ location: isStaking
+ ? 'StakeConfirmationView'
+ : 'UnstakeConfirmationView',
+ };
+
+ trackEvent(
+ createEventBuilder(metricsEvent.name)
+ .addProperties({
+ selected_provider: EVENT_PROVIDERS.CONSENSYS,
+ location: metricsEvent.location,
+ transaction_amount_eth: formatEther(valueWei),
+ })
+ .build(),
+ );
+
let transactionId: string | undefined;
- if (action === FooterButtonGroupActions.STAKE) {
+ if (isStaking) {
const txRes = await attemptDepositTransaction(
valueWei,
activeAccount.address,
);
transactionId = txRes?.transactionMeta?.id;
}
-
- if (action === FooterButtonGroupActions.UNSTAKE) {
+ // Unstaking
+ else {
const txRes = await attemptUnstakeTransaction(
valueWei,
activeAccount.address,
@@ -110,6 +200,26 @@ const FooterButtonGroup = ({ valueWei, action }: FooterButtonGroupProps) => {
}
};
+ const handleCancelPress = () => {
+ const metricsEvent = {
+ name: isStaking
+ ? MetaMetricsEvents.STAKE_CANCEL_CLICKED
+ : MetaMetricsEvents.UNSTAKE_CANCEL_CLICKED,
+ location: isStaking ? 'StakeConfirmationView' : 'UnstakeConfirmationView',
+ };
+
+ trackEvent(
+ createEventBuilder(metricsEvent.name)
+ .addProperties({
+ selected_provider: EVENT_PROVIDERS.CONSENSYS,
+ location: metricsEvent.location,
+ })
+ .build(),
+ );
+
+ navigation.goBack();
+ };
+
return (
diff --git a/app/components/UI/Swaps/components/LoadingAnimation/__snapshots__/index.test.tsx.snap b/app/components/UI/Swaps/components/LoadingAnimation/__snapshots__/index.test.tsx.snap
new file mode 100644
index 00000000000..76d124104e2
--- /dev/null
+++ b/app/components/UI/Swaps/components/LoadingAnimation/__snapshots__/index.test.tsx.snap
@@ -0,0 +1,1719 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`LoadingAnimation renders 1`] = `
+
+
+
+
+ Starting...
+
+
+
+
+
+
+
+
+
+
+
+ ---
+
+
+
+
+
+
+
+
+ ",
+ }
+ }
+ style={
+ [
+ {
+ "backgroundColor": "#ffffff",
+ "flex": 1,
+ },
+ undefined,
+ ]
+ }
+ />
+
+
+
+`;
diff --git a/app/components/UI/Swaps/components/LoadingAnimation/index.js b/app/components/UI/Swaps/components/LoadingAnimation/index.js
index ec6a1363364..9b282d42517 100644
--- a/app/components/UI/Swaps/components/LoadingAnimation/index.js
+++ b/app/components/UI/Swaps/components/LoadingAnimation/index.js
@@ -5,8 +5,10 @@ import React, {
useRef,
useState,
} from 'react';
+import { useSelector } from 'react-redux';
import { Animated, View, StyleSheet, Image } from 'react-native';
import PropTypes from 'prop-types';
+import { selectSelectedNetworkClientId } from '../../../../../selectors/networkController';
import Engine from '../../../../../core/Engine';
import Logger from '../../../../../util/Logger';
import Device from '../../../../../util/device';
@@ -129,6 +131,8 @@ function LoadingAnimation({
const [renderLogos, setRenderLogos] = useState(false);
const [currentQuoteIndex, setCurrentQuoteIndex] = useState(0);
+ const selectedNetworkClientId = useSelector(selectSelectedNetworkClientId);
+
/* References */
const foxRef = useRef();
const foxHeadPan = useRef(new Animated.ValueXY(0, 0)).current;
@@ -317,9 +321,11 @@ function LoadingAnimation({
return;
}
if (!aggregatorMetadata) {
+ const { SwapsController } = Engine.context;
try {
- const { SwapsController } = Engine.context;
- await SwapsController.fetchAggregatorMetadataWithCache();
+ await SwapsController.fetchAggregatorMetadataWithCache({
+ networkClientId: selectedNetworkClientId,
+ });
} catch (error) {
Logger.error(
error,
@@ -337,7 +343,7 @@ function LoadingAnimation({
setShouldStart(true);
}
})();
- }, [aggregatorMetadata, hasStarted]);
+ }, [aggregatorMetadata, hasStarted, selectedNetworkClientId]);
/* Delay the logos rendering to avoid navigation transition lag */
useEffect(() => {
diff --git a/app/components/UI/Swaps/components/LoadingAnimation/index.test.tsx b/app/components/UI/Swaps/components/LoadingAnimation/index.test.tsx
new file mode 100644
index 00000000000..d0f72eb0ad1
--- /dev/null
+++ b/app/components/UI/Swaps/components/LoadingAnimation/index.test.tsx
@@ -0,0 +1,24 @@
+import React from 'react';
+import renderWithProvider, {
+ DeepPartial,
+} from '../../../../../util/test/renderWithProvider';
+import LoadingAnimation from './';
+import { backgroundState } from '../../../../../util/test/initial-root-state';
+import { RootState } from '../../../../../reducers';
+
+const mockInitialState: DeepPartial = {
+ engine: {
+ backgroundState: {
+ ...backgroundState,
+ },
+ },
+};
+
+describe('LoadingAnimation', () => {
+ it('renders', () => {
+ const wrapper = renderWithProvider(, {
+ state: mockInitialState,
+ });
+ expect(wrapper).toMatchSnapshot();
+ });
+});
diff --git a/app/components/UI/Swaps/index.js b/app/components/UI/Swaps/index.js
index 8d189c21d8f..5808688e3eb 100644
--- a/app/components/UI/Swaps/index.js
+++ b/app/components/UI/Swaps/index.js
@@ -70,6 +70,7 @@ import {
selectChainId,
selectNetworkConfigurations,
selectProviderConfig,
+ selectSelectedNetworkClientId,
} from '../../../selectors/networkController';
import {
selectConversionRate,
@@ -184,6 +185,7 @@ function SwapsAmountView({
accounts,
selectedAddress,
chainId,
+ selectedNetworkClientId,
providerConfig,
networkConfigurations,
balances,
@@ -297,8 +299,12 @@ function SwapsAmountView({
(async () => {
const { SwapsController } = Engine.context;
try {
- await SwapsController.fetchAggregatorMetadataWithCache();
- await SwapsController.fetchTopAssetsWithCache();
+ await SwapsController.fetchAggregatorMetadataWithCache({
+ networkClientId: selectedNetworkClientId,
+ });
+ await SwapsController.fetchTopAssetsWithCache({
+ networkClientId: selectedNetworkClientId,
+ });
} catch (error) {
Logger.error(
error,
@@ -306,7 +312,7 @@ function SwapsAmountView({
);
}
})();
- }, []);
+ }, [selectedNetworkClientId]);
useEffect(() => {
(async () => {
@@ -320,7 +326,9 @@ function SwapsAmountView({
setInitialLoadingTokens(true);
}
setLoadingTokens(true);
- await SwapsController.fetchTokenWithCache();
+ await SwapsController.fetchTokenWithCache({
+ networkClientId: selectedNetworkClientId,
+ });
setLoadingTokens(false);
setInitialLoadingTokens(false);
} catch (error) {
@@ -333,7 +341,7 @@ function SwapsAmountView({
setInitialLoadingTokens(false);
}
})();
- }, [swapsControllerTokens, swapsTokens]);
+ }, [swapsControllerTokens, swapsTokens, selectedNetworkClientId]);
const canSetAnInitialSourceToken =
!isSourceSet &&
@@ -986,6 +994,10 @@ SwapsAmountView.propTypes = {
* Chain Id
*/
chainId: PropTypes.string,
+ /**
+ * Selected network client ID
+ */
+ selectedNetworkClientId: PropTypes.string,
/**
* Network configurations
*/
@@ -1008,6 +1020,7 @@ const mapStateToProps = (state) => ({
providerConfig: selectProviderConfig(state),
networkConfigurations: selectNetworkConfigurations(state),
chainId: selectChainId(state),
+ selectedNetworkClientId: selectSelectedNetworkClientId(state),
tokensWithBalance: swapsTokensWithBalanceSelector(state),
tokensTopAssets: swapsTopAssetsSelector(state),
});
diff --git a/app/components/UI/Swaps/index.test.tsx b/app/components/UI/Swaps/index.test.tsx
new file mode 100644
index 00000000000..d7ccfc1b9bd
--- /dev/null
+++ b/app/components/UI/Swaps/index.test.tsx
@@ -0,0 +1,48 @@
+import React from 'react';
+import renderWithProvider, {
+ DeepPartial,
+} from '../../../util/test/renderWithProvider';
+import SwapsAmountView from './';
+import { backgroundState } from '../../../util/test/initial-root-state';
+import { RootState } from '../../../reducers';
+import { QuoteViewSelectorIDs } from '../../../../e2e/selectors/swaps/QuoteView.selectors';
+
+jest.mock('@react-navigation/native', () => {
+ const actualNav = jest.requireActual('@react-navigation/native');
+ return {
+ ...actualNav,
+ useNavigation: () => ({
+ setOptions: jest.fn(),
+ pop: jest.fn(),
+ navigate: jest.fn(),
+ }),
+ useRoute: () => ({}),
+ };
+});
+
+jest.mock('../../../core/Engine', () => ({
+ context: {
+ SwapsController: {
+ fetchAggregatorMetadataWithCache: jest.fn(),
+ fetchTopAssetsWithCache: jest.fn(),
+ fetchTokenWithCache: jest.fn(),
+ },
+ },
+}));
+
+const mockInitialState: DeepPartial = {
+ engine: {
+ backgroundState: {
+ ...backgroundState,
+ },
+ },
+};
+
+describe('SwapsAmountView', () => {
+ it('renders', async () => {
+ const { getByTestId } = renderWithProvider(, {
+ state: mockInitialState,
+ });
+ expect(getByTestId(QuoteViewSelectorIDs.SOURCE_TOKEN)).toBeDefined();
+ });
+});
diff --git a/app/components/UI/Swaps/utils/index.js b/app/components/UI/Swaps/utils/index.js
index 665562c3f55..d9d41edd236 100644
--- a/app/components/UI/Swaps/utils/index.js
+++ b/app/components/UI/Swaps/utils/index.js
@@ -118,6 +118,7 @@ export function getQuotesNavigationsParams(route) {
* @param {object} options.destinationToken destinationToken object from tokens API
* @param {string} sourceAmount Amount in minimal token units of sourceToken to be swapped
* @param {string} fromAddress Current address attempting to swap
+ * @param {string} networkClientId Current network client ID
*/
export function getFetchParams({
slippage = 1,
@@ -125,6 +126,7 @@ export function getFetchParams({
destinationToken,
sourceAmount,
walletAddress,
+ networkClientId,
}) {
return {
slippage,
@@ -135,6 +137,7 @@ export function getFetchParams({
metaData: {
sourceTokenInfo: sourceToken,
destinationTokenInfo: destinationToken,
+ networkClientId,
},
};
}
diff --git a/app/components/UI/Tokens/TokenList/TokenListFooter/__snapshots__/index.test.tsx.snap b/app/components/UI/Tokens/TokenList/TokenListFooter/__snapshots__/index.test.tsx.snap
index 512895904bd..30e35623425 100644
--- a/app/components/UI/Tokens/TokenList/TokenListFooter/__snapshots__/index.test.tsx.snap
+++ b/app/components/UI/Tokens/TokenList/TokenListFooter/__snapshots__/index.test.tsx.snap
@@ -54,9 +54,9 @@ exports[`TokenListFooter renders correctly 1`] = `
style={
{
"color": "#ffffff",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
diff --git a/app/components/UI/Tokens/__snapshots__/index.test.tsx.snap b/app/components/UI/Tokens/__snapshots__/index.test.tsx.snap
index 4b1a0b3e3d0..091ed84b31d 100644
--- a/app/components/UI/Tokens/__snapshots__/index.test.tsx.snap
+++ b/app/components/UI/Tokens/__snapshots__/index.test.tsx.snap
@@ -860,9 +860,9 @@ exports[`Tokens render matches snapshot 1`] = `
style={
{
"color": "#141618",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -927,9 +927,9 @@ exports[`Tokens render matches snapshot 1`] = `
style={
{
"color": "#141618",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -2115,9 +2115,9 @@ exports[`Tokens should hide zero balance tokens when setting is on 1`] = `
style={
{
"color": "#141618",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -2182,9 +2182,9 @@ exports[`Tokens should hide zero balance tokens when setting is on 1`] = `
style={
{
"color": "#141618",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -3370,9 +3370,9 @@ exports[`Tokens should render correctly 1`] = `
style={
{
"color": "#141618",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -3437,9 +3437,9 @@ exports[`Tokens should render correctly 1`] = `
style={
{
"color": "#141618",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -4625,9 +4625,9 @@ exports[`Tokens should show all balance tokens when hideZeroBalanceTokens settin
style={
{
"color": "#141618",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -4692,9 +4692,9 @@ exports[`Tokens should show all balance tokens when hideZeroBalanceTokens settin
style={
{
"color": "#141618",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
diff --git a/app/components/UI/TransactionElement/utils.js b/app/components/UI/TransactionElement/utils.js
index 22b0e562005..4f9c30e6bbc 100644
--- a/app/components/UI/TransactionElement/utils.js
+++ b/app/components/UI/TransactionElement/utils.js
@@ -32,7 +32,10 @@ import { swapsUtils } from '@metamask/swaps-controller';
import { isSwapsNativeAsset } from '../Swaps/utils';
import { toLowerCaseEquals } from '../../../util/general';
import Engine from '../../../core/Engine';
-import { isEIP1559Transaction } from '@metamask/transaction-controller';
+import {
+ isEIP1559Transaction,
+ TransactionType,
+} from '@metamask/transaction-controller';
const { getSwapsContractAddress } = swapsUtils;
@@ -920,3 +923,11 @@ export default async function decodeTransaction(args) {
}
return [transactionElement, transactionDetails];
}
+
+export const TOKEN_CATEGORY_HASH = {
+ [TransactionType.tokenMethodApprove]: true,
+ [TransactionType.tokenMethodSetApprovalForAll]: true,
+ [TransactionType.tokenMethodTransfer]: true,
+ [TransactionType.tokenMethodTransferFrom]: true,
+ [TransactionType.tokenMethodIncreaseAllowance]: true,
+};
diff --git a/app/components/UI/UpdateNeeded/__snapshots__/UpdateNeeded.test.tsx.snap b/app/components/UI/UpdateNeeded/__snapshots__/UpdateNeeded.test.tsx.snap
index 4c180ba3e6b..c4087c199a1 100644
--- a/app/components/UI/UpdateNeeded/__snapshots__/UpdateNeeded.test.tsx.snap
+++ b/app/components/UI/UpdateNeeded/__snapshots__/UpdateNeeded.test.tsx.snap
@@ -476,9 +476,9 @@ exports[`UpdateNeeded should render correctly 1`] = `
style={
{
"color": "#ffffff",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -512,9 +512,9 @@ exports[`UpdateNeeded should render correctly 1`] = `
style={
{
"color": "#0376c9",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
diff --git a/app/components/Views/AccountConnect/__snapshots__/AccountConnect.test.tsx.snap b/app/components/Views/AccountConnect/__snapshots__/AccountConnect.test.tsx.snap
index 6ec45071a29..4b07f800e17 100644
--- a/app/components/Views/AccountConnect/__snapshots__/AccountConnect.test.tsx.snap
+++ b/app/components/Views/AccountConnect/__snapshots__/AccountConnect.test.tsx.snap
@@ -282,9 +282,9 @@ exports[`AccountConnect renders correctly 1`] = `
style={
{
"color": "#0376c9",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -343,9 +343,9 @@ exports[`AccountConnect renders correctly 1`] = `
style={
{
"color": "#0376c9",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -388,9 +388,9 @@ exports[`AccountConnect renders correctly 1`] = `
style={
{
"color": "#ffffff",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
diff --git a/app/components/Views/AccountPermissions/AccountPermissionsConfirmRevokeAll/__snapshots__/AccountPermissionsConfirmRevokeAll.test.tsx.snap b/app/components/Views/AccountPermissions/AccountPermissionsConfirmRevokeAll/__snapshots__/AccountPermissionsConfirmRevokeAll.test.tsx.snap
index 470bc9a07c3..8a7233f10d2 100644
--- a/app/components/Views/AccountPermissions/AccountPermissionsConfirmRevokeAll/__snapshots__/AccountPermissionsConfirmRevokeAll.test.tsx.snap
+++ b/app/components/Views/AccountPermissions/AccountPermissionsConfirmRevokeAll/__snapshots__/AccountPermissionsConfirmRevokeAll.test.tsx.snap
@@ -126,7 +126,6 @@ exports[`AccountPermissionsConfirmRevokeAll renders correctly 1`] = `
+
+
+
+
+
+
+`;
+
exports[`Asset should render correctly 1`] = `
StyleSheet.create({
@@ -168,6 +172,10 @@ class Asset extends PureComponent {
* Boolean that indicates if native token is supported to buy
*/
isNetworkBuyNativeTokenSupported: PropTypes.bool,
+ /**
+ * Function to set the swaps liveness
+ */
+ setLiveness: PropTypes.func,
};
state = {
@@ -200,7 +208,7 @@ class Asset extends PureComponent {
networkConfigurations,
} = this.props;
const colors = this.context.colors || mockTheme.colors;
- const isNativeToken = route.params.isETH;
+ const isNativeToken = route.params.isNative ?? route.params.isETH;
const isMainnet = isMainnetByChainId(chainId);
const blockExplorer = findBlockExplorerForRpc(
rpcUrl,
@@ -240,14 +248,34 @@ class Asset extends PureComponent {
this.updateNavBar(contentOffset);
};
+ checkLiveness = async (chainId) => {
+ try {
+ const featureFlags = await swapsUtils.fetchSwapsFeatureFlags(
+ getFeatureFlagChainId(chainId),
+ AppConstants.SWAPS.CLIENT_ID,
+ );
+ this.props.setLiveness(chainId, featureFlags);
+ } catch (error) {
+ Logger.error(error, 'Swaps: error while fetching swaps liveness');
+ this.props.setLiveness(chainId, null);
+ }
+ };
+
componentDidMount() {
this.updateNavBar();
+
+ const tokenChainId = this.props.route?.params?.chainId;
+ if (tokenChainId) {
+ this.checkLiveness(tokenChainId);
+ }
+
InteractionManager.runAfterInteractions(() => {
this.normalizeTransactions();
this.mounted = true;
});
this.navSymbol = (this.props.route.params?.symbol ?? '').toLowerCase();
this.navAddress = (this.props.route.params?.address ?? '').toLowerCase();
+
if (this.navSymbol.toUpperCase() !== 'ETH' && this.navAddress !== '') {
this.filter = this.noEthFilter;
} else {
@@ -287,6 +315,7 @@ class Asset extends PureComponent {
txParams: { from, to },
isTransfer,
transferInformation,
+ type,
} = tx;
if (
@@ -295,10 +324,15 @@ class Asset extends PureComponent {
(chainId === tx.chainId || (!tx.chainId && networkId === tx.networkID)) &&
tx.status !== 'unapproved'
) {
- if (isTransfer)
+ if (TOKEN_CATEGORY_HASH[type]) {
+ return false;
+ }
+ if (isTransfer) {
return this.props.tokens.find(({ address }) =>
toLowerCaseEquals(address, transferInformation.contractAddress),
);
+ }
+
return true;
}
return false;
@@ -482,7 +516,9 @@ class Asset extends PureComponent {
: isSwapsAllowed(chainId);
const isAssetAllowed =
- asset.isETH || asset.address?.toLowerCase() in this.props.swapsTokens;
+ asset.isETH ||
+ asset.isNative ||
+ asset.address?.toLowerCase() in this.props.swapsTokens;
const displaySwapsButton =
isSwapsFeatureLive &&
@@ -493,7 +529,6 @@ class Asset extends PureComponent {
const displayBuyButton = asset.isETH
? this.props.isNetworkBuyNativeTokenSupported
: this.props.isNetworkRampSupported;
-
return (
{loading ? (
@@ -559,4 +594,12 @@ const mapStateToProps = (state, { route }) => ({
networkClientId: selectNetworkClientId(state),
});
-export default connect(mapStateToProps)(withMetricsAwareness(Asset));
+const mapDispatchToProps = (dispatch) => ({
+ setLiveness: (chainId, featureFlags) =>
+ dispatch(setSwapsLiveness(chainId, featureFlags)),
+});
+
+export default connect(
+ mapStateToProps,
+ mapDispatchToProps,
+)(withMetricsAwareness(Asset));
diff --git a/app/components/Views/Asset/index.test.js b/app/components/Views/Asset/index.test.js
index a7461510901..23ab4e6da7b 100644
--- a/app/components/Views/Asset/index.test.js
+++ b/app/components/Views/Asset/index.test.js
@@ -1,10 +1,26 @@
import React from 'react';
+import { TransactionType } from '@metamask/transaction-controller';
+import { swapsUtils } from '@metamask/swaps-controller/';
import renderWithProvider from '../../../util/test/renderWithProvider';
import { backgroundState } from '../../../util/test/initial-root-state';
import Asset from './';
import { MOCK_ACCOUNTS_CONTROLLER_STATE } from '../../../util/test/accountsControllerTestUtils';
const mockInitialState = {
+ swaps: { '0x1': { isLive: true }, hasOnboarded: false, isLive: true },
+ fiatOrders: {
+ networks: [
+ {
+ active: true,
+ chainId: '1',
+ chainName: 'Ethereum Mainnet',
+ nativeTokenSupported: true,
+ },
+ ],
+ },
+ inpageProvider: {
+ networkId: '0x1',
+ },
engine: {
backgroundState: {
...backgroundState,
@@ -16,10 +32,58 @@ const mockInitialState = {
},
},
},
+ NetworkController: {
+ selectedNetworkClientId: 'selectedNetworkClientId',
+ networkConfigurationsByChainId: {
+ '0x1': {
+ chainId: '0x1',
+ rpcEndpoints: [
+ {
+ networkClientId: 'selectedNetworkClientId',
+ },
+ ],
+ defaultRpcEndpointIndex: 0,
+ defaultBlockExplorerUrl: 0,
+ blockExplorerUrls: ['https://block.com'],
+ },
+ '0x89': {
+ chainId: '0x89',
+ rpcEndpoints: [
+ {
+ networkClientId: 'otherNetworkClientId',
+ },
+ ],
+ defaultRpcEndpointIndex: 0,
+ },
+ },
+ },
+ TransactionController: {
+ transactions: [
+ {
+ txParams: {
+ from: '0xC4966c0D659D99699BFD7EB54D8fafEE40e4a756',
+ to: '0x0000000000000000000000000000000000000000',
+ },
+ hash: '0x3148',
+ status: 'confirmed',
+ chainId: '0x1',
+ networkID: '0x1',
+ type: TransactionType.simpleSend,
+ },
+ ],
+ },
},
},
};
+jest.mock('../../../store', () => ({
+ store: {
+ getState: () => mockInitialState,
+ },
+}));
+
+jest.unmock('react-native/Libraries/Interaction/InteractionManager');
+
jest.mock('../../../core/Engine', () => {
const {
MOCK_ADDRESS_1,
@@ -48,14 +112,65 @@ describe('Asset', () => {
it('should render correctly', () => {
const { toJSON } = renderWithProvider(
null }}
- route={{ params: { symbol: 'ETH', address: 'something', isETH: true } }}
+ navigation={{ setOptions: jest.fn() }}
+ route={{
+ params: {
+ symbol: 'ETH',
+ address: 'something',
+ isETH: true,
+ chainId: '0x1',
+ },
+ }}
+ />,
+ {
+ state: mockInitialState,
+ },
+ );
+ expect(toJSON()).toMatchSnapshot();
+ });
+
+ it('should call navigation.setOptions on mount', () => {
+ const mockSetOptions = jest.fn();
+ renderWithProvider(
+ ,
{
state: mockInitialState,
},
);
+
+ expect(mockSetOptions).toHaveBeenCalled();
+ });
+
+ it('should not display swaps button if the asset is not allowed', () => {
+ jest.spyOn(swapsUtils, 'fetchSwapsFeatureFlags').mockRejectedValue('error');
+ const { toJSON } = renderWithProvider(
+ ,
+ {
+ state: mockInitialState,
+ },
+ );
+
expect(toJSON()).toMatchSnapshot();
});
});
diff --git a/app/components/Views/ChangeInSimulationModal/__snapshots__/ChangeInSimulationModal.test.tsx.snap b/app/components/Views/ChangeInSimulationModal/__snapshots__/ChangeInSimulationModal.test.tsx.snap
index e406e1c8f6c..22bf1239750 100644
--- a/app/components/Views/ChangeInSimulationModal/__snapshots__/ChangeInSimulationModal.test.tsx.snap
+++ b/app/components/Views/ChangeInSimulationModal/__snapshots__/ChangeInSimulationModal.test.tsx.snap
@@ -115,9 +115,9 @@ exports[`ChangeInSimulationModal render matches snapshot 1`] = `
style={
{
"color": "#ffffff",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -154,9 +154,9 @@ exports[`ChangeInSimulationModal render matches snapshot 1`] = `
style={
{
"color": "#0376c9",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
diff --git a/app/components/Views/DataCollectionModal/__snapshots__/index.test.tsx.snap b/app/components/Views/DataCollectionModal/__snapshots__/index.test.tsx.snap
index 1bf004aa428..397ea4c37da 100644
--- a/app/components/Views/DataCollectionModal/__snapshots__/index.test.tsx.snap
+++ b/app/components/Views/DataCollectionModal/__snapshots__/index.test.tsx.snap
@@ -203,9 +203,9 @@ exports[`DataCollectionModal should render expected snapshot 1`] = `
style={
{
"color": "#ffffff",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
diff --git a/app/components/Views/EditAccountName/__snapshots__/EditAccountName.test.tsx.snap b/app/components/Views/EditAccountName/__snapshots__/EditAccountName.test.tsx.snap
index cf68a7faa17..dc00af5b76c 100644
--- a/app/components/Views/EditAccountName/__snapshots__/EditAccountName.test.tsx.snap
+++ b/app/components/Views/EditAccountName/__snapshots__/EditAccountName.test.tsx.snap
@@ -203,9 +203,9 @@ exports[`EditAccountName should render correctly 1`] = `
style={
{
"color": "#0376c9",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -243,9 +243,9 @@ exports[`EditAccountName should render correctly 1`] = `
style={
{
"color": "#ffffff",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
diff --git a/app/components/Views/ErrorBoundary/index.js b/app/components/Views/ErrorBoundary/index.js
index a0c7af42270..603ebc4f312 100644
--- a/app/components/Views/ErrorBoundary/index.js
+++ b/app/components/Views/ErrorBoundary/index.js
@@ -40,7 +40,7 @@ import {
} from '../../../components/hooks/useMetrics';
import AppConstants from '../../../core/AppConstants';
import { useSelector } from 'react-redux';
-
+import { isTest } from '../../../util/test/utils';
// eslint-disable-next-line import/no-commonjs
const WarningIcon = require('./warning-icon.png');
@@ -246,7 +246,6 @@ export const Fallback = (props) => {
captureSentryFeedback({ sentryId: props.sentryId, comments: feedback });
Alert.alert(strings('error_screen.bug_report_thanks'));
};
-
return (
@@ -270,6 +269,14 @@ export const Fallback = (props) => {
}
/>
+
+ {isTest && (
+
+
+ {strings('error_screen.save_seedphrase_2')}
+
+
+ )}
{strings('error_screen.error_message')}
diff --git a/app/components/Views/Login/__snapshots__/index.test.tsx.snap b/app/components/Views/Login/__snapshots__/index.test.tsx.snap
index 4beae542b9e..599cee47dee 100644
--- a/app/components/Views/Login/__snapshots__/index.test.tsx.snap
+++ b/app/components/Views/Login/__snapshots__/index.test.tsx.snap
@@ -186,6 +186,28 @@ exports[`Login should render correctly 1`] = `
+
+
+ save your Secret Recovery Phrase
+
+
{
) : null}
- {selectedIndex === QRTabSwitcherScreens.Receive ? (
-
- ) : null}
-
+
+ }
+ >
+ {selectedIndex === QRTabSwitcherScreens.Receive ? (
+
+ ) : null}
+
{disableTabber ? null : (
diff --git a/app/components/Views/QRTabSwitcher/styles.ts b/app/components/Views/QRTabSwitcher/styles.ts
index 46e09f4c5cc..7a2eb38654f 100644
--- a/app/components/Views/QRTabSwitcher/styles.ts
+++ b/app/components/Views/QRTabSwitcher/styles.ts
@@ -21,16 +21,10 @@ const createStyles = (theme: Theme) => {
justifyContent: 'flex-start',
},
overlay: {
- flexDirection: 'row',
- justifyContent: 'flex-end',
position: 'absolute',
width: '100%',
top: navbarTop,
- },
- closeIcon: {
- position: 'absolute',
- top: 0,
- right: 15,
+ paddingHorizontal: 16,
},
segmentedControlContainer: {
position: 'absolute',
diff --git a/app/components/Views/Settings/AdvancedSettings/FiatOnTestnetsFriction/__snapshots__/FiatOnTestnetsFriction.test.tsx.snap b/app/components/Views/Settings/AdvancedSettings/FiatOnTestnetsFriction/__snapshots__/FiatOnTestnetsFriction.test.tsx.snap
index 49466bd8b95..4ae53559ea1 100644
--- a/app/components/Views/Settings/AdvancedSettings/FiatOnTestnetsFriction/__snapshots__/FiatOnTestnetsFriction.test.tsx.snap
+++ b/app/components/Views/Settings/AdvancedSettings/FiatOnTestnetsFriction/__snapshots__/FiatOnTestnetsFriction.test.tsx.snap
@@ -348,9 +348,9 @@ exports[`Show fiat on testnets friction bottom sheet should render 1`] = `
style={
{
"color": "#0376c9",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -386,9 +386,9 @@ exports[`Show fiat on testnets friction bottom sheet should render 1`] = `
style={
{
"color": "#ffffff",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
diff --git a/app/components/Views/Settings/AdvancedSettings/__snapshots__/index.test.tsx.snap b/app/components/Views/Settings/AdvancedSettings/__snapshots__/index.test.tsx.snap
index 75f86913fe8..cb046e2eb80 100644
--- a/app/components/Views/Settings/AdvancedSettings/__snapshots__/index.test.tsx.snap
+++ b/app/components/Views/Settings/AdvancedSettings/__snapshots__/index.test.tsx.snap
@@ -161,9 +161,9 @@ exports[`AdvancedSettings should render correctly 1`] = `
style={
{
"color": "#0376c9",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -690,9 +690,9 @@ exports[`AdvancedSettings should render correctly 1`] = `
style={
{
"color": "#0376c9",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
diff --git a/app/components/Views/Settings/Contacts/AmbiguousAddressSheet/__snapshots__/AmbiguousAddressSheet.test.tsx.snap b/app/components/Views/Settings/Contacts/AmbiguousAddressSheet/__snapshots__/AmbiguousAddressSheet.test.tsx.snap
index 4905c9bd673..4d390b981a9 100644
--- a/app/components/Views/Settings/Contacts/AmbiguousAddressSheet/__snapshots__/AmbiguousAddressSheet.test.tsx.snap
+++ b/app/components/Views/Settings/Contacts/AmbiguousAddressSheet/__snapshots__/AmbiguousAddressSheet.test.tsx.snap
@@ -590,9 +590,9 @@ exports[`AmbiguousAddressSheet should render correctly 1`] = `
style={
{
"color": "#ffffff",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
diff --git a/app/components/Views/Settings/DeveloperOptions/__snapshots__/index.test.tsx.snap b/app/components/Views/Settings/DeveloperOptions/__snapshots__/index.test.tsx.snap
index 4dc5c1d1e3d..4f0a4ec77f0 100644
--- a/app/components/Views/Settings/DeveloperOptions/__snapshots__/index.test.tsx.snap
+++ b/app/components/Views/Settings/DeveloperOptions/__snapshots__/index.test.tsx.snap
@@ -437,9 +437,9 @@ exports[`DeveloperOptions should render correctly 1`] = `
style={
{
"color": "#0376c9",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
diff --git a/app/components/Views/Settings/ExperimentalSettings/__snapshots__/index.test.tsx.snap b/app/components/Views/Settings/ExperimentalSettings/__snapshots__/index.test.tsx.snap
index a82c3c8852a..9f338464fc0 100644
--- a/app/components/Views/Settings/ExperimentalSettings/__snapshots__/index.test.tsx.snap
+++ b/app/components/Views/Settings/ExperimentalSettings/__snapshots__/index.test.tsx.snap
@@ -72,9 +72,9 @@ exports[`ExperimentalSettings should render correctly 1`] = `
style={
{
"color": "#0376c9",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -198,9 +198,9 @@ exports[`ExperimentalSettings should render correctly 1`] = `
style={
{
"color": "#0376c9",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
diff --git a/app/components/Views/Settings/NetworksSettings/NetworkSettings/CustomNetworkView/CustomNetwork.tsx b/app/components/Views/Settings/NetworksSettings/NetworkSettings/CustomNetworkView/CustomNetwork.tsx
index fa297b73a7b..afb9f8421e8 100644
--- a/app/components/Views/Settings/NetworksSettings/NetworkSettings/CustomNetworkView/CustomNetwork.tsx
+++ b/app/components/Views/Settings/NetworksSettings/NetworkSettings/CustomNetworkView/CustomNetwork.tsx
@@ -3,6 +3,7 @@ import NetworkModals from '../../../../../UI/NetworkModal';
import { View, TouchableOpacity } from 'react-native';
import { useSelector } from 'react-redux';
import WarningIcon from 'react-native-vector-icons/FontAwesome';
+import { toHex } from '@metamask/controller-utils';
import CustomText from '../../../../../Base/Text';
import EmptyPopularList from '../emptyList';
import { useNavigation } from '@react-navigation/native';
@@ -46,7 +47,7 @@ const CustomNetwork = ({
// TODO: Replace "any" with type
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(savedNetwork: any) =>
- savedNetwork.chainId === networkConfiguration.chainId,
+ toHex(savedNetwork.chainId) === toHex(networkConfiguration.chainId),
);
return {
...networkConfiguration,
diff --git a/app/components/Views/Settings/NetworksSettings/NetworkSettings/index.js b/app/components/Views/Settings/NetworksSettings/NetworkSettings/index.js
index f937c9130ac..757e41ff5e7 100644
--- a/app/components/Views/Settings/NetworksSettings/NetworkSettings/index.js
+++ b/app/components/Views/Settings/NetworksSettings/NetworkSettings/index.js
@@ -541,7 +541,7 @@ export class NetworkSettings extends PureComponent {
editable = false;
blockExplorerUrl =
networkConfigurations?.[chainId]?.blockExplorerUrls[
- networkConfigurations?.[chainId]?.defaultBlockExplorerUrlIndex
+ networkConfigurations?.[chainId]?.defaultBlockExplorerUrlIndex
];
rpcUrl =
networkConfigurations?.[chainId]?.rpcEndpoints[
@@ -563,13 +563,13 @@ export class NetworkSettings extends PureComponent {
({ rpcEndpoints, defaultRpcEndpointIndex }) =>
rpcEndpoints[defaultRpcEndpointIndex].url === networkTypeOrRpcUrl ||
rpcEndpoints[defaultRpcEndpointIndex].networkClientId ===
- networkTypeOrRpcUrl,
+ networkTypeOrRpcUrl,
);
nickname = networkConfiguration?.name;
chainId = networkConfiguration?.chainId;
blockExplorerUrl =
networkConfiguration?.blockExplorerUrls[
- networkConfiguration?.defaultBlockExplorerUrlIndex
+ networkConfiguration?.defaultBlockExplorerUrlIndex
];
ticker = networkConfiguration?.nativeCurrency;
editable = true;
@@ -854,8 +854,8 @@ export class NetworkSettings extends PureComponent {
networkConfig,
existingNetwork.chainId === chainId
? {
- replacementSelectedRpcEndpointIndex: indexRpc,
- }
+ replacementSelectedRpcEndpointIndex: indexRpc,
+ }
: undefined,
);
} else {
@@ -867,8 +867,8 @@ export class NetworkSettings extends PureComponent {
isCustomMainnet
? navigation.navigate('OptinMetrics')
: shouldNetworkSwitchPopToWallet
- ? navigation.navigate('WalletView')
- : navigation.goBack();
+ ? navigation.navigate('WalletView')
+ : navigation.goBack();
};
/**
@@ -1534,7 +1534,7 @@ export class NetworkSettings extends PureComponent {
const { networkClientId } =
networkConfigurations?.rpcEndpoints?.[
- networkConfigurations.defaultRpcEndpointIndex
+ networkConfigurations.defaultRpcEndpointIndex
] ?? {};
NetworkController.setActiveNetwork(networkClientId);
@@ -1950,15 +1950,15 @@ export class NetworkSettings extends PureComponent {
// Conditionally include secondaryText only if rpcName exists
{...(rpcName
? {
- secondaryText:
- hideKeyFromUrl(rpcUrl) ??
- hideKeyFromUrl(
- networkConfigurations?.[chainId]?.rpcEndpoints?.[
- networkConfigurations?.[chainId]
- ?.defaultRpcEndpointIndex
- ]?.url,
- ),
- }
+ secondaryText:
+ hideKeyFromUrl(rpcUrl) ??
+ hideKeyFromUrl(
+ networkConfigurations?.[chainId]?.rpcEndpoints?.[
+ networkConfigurations?.[chainId]
+ ?.defaultRpcEndpointIndex
+ ]?.url,
+ ),
+ }
: {})}
isSelected={false}
withAvatar={false}
@@ -1993,17 +1993,17 @@ export class NetworkSettings extends PureComponent {
{!isNetworkUiRedesignEnabled()
? warningRpcUrl && (
-
- {warningRpcUrl}
-
- )
+
+ {warningRpcUrl}
+
+ )
: null}
@@ -2268,10 +2268,12 @@ export class NetworkSettings extends PureComponent {
) : null}
{isNetworkUiRedesignEnabled() &&
- showMultiBlockExplorerAddModal.isVisible ? (
+ showMultiBlockExplorerAddModal.isVisible ? (
0 ? styles.sheet : styles.sheetSmall
+ blockExplorerUrls.length > 0 || addMode
+ ? styles.sheet
+ : styles.sheetSmall
}
onDismiss={this.closeBlockExplorerModal}
shouldGoBack={false}
@@ -2338,7 +2340,9 @@ export class NetworkSettings extends PureComponent {
{isNetworkUiRedesignEnabled() && showMultiRpcAddModal.isVisible ? (
0 ? styles.sheet : styles.sheetSmall}
+ style={
+ rpcUrls.length > 0 || addMode ? styles.sheet : styles.sheetSmall
+ }
onDismiss={this.closeRpcModal}
shouldGoBack={false}
>
@@ -2478,7 +2482,7 @@ export class NetworkSettings extends PureComponent {
>
{(isNetworkUiRedesignEnabled() && !shouldShowPopularNetworks) ||
- networkTypeOrRpcUrl ? (
+ networkTypeOrRpcUrl ? (
this.customNetwork()
) : (
{
expect(wrapper.state('rpcUrls')[0].name).toBe('New RPC');
});
+ it('adds add RPC URL through modal and update state when addMode is true', async () => {
+ wrapper.setState({ addMode: true });
+
+ const instance = wrapper.instance();
+
+ await instance.onRpcItemAdd('https://new-rpc-url.com', 'New RPC');
+
+ expect(wrapper.state('rpcUrls').length).toBe(1);
+ expect(wrapper.state('rpcUrls')[0].url).toBe('https://new-rpc-url.com');
+ expect(wrapper.state('rpcUrls')[0].name).toBe('New RPC');
+ });
+
it('should correctly add Block Explorer URL through modal and update state', async () => {
const instance = wrapper.instance();
@@ -828,6 +840,21 @@ describe('NetworkSettings', () => {
);
});
+ it('adds correctly add Block Explorer URL through modal and update state when addMode is true', async () => {
+ wrapper.setState({ addMode: true });
+
+ const instance = wrapper.instance();
+
+ // Open Block Explorer form modal and add a new URL
+ instance.openAddBlockExplorerForm();
+ await instance.onBlockExplorerItemAdd('https://new-blockexplorer.com');
+
+ expect(wrapper.state('blockExplorerUrls').length).toBe(1);
+ expect(wrapper.state('blockExplorerUrls')[0]).toBe(
+ 'https://new-blockexplorer.com',
+ );
+ });
+
it('should not add an empty Block Explorer URL and should return early', async () => {
const instance = wrapper.instance();
diff --git a/app/components/Views/Settings/SecuritySettings/Sections/MetaMetricsAndDataCollectionSection/__snapshots__/MetaMetricsAndDataCollectionSection.test.tsx.snap b/app/components/Views/Settings/SecuritySettings/Sections/MetaMetricsAndDataCollectionSection/__snapshots__/MetaMetricsAndDataCollectionSection.test.tsx.snap
index 9f93a29ee41..be27f25d0a7 100644
--- a/app/components/Views/Settings/SecuritySettings/Sections/MetaMetricsAndDataCollectionSection/__snapshots__/MetaMetricsAndDataCollectionSection.test.tsx.snap
+++ b/app/components/Views/Settings/SecuritySettings/Sections/MetaMetricsAndDataCollectionSection/__snapshots__/MetaMetricsAndDataCollectionSection.test.tsx.snap
@@ -411,9 +411,9 @@ exports[`MetaMetricsAndDataCollectionSection render matches snapshot 1`] = `
style={
{
"color": "#0376c9",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
diff --git a/app/components/Views/Settings/SecuritySettings/__snapshots__/SecuritySettings.test.tsx.snap b/app/components/Views/Settings/SecuritySettings/__snapshots__/SecuritySettings.test.tsx.snap
index c9e11533f2e..1251af4e603 100644
--- a/app/components/Views/Settings/SecuritySettings/__snapshots__/SecuritySettings.test.tsx.snap
+++ b/app/components/Views/Settings/SecuritySettings/__snapshots__/SecuritySettings.test.tsx.snap
@@ -132,9 +132,9 @@ exports[`SecuritySettings should render correctly 1`] = `
style={
{
"color": "#0376c9",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -229,9 +229,9 @@ exports[`SecuritySettings should render correctly 1`] = `
style={
{
"color": "#ffffff",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -309,9 +309,9 @@ exports[`SecuritySettings should render correctly 1`] = `
style={
{
"color": "#0376c9",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -625,9 +625,9 @@ exports[`SecuritySettings should render correctly 1`] = `
style={
{
"color": "#ffffff",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -947,9 +947,9 @@ exports[`SecuritySettings should render correctly 1`] = `
style={
{
"color": "#0376c9",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -1036,9 +1036,9 @@ exports[`SecuritySettings should render correctly 1`] = `
style={
{
"color": "#0376c9",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -1153,9 +1153,9 @@ exports[`SecuritySettings should render correctly 1`] = `
style={
{
"color": "#0376c9",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -1240,9 +1240,9 @@ exports[`SecuritySettings should render correctly 1`] = `
style={
{
"color": "#0376c9",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -1947,9 +1947,9 @@ exports[`SecuritySettings should render correctly 1`] = `
style={
{
"color": "#0376c9",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -2500,9 +2500,9 @@ exports[`SecuritySettings should render correctly 1`] = `
style={
{
"color": "#0376c9",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -2675,9 +2675,9 @@ exports[`SecuritySettings should render correctly 1`] = `
style={
{
"color": "#0376c9",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -2743,9 +2743,9 @@ exports[`SecuritySettings should render correctly 1`] = `
style={
{
"color": "#0376c9",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -2791,9 +2791,9 @@ exports[`SecuritySettings should render correctly 1`] = `
style={
{
"color": "#0376c9",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -2908,9 +2908,9 @@ exports[`SecuritySettings should render correctly 1`] = `
style={
{
"color": "#0376c9",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
diff --git a/app/components/Views/ShowDisplayMediaNFTSheet/__snapshots__/ShowDisplayNFTMediaSheet.test.tsx.snap b/app/components/Views/ShowDisplayMediaNFTSheet/__snapshots__/ShowDisplayNFTMediaSheet.test.tsx.snap
index f3817c9cce7..7d69a71c8b2 100644
--- a/app/components/Views/ShowDisplayMediaNFTSheet/__snapshots__/ShowDisplayNFTMediaSheet.test.tsx.snap
+++ b/app/components/Views/ShowDisplayMediaNFTSheet/__snapshots__/ShowDisplayNFTMediaSheet.test.tsx.snap
@@ -565,9 +565,9 @@ exports[`ShowNftSheet should render correctly 1`] = `
style={
{
"color": "#0376c9",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -603,9 +603,9 @@ exports[`ShowNftSheet should render correctly 1`] = `
style={
{
"color": "#ffffff",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
diff --git a/app/components/Views/ShowIpfsGatewaySheet/__snapshots__/ShowIpfsGatewaySheet.test.tsx.snap b/app/components/Views/ShowIpfsGatewaySheet/__snapshots__/ShowIpfsGatewaySheet.test.tsx.snap
index e6cd1e2bde7..78cb8f3f149 100644
--- a/app/components/Views/ShowIpfsGatewaySheet/__snapshots__/ShowIpfsGatewaySheet.test.tsx.snap
+++ b/app/components/Views/ShowIpfsGatewaySheet/__snapshots__/ShowIpfsGatewaySheet.test.tsx.snap
@@ -568,9 +568,9 @@ exports[`ShowIpfsGatewaySheet should render correctly 1`] = `
style={
{
"color": "#0376c9",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -606,9 +606,9 @@ exports[`ShowIpfsGatewaySheet should render correctly 1`] = `
style={
{
"color": "#ffffff",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
diff --git a/app/components/Views/confirmations/ApproveView/Approve/__snapshots__/index.test.tsx.snap b/app/components/Views/confirmations/ApproveView/Approve/__snapshots__/index.test.tsx.snap
index 5616f352a89..e676b76a254 100644
--- a/app/components/Views/confirmations/ApproveView/Approve/__snapshots__/index.test.tsx.snap
+++ b/app/components/Views/confirmations/ApproveView/Approve/__snapshots__/index.test.tsx.snap
@@ -660,9 +660,9 @@ exports[`Approve should render transaction approval 1`] = `
style={
{
"color": "#0376c9",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
diff --git a/app/components/Views/confirmations/Send/__snapshots__/index.test.tsx.snap b/app/components/Views/confirmations/Send/__snapshots__/index.test.tsx.snap
index e0f712f62e0..3fa1e08f901 100644
--- a/app/components/Views/confirmations/Send/__snapshots__/index.test.tsx.snap
+++ b/app/components/Views/confirmations/Send/__snapshots__/index.test.tsx.snap
@@ -157,7 +157,6 @@ exports[`Accounts should render correctly 1`] = `
style={
{
"alignItems": "center",
- "flex": 1,
"justifyContent": "center",
}
}
@@ -168,9 +167,9 @@ exports[`Accounts should render correctly 1`] = `
style={
{
"color": "#141618",
- "fontFamily": "EuclidCircularB-Regular",
- "fontSize": 30,
- "fontWeight": "400",
+ "fontFamily": "EuclidCircularB-Bold",
+ "fontSize": 14,
+ "fontWeight": "700",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -186,21 +185,6 @@ exports[`Accounts should render correctly 1`] = `
}
}
>
-
diff --git a/app/components/Views/confirmations/SendFlow/Confirm/__snapshots__/index.test.tsx.snap b/app/components/Views/confirmations/SendFlow/Confirm/__snapshots__/index.test.tsx.snap
index 910a960a2c1..375f22756fe 100644
--- a/app/components/Views/confirmations/SendFlow/Confirm/__snapshots__/index.test.tsx.snap
+++ b/app/components/Views/confirmations/SendFlow/Confirm/__snapshots__/index.test.tsx.snap
@@ -155,7 +155,6 @@ exports[`Confirm should render correctly 1`] = `
style={
{
"alignItems": "center",
- "flex": 1,
"justifyContent": "center",
}
}
@@ -166,9 +165,9 @@ exports[`Confirm should render correctly 1`] = `
style={
{
"color": "#141618",
- "fontFamily": "EuclidCircularB-Regular",
- "fontSize": 30,
- "fontWeight": "400",
+ "fontFamily": "EuclidCircularB-Bold",
+ "fontSize": 14,
+ "fontWeight": "700",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -184,21 +183,6 @@ exports[`Confirm should render correctly 1`] = `
}
}
>
-
diff --git a/app/components/Views/confirmations/SendFlow/Confirm/index.js b/app/components/Views/confirmations/SendFlow/Confirm/index.js
index 8c06868102f..7aa29a398e1 100644
--- a/app/components/Views/confirmations/SendFlow/Confirm/index.js
+++ b/app/components/Views/confirmations/SendFlow/Confirm/index.js
@@ -264,16 +264,14 @@ class Confirm extends PureComponent {
* Boolean that indicates if smart transaction should be used
*/
shouldUseSmartTransaction: PropTypes.bool,
-
/**
* Object containing transaction metrics by id
*/
transactionMetricsById: PropTypes.object,
-
/**
- * Object containing the transaction simulation data
+ * Transaction metadata from the transaction controller
*/
- transactionSimulationData: PropTypes.object,
+ transactionMetadata: PropTypes.object,
/**
* Update transaction metrics
*/
@@ -915,9 +913,12 @@ class Confirm extends PureComponent {
resetTransaction,
gasEstimateType,
shouldUseSmartTransaction,
- transactionSimulationData: { isUpdatedAfterSecurityCheck } = {},
+ transactionMetadata,
} = this.props;
+ const transactionSimulationData = transactionMetadata?.simulationData;
+ const { isUpdatedAfterSecurityCheck } = transactionSimulationData ?? {};
+
const {
legacyGasTransaction,
transactionConfirmed,
@@ -1326,7 +1327,7 @@ class Confirm extends PureComponent {
gasEstimateType,
isNativeTokenBuySupported,
shouldUseSmartTransaction,
- transactionSimulationData,
+ transactionMetadata,
transactionState,
useTransactionSimulations,
} = this.props;
@@ -1359,6 +1360,7 @@ class Confirm extends PureComponent {
const isLedgerAccount = isHardwareAccount(fromSelectedAddress, [
ExtendedKeyringTypes.ledger,
]);
+ const transactionSimulationData = transactionMetadata?.simulationData;
const isTestNetwork = isTestNet(chainId);
@@ -1430,9 +1432,8 @@ class Confirm extends PureComponent {
{useTransactionSimulations && transactionState?.id && (
)}
@@ -1575,8 +1576,8 @@ const mapStateToProps = (state) => ({
),
shouldUseSmartTransaction: selectShouldUseSmartTransaction(state),
transactionMetricsById: selectTransactionMetrics(state),
- transactionSimulationData:
- selectCurrentTransactionMetadata(state)?.simulationData,
+ transactionMetadata:
+ selectCurrentTransactionMetadata(state),
useTransactionSimulations: selectUseTransactionSimulations(state),
securityAlertResponse: selectCurrentTransactionSecurityAlertResponse(state),
});
diff --git a/app/components/Views/confirmations/components/Approval/TemplateConfirmation/Templates/__snapshots__/ApprovalResult.test.tsx.snap b/app/components/Views/confirmations/components/Approval/TemplateConfirmation/Templates/__snapshots__/ApprovalResult.test.tsx.snap
index 45ccec94bce..499ad947379 100644
--- a/app/components/Views/confirmations/components/Approval/TemplateConfirmation/Templates/__snapshots__/ApprovalResult.test.tsx.snap
+++ b/app/components/Views/confirmations/components/Approval/TemplateConfirmation/Templates/__snapshots__/ApprovalResult.test.tsx.snap
@@ -193,9 +193,9 @@ exports[`ApprovalResult renders approval result with error type 1`] = `
style={
{
"color": "#ffffff",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -402,9 +402,9 @@ exports[`ApprovalResult renders approval result with success type 1`] = `
style={
{
"color": "#ffffff",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
diff --git a/app/components/Views/confirmations/components/Approval/TemplateConfirmation/__snapshots__/TemplateConfirmation.test.tsx.snap b/app/components/Views/confirmations/components/Approval/TemplateConfirmation/__snapshots__/TemplateConfirmation.test.tsx.snap
index 10d03e6268b..34859d9ad12 100644
--- a/app/components/Views/confirmations/components/Approval/TemplateConfirmation/__snapshots__/TemplateConfirmation.test.tsx.snap
+++ b/app/components/Views/confirmations/components/Approval/TemplateConfirmation/__snapshots__/TemplateConfirmation.test.tsx.snap
@@ -77,9 +77,9 @@ exports[`TemplateConfirmation renders content and actions 1`] = `
style={
{
"color": "#ffffff",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
@@ -119,9 +119,9 @@ exports[`TemplateConfirmation renders content and actions 1`] = `
style={
{
"color": "#0376c9",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
diff --git a/app/components/Views/confirmations/components/ApproveTransactionReview/__snapshots__/index.test.tsx.snap b/app/components/Views/confirmations/components/ApproveTransactionReview/__snapshots__/index.test.tsx.snap
index da3fb4c9803..27efee87ff6 100644
--- a/app/components/Views/confirmations/components/ApproveTransactionReview/__snapshots__/index.test.tsx.snap
+++ b/app/components/Views/confirmations/components/ApproveTransactionReview/__snapshots__/index.test.tsx.snap
@@ -477,9 +477,9 @@ exports[`ApproveTransactionModal render matches snapshot 1`] = `
style={
{
"color": "#0376c9",
- "fontFamily": "EuclidCircularB-Regular",
+ "fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
- "fontWeight": "400",
+ "fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
diff --git a/app/components/Views/confirmations/components/TransactionReview/index.js b/app/components/Views/confirmations/components/TransactionReview/index.js
index c548b692d6c..6c43963b376 100644
--- a/app/components/Views/confirmations/components/TransactionReview/index.js
+++ b/app/components/Views/confirmations/components/TransactionReview/index.js
@@ -261,10 +261,6 @@ class TransactionReview extends PureComponent {
* Boolean that indicates if smart transaction should be used
*/
shouldUseSmartTransaction: PropTypes.bool,
- /**
- * Transaction simulation data
- */
- transactionSimulationData: PropTypes.object,
/**
* Boolean that indicates if transaction simulations should be enabled
*/
@@ -523,10 +519,12 @@ class TransactionReview extends PureComponent {
transaction,
transaction: { to, origin, from, ensRecipient, id: transactionId },
error,
- transactionSimulationData,
+ transactionMetadata,
useTransactionSimulations,
} = this.props;
+ const transactionSimulationData = transactionMetadata?.simulationData;
+
const {
actionKey,
assetAmount,
@@ -619,9 +617,8 @@ class TransactionReview extends PureComponent {
{useTransactionSimulations && transactionSimulationData && (
)}
@@ -720,8 +717,6 @@ const mapStateToProps = (state) => ({
primaryCurrency: state.settings.primaryCurrency,
tokenList: selectTokenList(state),
shouldUseSmartTransaction: selectShouldUseSmartTransaction(state),
- transactionSimulationData:
- selectCurrentTransactionMetadata(state)?.simulationData,
useTransactionSimulations: selectUseTransactionSimulations(state),
securityAlertResponse: selectCurrentTransactionSecurityAlertResponse(state),
transactionMetadata: selectCurrentTransactionMetadata(state),
diff --git a/app/core/Analytics/MetaMetrics.events.ts b/app/core/Analytics/MetaMetrics.events.ts
index ed8898687ef..8610a0c4d9b 100644
--- a/app/core/Analytics/MetaMetrics.events.ts
+++ b/app/core/Analytics/MetaMetrics.events.ts
@@ -283,7 +283,27 @@ enum EVENT_NAME {
STAKE_CLAIM_BUTTON_CLICKED = 'Stake Claim Button Clicked',
STAKE_LEARN_MORE_CLICKED = 'Stake Learn More Clicked',
STAKE_INPUT_CURRENCY_SWITCH_CLICKED = 'Stake Input Currency Switch Clicked',
+ STAKE_CANCEL_CLICKED = 'Stake Cancel Clicked',
+ STAKE_CONFIRMATION_BACK_CLICKED = 'Stake Confirmation Back Clicked',
+ STAKE_TRANSACTION_INITIATED = 'Stake Transaction Initiated',
+ STAKE_TRANSACTION_APPROVED = 'Stake Transaction Approved',
+ STAKE_TRANSACTION_REJECTED = 'Stake Transaction Rejected',
+ STAKE_TRANSACTION_FAILED = 'Stake Transaction Failed',
+ STAKE_TRANSACTION_SUBMITTED = 'Stake Transaction Submitted',
+ STAKE_TRANSACTION_CONFIRMED = 'Stake Transaction Confirmed',
+ STAKE_GAS_COST_IMPACT_WARNING_TRIGGERED = 'Stake Gas Cost Impact Warning Triggered',
+ STAKE_GAS_COST_IMPACT_CANCEL_CLICKED = 'Stake Gas Cost Impact Cancel Clicked',
+ STAKE_GAS_COST_IMPACT_PROCEEDED_CLICKED = 'Stake Gas Cost Impact Proceeded Clicked',
UNSTAKE_INPUT_CURRENCY_SWITCH_CLICKED = 'Unstake Input Currency Switch Clicked',
+ UNSTAKE_CANCEL_CLICKED = 'Unstake Cancel Clicked',
+ UNSTAKE_TRANSACTION_INITIATED = 'Unstake Transaction Initiated',
+ UNSTAKE_CONFIRMATION_BACK_CLICKED = 'Unstake Confirmation Back Clicked',
+ UNSTAKE_TRANSACTION_APPROVED = 'Unstake Transaction Approved',
+ UNSTAKE_TRANSACTION_REJECTED = 'Unstake Transaction Rejected',
+ UNSTAKE_TRANSACTION_FAILED = 'Unstake Transaction Failed',
+ UNSTAKE_TRANSACTION_CONFIRMED = 'Unstake Transaction Confirmed',
+ UNSTAKE_TRANSACTION_SUBMITTED = 'Unstake Transaction Submitted',
+ VISITED_ETH_OVERVIEW_WITH_STAKED_POSITIONS = 'Visited ETH Overview with Staked Positions',
// Force Upgrade | Automatic Security Checks
FORCE_UPGRADE_UPDATE_NEEDED_PROMPT_VIEWED = 'Force Upgrade Update Needed Prompt Viewed',
@@ -913,9 +933,63 @@ const events = {
STAKE_INPUT_CURRENCY_SWITCH_CLICKED: generateOpt(
EVENT_NAME.STAKE_INPUT_CURRENCY_SWITCH_CLICKED,
),
+ STAKE_CANCEL_CLICKED: generateOpt(EVENT_NAME.STAKE_CANCEL_CLICKED),
+ STAKE_CONFIRMATION_BACK_CLICKED: generateOpt(
+ EVENT_NAME.STAKE_CONFIRMATION_BACK_CLICKED,
+ ),
+ STAKE_TRANSACTION_INITIATED: generateOpt(
+ EVENT_NAME.STAKE_TRANSACTION_INITIATED,
+ ),
+ STAKE_TRANSACTION_APPROVED: generateOpt(
+ EVENT_NAME.STAKE_TRANSACTION_APPROVED,
+ ),
+ STAKE_TRANSACTION_REJECTED: generateOpt(
+ EVENT_NAME.STAKE_TRANSACTION_REJECTED,
+ ),
+ STAKE_TRANSACTION_FAILED: generateOpt(EVENT_NAME.STAKE_TRANSACTION_FAILED),
+ STAKE_TRANSACTION_CONFIRMED: generateOpt(
+ EVENT_NAME.STAKE_TRANSACTION_CONFIRMED,
+ ),
+ STAKE_TRANSACTION_SUBMITTED: generateOpt(
+ EVENT_NAME.STAKE_TRANSACTION_SUBMITTED,
+ ),
+ STAKE_GAS_COST_IMPACT_WARNING_TRIGGERED: generateOpt(
+ EVENT_NAME.STAKE_GAS_COST_IMPACT_WARNING_TRIGGERED,
+ ),
+ STAKE_GAS_COST_IMPACT_CANCEL_CLICKED: generateOpt(
+ EVENT_NAME.STAKE_GAS_COST_IMPACT_CANCEL_CLICKED,
+ ),
+ STAKE_GAS_COST_IMPACT_PROCEEDED_CLICKED: generateOpt(
+ EVENT_NAME.STAKE_GAS_COST_IMPACT_PROCEEDED_CLICKED,
+ ),
UNSTAKE_INPUT_CURRENCY_SWITCH_CLICKED: generateOpt(
EVENT_NAME.UNSTAKE_INPUT_CURRENCY_SWITCH_CLICKED,
),
+ UNSTAKE_CANCEL_CLICKED: generateOpt(EVENT_NAME.UNSTAKE_CANCEL_CLICKED),
+ UNSTAKE_CONFIRMATION_BACK_CLICKED: generateOpt(
+ EVENT_NAME.UNSTAKE_CONFIRMATION_BACK_CLICKED,
+ ),
+ UNSTAKE_TRANSACTION_INITIATED: generateOpt(
+ EVENT_NAME.UNSTAKE_TRANSACTION_INITIATED,
+ ),
+ UNSTAKE_TRANSACTION_APPROVED: generateOpt(
+ EVENT_NAME.UNSTAKE_TRANSACTION_APPROVED,
+ ),
+ UNSTAKE_TRANSACTION_REJECTED: generateOpt(
+ EVENT_NAME.UNSTAKE_TRANSACTION_REJECTED,
+ ),
+ UNSTAKE_TRANSACTION_FAILED: generateOpt(
+ EVENT_NAME.UNSTAKE_TRANSACTION_FAILED,
+ ),
+ UNSTAKE_TRANSACTION_CONFIRMED: generateOpt(
+ EVENT_NAME.UNSTAKE_TRANSACTION_CONFIRMED,
+ ),
+ UNSTAKE_TRANSACTION_SUBMITTED: generateOpt(
+ EVENT_NAME.UNSTAKE_TRANSACTION_SUBMITTED,
+ ),
+ VISITED_ETH_OVERVIEW_WITH_STAKED_POSITIONS: generateOpt(
+ EVENT_NAME.VISITED_ETH_OVERVIEW_WITH_STAKED_POSITIONS,
+ ),
};
/**
diff --git a/app/core/Engine/Engine.test.ts b/app/core/Engine/Engine.test.ts
index 5af5d8965c8..a261e484232 100644
--- a/app/core/Engine/Engine.test.ts
+++ b/app/core/Engine/Engine.test.ts
@@ -8,7 +8,6 @@ import { mockNetworkState } from '../../util/test/network';
import MetaMetrics from '../Analytics/MetaMetrics';
import { store } from '../../store';
import { MetaMetricsEvents } from '../Analytics';
-import { NetworkState } from '@metamask/network-controller';
import { Hex } from '@metamask/utils';
import { TransactionMeta } from '@metamask/transaction-controller';
import { RootState } from '../../reducers';
@@ -132,18 +131,12 @@ describe('Engine', () => {
[selectedAddress]: { balance: (ethBalance * 1e18).toString() },
},
},
- NetworkController: {
- state: {
- ...mockNetworkState({
- chainId: '0x1',
- id: '0x1',
- nickname: 'mainnet',
- ticker: 'ETH',
- }),
- },
- // TODO(dbrans): Investigate why the shape of the NetworkController state in this
- // test is {state: NetworkState} instead of just NetworkState.
- } as unknown as NetworkState,
+ NetworkController: mockNetworkState({
+ chainId: '0x1',
+ id: '0x1',
+ nickname: 'mainnet',
+ ticker: 'ETH',
+ }),
CurrencyRateController: {
currencyRates: {
[ticker]: {
diff --git a/app/core/Engine/Engine.ts b/app/core/Engine/Engine.ts
index 95c23de7ba2..a586b2c2393 100644
--- a/app/core/Engine/Engine.ts
+++ b/app/core/Engine/Engine.ts
@@ -1404,16 +1404,12 @@ export class Engine {
// allowedActions: [
// 'GasFeeController:getEIP1559GasFeeEstimates',
// ],
- allowedActions: [
- 'NetworkController:findNetworkClientIdByChainId',
- 'NetworkController:getNetworkClientById',
- ],
- allowedEvents: [],
+ allowedActions: ['NetworkController:getNetworkClientById'],
+ allowedEvents: ['NetworkController:networkDidChange'],
}),
pollCountLimit: AppConstants.SWAPS.POLL_COUNT_LIMIT,
// TODO: Remove once GasFeeController exports this action type
fetchGasFeeEstimates: () => gasFeeController.fetchGasFeeEstimates(),
- // @ts-expect-error TODO: Resolve mismatch between gas fee and swaps controller types
fetchEstimatedMultiLayerL1Fee,
}),
GasFeeController: gasFeeController,
@@ -1675,7 +1671,7 @@ export class Engine {
}
configureControllersOnNetworkChange() {
- const { AccountTrackerController, NetworkController, SwapsController } =
+ const { AccountTrackerController, NetworkController } =
this.context;
const { provider } = NetworkController.getProviderAndBlockTracker();
@@ -1685,10 +1681,6 @@ export class Engine {
}
provider.sendAsync = provider.sendAsync.bind(provider);
- SwapsController.setProvider(provider, {
- chainId: getGlobalChainId(NetworkController),
- pollCountLimit: AppConstants.SWAPS.POLL_COUNT_LIMIT,
- });
AccountTrackerController.refresh();
}
diff --git a/app/core/RPCMethods/wallet_switchEthereumChain.js b/app/core/RPCMethods/wallet_switchEthereumChain.js
index 69a7d85cee4..7d9d3163545 100644
--- a/app/core/RPCMethods/wallet_switchEthereumChain.js
+++ b/app/core/RPCMethods/wallet_switchEthereumChain.js
@@ -1,6 +1,7 @@
import Engine from '../Engine';
import { providerErrors, rpcErrors } from '@metamask/rpc-errors';
import { MetaMetricsEvents, MetaMetrics } from '../../core/Analytics';
+import { MetricsEventBuilder } from '../../core/Analytics/MetricsEventBuilder';
import { selectNetworkConfigurations } from '../../selectors/networkController';
import { store } from '../../store';
import {
@@ -74,8 +75,7 @@ const wallet_switchEthereumChain = async ({
});
MetaMetrics.getInstance().trackEvent(
- MetaMetrics.getInstance()
- .createEventBuilder(MetaMetricsEvents.NETWORK_SWITCHED)
+ MetricsEventBuilder.createEventBuilder(MetaMetricsEvents.NETWORK_SWITCHED)
.addProperties(analyticsParams)
.build(),
);
diff --git a/app/lib/ppom/ppom-util.test.ts b/app/lib/ppom/ppom-util.test.ts
index 89faa23a585..6d0ab6bc03d 100644
--- a/app/lib/ppom/ppom-util.test.ts
+++ b/app/lib/ppom/ppom-util.test.ts
@@ -3,7 +3,10 @@ import * as SignatureRequestActions from '../../actions/signatureRequest'; // es
import * as TransactionActions from '../../actions/transaction'; // eslint-disable-line import/no-namespace
import * as NetworkControllerSelectors from '../../selectors/networkController'; // eslint-disable-line import/no-namespace
import Engine from '../../core/Engine';
-import PPOMUtil from './ppom-util';
+import PPOMUtil, {
+ METHOD_SIGN_TYPED_DATA_V3,
+ METHOD_SIGN_TYPED_DATA_V4,
+} from './ppom-util';
// eslint-disable-next-line import/no-namespace
import * as securityAlertAPI from './security-alerts-api';
import { isBlockaidFeatureEnabled } from '../../util/blockaid';
@@ -22,6 +25,10 @@ import Logger from '../../util/Logger';
const CHAIN_ID_MOCK = '0x1';
+const SIGN_TYPED_DATA_PARAMS_MOCK_1 = '0x123';
+const SIGN_TYPED_DATA_PARAMS_MOCK_2 =
+ '{"primaryType":"Permit","domain":{},"types":{}}';
+
jest.mock('./security-alerts-api');
jest.mock('../../util/blockaid');
@@ -439,5 +446,38 @@ describe('PPOM Utils', () => {
source: SecurityAlertSource.Local,
});
});
+
+ it.each([METHOD_SIGN_TYPED_DATA_V3, METHOD_SIGN_TYPED_DATA_V4])(
+ 'sanitizes request params if method is %s',
+ async (method: string) => {
+ isSecurityAlertsEnabledMock.mockReturnValue(true);
+ getSupportedChainIdsMock.mockResolvedValue([CHAIN_ID_MOCK]);
+
+ const firstTwoParams = [
+ SIGN_TYPED_DATA_PARAMS_MOCK_1,
+ SIGN_TYPED_DATA_PARAMS_MOCK_2,
+ ];
+
+ const unwantedParams = [{}, undefined, 1, null];
+
+ const params = [...firstTwoParams, ...unwantedParams];
+
+ const request = {
+ ...mockRequest,
+ method,
+ params,
+ };
+ await PPOMUtil.validateRequest(request, CHAIN_ID_MOCK);
+
+ expect(validateWithSecurityAlertsAPIMock).toHaveBeenCalledTimes(1);
+ expect(validateWithSecurityAlertsAPIMock).toHaveBeenCalledWith(
+ CHAIN_ID_MOCK,
+ {
+ ...request,
+ params: firstTwoParams,
+ },
+ );
+ },
+ );
});
});
diff --git a/app/lib/ppom/ppom-util.ts b/app/lib/ppom/ppom-util.ts
index 3a7716eb87f..b76d4bf8f4b 100644
--- a/app/lib/ppom/ppom-util.ts
+++ b/app/lib/ppom/ppom-util.ts
@@ -34,6 +34,8 @@ export interface PPOMRequest {
const TRANSACTION_METHOD = 'eth_sendTransaction';
const TRANSACTION_METHODS = [TRANSACTION_METHOD, 'eth_sendRawTransaction'];
+export const METHOD_SIGN_TYPED_DATA_V3 = 'eth_signTypedData_v3';
+export const METHOD_SIGN_TYPED_DATA_V4 = 'eth_signTypedData_v4';
const CONFIRMATION_METHODS = Object.freeze([
'eth_sendRawTransaction',
@@ -155,7 +157,7 @@ async function validateWithController(
ppomController: PPOMController,
request: PPOMRequest,
): Promise {
- try{
+ try {
const response = (await ppomController.usePPOM((ppom) =>
ppom.validateJsonRpc(request as unknown as Record),
)) as SecurityAlertResponse;
@@ -166,7 +168,10 @@ async function validateWithController(
};
} catch (e) {
Logger.log(`Error validating request with PPOM: ${e}`);
- return {...SECURITY_ALERT_RESPONSE_FAILED, source: SecurityAlertSource.Local,};
+ return {
+ ...SECURITY_ALERT_RESPONSE_FAILED,
+ source: SecurityAlertSource.Local,
+ };
}
}
@@ -212,9 +217,25 @@ function isTransactionRequest(request: PPOMRequest) {
return TRANSACTION_METHODS.includes(request.method);
}
+function sanitizeRequest(request: PPOMRequest): PPOMRequest {
+ // This is a temporary fix to prevent a PPOM bypass
+ if (
+ request.method === METHOD_SIGN_TYPED_DATA_V4 ||
+ request.method === METHOD_SIGN_TYPED_DATA_V3
+ ) {
+ if (Array.isArray(request.params)) {
+ return {
+ ...request,
+ params: request.params.slice(0, 2),
+ };
+ }
+ }
+ return request;
+}
+
function normalizeRequest(request: PPOMRequest): PPOMRequest {
if (request.method !== TRANSACTION_METHOD) {
- return request;
+ return sanitizeRequest(request);
}
request.origin = request.origin
diff --git a/app/reducers/swaps/index.js b/app/reducers/swaps/index.js
index 04a57225652..09cfc620d24 100644
--- a/app/reducers/swaps/index.js
+++ b/app/reducers/swaps/index.js
@@ -2,13 +2,13 @@ import { createSelector } from 'reselect';
import { isMainnetByChainId } from '../../util/networks';
import { safeToChecksumAddress } from '../../util/address';
import { toLowerCaseEquals } from '../../util/general';
-import Engine from '../../core/Engine';
import { lte } from '../../util/lodash';
import { selectChainId } from '../../selectors/networkController';
import {
selectAllTokens,
selectTokens,
} from '../../selectors/tokensController';
+import { selectTokenList } from '../../selectors/tokenListController';
import { selectContractBalances } from '../../selectors/tokenBalancesController';
import { getChainFeatureFlags, getSwapsLiveness } from './utils';
import { allowedTestnetChainIds } from '../../components/UI/Swaps/utils';
@@ -39,15 +39,12 @@ export const setSwapsHasOnboarded = (hasOnboarded) => ({
// * Functions
-function addMetadata(chainId, tokens) {
+function addMetadata(chainId, tokens, tokenList) {
if (!isMainnetByChainId(chainId)) {
return tokens;
}
return tokens.map((token) => {
- const tokenMetadata =
- Engine.context.TokenListController.state.tokenList[
- safeToChecksumAddress(token.address)
- ];
+ const tokenMetadata = tokenList[safeToChecksumAddress(token.address)];
if (tokenMetadata) {
return { ...token, name: tokenMetadata.name };
}
@@ -235,12 +232,13 @@ const swapsControllerAndUserTokensMultichain = createSelector(
export const swapsTokensSelector = createSelector(
chainIdSelector,
swapsControllerAndUserTokens,
- (chainId, tokens) => {
+ selectTokenList,
+ (chainId, tokens, tokenList) => {
if (!tokens) {
return [];
}
- return addMetadata(chainId, tokens);
+ return addMetadata(chainId, tokens, tokenList);
},
);
@@ -253,13 +251,17 @@ const topAssets = (state) =>
*/
export const swapsTokensObjectSelector = createSelector(
swapsControllerAndUserTokens,
- (tokens) =>
- tokens?.length > 0
- ? tokens.reduce(
- (acc, token) => ({ ...acc, [token.address]: undefined }),
- {},
- )
- : {},
+ (tokens) => {
+ if (!tokens || tokens.length === 0) {
+ return {};
+ }
+
+ const result = {};
+ for (const token of tokens) {
+ result[token.address] = undefined;
+ }
+ return result;
+ }
);
/**
@@ -288,8 +290,9 @@ export const swapsTokensMultiChainObjectSelector = createSelector(
export const swapsTokensWithBalanceSelector = createSelector(
chainIdSelector,
swapsControllerAndUserTokens,
+ selectTokenList,
selectContractBalances,
- (chainId, tokens, balances) => {
+ (chainId, tokens, tokenList, balances) => {
if (!tokens) {
return [];
}
@@ -321,7 +324,7 @@ export const swapsTokensWithBalanceSelector = createSelector(
0,
Math.max(tokensWithBalance.length, MAX_TOKENS_WITH_BALANCE),
);
- return addMetadata(chainId, result);
+ return addMetadata(chainId, result, tokenList);
},
);
@@ -332,8 +335,9 @@ export const swapsTokensWithBalanceSelector = createSelector(
export const swapsTopAssetsSelector = createSelector(
chainIdSelector,
swapsControllerAndUserTokens,
+ selectTokenList,
topAssets,
- (chainId, tokens, topAssets) => {
+ (chainId, tokens, tokenList, topAssets) => {
if (!topAssets || !tokens) {
return [];
}
@@ -342,7 +346,7 @@ export const swapsTopAssetsSelector = createSelector(
tokens?.find((token) => toLowerCaseEquals(token.address, address)),
)
.filter(Boolean);
- return addMetadata(chainId, result);
+ return addMetadata(chainId, result, tokenList);
},
);
diff --git a/app/reducers/swaps/swaps.test.ts b/app/reducers/swaps/swaps.test.ts
index f8bfdeae4e9..be4c7292d96 100644
--- a/app/reducers/swaps/swaps.test.ts
+++ b/app/reducers/swaps/swaps.test.ts
@@ -6,8 +6,13 @@ import reducer, {
SWAPS_SET_LIVENESS,
SWAPS_SET_HAS_ONBOARDED,
swapsSmartTxFlagEnabled,
+ swapsTokensObjectSelector,
} from './index';
import { NetworkClientType } from '@metamask/network-controller';
+// eslint-disable-next-line import/no-namespace
+import * as tokensControllerSelectors from '../../selectors/tokensController';
+
+jest.mock('../../selectors/tokensController');
const emptyAction = { type: null };
@@ -321,6 +326,69 @@ describe('swaps reducer', () => {
});
});
+ describe('swapsTokensObjectSelector', () => {
+ it('should return a object that returns an object combining TokensController and SwapsController tokens where each key is an address and each value is undefined', () => {
+ jest.spyOn(tokensControllerSelectors, 'selectTokens').mockReturnValue([
+ {
+ address: '0x0000000000000000000000000000000000000010',
+ symbol: 'TOKEN1',
+ decimals: 1,
+ aggregators: [],
+ },
+ {
+ address: '0x0000000000000000000000000000000000000011',
+ symbol: 'TOKEN2',
+ decimals: 2,
+ aggregators: [],
+ },
+ ]);
+ const state = {
+ engine: {
+ backgroundState: {
+ SwapsController: {
+ tokens: [
+ {
+ address: '0x0000000000000000000000000000000000000000',
+ symbol: 'SWAPS-TOKEN1',
+ decimals: 1,
+ occurrences: 10,
+ iconUrl: 'https://some.token.icon.url/1',
+ },
+ {
+ address: '0x0000000000000000000000000000000000000001',
+ symbol: 'SWAPS-TOKEN2',
+ decimals: 2,
+ occurrences: 20,
+ iconUrl: 'https://some.token.icon.url/2',
+ },
+ ],
+ },
+ },
+ },
+ };
+ expect(swapsTokensObjectSelector(state)).toStrictEqual({
+ '0x0000000000000000000000000000000000000000': undefined,
+ '0x0000000000000000000000000000000000000001': undefined,
+ '0x0000000000000000000000000000000000000010': undefined,
+ '0x0000000000000000000000000000000000000011': undefined,
+ });
+ });
+
+ it('should return an empty object if there are no Swaps tokens or user tokens', () => {
+ jest.spyOn(tokensControllerSelectors, 'selectTokens').mockReturnValue([]);
+ const state = {
+ engine: {
+ backgroundState: {
+ SwapsController: {
+ tokens: [],
+ },
+ },
+ },
+ };
+ expect(swapsTokensObjectSelector(state)).toStrictEqual({});
+ });
+ });
+
it('should set has onboarded', () => {
const initalState = reducer(undefined, emptyAction);
// @ts-ignore
diff --git a/app/store/migrations/064.test.ts b/app/store/migrations/064.test.ts
new file mode 100644
index 00000000000..680fe4fc378
--- /dev/null
+++ b/app/store/migrations/064.test.ts
@@ -0,0 +1,173 @@
+import migration from './064';
+import { merge } from 'lodash';
+import initialRootState from '../../util/test/initial-root-state';
+import { captureException } from '@sentry/react-native';
+import { RootState } from '../../reducers';
+
+const oldState = {
+ engine: {
+ backgroundState: {
+ NetworkController: {
+ selectedNetworkClientId: 'unknown-client-id',
+ networkConfigurationsByChainId: {
+ '0x1': {
+ rpcEndpoints: [{ networkClientId: 'mainnet' }],
+ },
+ '0x5': {
+ rpcEndpoints: [{ networkClientId: 'goerli' }],
+ },
+ },
+ },
+ },
+ },
+};
+
+const expectedNewState = {
+ engine: {
+ backgroundState: {
+ NetworkController: {
+ selectedNetworkClientId: 'mainnet',
+ networkConfigurationsByChainId: {
+ '0x1': {
+ rpcEndpoints: [{ networkClientId: 'mainnet' }],
+ },
+ '0x5': {
+ rpcEndpoints: [{ networkClientId: 'goerli' }],
+ },
+ },
+ },
+ },
+ },
+};
+
+jest.mock('@sentry/react-native', () => ({
+ captureException: jest.fn(),
+}));
+const mockedCaptureException = jest.mocked(captureException);
+
+describe('Migration #64', () => {
+ beforeEach(() => {
+ jest.restoreAllMocks();
+ jest.resetAllMocks();
+ });
+
+ const invalidStates = [
+ {
+ state: merge({}, initialRootState, {
+ engine: {
+ backgroundState: {
+ NetworkController: null,
+ },
+ },
+ }),
+ errorMessage:
+ "Migration 64: Invalid or missing 'NetworkController' in backgroundState: 'object'",
+ scenario: 'NetworkController state is invalid',
+ },
+ {
+ state: merge({}, initialRootState, {
+ engine: {
+ backgroundState: {
+ NetworkController: { networkConfigurationsByChainId: null },
+ },
+ },
+ }),
+ errorMessage:
+ "Migration 64: Missing or invalid 'networkConfigurationsByChainId' in NetworkController",
+ scenario: 'networkConfigurationsByChainId is invalid',
+ },
+ ];
+
+ for (const { errorMessage, scenario, state } of invalidStates) {
+ it(`should capture exception if ${scenario}`, async () => {
+ const newState = await migration(state);
+
+ expect(newState).toStrictEqual(state);
+ expect(mockedCaptureException).toHaveBeenCalledWith(expect.any(Error));
+ expect(mockedCaptureException.mock.calls[0][0].message).toBe(
+ errorMessage,
+ );
+ });
+ }
+
+ it('should set selectedNetworkClientId to "mainnet" if it does not exist in networkConfigurationsByChainId', async () => {
+ const newState = await migration(oldState);
+ expect(newState).toStrictEqual(expectedNewState);
+ });
+
+ it('should keep selectedNetworkClientId unchanged if it exists in networkConfigurationsByChainId', async () => {
+ const validState = merge({}, oldState, {
+ engine: {
+ backgroundState: {
+ NetworkController: {
+ selectedNetworkClientId: 'mainnet',
+ },
+ },
+ },
+ });
+ const newState = await migration(validState);
+
+ expect(newState).toStrictEqual(validState);
+ });
+
+ it('should set selectedNetworkClientId to the default mainnet client ID if mainnet configuration exists but selectedNetworkClientId is invalid', async () => {
+ const invalidClientState = merge({}, oldState, {
+ engine: {
+ backgroundState: {
+ NetworkController: {
+ selectedNetworkClientId: 'invalid-client-id',
+ },
+ },
+ },
+ });
+
+ const newState = await migration(invalidClientState);
+ expect(
+ (newState as RootState).engine.backgroundState.NetworkController
+ .selectedNetworkClientId,
+ ).toBe('mainnet');
+ });
+
+ it('should handle the absence of mainnet configuration gracefully', async () => {
+ const noMainnetState = merge({}, oldState, {
+ engine: {
+ backgroundState: {
+ NetworkController: {
+ networkConfigurationsByChainId: {
+ '0x1': {
+ chainId: '0x1',
+ defaultRpcEndpointIndex: 0,
+ rpcEndpoints: [{ networkClientId: 'another-mainnet' }],
+ },
+ '0x5': {
+ rpcEndpoints: [{ networkClientId: 'goerli' }],
+ },
+ },
+ selectedNetworkClientId: 'unknown-client-id',
+ },
+ },
+ },
+ });
+
+ const newState = await migration(noMainnetState);
+ expect(
+ (newState as RootState).engine.backgroundState.NetworkController
+ .selectedNetworkClientId,
+ ).toBe('another-mainnet');
+ });
+
+ it('should not modify the state if it is already valid', async () => {
+ const validState = merge({}, oldState, {
+ engine: {
+ backgroundState: {
+ NetworkController: {
+ selectedNetworkClientId: 'mainnet',
+ },
+ },
+ },
+ });
+
+ const newState = await migration(validState);
+ expect(newState).toStrictEqual(validState);
+ });
+});
diff --git a/app/store/migrations/064.ts b/app/store/migrations/064.ts
new file mode 100644
index 00000000000..048fcbb341c
--- /dev/null
+++ b/app/store/migrations/064.ts
@@ -0,0 +1,167 @@
+import { captureException } from '@sentry/react-native';
+import { isObject, hasProperty, Hex } from '@metamask/utils';
+import { CHAIN_IDS } from '@metamask/transaction-controller';
+import {
+ NetworkClientId,
+ NetworkConfiguration,
+ NetworkState,
+} from '@metamask/network-controller';
+import { ensureValidState } from './util';
+import { RootState } from '../../reducers';
+
+/**
+ * This migration checks if `selectedNetworkClientId` exists in any entry within `networkConfigurationsByChainId`.
+ * If it does not, or if `selectedNetworkClientId` is undefined or invalid, it sets `selectedNetworkClientId` to `'mainnet'`.
+ * @param {unknown} stateAsync - Redux state.
+ * @returns Migrated Redux state.
+ */
+export default async function migrate(stateAsync: unknown) {
+ const migrationVersion = 64;
+ const mainnetChainId = CHAIN_IDS.MAINNET;
+
+ const state = await stateAsync;
+
+ if (!ensureValidState(state, migrationVersion)) {
+ return state;
+ }
+
+ const networkControllerState = state.engine.backgroundState
+ .NetworkController as NetworkState;
+
+ if (
+ !isValidNetworkControllerState(
+ networkControllerState,
+ state as RootState,
+ migrationVersion,
+ )
+ ) {
+ return state;
+ }
+
+ const { networkConfigurationsByChainId, selectedNetworkClientId } =
+ networkControllerState;
+
+ const networkClientIdExists = doesNetworkClientIdExist(
+ selectedNetworkClientId,
+ networkConfigurationsByChainId,
+ migrationVersion,
+ );
+
+ const isMainnetRpcExists = isMainnetRpcConfigured(
+ networkConfigurationsByChainId,
+ );
+
+ ensureSelectedNetworkClientId(
+ networkControllerState,
+ networkClientIdExists,
+ isMainnetRpcExists,
+ networkConfigurationsByChainId,
+ mainnetChainId,
+ );
+
+ return state;
+}
+
+function isValidNetworkControllerState(
+ networkControllerState: NetworkState,
+ state: RootState,
+ migrationVersion: number,
+) {
+ if (
+ !isObject(networkControllerState) ||
+ !hasProperty(state.engine.backgroundState, 'NetworkController')
+ ) {
+ captureException(
+ new Error(
+ `Migration ${migrationVersion}: Invalid or missing 'NetworkController' in backgroundState: '${typeof networkControllerState}'`,
+ ),
+ );
+ return false;
+ }
+
+ if (
+ !hasProperty(networkControllerState, 'networkConfigurationsByChainId') ||
+ !isObject(networkControllerState.networkConfigurationsByChainId)
+ ) {
+ captureException(
+ new Error(
+ `Migration ${migrationVersion}: Missing or invalid 'networkConfigurationsByChainId' in NetworkController`,
+ ),
+ );
+ return false;
+ }
+
+ return true;
+}
+
+function doesNetworkClientIdExist(
+ selectedNetworkClientId: NetworkClientId,
+ networkConfigurationsByChainId: Record,
+ migrationVersion: number,
+) {
+ for (const chainId in networkConfigurationsByChainId) {
+ const networkConfig = networkConfigurationsByChainId[chainId as Hex];
+
+ if (
+ isObject(networkConfig) &&
+ hasProperty(networkConfig, 'rpcEndpoints') &&
+ Array.isArray(networkConfig.rpcEndpoints)
+ ) {
+ if (
+ networkConfig.rpcEndpoints.some(
+ (endpoint) =>
+ isObject(endpoint) &&
+ hasProperty(endpoint, 'networkClientId') &&
+ endpoint.networkClientId === selectedNetworkClientId,
+ )
+ ) {
+ return true;
+ }
+ } else {
+ captureException(
+ new Error(
+ `Migration ${migrationVersion}: Invalid network configuration or missing 'rpcEndpoints' for chainId: '${chainId}'`,
+ ),
+ );
+ }
+ }
+
+ return false;
+}
+
+function isMainnetRpcConfigured(
+ networkConfigurationsByChainId: Record,
+) {
+ return Object.values(networkConfigurationsByChainId).some((networkConfig) =>
+ networkConfig.rpcEndpoints.some(
+ (endpoint) => endpoint.networkClientId === 'mainnet',
+ ),
+ );
+}
+
+function ensureSelectedNetworkClientId(
+ networkControllerState: NetworkState,
+ networkClientIdExists: boolean,
+ isMainnetRpcExists: boolean,
+ networkConfigurationsByChainId: Record,
+ mainnetChainId: Hex,
+) {
+ const setDefaultMainnetClientId = () => {
+ networkControllerState.selectedNetworkClientId = isMainnetRpcExists
+ ? 'mainnet'
+ : networkConfigurationsByChainId[mainnetChainId].rpcEndpoints[
+ networkConfigurationsByChainId[mainnetChainId].defaultRpcEndpointIndex
+ ].networkClientId;
+ };
+
+ if (
+ !hasProperty(networkControllerState, 'selectedNetworkClientId') ||
+ typeof networkControllerState.selectedNetworkClientId !== 'string'
+ ) {
+ setDefaultMainnetClientId();
+ }
+
+ if (!networkClientIdExists) {
+ setDefaultMainnetClientId();
+ }
+}
diff --git a/app/store/migrations/index.ts b/app/store/migrations/index.ts
index 06f50319276..44ef0d4f7d2 100644
--- a/app/store/migrations/index.ts
+++ b/app/store/migrations/index.ts
@@ -64,6 +64,7 @@ import migration60 from './060';
import migration61 from './061';
import migration62 from './062';
import migration63 from './063';
+import migration64 from './064';
type MigrationFunction = (state: unknown) => unknown;
type AsyncMigrationFunction = (state: unknown) => Promise;
@@ -140,6 +141,7 @@ export const migrationList: MigrationsList = {
61: migration61,
62: migration62,
63: migration63,
+ 64: migration64,
};
// Enable both synchronous and asynchronous migrations
diff --git a/app/util/logs/__snapshots__/index.test.ts.snap b/app/util/logs/__snapshots__/index.test.ts.snap
index 04e5f381aa0..4bc232b5193 100644
--- a/app/util/logs/__snapshots__/index.test.ts.snap
+++ b/app/util/logs/__snapshots__/index.test.ts.snap
@@ -305,6 +305,7 @@ exports[`logs :: generateStateLogs generates a valid json export 1`] = `
"decimals": 0,
"symbol": "",
},
+ "networkClientId": "mainnet",
"sourceTokenInfo": {
"address": "",
"decimals": 0,
diff --git a/app/util/networks/engineNetworkUtils.ts b/app/util/networks/engineNetworkUtils.ts
index e093fd80e5a..65391429710 100644
--- a/app/util/networks/engineNetworkUtils.ts
+++ b/app/util/networks/engineNetworkUtils.ts
@@ -1,6 +1,7 @@
import Engine from '../../core/Engine';
import { convertHexToDecimal } from '@metamask/controller-utils';
-import { TransactionMeta } from '@metamask/transaction-controller';
+import { NetworkClientId } from '@metamask/network-controller';
+import { TransactionParams } from '@metamask/transaction-controller';
import { isStrictHexString } from '@metamask/utils';
/**
@@ -42,14 +43,15 @@ export function toggleUseSafeChainsListValidation(value: boolean): void {
*/
export const fetchEstimatedMultiLayerL1Fee = async (
_: unknown,
- txMeta: TransactionMeta,
+ { txParams, networkClientId }: {
+ txParams: TransactionParams,
+ networkClientId: NetworkClientId,
+ }
) => {
- const chainId = txMeta.chainId;
-
const layer1GasFee =
await Engine.context.TransactionController.getLayer1GasFee({
- transactionParams: txMeta.txParams,
- chainId,
+ transactionParams: txParams,
+ networkClientId,
});
const layer1GasFeeNoPrefix = layer1GasFee?.startsWith('0x')
diff --git a/app/util/number/index.js b/app/util/number/index.js
index 28027c52b7a..894716562aa 100644
--- a/app/util/number/index.js
+++ b/app/util/number/index.js
@@ -482,6 +482,7 @@ export function addCurrencySymbol(
currencyCode,
extendDecimals = false,
) {
+ const prefix = parseFloat(amount) < 0 ? '-' : '';
if (extendDecimals) {
if (isNumberScientificNotationWhenString(amount)) {
amount = amount.toFixed(18);
@@ -512,17 +513,22 @@ export function addCurrencySymbol(
amount = parseFloat(amount).toFixed(2);
}
+ const amountString = amount.toString();
+ const absAmountStr = amountString.startsWith('-')
+ ? amountString.slice(1) // Remove the first character if it's a '-'
+ : amountString;
+
if (currencySymbols[currencyCode]) {
- return `${currencySymbols[currencyCode]}${amount}`;
+ return `${prefix}${currencySymbols[currencyCode]}${absAmountStr}`;
}
const lowercaseCurrencyCode = currencyCode?.toLowerCase();
if (currencySymbols[lowercaseCurrencyCode]) {
- return `${currencySymbols[lowercaseCurrencyCode]}${amount}`;
+ return `${prefix}${currencySymbols[lowercaseCurrencyCode]}${absAmountStr}`;
}
- return `${amount} ${currencyCode}`;
+ return `${prefix}${absAmountStr} ${currencyCode}`;
}
/**
diff --git a/app/util/test/initial-background-state.json b/app/util/test/initial-background-state.json
index 53276453bee..7cd4d595c96 100644
--- a/app/util/test/initial-background-state.json
+++ b/app/util/test/initial-background-state.json
@@ -270,7 +270,8 @@
"decimals": 0,
"address": "",
"symbol": ""
- }
+ },
+ "networkClientId": "mainnet"
},
"topAggSavings": null,
"aggregatorMetadata": null,
diff --git a/bitrise.yml b/bitrise.yml
index 44878376bba..e46fa35dea7 100644
--- a/bitrise.yml
+++ b/bitrise.yml
@@ -71,10 +71,10 @@ pipelines:
stages:
- create_build_qa_android: {}
- app_upgrade_test_stage: {}
- multichain_e2e_pipeline:
+ multichain_permissions_e2e_pipeline:
stages:
- - build_multichain_e2e_ios_android_stage: {}
- - run_multichain_e2e_ios_android_stage: {}
+ - build_multichain_permissions_e2e_ios_android_stage: {}
+ - run_multichain_permissions_e2e_ios_android_stage: {}
# Pipeline for Flask
create_flask_release_builds_pipeline:
stages:
@@ -140,15 +140,15 @@ stages:
workflows:
- ios_e2e_build: {}
- android_e2e_build: {}
- build_multichain_e2e_ios_android_stage:
+ build_multichain_permissions_e2e_ios_android_stage:
abort_on_fail: true
workflows:
- - build_ios_multichain_e2e: {}
- - build_android_multichain_e2e: {}
- run_multichain_e2e_ios_android_stage:
+ - build_ios_multichain_permissions_e2e: {}
+ - build_android_multichain_permissions_e2e: {}
+ run_multichain_permissions_e2e_ios_android_stage:
workflows:
- - run_tag_multichain_ios: {}
- - run_tag_multichain_android: {}
+ - run_tag_multichain_permissions_ios: {}
+ - run_tag_multichain_permissions_android: {}
run_smoke_e2e_ios_android_stage:
workflows:
- run_ios_api_specs: {}
@@ -160,12 +160,13 @@ stages:
- run_tag_smoke_assets_android: {}
- run_tag_smoke_confirmations_ios: {}
- run_tag_smoke_confirmations_android: {}
+ - run_tag_smoke_ramps_android: {}
# - run_tag_smoke_swaps_ios: {}
# - run_tag_smoke_swaps_android: {}
- run_tag_smoke_core_ios: {}
- run_tag_smoke_core_android: {}
- - run_tag_multichain_ios: {}
- - run_tag_multichain_android: {}
+ - run_tag_multichain_permissions_ios: {}
+ - run_tag_multichain_permissions_android: {}
build_regression_e2e_ios_android_stage:
workflows:
- ios_build_regression_tests: {}
@@ -182,6 +183,7 @@ stages:
- run_tag_smoke_confirmations_android: {}
- run_tag_smoke_accounts_ios: {}
- run_tag_smoke_accounts_android: {}
+ - run_tag_smoke_ramps_android: {}
# - run_tag_smoke_identity_ios: {}
# - run_tag_smoke_identity_android: {}
# - run_tag_smoke_assets_ios: {}
@@ -539,11 +541,11 @@ workflows:
- TEST_TYPE: 'upgrade'
after_run:
- wdio_android_e2e_test
- build_ios_multichain_e2e:
+ build_ios_multichain_permissions_e2e:
after_run:
- ios_e2e_build
# - android_e2e_build
- build_android_multichain_e2e:
+ build_android_multichain_permissions_e2e:
meta:
bitrise.io:
stack: linux-docker-android-22.04
@@ -683,20 +685,30 @@ workflows:
- TEST_SUITE_TAG: '.*SmokeCore.*'
after_run:
- android_e2e_test
- run_tag_multichain_ios:
+ run_tag_multichain_permissions_ios:
envs:
- TEST_SUITE_FOLDER: './e2e/specs/multichain/*'
- - TEST_SUITE_TAG: '.*SmokeMultiChain.*'
+ - TEST_SUITE_TAG: '.*SmokeMultiChainPermissions.*'
after_run:
- ios_e2e_test
- run_tag_multichain_android:
+ run_tag_multichain_permissions_android:
meta:
bitrise.io:
stack: linux-docker-android-22.04
machine_type_id: elite-xl
envs:
- TEST_SUITE_FOLDER: './e2e/specs/multichain/*'
- - TEST_SUITE_TAG: '.*SmokeMultiChain.*'
+ - TEST_SUITE_TAG: '.*SmokeMultiChainPermissions.*'
+ after_run:
+ - android_e2e_test
+ run_tag_smoke_ramps_android:
+ meta:
+ bitrise.io:
+ stack: linux-docker-android-22.04
+ machine_type_id: elite-xl
+ envs:
+ - TEST_SUITE_FOLDER: './e2e/specs/ramps/*'
+ - TEST_SUITE_TAG: '.*SmokeRamps.*'
after_run:
- android_e2e_test
android_e2e_build:
@@ -970,7 +982,7 @@ workflows:
inputs:
- content: |-
#!/usr/bin/env bash
- brew install ccache with HOMEBREW_NO_DEPENDENTS_CHECK=1
+ brew install ccache with HOMEBREW_NO_DEPENDENTS_CHECK=1
ln -s $(which ccache) /usr/local/bin/gcc
ln -s $(which ccache) /usr/local/bin/g++
ln -s $(which ccache) /usr/local/bin/cc
@@ -1781,16 +1793,16 @@ app:
PROJECT_LOCATION_IOS: ios
- opts:
is_expand: false
- VERSION_NAME: 7.37.0
+ VERSION_NAME: 7.37.1
- opts:
is_expand: false
- VERSION_NUMBER: 1512
+ VERSION_NUMBER: 1520
- opts:
is_expand: false
- FLASK_VERSION_NAME: 7.37.0
+ FLASK_VERSION_NAME: 7.37.1
- opts:
is_expand: false
- FLASK_VERSION_NUMBER: 1512
+ FLASK_VERSION_NUMBER: 1520
- opts:
is_expand: false
ANDROID_APK_LINK: ''
@@ -1831,4 +1843,4 @@ trigger_map:
- tag: 'v*.*.*-RC-*'
pipeline: release_e2e_pipeline
- push_branch: detox/address-regression-tests-slowdown
- pipeline: multichain_e2e_pipeline
+ pipeline: multichain_permissions_e2e_pipeline
diff --git a/e2e/fixtures/fixture-builder.js b/e2e/fixtures/fixture-builder.js
index 024f90a6c1a..1f7fcf30f89 100644
--- a/e2e/fixtures/fixture-builder.js
+++ b/e2e/fixtures/fixture-builder.js
@@ -5,7 +5,8 @@ import { merge } from 'lodash';
import { CustomNetworks, PopularNetworksList } from '../resources/networks.e2e';
import { CHAIN_IDS } from '@metamask/transaction-controller';
-export const DEFAULT_FIXTURE_ACCOUNT = '0x76cf1CdD1fcC252442b50D6e97207228aA4aefC3';
+export const DEFAULT_FIXTURE_ACCOUNT =
+ '0x76cf1CdD1fcC252442b50D6e97207228aA4aefC3';
const DAPP_URL = 'localhost';
@@ -447,7 +448,7 @@ class FixtureBuilder {
whitelist: [],
tabs: [
{
- url: 'https://portfolio.metamask.io/explore?MetaMaskEntry=mobile/',
+ url: 'https://metamask.github.io/test-dapp/',
id: 1692550481062,
},
],
@@ -627,6 +628,7 @@ class FixtureBuilder {
selectedRegionAgg: null,
selectedPaymentMethodAgg: null,
getStartedAgg: false,
+ getStartedSell: false,
authenticationUrls: [],
activationKeys: [],
},
@@ -696,8 +698,9 @@ class FixtureBuilder {
const { providerConfig } = data;
// Generate a unique key for the new network client ID
- const newNetworkClientId = `networkClientId${Object.keys(networkController.networkConfigurationsByChainId).length + 1
- }`;
+ const newNetworkClientId = `networkClientId${
+ Object.keys(networkController.networkConfigurationsByChainId).length + 1
+ }`;
// Define the network configuration
const networkConfig = {
@@ -776,6 +779,30 @@ class FixtureBuilder {
return this;
}
+ withRampsSelectedRegion(region = null) {
+ const defaultRegion = {
+ currencies: ['/currencies/fiat/xcd'],
+ emoji: '🇱🇨',
+ id: '/regions/lc',
+ name: 'Saint Lucia',
+ support: { buy: true, sell: true, recurringBuy: true },
+ unsupported: false,
+ recommended: false,
+ detected: false,
+ };
+
+ // Use the provided region or fallback to the default
+ this.fixture.state.fiatOrders.selectedRegionAgg = region ?? defaultRegion;
+ return this;
+ }
+ withRampsSelectedPaymentMethod() {
+ const paymentType = '/payments/debit-credit-card';
+
+ // Use the provided region or fallback to the default
+ this.fixture.state.fiatOrders.selectedPaymentMethodAgg = paymentType;
+ return this;
+ }
+
/**
* Adds chain switching permission for specific chains.
* @param {string[]} chainIds - Array of chain IDs to permit (defaults to ['0x1']), other nexts like linea mainnet 0xe708
@@ -818,9 +845,10 @@ class FixtureBuilder {
const fixtures = this.fixture.state.engine.backgroundState;
// Generate a unique key for the new network client ID
- const newNetworkClientId = `networkClientId${Object.keys(fixtures.NetworkController.networkConfigurationsByChainId)
- .length + 1
- }`;
+ const newNetworkClientId = `networkClientId${
+ Object.keys(fixtures.NetworkController.networkConfigurationsByChainId)
+ .length + 1
+ }`;
// Define the Ganache network configuration
const ganacheNetworkConfig = {
@@ -856,9 +884,10 @@ class FixtureBuilder {
const sepoliaConfig = CustomNetworks.Sepolia.providerConfig;
// Generate a unique key for the new network client ID
- const newNetworkClientId = `networkClientId${Object.keys(fixtures.NetworkController.networkConfigurationsByChainId)
- .length + 1
- }`;
+ const newNetworkClientId = `networkClientId${
+ Object.keys(fixtures.NetworkController.networkConfigurationsByChainId)
+ .length + 1
+ }`;
// Define the Sepolia network configuration
const sepoliaNetworkConfig = {
@@ -908,8 +937,9 @@ class FixtureBuilder {
} = network.providerConfig;
// Generate a unique key for the new network client ID
- const newNetworkClientId = `networkClientId${Object.keys(networkConfigurationsByChainId).length + 1
- }`;
+ const newNetworkClientId = `networkClientId${
+ Object.keys(networkConfigurationsByChainId).length + 1
+ }`;
// Define the network configuration
const networkConfig = {
@@ -988,19 +1018,16 @@ class FixtureBuilder {
allTokens: {
[CHAIN_IDS.MAINNET]: {
[DEFAULT_FIXTURE_ACCOUNT]: tokens,
- }
- }
+ },
+ },
});
return this;
}
withIncomingTransactionPreferences(incomingTransactionPreferences) {
- merge(
- this.fixture.state.engine.backgroundState.PreferencesController,
- {
- showIncomingTransactions: incomingTransactionPreferences,
- },
- );
+ merge(this.fixture.state.engine.backgroundState.PreferencesController, {
+ showIncomingTransactions: incomingTransactionPreferences,
+ });
return this;
}
diff --git a/e2e/pages/Browser/ConnectedAccountsModal.js b/e2e/pages/Browser/ConnectedAccountsModal.js
index 1297622507a..7940907e56b 100644
--- a/e2e/pages/Browser/ConnectedAccountsModal.js
+++ b/e2e/pages/Browser/ConnectedAccountsModal.js
@@ -89,7 +89,7 @@ class ConnectedAccountsModal {
}
async tapManagePermissionsButton() {
- await TestHelpers.delay(3000);
+ await TestHelpers.delay(4000);
await Gestures.waitAndTap(this.managePermissionsButton);
}
diff --git a/e2e/pages/Browser/ContractApprovalBottomSheet.js b/e2e/pages/Browser/ContractApprovalBottomSheet.js
index e99985f84c4..489fe6a83c0 100644
--- a/e2e/pages/Browser/ContractApprovalBottomSheet.js
+++ b/e2e/pages/Browser/ContractApprovalBottomSheet.js
@@ -48,6 +48,10 @@ class ContractApprovalBottomSheet {
);
}
+ get confirmButton() {
+ return Matchers.getElementByText(ContractApprovalBottomSheetSelectorsText.CONFIRM);
+ }
+
async tapAddNickName() {
await Gestures.waitAndTap(this.addNickName);
}
@@ -63,6 +67,10 @@ class ContractApprovalBottomSheet {
await Gestures.waitAndTap(this.approveButton);
}
+ async tapConfirmButton() {
+ await Gestures.waitAndTap(this.confirmButton);
+ }
+
async tapToCopyContractAddress() {
await Gestures.waitAndTap(this.contractAddress);
}
diff --git a/e2e/pages/Browser/NetworkConnectMultiSelector.js b/e2e/pages/Browser/NetworkConnectMultiSelector.js
index 36a9d8f1b02..9eaf39f8ebd 100644
--- a/e2e/pages/Browser/NetworkConnectMultiSelector.js
+++ b/e2e/pages/Browser/NetworkConnectMultiSelector.js
@@ -1,7 +1,7 @@
import { NetworkConnectMultiSelectorSelectorsIDs } from '../../selectors/Browser/NetworkConnectMultiSelector.selectors';
import Matchers from '../../utils/Matchers';
import Gestures from '../../utils/Gestures';
-
+import { waitFor } from 'detox';
class NetworkConnectMultiSelector {
get updateButton() {
return Matchers.getElementByID(
@@ -22,6 +22,24 @@ class NetworkConnectMultiSelector {
async tapBackButton() {
await Gestures.waitAndTap(this.backButton);
}
+
+ async isNetworkChainPermissionSelected(chainName) {
+ const chainPermissionTestId = `${chainName}-selected`;
+
+ const element = await Matchers.getElementByID(chainPermissionTestId);
+ await waitFor(element).toBeVisible().withTimeout(10000);
+
+ return expect(element).toExist();
+ }
+
+ async isNetworkChainPermissionNotSelected(chainName) {
+ const chainPermissionTestId = `${chainName}-not-selected`;
+
+ const element = await Matchers.getElementByID(chainPermissionTestId);
+ await waitFor(element).toBeVisible().withTimeout(10000);
+
+ return expect(element).toExist();
+ }
}
export default new NetworkConnectMultiSelector();
diff --git a/e2e/pages/Browser/TestDApp.js b/e2e/pages/Browser/TestDApp.js
index cdf89c571f8..ec451f5dbe5 100644
--- a/e2e/pages/Browser/TestDApp.js
+++ b/e2e/pages/Browser/TestDApp.js
@@ -12,6 +12,7 @@ import Matchers from '../../utils/Matchers';
export const TEST_DAPP_LOCAL_URL = `http://localhost:${getLocalTestDappPort()}`;
const CONFIRM_BUTTON_TEXT = enContent.confirmation_modal.confirm_cta;
+const APPROVE_BUTTON_TEXT = enContent.transactions.tx_review_approve;
class TestDApp {
get androidContainer() {
@@ -22,6 +23,10 @@ class TestDApp {
return Matchers.getElementByText(CONFIRM_BUTTON_TEXT);
}
+ get approveButtonText() {
+ return Matchers.getElementByText(APPROVE_BUTTON_TEXT);
+ }
+
get DappConnectButton() {
return Matchers.getElementByWebID(
BrowserViewSelectorsIDs.BROWSER_WEBVIEW_ID,
@@ -29,10 +34,23 @@ class TestDApp {
);
}
- get ApproveButton() {
+ get ApproveERC20TokensButton() {
+ return Matchers.getElementByWebID(
+ BrowserViewSelectorsIDs.BROWSER_WEBVIEW_ID,
+ TestDappSelectorsWebIDs.APPROVE_ERC_20_TOKENS_BUTTON_ID,
+ );
+ }
+ get invalidSignature() {
return Matchers.getElementByWebID(
BrowserViewSelectorsIDs.BROWSER_WEBVIEW_ID,
- TestDappSelectorsWebIDs.APPROVE_TOKENS_BUTTON_ID,
+ 'signInvalidType',
+ );
+ }
+
+ get ApproveERC721TokenButton() {
+ return Matchers.getElementByWebID(
+ BrowserViewSelectorsIDs.BROWSER_WEBVIEW_ID,
+ TestDappSelectorsWebIDs.APPROVE_ERC_721_TOKEN_BUTTON_ID,
);
}
// This taps on the transfer tokens button under the "SEND TOKENS section"
@@ -89,7 +107,7 @@ class TestDApp {
get nftSetApprovalForAllButton() {
return Matchers.getElementByWebID(
BrowserViewSelectorsIDs.BROWSER_WEBVIEW_ID,
- TestDappSelectorsWebIDs.SET_APPROVAL_FOR_ALL_BUTTON_ID,
+ TestDappSelectorsWebIDs.SET_APPROVAL_FOR_ALL_NFT_BUTTON_ID,
);
}
@@ -100,14 +118,41 @@ class TestDApp {
);
}
+ get erc1155SetApprovalForAllButton() {
+ return Matchers.getElementByWebID(
+ BrowserViewSelectorsIDs.BROWSER_WEBVIEW_ID,
+ TestDappSelectorsWebIDs.SET_APPROVAL_FOR_ALL_ERC1155_BUTTON_ID,
+ );
+ }
+
+ get sendFailingTransactionButton() {
+ return Matchers.getElementByWebID(
+ BrowserViewSelectorsIDs.BROWSER_WEBVIEW_ID,
+ TestDappSelectorsWebIDs.SEND_FAILING_TRANSACTION_BUTTON_ID,
+ );
+ }
+
+ get erc1155BatchTransferButton() {
+ return Matchers.getElementByWebID(
+ BrowserViewSelectorsIDs.BROWSER_WEBVIEW_ID,
+ TestDappSelectorsWebIDs.BATCH_TRANSFER_ERC1155_BUTTON_ID,
+ );
+ }
+
async connect() {
await this.tapButton(this.DappConnectButton);
}
- async tapApproveButton() {
- await this.tapButton(this.ApproveButton);
+ async tapApproveERC20TokensButton() {
+ await this.tapButton(this.ApproveERC20TokensButton);
}
+ async tapApproveERC721TokenButton() {
+ await this.tapButton(this.ApproveERC721TokenButton);
+ }
+ async tapInvalidSigButton() {
+ await this.tapButton(this.invalidSignature);
+ }
async tapIncreaseAllowanceButton() {
await this.tapButton(this.increaseAllowanceButton);
}
@@ -146,10 +191,26 @@ class TestDApp {
await this.tapButton(this.nftSetApprovalForAllButton);
}
+ async tapERC1155SetApprovalForAllButton() {
+ await this.tapButton(this.erc1155SetApprovalForAllButton);
+ }
+
async tapConfirmButton() {
await Gestures.tap(this.confirmButtonText, 0);
}
+ async tapApproveButton() {
+ await Gestures.tap(this.approveButtonText, 0);
+ }
+
+ async tapSendFailingTransactionButton() {
+ await this.tapButton(this.sendFailingTransactionButton);
+ }
+
+ async tapERC1155BatchTransferButton() {
+ await this.tapButton(this.erc1155BatchTransferButton);
+ }
+
async tapButton(elementId) {
await Gestures.scrollToWebViewPort(elementId);
await Gestures.tapWebElement(elementId);
diff --git a/e2e/pages/ErrorBoundaryView/ErrorBoundaryView.js b/e2e/pages/ErrorBoundaryView/ErrorBoundaryView.js
new file mode 100644
index 00000000000..7368f183b15
--- /dev/null
+++ b/e2e/pages/ErrorBoundaryView/ErrorBoundaryView.js
@@ -0,0 +1,21 @@
+import Matchers from '../../utils/Matchers';
+import Gestures from '../../utils/Gestures';
+import { ErrorBoundarySelectorsText } from '../../selectors/ErrorBoundary/ErrorBoundaryView.selectors';
+
+class ErrorBoundaryView {
+ get title() {
+ return Matchers.getElementByText(ErrorBoundarySelectorsText.TITLE);
+ }
+
+ get srpLinkText() {
+ return Matchers.getElementByText(
+ ErrorBoundarySelectorsText.SAVE_YOUR_SRP_TEXT,
+ );
+ }
+
+ async tapSRPLinkText() {
+ await Gestures.waitAndTap(this.srpLinkText);
+ }
+}
+
+export default new ErrorBoundaryView();
diff --git a/e2e/pages/Network/NetworkAddedBottomSheet.js b/e2e/pages/Network/NetworkAddedBottomSheet.js
index 0bb721b3ccc..ca841c6fb2d 100644
--- a/e2e/pages/Network/NetworkAddedBottomSheet.js
+++ b/e2e/pages/Network/NetworkAddedBottomSheet.js
@@ -13,23 +13,15 @@ class NetworkAddedBottomSheet {
}
get switchNetworkButton() {
- return device.getPlatform() === 'android'
- ? Matchers.getElementByLabel(
- NetworkAddedBottomSheetSelectorsIDs.SWITCH_NETWORK_BUTTON,
- )
- : Matchers.getElementByID(
- NetworkAddedBottomSheetSelectorsIDs.SWITCH_NETWORK_BUTTON,
- );
+ return Matchers.getElementByID(
+ NetworkAddedBottomSheetSelectorsIDs.SWITCH_NETWORK_BUTTON,
+ );
}
get closeNetworkButton() {
- return device.getPlatform() === 'android'
- ? Matchers.getElementByLabel(
- NetworkAddedBottomSheetSelectorsIDs.CLOSE_NETWORK_BUTTON,
- )
- : Matchers.getElementByID(
- NetworkAddedBottomSheetSelectorsIDs.CLOSE_NETWORK_BUTTON,
- );
+ return Matchers.getElementByID(
+ NetworkAddedBottomSheetSelectorsIDs.CLOSE_NETWORK_BUTTON,
+ );
}
async tapSwitchToNetwork() {
diff --git a/e2e/pages/Network/NetworkApprovalBottomSheet.js b/e2e/pages/Network/NetworkApprovalBottomSheet.js
index be0402572d9..ce236d533a5 100644
--- a/e2e/pages/Network/NetworkApprovalBottomSheet.js
+++ b/e2e/pages/Network/NetworkApprovalBottomSheet.js
@@ -4,7 +4,9 @@ import Gestures from '../../utils/Gestures';
class NetworkApprovalBottomSheet {
get container() {
- return Matchers.getElementByID(NetworkApprovalBottomSheetSelectorsIDs.CONTAINER);
+ return Matchers.getElementByID(
+ NetworkApprovalBottomSheetSelectorsIDs.CONTAINER,
+ );
}
get approvedButton() {
@@ -12,6 +14,11 @@ class NetworkApprovalBottomSheet {
NetworkApprovalBottomSheetSelectorsIDs.APPROVE_BUTTON,
);
}
+ get cancelButton() {
+ return Matchers.getElementByID(
+ NetworkApprovalBottomSheetSelectorsIDs.CANCEL_BUTTON,
+ );
+ }
get displayName() {
return Matchers.getElementByID(
@@ -22,6 +29,9 @@ class NetworkApprovalBottomSheet {
async tapApproveButton() {
await Gestures.tap(this.approvedButton);
}
+ async tapCancelButton() {
+ await Gestures.tap(this.cancelButton);
+ }
}
export default new NetworkApprovalBottomSheet();
diff --git a/e2e/pages/Ramps/BuildQuoteView.js b/e2e/pages/Ramps/BuildQuoteView.js
index 407abb8177d..e7bcd2f1ba1 100644
--- a/e2e/pages/Ramps/BuildQuoteView.js
+++ b/e2e/pages/Ramps/BuildQuoteView.js
@@ -22,6 +22,10 @@ class BuildQuoteView {
async tapCancelButton() {
await Gestures.waitAndTap(this.cancelButton);
}
+ async tapDefaultToken(token) {
+ const tokenName = await Matchers.getElementByText(token);
+ await Gestures.waitAndTap(tokenName);
+ }
}
export default new BuildQuoteView();
diff --git a/e2e/pages/Ramps/TokenSelectBottomSheet.js b/e2e/pages/Ramps/TokenSelectBottomSheet.js
new file mode 100644
index 00000000000..0625e6bcf0c
--- /dev/null
+++ b/e2e/pages/Ramps/TokenSelectBottomSheet.js
@@ -0,0 +1,12 @@
+import Matchers from '../../utils/Matchers';
+import Gestures from '../../utils/Gestures';
+
+class TokenSelectBottomSheet {
+ async tapTokenByName(token) {
+ const tokenName = await Matchers.getElementByText(token);
+
+ await Gestures.waitAndTap(tokenName);
+ }
+}
+
+export default new TokenSelectBottomSheet();
diff --git a/e2e/resources/blacklistURLs.json b/e2e/resources/blacklistURLs.json
index e8b620c8ca8..f337d71278b 100644
--- a/e2e/resources/blacklistURLs.json
+++ b/e2e/resources/blacklistURLs.json
@@ -14,6 +14,10 @@
".*phishing-detection.cx.metamask.io/.*",
".*eth.llamarpc.com/.*",
".*token-api.metaswap.codefi.network/.*",
- ".*gas.api.cx.metamask.io/networks/*"
+ ".*gas.api.cx.metamask.io/networks/.*",
+ ".*clients3.google.com/generate_204.*",
+ ".*pulse.walletconnect.org/batch.*",
+ ".*accounts.api.cx.metamask.io/v2/accounts/.*",
+ ".*exp.host/--/api/v2/development-sessions/.*"
]
}
diff --git a/e2e/resources/networks.e2e.js b/e2e/resources/networks.e2e.js
index 1cd7b4eb927..8480ea55e74 100644
--- a/e2e/resources/networks.e2e.js
+++ b/e2e/resources/networks.e2e.js
@@ -10,7 +10,7 @@ const PopularNetworksList = {
type: 'rpc',
chainId: toHex('43114'),
rpcUrl: 'https://api.avax.network/ext/bc/C/rpc',
- nickname: 'Avalanche Mainnet C-Chain',
+ nickname: 'Avalanche C-Chain',
ticker: 'AVAX',
},
},
@@ -46,7 +46,7 @@ const PopularNetworksList = {
type: 'rpc',
chainId: toHex('10'),
rpcUrl: `https://optimism-mainnet.infura.io/v3/${infuraProjectId}`,
- nickname: 'Optimism',
+ nickname: 'OP Mainnet',
ticker: 'ETH',
},
},
diff --git a/e2e/selectors/Browser/ContractApprovalBottomSheet.selectors.js b/e2e/selectors/Browser/ContractApprovalBottomSheet.selectors.js
index 39ee13229f7..d469fbfed79 100644
--- a/e2e/selectors/Browser/ContractApprovalBottomSheet.selectors.js
+++ b/e2e/selectors/Browser/ContractApprovalBottomSheet.selectors.js
@@ -6,6 +6,7 @@ export const ContractApprovalBottomSheetSelectorsText = {
APPROVE: enContent.transactions.tx_review_approve,
REJECT: enContent.transaction.reject,
NEXT: enContent.transaction.next,
+ CONFIRM: enContent.transaction.confirm,
};
export const ContractApprovalBottomSheetSelectorsIDs = {
diff --git a/e2e/selectors/Browser/TestDapp.selectors.js b/e2e/selectors/Browser/TestDapp.selectors.js
index 0f2b7cad254..f2449607808 100644
--- a/e2e/selectors/Browser/TestDapp.selectors.js
+++ b/e2e/selectors/Browser/TestDapp.selectors.js
@@ -1,14 +1,18 @@
export const TestDappSelectorsWebIDs = {
- APPROVE_TOKENS_BUTTON_ID: 'approveTokens',
+ APPROVE_ERC_20_TOKENS_BUTTON_ID: 'approveTokens',
+ APPROVE_ERC_721_TOKEN_BUTTON_ID: 'approveButton',
CONNECT_BUTTON: 'connectButton',
ERC_20_SEND_TOKENS_TRANSFER_TOKENS_BUTTON_ID: 'transferTokens',
INCREASE_ALLOWANCE_BUTTON_ID: 'increaseTokenAllowance',
NFT_TRANSFER_FROM_BUTTON_ID: 'transferFromButton',
PERSONAL_SIGN: 'personalSign',
- SET_APPROVAL_FOR_ALL_BUTTON_ID: 'setApprovalForAllButton',
+ SET_APPROVAL_FOR_ALL_NFT_BUTTON_ID: 'setApprovalForAllButton',
+ SET_APPROVAL_FOR_ALL_ERC1155_BUTTON_ID: 'setApprovalForAllERC1155Button',
SIGN_TYPE_DATA: 'signTypedData',
SIGN_TYPE_DATA_V3: 'signTypedDataV3',
SIGN_TYPE_DATA_V4: 'signTypedDataV4',
ETHEREUM_SIGN: 'siwe',
ADD_TOKENS_TO_WALLET_BUTTON: 'watchAssets',
+ SEND_FAILING_TRANSACTION_BUTTON_ID: 'sendFailingButton',
+ BATCH_TRANSFER_ERC1155_BUTTON_ID: 'batchTransferFromButton',
};
diff --git a/e2e/selectors/ErrorBoundary/ErrorBoundaryView.selectors.js b/e2e/selectors/ErrorBoundary/ErrorBoundaryView.selectors.js
new file mode 100644
index 00000000000..fdad2454ec5
--- /dev/null
+++ b/e2e/selectors/ErrorBoundary/ErrorBoundaryView.selectors.js
@@ -0,0 +1,9 @@
+import enContent from '../../../locales/languages/en.json';
+
+export const ErrorBoundarySelectorsIDs = {
+ CONTAINER: 'error-boundary-container-id',
+};
+export const ErrorBoundarySelectorsText = {
+ SAVE_YOUR_SRP_TEXT: enContent.error_screen.save_seedphrase_2,
+ TITLE: enContent.error_screen.title,
+};
diff --git a/e2e/selectors/Transactions/ActivitiesView.selectors.js b/e2e/selectors/Transactions/ActivitiesView.selectors.js
index 50a3cb95384..b7e9c7f1fe5 100644
--- a/e2e/selectors/Transactions/ActivitiesView.selectors.js
+++ b/e2e/selectors/Transactions/ActivitiesView.selectors.js
@@ -10,10 +10,13 @@ export const ActivitiesViewSelectorsIDs = {
export const ActivitiesViewSelectorsText = {
CONFIRM_TEXT: enContent.transaction.confirmed,
+ FAILED_TEXT: enContent.transaction.failed,
+ SMART_CONTRACT_INTERACTION: enContent.transactions.smart_contract_interaction,
INCREASE_ALLOWANCE_METHOD: enContent.transactions.increase_allowance,
SENT_COLLECTIBLE_MESSAGE_TEXT: enContent.transactions.sent_collectible,
SENT_TOKENS_MESSAGE_TEXT: (unit) => getSentUnitMessage(unit),
SET_APPROVAL_FOR_ALL_METHOD: enContent.transactions.set_approval_for_all,
SWAP: enContent.swaps.transaction_label.swap,
TITLE: enContent.transactions_view.title,
+
};
diff --git a/e2e/specs/accounts/error-boundary-srp-backup.spec.js b/e2e/specs/accounts/error-boundary-srp-backup.spec.js
new file mode 100644
index 00000000000..667bd1b21a5
--- /dev/null
+++ b/e2e/specs/accounts/error-boundary-srp-backup.spec.js
@@ -0,0 +1,56 @@
+'use strict';
+import Browser from '../../pages/Browser/BrowserView';
+import TabBarComponent from '../../pages/wallet/TabBarComponent';
+import { loginToApp } from '../../viewHelper';
+import TestDApp from '../../pages/Browser/TestDApp';
+import FixtureBuilder from '../../fixtures/fixture-builder';
+import {
+ withFixtures,
+ defaultGanacheOptions,
+} from '../../fixtures/fixture-helper';
+import { SmokeAccounts } from '../../tags';
+import TestHelpers from '../../helpers';
+import Assertions from '../../utils/Assertions';
+import RevealSecretRecoveryPhrase from '../../pages/Settings/SecurityAndPrivacy/RevealSecretRecoveryPhrase';
+import ErrorBoundaryView from '../../pages/ErrorBoundaryView/ErrorBoundaryView';
+const PASSWORD = '123123123';
+
+describe(SmokeAccounts('Error Boundary Screen'), () => {
+ beforeAll(async () => {
+ jest.setTimeout(2500000);
+ await TestHelpers.reverseServerPort();
+ });
+
+ it('should trigger error boundary screen to reveal SRP', async () => {
+ await withFixtures(
+ {
+ dapp: true,
+ fixture: new FixtureBuilder()
+ .withGanacheNetwork()
+ .withPermissionControllerConnectedToTestDapp()
+ .build(),
+ restartDevice: true,
+ ganacheOptions: defaultGanacheOptions,
+ },
+ async () => {
+ await loginToApp();
+
+ await TabBarComponent.tapBrowser();
+ await Browser.navigateToTestDApp();
+
+ await TestDApp.tapInvalidSigButton();
+ await Assertions.checkIfVisible(ErrorBoundaryView.title);
+ await ErrorBoundaryView.tapSRPLinkText();
+
+ await RevealSecretRecoveryPhrase.enterPasswordToRevealSecretCredential(
+ PASSWORD,
+ );
+ // If the following step fails, ensure you are using a test build with tap and hold to reveal animation disabled
+ await RevealSecretRecoveryPhrase.tapToReveal();
+ await Assertions.checkIfVisible(RevealSecretRecoveryPhrase.container);
+
+ await Assertions.checkIfTextIsDisplayed(defaultGanacheOptions.mnemonic);
+ },
+ );
+ });
+});
diff --git a/e2e/specs/multichain/assets/asset-list.spec.js b/e2e/specs/assets/multichain/asset-list.spec.js
similarity index 98%
rename from e2e/specs/multichain/assets/asset-list.spec.js
rename to e2e/specs/assets/multichain/asset-list.spec.js
index d33360a7f6f..042723d44d9 100644
--- a/e2e/specs/multichain/assets/asset-list.spec.js
+++ b/e2e/specs/assets/multichain/asset-list.spec.js
@@ -1,6 +1,6 @@
// 'persists the preferred asset list preference when changing networks'
-import { SmokeMultiChain } from '../../../tags';
+import { SmokeAssets } from '../../../tags';
import WalletView from '../../../pages/wallet/WalletView';
import FixtureBuilder from '../../../fixtures/fixture-builder';
import {
@@ -26,7 +26,7 @@ const ETHEREUM_NAME = 'Ethereum';
const AVAX_NAME = 'AVAX';
const BNB_NAME = 'BNB';
-describe(SmokeMultiChain('Import Tokens'), () => {
+describe(SmokeAssets('Import Tokens'), () => {
beforeAll(async () => {
await TestHelpers.reverseServerPort();
const fixture = new FixtureBuilder().withPopularNetworks().build();
diff --git a/e2e/specs/confirmations/approve-custom-erc20.spec.js b/e2e/specs/confirmations/approve-custom-erc20.spec.js
index 1c8d9e96383..ed24c9c3c6a 100644
--- a/e2e/specs/confirmations/approve-custom-erc20.spec.js
+++ b/e2e/specs/confirmations/approve-custom-erc20.spec.js
@@ -48,7 +48,7 @@ describe(SmokeConfirmations('ERC20 tokens'), () => {
await TestDApp.navigateToTestDappWithContract({
contractAddress: hstAddress,
});
- await TestDApp.tapApproveButton();
+ await TestDApp.tapApproveERC20TokensButton();
//Input custom token amount
await Assertions.checkIfVisible(
diff --git a/e2e/specs/confirmations/approve-default-erc20.spec.js b/e2e/specs/confirmations/approve-default-erc20.spec.js
index ed9c02188c5..ca7a2889a0f 100644
--- a/e2e/specs/confirmations/approve-default-erc20.spec.js
+++ b/e2e/specs/confirmations/approve-default-erc20.spec.js
@@ -50,7 +50,7 @@ describe(SmokeConfirmations('ERC20 tokens'), () => {
await TestDApp.navigateToTestDappWithContract({
contractAddress: hstAddress,
});
- await TestDApp.tapApproveButton();
+ await TestDApp.tapApproveERC20TokensButton();
await Assertions.checkIfVisible(
ContractApprovalBottomSheet.approveTokenAmount,
diff --git a/e2e/specs/confirmations/approve-erc721.spec.js b/e2e/specs/confirmations/approve-erc721.spec.js
new file mode 100644
index 00000000000..d06a16d4909
--- /dev/null
+++ b/e2e/specs/confirmations/approve-erc721.spec.js
@@ -0,0 +1,61 @@
+'use strict';
+
+import { SmokeConfirmations } from '../../tags';
+import TestHelpers from '../../helpers';
+import { loginToApp } from '../../viewHelper';
+
+import TabBarComponent from '../../pages/wallet/TabBarComponent';
+import TestDApp from '../../pages/Browser/TestDApp';
+import FixtureBuilder from '../../fixtures/fixture-builder';
+import {
+ withFixtures,
+ defaultGanacheOptions,
+} from '../../fixtures/fixture-helper';
+import { SMART_CONTRACTS } from '../../../app/util/test/smart-contracts';
+import { ActivitiesViewSelectorsText } from '../../selectors/Transactions/ActivitiesView.selectors';
+import Assertions from '../../utils/Assertions';
+
+describe(SmokeConfirmations('ERC721 tokens'), () => {
+ const NFT_CONTRACT = SMART_CONTRACTS.NFTS;
+
+ beforeAll(async () => {
+ jest.setTimeout(150000);
+ await TestHelpers.reverseServerPort();
+ });
+
+ it('approve an ERC721 token from a dapp', async () => {
+ await withFixtures(
+ {
+ dapp: true,
+ fixture: new FixtureBuilder()
+ .withGanacheNetwork()
+ .withPermissionControllerConnectedToTestDapp()
+ .build(),
+ restartDevice: true,
+ ganacheOptions: defaultGanacheOptions,
+ smartContract: NFT_CONTRACT,
+ },
+ async ({ contractRegistry }) => {
+ const nftsAddress = await contractRegistry.getContractAddress(
+ NFT_CONTRACT,
+ );
+ await loginToApp();
+ // Navigate to the browser screen
+ await TabBarComponent.tapBrowser();
+ await TestDApp.navigateToTestDappWithContract({
+ contractAddress: nftsAddress,
+ });
+ // Approve NFT
+ await TestDApp.tapApproveERC721TokenButton();
+ await TestHelpers.delay(3000);
+ await TestDApp.tapApproveButton();
+ // Navigate to the activity screen
+ await TabBarComponent.tapActivity();
+ // Assert NFT is approved
+ await Assertions.checkIfTextIsDisplayed(
+ ActivitiesViewSelectorsText.CONFIRM_TEXT,
+ );
+ },
+ );
+ });
+});
diff --git a/e2e/specs/confirmations/batch-transfer-erc1155.spec.js b/e2e/specs/confirmations/batch-transfer-erc1155.spec.js
new file mode 100644
index 00000000000..b7ed8494d16
--- /dev/null
+++ b/e2e/specs/confirmations/batch-transfer-erc1155.spec.js
@@ -0,0 +1,73 @@
+'use strict';
+
+import { SmokeConfirmations } from '../../tags';
+import TestHelpers from '../../helpers';
+import { loginToApp } from '../../viewHelper';
+
+import TabBarComponent from '../../pages/wallet/TabBarComponent';
+import TestDApp from '../../pages/Browser/TestDApp';
+import FixtureBuilder from '../../fixtures/fixture-builder';
+import {
+ withFixtures,
+ defaultGanacheOptions,
+} from '../../fixtures/fixture-helper';
+import { SMART_CONTRACTS } from '../../../app/util/test/smart-contracts';
+import { ActivitiesViewSelectorsText } from '../../selectors/Transactions/ActivitiesView.selectors';
+import Assertions from '../../utils/Assertions';
+import { ContractApprovalBottomSheetSelectorsText } from '../../selectors/Browser/ContractApprovalBottomSheet.selectors';
+import ContractApprovalBottomSheet from '../../pages/Browser/ContractApprovalBottomSheet';
+
+describe(SmokeConfirmations('ERC1155 token'), () => {
+ const ERC1155_CONTRACT = SMART_CONTRACTS.ERC1155;
+
+ beforeAll(async () => {
+ await TestHelpers.reverseServerPort();
+ });
+
+ it('batch transfer ERC1155 tokens', async () => {
+ await withFixtures(
+ {
+ dapp: true,
+ fixture: new FixtureBuilder()
+ .withGanacheNetwork()
+ .withPermissionControllerConnectedToTestDapp()
+ .build(),
+ restartDevice: true,
+ ganacheOptions: defaultGanacheOptions,
+ smartContract: ERC1155_CONTRACT,
+ },
+ async ({ contractRegistry }) => {
+ const erc1155Address = await contractRegistry.getContractAddress(
+ ERC1155_CONTRACT,
+ );
+ await loginToApp();
+
+ // Navigate to the browser screen
+ await TabBarComponent.tapBrowser();
+ await TestDApp.navigateToTestDappWithContract({
+ contractAddress: erc1155Address,
+ });
+
+ // Send batch transfer for ERC1155 tokens
+ await TestDApp.tapERC1155BatchTransferButton();
+ await Assertions.checkIfTextIsDisplayed(
+ ContractApprovalBottomSheetSelectorsText.CONFIRM,
+ );
+
+ // Tap confirm button
+ await ContractApprovalBottomSheet.tapConfirmButton();
+
+ // Navigate to the activity screen
+ await TabBarComponent.tapActivity();
+
+ // Assert that the ERC1155 activity is an smart contract interaction and it is confirmed
+ await Assertions.checkIfTextIsDisplayed(
+ ActivitiesViewSelectorsText.SMART_CONTRACT_INTERACTION,
+ );
+ await Assertions.checkIfTextIsDisplayed(
+ ActivitiesViewSelectorsText.CONFIRM_TEXT,
+ );
+ },
+ );
+ });
+});
diff --git a/e2e/specs/confirmations/send-failing-contract.spec.js b/e2e/specs/confirmations/send-failing-contract.spec.js
new file mode 100644
index 00000000000..dac0b112d01
--- /dev/null
+++ b/e2e/specs/confirmations/send-failing-contract.spec.js
@@ -0,0 +1,77 @@
+'use strict';
+
+import { SmokeConfirmations } from '../../tags';
+import TestHelpers from '../../helpers';
+import { loginToApp } from '../../viewHelper';
+
+import TabBarComponent from '../../pages/wallet/TabBarComponent';
+import TestDApp from '../../pages/Browser/TestDApp';
+import FixtureBuilder from '../../fixtures/fixture-builder';
+import {
+ withFixtures,
+ defaultGanacheOptions,
+} from '../../fixtures/fixture-helper';
+import { SMART_CONTRACTS } from '../../../app/util/test/smart-contracts';
+import { ActivitiesViewSelectorsText } from '../../selectors/Transactions/ActivitiesView.selectors';
+import Assertions from '../../utils/Assertions';
+import { mockEvents } from '../../api-mocking/mock-config/mock-events';
+
+describe(SmokeConfirmations('Failing contracts'), () => {
+ const FAILING_CONTRACT = SMART_CONTRACTS.FAILING;
+
+ beforeAll(async () => {
+ jest.setTimeout(150000);
+ await TestHelpers.reverseServerPort();
+ });
+
+ it('sends a failing contract transaction', async () => {
+
+ const testSpecificMock = {
+ GET: [
+ mockEvents.GET.suggestedGasFeesApiGanache
+ ],
+ };
+ await withFixtures(
+ {
+ dapp: true,
+ fixture: new FixtureBuilder()
+ .withGanacheNetwork()
+ .withPermissionControllerConnectedToTestDapp()
+ .build(),
+ restartDevice: true,
+ ganacheOptions: defaultGanacheOptions,
+ smartContract: FAILING_CONTRACT,
+ testSpecificMock,
+ },
+ async ({ contractRegistry }) => {
+ const failingAddress = await contractRegistry.getContractAddress(
+ FAILING_CONTRACT,
+ );
+ await loginToApp();
+
+ // Navigate to the browser screen
+ await TabBarComponent.tapBrowser();
+ await TestDApp.navigateToTestDappWithContract({
+ contractAddress: failingAddress,
+ });
+
+ // Send a failing transaction
+ await TestDApp.tapSendFailingTransactionButton();
+ await TestHelpers.delay(3000);
+
+ await TestDApp.tapConfirmButton();
+
+ // Navigate to the activity screen
+ await TabBarComponent.tapActivity();
+
+ // Assert the failed transaction is displayed
+ await Assertions.checkIfTextIsDisplayed(
+ ActivitiesViewSelectorsText.SMART_CONTRACT_INTERACTION
+ );
+ await Assertions.checkIfTextIsDisplayed(
+ ActivitiesViewSelectorsText.FAILED_TEXT
+ );
+ },
+ );
+ });
+});
diff --git a/e2e/specs/confirmations/send-to-contract-address.spec.js b/e2e/specs/confirmations/send-to-contract-address.spec.js
new file mode 100644
index 00000000000..ddcbad62bc9
--- /dev/null
+++ b/e2e/specs/confirmations/send-to-contract-address.spec.js
@@ -0,0 +1,70 @@
+'use strict';
+
+import { SmokeConfirmations } from '../../tags';
+import AmountView from '../../pages/Send/AmountView';
+import SendView from '../../pages/Send/SendView';
+import TransactionConfirmationView from '../../pages/Send/TransactionConfirmView';
+import { loginToApp } from '../../viewHelper';
+import WalletActionsBottomSheet from '../../pages/wallet/WalletActionsBottomSheet';
+
+import TestHelpers from '../../helpers';
+import FixtureBuilder from '../../fixtures/fixture-builder';
+import {
+ withFixtures,
+ defaultGanacheOptions,
+} from '../../fixtures/fixture-helper';
+import {
+ SMART_CONTRACTS,
+ contractConfiguration,
+} from '../../../app/util/test/smart-contracts';
+import { ActivitiesViewSelectorsText } from '../../selectors/Transactions/ActivitiesView.selectors';
+
+import TabBarComponent from '../../pages/wallet/TabBarComponent';
+import Assertions from '../../utils/Assertions';
+
+const HST_CONTRACT = SMART_CONTRACTS.HST;
+
+describe(SmokeConfirmations('Send to contract address'), () => {
+ beforeAll(async () => {
+ jest.setTimeout(170000);
+ await TestHelpers.reverseServerPort();
+ });
+
+ it('should send ETH to a contract from inside the wallet', async () => {
+ const AMOUNT = '12';
+
+ await withFixtures(
+ {
+ dapp: true,
+ fixture: new FixtureBuilder().withGanacheNetwork().build(),
+ restartDevice: true,
+ ganacheOptions: defaultGanacheOptions,
+ smartContract: HST_CONTRACT,
+ },
+ async ({ contractRegistry }) => {
+ const hstAddress = await contractRegistry.getContractAddress(
+ HST_CONTRACT,
+ );
+ await loginToApp();
+
+ await TabBarComponent.tapActions();
+ await WalletActionsBottomSheet.tapSendButton();
+
+ await SendView.inputAddress(hstAddress);
+ await SendView.tapNextButton();
+
+ await Assertions.checkIfVisible(AmountView.title);
+
+ await AmountView.typeInTransactionAmount(AMOUNT);
+ await AmountView.tapNextButton();
+
+ await TransactionConfirmationView.tapConfirmButton();
+ await TabBarComponent.tapActivity();
+
+ await Assertions.checkIfTextIsDisplayed(
+ ActivitiesViewSelectorsText.SMART_CONTRACT_INTERACTION,
+ );
+ },
+ );
+ });
+});
diff --git a/e2e/specs/confirmations/set-approval-for-all-erc1155.spec.js b/e2e/specs/confirmations/set-approval-for-all-erc1155.spec.js
new file mode 100644
index 00000000000..8e646db9efd
--- /dev/null
+++ b/e2e/specs/confirmations/set-approval-for-all-erc1155.spec.js
@@ -0,0 +1,73 @@
+'use strict';
+
+import { SmokeConfirmations } from '../../tags';
+import TestHelpers from '../../helpers';
+import { loginToApp } from '../../viewHelper';
+
+import TabBarComponent from '../../pages/wallet/TabBarComponent';
+import TestDApp from '../../pages/Browser/TestDApp';
+import FixtureBuilder from '../../fixtures/fixture-builder';
+import {
+ withFixtures,
+ defaultGanacheOptions,
+} from '../../fixtures/fixture-helper';
+import { SMART_CONTRACTS } from '../../../app/util/test/smart-contracts';
+import { ActivitiesViewSelectorsText } from '../../selectors/Transactions/ActivitiesView.selectors';
+import Assertions from '../../utils/Assertions';
+import { ContractApprovalBottomSheetSelectorsText } from '../../selectors/Browser/ContractApprovalBottomSheet.selectors';
+import ContractApprovalBottomSheet from '../../pages/Browser/ContractApprovalBottomSheet';
+
+describe(SmokeConfirmations('ERC1155 token'), () => {
+ const ERC1155_CONTRACT = SMART_CONTRACTS.ERC1155;
+
+ beforeAll(async () => {
+ await TestHelpers.reverseServerPort();
+ });
+
+ it('approve all ERC1155 tokens', async () => {
+ await withFixtures(
+ {
+ dapp: true,
+ fixture: new FixtureBuilder()
+ .withGanacheNetwork()
+ .withPermissionControllerConnectedToTestDapp()
+ .build(),
+ restartDevice: true,
+ ganacheOptions: defaultGanacheOptions,
+ smartContract: ERC1155_CONTRACT,
+ },
+ async ({ contractRegistry }) => {
+ const erc1155Address = await contractRegistry.getContractAddress(
+ ERC1155_CONTRACT,
+ );
+ await loginToApp();
+
+ // Navigate to the browser screen
+ await TabBarComponent.tapBrowser();
+ await TestDApp.navigateToTestDappWithContract({
+ contractAddress: erc1155Address,
+ });
+
+ // Set approval for all ERC1155 tokens
+ await TestDApp.tapERC1155SetApprovalForAllButton();
+ await Assertions.checkIfTextIsDisplayed(
+ ContractApprovalBottomSheetSelectorsText.APPROVE,
+ );
+
+ // Tap approve button
+ await ContractApprovalBottomSheet.tapApproveButton();
+
+ // Navigate to the activity screen
+ await TabBarComponent.tapActivity();
+
+ // Assert that the ERC1155 activity is an set approve for all and it is confirmed
+ await Assertions.checkIfTextIsDisplayed(
+ ActivitiesViewSelectorsText.SET_APPROVAL_FOR_ALL_METHOD,
+ );
+ await Assertions.checkIfTextIsDisplayed(
+ ActivitiesViewSelectorsText.CONFIRM_TEXT,
+ );
+ },
+ );
+ });
+});
diff --git a/e2e/specs/multichain/permissions/accounts/permission-system-revoke-multiple.spec.js b/e2e/specs/multichain/permissions/accounts/permission-system-revoke-multiple.spec.js
index 5a77d78a195..b73885b0910 100644
--- a/e2e/specs/multichain/permissions/accounts/permission-system-revoke-multiple.spec.js
+++ b/e2e/specs/multichain/permissions/accounts/permission-system-revoke-multiple.spec.js
@@ -11,17 +11,17 @@ import { loginToApp } from '../../../../viewHelper';
import FixtureBuilder from '../../../../fixtures/fixture-builder';
import { withFixtures } from '../../../../fixtures/fixture-helper';
import Assertions from '../../../../utils/Assertions';
-import { SmokeMultiChain } from '../../../../tags';
+import { SmokeMultiChainPermissions } from '../../../../tags';
const AccountTwoText = 'Account 2';
-describe(SmokeMultiChain('Account Permission Management'), () => {
+describe(SmokeMultiChainPermissions('Account Permission Management'), () => {
beforeAll(async () => {
jest.setTimeout(150000);
await TestHelpers.reverseServerPort();
});
- it('allows connecting multiple accounts and revoking all permissions simultaneously', async () => {
+ it('revokes all account permissions simultaneously', async () => {
await withFixtures(
{
dapp: true,
diff --git a/e2e/specs/multichain/permissions/accounts/permission-system-revoke-single.spec.js b/e2e/specs/multichain/permissions/accounts/permission-system-revoke-single.spec.js
index f2435342826..d1c5a2f8002 100644
--- a/e2e/specs/multichain/permissions/accounts/permission-system-revoke-single.spec.js
+++ b/e2e/specs/multichain/permissions/accounts/permission-system-revoke-single.spec.js
@@ -1,6 +1,6 @@
'use strict';
import TestHelpers from '../../../../helpers';
-import { SmokeMultiChain } from '../../../../tags';
+import { SmokeMultiChainPermissions } from '../../../../tags';
import Browser from '../../../../pages/Browser/BrowserView';
import TabBarComponent from '../../../../pages/wallet/TabBarComponent';
import NetworkListModal from '../../../../pages/Network/NetworkListModal';
@@ -10,7 +10,7 @@ import { withFixtures } from '../../../../fixtures/fixture-helper';
import { loginToApp } from '../../../../viewHelper';
import Assertions from '../../../../utils/Assertions';
-describe(SmokeMultiChain('Account Permission Management'), () => {
+describe(SmokeMultiChainPermissions('Account Permission Management'), () => {
beforeAll(async () => {
jest.setTimeout(150000);
await TestHelpers.reverseServerPort();
diff --git a/e2e/specs/multichain/permissions/chains/permission-system-add-non-permitted.spec.js b/e2e/specs/multichain/permissions/chains/permission-system-add-non-permitted.spec.js
index 1553600b2c6..a33b641f342 100644
--- a/e2e/specs/multichain/permissions/chains/permission-system-add-non-permitted.spec.js
+++ b/e2e/specs/multichain/permissions/chains/permission-system-add-non-permitted.spec.js
@@ -1,4 +1,4 @@
-import { SmokeMultiChain } from '../../../../tags';
+import { SmokeMultiChainPermissions } from '../../../../tags';
import { loginToApp } from '../../../../viewHelper';
import WalletView from '../../../../pages/wallet/WalletView';
import NetworkListModal from '../../../../pages/Network/NetworkListModal';
@@ -22,7 +22,7 @@ const fixtureServer = new FixtureServer();
const SEPOLIA = CustomNetworks.Sepolia.providerConfig.nickname;
describe(
- SmokeMultiChain('Chain Permission System, non-permitted chain, '),
+ SmokeMultiChainPermissions('Chain Permission System, non-permitted chain, '),
() => {
beforeAll(async () => {
await TestHelpers.reverseServerPort();
@@ -102,7 +102,7 @@ describe(
);
});
- it('should add network permission when requested', async () => {
+ it.skip('should add network permission when requested', async () => {
await withFixtures(
{
dapp: true,
diff --git a/e2e/specs/multichain/permissions/chains/permission-system-discard-changes.spec.js b/e2e/specs/multichain/permissions/chains/permission-system-discard-changes.spec.js
index 5bcebcdc82a..fdbdcc39402 100644
--- a/e2e/specs/multichain/permissions/chains/permission-system-discard-changes.spec.js
+++ b/e2e/specs/multichain/permissions/chains/permission-system-discard-changes.spec.js
@@ -1,6 +1,6 @@
'use strict';
import TestHelpers from '../../../../helpers';
-import { SmokeMultiChain } from '../../../../tags';
+import { SmokeMultiChainPermissions } from '../../../../tags';
import Browser from '../../../../pages/Browser/BrowserView';
import TabBarComponent from '../../../../pages/wallet/TabBarComponent';
import ConnectedAccountsModal from '../../../../pages/Browser/ConnectedAccountsModal';
@@ -11,7 +11,7 @@ import Assertions from '../../../../utils/Assertions';
import NetworkConnectMultiSelector from '../../../../pages/Browser/NetworkConnectMultiSelector';
import NetworkNonPemittedBottomSheet from '../../../../pages/Network/NetworkNonPemittedBottomSheet';
-describe(SmokeMultiChain('Chain Permission Management'), () => {
+describe(SmokeMultiChainPermissions('Chain Permission Management'), () => {
beforeAll(async () => {
jest.setTimeout(150000);
await TestHelpers.reverseServerPort();
diff --git a/e2e/specs/multichain/permissions/chains/permission-system-initial-connection.spec.js b/e2e/specs/multichain/permissions/chains/permission-system-initial-connection.spec.js
index a6773893814..5e0659c1e57 100644
--- a/e2e/specs/multichain/permissions/chains/permission-system-initial-connection.spec.js
+++ b/e2e/specs/multichain/permissions/chains/permission-system-initial-connection.spec.js
@@ -1,6 +1,6 @@
'use strict';
import TestHelpers from '../../../../helpers';
-import { SmokeMultiChain } from '../../../../tags';
+import { SmokeMultiChainPermissions } from '../../../../tags';
import Browser from '../../../../pages/Browser/BrowserView';
import TabBarComponent from '../../../../pages/wallet/TabBarComponent';
import TestDApp from '../../../../pages/Browser/TestDApp';
@@ -13,7 +13,7 @@ import ConnectBottomSheet from '../../../../pages/Browser/ConnectBottomSheet';
import NetworkNonPemittedBottomSheet from '../../../../pages/Network/NetworkNonPemittedBottomSheet';
import NetworkConnectMultiSelector from '../../../../pages/Browser/NetworkConnectMultiSelector';
-describe(SmokeMultiChain('Chain Permission Management'), () => {
+describe(SmokeMultiChainPermissions('Chain Permission Management'), () => {
beforeAll(async () => {
jest.setTimeout(150000);
await TestHelpers.reverseServerPort();
diff --git a/e2e/specs/multichain/permissions/chains/permission-system-remove.spec.js b/e2e/specs/multichain/permissions/chains/permission-system-remove.spec.js
index e3e7ab3af4c..6c927a02e8f 100644
--- a/e2e/specs/multichain/permissions/chains/permission-system-remove.spec.js
+++ b/e2e/specs/multichain/permissions/chains/permission-system-remove.spec.js
@@ -1,6 +1,6 @@
'use strict';
import TestHelpers from '../../../../helpers';
-import { SmokeMultiChain } from '../../../../tags';
+import { SmokeMultiChainPermissions } from '../../../../tags';
import Browser from '../../../../pages/Browser/BrowserView';
import TabBarComponent from '../../../../pages/wallet/TabBarComponent';
@@ -18,7 +18,7 @@ import NetworkEducationModal from '../../../../pages/Network/NetworkEducationMod
import ConnectBottomSheet from '../../../../pages/Browser/ConnectBottomSheet';
import PermissionSummaryBottomSheet from '../../../../pages/Browser/PermissionSummaryBottomSheet';
-describe(SmokeMultiChain('Chain Permission Management'), () => {
+describe(SmokeMultiChainPermissions('Chain Permission Management'), () => {
beforeAll(async () => {
jest.setTimeout(150000);
await TestHelpers.reverseServerPort();
diff --git a/e2e/specs/multichain/permissions/chains/permission-system-revoke-single.spec.js b/e2e/specs/multichain/permissions/chains/permission-system-revoke-single.spec.js
index 720c8db2cb7..5129d70bdaa 100644
--- a/e2e/specs/multichain/permissions/chains/permission-system-revoke-single.spec.js
+++ b/e2e/specs/multichain/permissions/chains/permission-system-revoke-single.spec.js
@@ -1,6 +1,6 @@
'use strict';
import TestHelpers from '../../../../helpers';
-import { SmokeMultiChain } from '../../../../tags';
+import { SmokeMultiChainPermissions } from '../../../../tags';
import Browser from '../../../../pages/Browser/BrowserView';
import TabBarComponent from '../../../../pages/wallet/TabBarComponent';
import NetworkListModal from '../../../../pages/Network/NetworkListModal';
@@ -10,7 +10,7 @@ import { withFixtures } from '../../../../fixtures/fixture-helper';
import { loginToApp } from '../../../../viewHelper';
import Assertions from '../../../../utils/Assertions';
-describe(SmokeMultiChain('Chain Permission Management'), () => {
+describe(SmokeMultiChainPermissions('Chain Permission Management'), () => {
beforeAll(async () => {
jest.setTimeout(150000);
await TestHelpers.reverseServerPort();
diff --git a/e2e/specs/multichain/permissions/chains/permission-system-update-permissions.spec.js b/e2e/specs/multichain/permissions/chains/permission-system-update-permissions.spec.js
index a4b50516810..ebd1c583dd3 100644
--- a/e2e/specs/multichain/permissions/chains/permission-system-update-permissions.spec.js
+++ b/e2e/specs/multichain/permissions/chains/permission-system-update-permissions.spec.js
@@ -1,6 +1,6 @@
'use strict';
import TestHelpers from '../../../../helpers';
-import { SmokeMultiChain } from '../../../../tags';
+import { SmokeMultiChainPermissions } from '../../../../tags';
import Browser from '../../../../pages/Browser/BrowserView';
import TabBarComponent from '../../../../pages/wallet/TabBarComponent';
import ConnectedAccountsModal from '../../../../pages/Browser/ConnectedAccountsModal';
@@ -14,13 +14,14 @@ import { CustomNetworks } from '../../../../resources/networks.e2e';
import WalletView from '../../../../pages/wallet/WalletView';
import NetworkEducationModal from '../../../../pages/Network/NetworkEducationModal';
import PermissionSummaryBottomSheet from '../../../../pages/Browser/PermissionSummaryBottomSheet';
+import { NetworkNonPemittedBottomSheetSelectorsText } from '../../../../selectors/Network/NetworkNonPemittedBottomSheet.selectors';
-describe(SmokeMultiChain('Chain Permission Management'), () => {
+describe(SmokeMultiChainPermissions('Chain Permission Management'), () => {
beforeAll(async () => {
jest.setTimeout(150000);
await TestHelpers.reverseServerPort();
});
- it('allows simultaneous granting and revoking of multiple chain permissions', async () => {
+ it.skip('allows simultaneous granting and revoking of multiple chain permissions', async () => {
await withFixtures(
{
dapp: true,
@@ -54,14 +55,11 @@ describe(SmokeMultiChain('Chain Permission Management'), () => {
// Verify changes were saved by checking chain permissions again
await ConnectedAccountsModal.tapNavigateToEditNetworksPermissionsButton();
-
- // Deselect both networks to verify they were the only ones selected
- await NetworkNonPemittedBottomSheet.tapEthereumMainNetNetworkName();
- await NetworkNonPemittedBottomSheet.tapLineaSepoliaNetworkName();
-
- // Verify the disconnect all button appears (indicating no chains are selected)
- await Assertions.checkIfVisible(
- ConnectedAccountsModal.disconnectNetworksButton,
+ await NetworkConnectMultiSelector.isNetworkChainPermissionSelected(
+ NetworkNonPemittedBottomSheetSelectorsText.ETHEREUM_MAIN_NET_NETWORK_NAME,
+ );
+ await NetworkConnectMultiSelector.isNetworkChainPermissionSelected(
+ NetworkNonPemittedBottomSheetSelectorsText.LINEA_SEPOLIA_NETWORK_NAME,
);
},
);
diff --git a/e2e/specs/networks/add-custom-rpc.spec.js b/e2e/specs/networks/add-custom-rpc.spec.js
index cd8269aa2d2..d0d53ce26a5 100644
--- a/e2e/specs/networks/add-custom-rpc.spec.js
+++ b/e2e/specs/networks/add-custom-rpc.spec.js
@@ -20,7 +20,7 @@ import { CustomNetworks } from '../../resources/networks.e2e';
const fixtureServer = new FixtureServer();
-describe(SmokeCore('Custom RPC Tests'), () => {
+describe('Custom RPC Tests', () => {
beforeAll(async () => {
await TestHelpers.reverseServerPort();
const fixture = new FixtureBuilder().build();
diff --git a/e2e/specs/ramps/deeplink-to-buy-flow-with-unsupported-network.spec.js b/e2e/specs/ramps/deeplink-to-buy-flow-with-unsupported-network.spec.js
new file mode 100644
index 00000000000..329df8acd11
--- /dev/null
+++ b/e2e/specs/ramps/deeplink-to-buy-flow-with-unsupported-network.spec.js
@@ -0,0 +1,62 @@
+'use strict';
+import TestHelpers from '../../helpers';
+
+import { loginToApp } from '../../viewHelper';
+import { withFixtures } from '../../fixtures/fixture-helper';
+import { SmokeRamps } from '../../tags';
+import FixtureBuilder from '../../fixtures/fixture-builder';
+
+import SellGetStartedView from '../../pages/Ramps/SellGetStartedView';
+import BuyGetStartedView from '../../pages/Ramps/BuyGetStartedView';
+
+import Assertions from '../../utils/Assertions';
+import NetworkAddedBottomSheet from '../../pages/Network/NetworkAddedBottomSheet';
+import NetworkApprovalBottomSheet from '../../pages/Network/NetworkApprovalBottomSheet';
+import NetworkEducationModal from '../../pages/Network/NetworkEducationModal';
+import NetworkListModal from '../../pages/Network/NetworkListModal';
+import { PopularNetworksList } from '../../resources/networks.e2e';
+
+describe(SmokeRamps('Buy Crypto Deeplinks'), () => {
+ beforeAll(async () => {
+ await TestHelpers.reverseServerPort();
+ });
+
+ beforeEach(async () => {
+ jest.setTimeout(150000);
+ });
+
+ it('should deep link to onramp to unsupported network', async () => {
+ const BuyDeepLink = 'metamask://buy?chainId=2';
+
+ await withFixtures(
+ {
+ fixture: new FixtureBuilder().withRampsSelectedRegion().build(),
+ restartDevice: true,
+ },
+ async () => {
+ await loginToApp();
+ await device.sendToHome();
+ await device.launchApp({
+ url: BuyDeepLink,
+ });
+
+ await Assertions.checkIfVisible(
+ await SellGetStartedView.getStartedButton,
+ );
+
+ await BuyGetStartedView.tapGetStartedButton();
+
+ await Assertions.checkIfTextIsDisplayed('Unsupported buy Network');
+ await NetworkListModal.changeNetworkTo(
+ PopularNetworksList.Avalanche.providerConfig.nickname,
+ );
+ await NetworkApprovalBottomSheet.tapApproveButton();
+ await NetworkAddedBottomSheet.tapCloseButton();
+ await Assertions.checkIfVisible(NetworkEducationModal.container);
+ await NetworkEducationModal.tapGotItButton();
+ await Assertions.checkIfTextIsNotDisplayed('Unsupported buy Network');
+ await Assertions.checkIfTextIsDisplayed('Avalanche');
+ },
+ );
+ });
+});
diff --git a/e2e/specs/ramps/deeplink-to-buy-flow.spec.js b/e2e/specs/ramps/deeplink-to-buy-flow.spec.js
new file mode 100644
index 00000000000..df9a62b634e
--- /dev/null
+++ b/e2e/specs/ramps/deeplink-to-buy-flow.spec.js
@@ -0,0 +1,91 @@
+'use strict';
+import TestHelpers from '../../helpers';
+
+import { loginToApp } from '../../viewHelper';
+import { withFixtures } from '../../fixtures/fixture-helper';
+import { SmokeRamps } from '../../tags';
+import FixtureBuilder from '../../fixtures/fixture-builder';
+
+import SellGetStartedView from '../../pages/Ramps/SellGetStartedView';
+import BuyGetStartedView from '../../pages/Ramps/BuyGetStartedView';
+
+import BuildQuoteView from '../../pages/Ramps/BuildQuoteView';
+import TokenSelectBottomSheet from '../../pages/Ramps/TokenSelectBottomSheet';
+import Assertions from '../../utils/Assertions';
+
+import { PopularNetworksList } from '../../resources/networks.e2e';
+import NetworkEducationModal from '../../pages/Network/NetworkEducationModal';
+describe(SmokeRamps('Buy Crypto Deeplinks'), () => {
+ beforeAll(async () => {
+ await TestHelpers.reverseServerPort();
+ });
+
+ beforeEach(async () => {
+ jest.setTimeout(150000);
+ });
+ it('should deep link to onramp ETH', async () => {
+ const buyLink = 'metamask://buy?chainId=1&amount=275';
+
+ await withFixtures(
+ {
+ fixture: new FixtureBuilder()
+ .withRampsSelectedPaymentMethod()
+ .withRampsSelectedRegion()
+ .build(),
+ restartDevice: true,
+ },
+ async () => {
+ await loginToApp();
+ await device.sendToHome();
+ await device.launchApp({
+ url: buyLink,
+ });
+ await Assertions.checkIfVisible(
+ await SellGetStartedView.getStartedButton,
+ );
+
+ await BuyGetStartedView.tapGetStartedButton();
+ await Assertions.checkIfVisible(BuildQuoteView.getQuotesButton);
+ await BuildQuoteView.tapDefaultToken('Ethereum');
+
+ await TokenSelectBottomSheet.tapTokenByName('DAI');
+ await Assertions.checkIfTextIsDisplayed('Dai Stablecoin');
+ await Assertions.checkIfTextIsDisplayed('$275');
+ },
+ );
+ });
+ it('should deep link to onramp on Base network', async () => {
+ const BuyDeepLink =
+ 'metamask://buy?chainId=8453&address=0x833589fcd6edb6e08f4c7c32d4f71b54bda02913&amount=12';
+
+ await withFixtures(
+ {
+ fixture: new FixtureBuilder()
+ .withPopularNetworks()
+ .withRampsSelectedRegion()
+ .build(),
+ restartDevice: true,
+ },
+ async () => {
+ await loginToApp();
+ await device.sendToHome();
+ await device.launchApp({
+ url: BuyDeepLink,
+ });
+
+ await Assertions.checkIfVisible(
+ await SellGetStartedView.getStartedButton,
+ );
+
+ await BuyGetStartedView.tapGetStartedButton();
+
+ await Assertions.checkIfVisible(NetworkEducationModal.container);
+ await NetworkEducationModal.tapGotItButton();
+ await Assertions.checkIfTextIsDisplayed('USD Coin');
+ await Assertions.checkIfTextIsDisplayed(
+ PopularNetworksList.Base.providerConfig.nickname,
+ );
+ },
+ );
+ });
+});
diff --git a/e2e/specs/ramps/deeplink-to-sell-flow.spec.js b/e2e/specs/ramps/deeplink-to-sell-flow.spec.js
new file mode 100644
index 00000000000..279968e5902
--- /dev/null
+++ b/e2e/specs/ramps/deeplink-to-sell-flow.spec.js
@@ -0,0 +1,98 @@
+'use strict';
+import { loginToApp } from '../../viewHelper';
+
+import FixtureBuilder from '../../fixtures/fixture-builder';
+import { withFixtures } from '../../fixtures/fixture-helper';
+
+import TestHelpers from '../../helpers';
+import SellGetStartedView from '../../pages/Ramps/SellGetStartedView';
+import { SmokeRamps } from '../../tags';
+
+import BuildQuoteView from '../../pages/Ramps/BuildQuoteView';
+import Assertions from '../../utils/Assertions';
+import NetworkApprovalBottomSheet from '../../pages/Network/NetworkApprovalBottomSheet';
+import NetworkAddedBottomSheet from '../../pages/Network/NetworkAddedBottomSheet';
+import NetworkEducationModal from '../../pages/Network/NetworkEducationModal';
+import NetworkListModal from '../../pages/Network/NetworkListModal';
+import { PopularNetworksList } from '../../resources/networks.e2e';
+
+describe(SmokeRamps('Sell Crypto Deeplinks'), () => {
+ beforeAll(async () => {
+ await TestHelpers.reverseServerPort();
+ });
+
+ beforeEach(async () => {
+ jest.setTimeout(150000);
+ });
+ it('should deep link to offramp ETH', async () => {
+ const sellDeepLinkURL =
+ 'metamask://sell?chainId=1&address=0x0000000000000000000000000000000000000000&amount=50';
+ const franceRegion = {
+ currencies: ['/currencies/fiat/eur'],
+ emoji: '🇫🇷',
+ id: '/regions/fr',
+ name: 'France',
+ support: { buy: true, sell: true, recurringBuy: true },
+ unsupported: false,
+ recommended: false,
+ detected: false,
+ };
+ await withFixtures(
+ {
+ fixture: new FixtureBuilder()
+ .withRampsSelectedRegion(franceRegion)
+ .build(),
+ restartDevice: true,
+ },
+ async () => {
+ await loginToApp();
+
+ await device.openURL({
+ url: sellDeepLinkURL,
+ });
+ await Assertions.checkIfVisible(
+ await SellGetStartedView.getStartedButton,
+ );
+
+ await SellGetStartedView.tapGetStartedButton();
+ await Assertions.checkIfVisible(BuildQuoteView.getQuotesButton);
+
+ await Assertions.checkIfTextIsDisplayed('50 ETH');
+ },
+ );
+ });
+ it('should deep link to offramp with Base but switch network to OP Mainnet', async () => {
+ const SellDeepLink = 'metamask://sell?chainId=8453';
+
+ await withFixtures(
+ {
+ fixture: new FixtureBuilder().withRampsSelectedRegion().build(),
+ restartDevice: true,
+ },
+ async () => {
+ await loginToApp();
+ await device.sendToHome();
+ await device.launchApp({
+ url: SellDeepLink,
+ });
+ await Assertions.checkIfVisible(
+ await SellGetStartedView.getStartedButton,
+ );
+ await SellGetStartedView.tapGetStartedButton();
+ await Assertions.checkIfVisible(NetworkApprovalBottomSheet.container);
+ await NetworkApprovalBottomSheet.tapCancelButton();
+ await NetworkListModal.changeNetworkTo(
+ PopularNetworksList.Optimism.providerConfig.nickname,
+ );
+ await NetworkApprovalBottomSheet.tapApproveButton();
+ await NetworkAddedBottomSheet.tapCloseButton();
+ await Assertions.checkIfVisible(NetworkEducationModal.container);
+ await NetworkEducationModal.tapGotItButton();
+ await Assertions.checkIfTextIsDisplayed('Ethereum');
+ await Assertions.checkIfTextIsDisplayed(
+ PopularNetworksList.Optimism.providerConfig.nickname,
+ );
+ },
+ );
+ });
+});
diff --git a/e2e/specs/ramps/offramp.spec.js b/e2e/specs/ramps/offramp.spec.js
index b352a696427..027c6051f29 100644
--- a/e2e/specs/ramps/offramp.spec.js
+++ b/e2e/specs/ramps/offramp.spec.js
@@ -12,7 +12,7 @@ import { CustomNetworks } from '../../resources/networks.e2e';
import TestHelpers from '../../helpers';
import FixtureServer from '../../fixtures/fixture-server';
import { getFixturesServerPort } from '../../fixtures/utils';
-import { SmokeCore } from '../../tags';
+import { SmokeRamps } from '../../tags';
import Assertions from '../../utils/Assertions';
import SellGetStartedView from '../../pages/Ramps/SellGetStartedView';
import SelectRegionView from '../../pages/Ramps/SelectRegionView';
@@ -34,7 +34,7 @@ const PaymentMethods = {
ACH_BANK_TRANSFER: 'ACH Bank Transfer',
};
-describe(SmokeCore('Off-Ramp'), () => {
+describe(SmokeRamps('Off-Ramp'), () => {
beforeAll(async () => {
await TestHelpers.reverseServerPort();
const fixture = new FixtureBuilder()
diff --git a/e2e/specs/ramps/onramp.spec.js b/e2e/specs/ramps/onramp.spec.js
index 6ce7d152291..be78ab9d9e9 100644
--- a/e2e/specs/ramps/onramp.spec.js
+++ b/e2e/specs/ramps/onramp.spec.js
@@ -11,7 +11,7 @@ import {
import TestHelpers from '../../helpers';
import FixtureServer from '../../fixtures/fixture-server';
import { getFixturesServerPort } from '../../fixtures/utils';
-import { SmokeCore } from '../../tags';
+import { SmokeRamps } from '../../tags';
import BuyGetStartedView from '../../pages/Ramps/BuyGetStartedView';
import SelectRegionView from '../../pages/Ramps/SelectRegionView';
import SelectPaymentMethodView from '../../pages/Ramps/SelectPaymentMethodView';
@@ -20,7 +20,7 @@ import Assertions from '../../utils/Assertions';
const fixtureServer = new FixtureServer();
-describe(SmokeCore('Buy Crypto'), () => {
+describe(SmokeRamps('Buy Crypto'), () => {
beforeAll(async () => {
await TestHelpers.reverseServerPort();
const fixture = new FixtureBuilder().build();
diff --git a/e2e/tags.js b/e2e/tags.js
index 2c7e0950126..2d23561e08e 100644
--- a/e2e/tags.js
+++ b/e2e/tags.js
@@ -7,7 +7,8 @@ const tags = {
SmokeRest: 'SmokeRest:',
smokeAssets: 'smokeAssets:',
smokeIdentity: 'smokeIdentity:',
- smokeMultiChain: 'SmokeMultiChain:',
+ smokeMultiChainPermissions: 'SmokeMultiChainPermissions:',
+ smokeRamps: 'SmokeRamps:',
};
const Regression = (testName) => `${tags.regression} ${testName}`;
@@ -18,8 +19,10 @@ const SmokeConfirmations = (testName) =>
const SmokeSwaps = (testName) => `${tags.SmokeSwaps} ${testName}`;
const SmokeAssets = (testName) => `${tags.smokeAssets} ${testName}`;
const SmokeIdentity = (testName) => `${tags.smokeIdentity} ${testName}`;
+const SmokeRamps = (testName) => `${tags.smokeRamps} ${testName}`;
-const SmokeMultiChain = (testName) => `${tags.smokeMultiChain} ${testName}`;
+const SmokeMultiChainPermissions = (testName) =>
+ `${tags.smokeMultiChainPermissions} ${testName}`;
export {
Regression,
SmokeAccounts,
@@ -28,5 +31,6 @@ export {
SmokeSwaps,
SmokeAssets,
SmokeIdentity,
- SmokeMultiChain,
+ SmokeMultiChainPermissions,
+ SmokeRamps,
};
diff --git a/ios/MetaMask.xcodeproj/project.pbxproj b/ios/MetaMask.xcodeproj/project.pbxproj
index 604be1574b1..fde045b95df 100644
--- a/ios/MetaMask.xcodeproj/project.pbxproj
+++ b/ios/MetaMask.xcodeproj/project.pbxproj
@@ -1380,7 +1380,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
- CURRENT_PROJECT_VERSION = 1512;
+ CURRENT_PROJECT_VERSION = 1520;
DEAD_CODE_STRIPPING = YES;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = 48XVW22RCG;
@@ -1418,7 +1418,7 @@
"${inherited}",
);
LLVM_LTO = YES;
- MARKETING_VERSION = 7.37.0;
+ MARKETING_VERSION = 7.37.1;
ONLY_ACTIVE_ARCH = YES;
OTHER_CFLAGS = "$(inherited)";
OTHER_LDFLAGS = (
@@ -1449,7 +1449,7 @@
CODE_SIGN_ENTITLEMENTS = MetaMask/MetaMask.entitlements;
CODE_SIGN_IDENTITY = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
- CURRENT_PROJECT_VERSION = 1512;
+ CURRENT_PROJECT_VERSION = 1520;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = 48XVW22RCG;
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 48XVW22RCG;
@@ -1484,7 +1484,7 @@
"${inherited}",
);
LLVM_LTO = YES;
- MARKETING_VERSION = 7.37.0;
+ MARKETING_VERSION = 7.37.1;
ONLY_ACTIVE_ARCH = NO;
OTHER_CFLAGS = "$(inherited)";
OTHER_LDFLAGS = (
@@ -1514,7 +1514,7 @@
CODE_SIGN_ENTITLEMENTS = MetaMask/MetaMaskDebug.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
- CURRENT_PROJECT_VERSION = 1512;
+ CURRENT_PROJECT_VERSION = 1520;
DEAD_CODE_STRIPPING = YES;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = 48XVW22RCG;
@@ -1547,7 +1547,7 @@
);
LIBRARY_SEARCH_PATHS = "$(SDKROOT)/usr/lib/swift$(inherited)";
LLVM_LTO = YES;
- MARKETING_VERSION = 7.37.0;
+ MARKETING_VERSION = 7.37.1;
ONLY_ACTIVE_ARCH = YES;
OTHER_CFLAGS = "$(inherited)";
OTHER_LDFLAGS = (
@@ -1576,7 +1576,7 @@
CODE_SIGN_ENTITLEMENTS = MetaMask/MetaMask.entitlements;
CODE_SIGN_IDENTITY = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
- CURRENT_PROJECT_VERSION = 1512;
+ CURRENT_PROJECT_VERSION = 1520;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = 48XVW22RCG;
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 48XVW22RCG;
@@ -1607,7 +1607,7 @@
);
LIBRARY_SEARCH_PATHS = "$(SDKROOT)/usr/lib/swift$(inherited)";
LLVM_LTO = YES;
- MARKETING_VERSION = 7.37.0;
+ MARKETING_VERSION = 7.37.1;
ONLY_ACTIVE_ARCH = NO;
OTHER_CFLAGS = "$(inherited)";
OTHER_LDFLAGS = (
@@ -1731,7 +1731,7 @@
CODE_SIGN_ENTITLEMENTS = MetaMask/MetaMaskDebug.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
- CURRENT_PROJECT_VERSION = 1512;
+ CURRENT_PROJECT_VERSION = 1520;
DEAD_CODE_STRIPPING = YES;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = 48XVW22RCG;
@@ -1768,7 +1768,7 @@
"\"$(SRCROOT)/MetaMask/System/Library/Frameworks\"",
);
LLVM_LTO = YES;
- MARKETING_VERSION = 7.37.0;
+ MARKETING_VERSION = 7.37.1;
ONLY_ACTIVE_ARCH = YES;
OTHER_CFLAGS = (
"$(inherited)",
@@ -1800,7 +1800,7 @@
CODE_SIGN_ENTITLEMENTS = MetaMask/MetaMask.entitlements;
CODE_SIGN_IDENTITY = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
- CURRENT_PROJECT_VERSION = 1512;
+ CURRENT_PROJECT_VERSION = 1520;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = 48XVW22RCG;
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 48XVW22RCG;
@@ -1835,7 +1835,7 @@
"\"$(SRCROOT)/MetaMask/System/Library/Frameworks\"",
);
LLVM_LTO = YES;
- MARKETING_VERSION = 7.37.0;
+ MARKETING_VERSION = 7.37.1;
ONLY_ACTIVE_ARCH = NO;
OTHER_CFLAGS = (
"$(inherited)",
diff --git a/package.json b/package.json
index c1eec01a58c..e16c08380f4 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "metamask",
- "version": "7.37.0",
+ "version": "7.37.1",
"private": true,
"scripts": {
"audit:ci": "./scripts/yarn-audit.sh",
@@ -159,11 +159,9 @@
"@metamask/composable-controller": "^10.0.0",
"@metamask/controller-utils": "^11.3.0",
"@metamask/design-tokens": "^4.0.0",
+ "@metamask/eth-hd-keyring": "^9.0.0",
"@metamask/eth-json-rpc-filters": "^9.0.0",
"@metamask/eth-json-rpc-middleware": "^15.0.0",
- "@metamask/eth-hd-keyring": "^9.0.0",
- "@metamask/eth-json-rpc-filters": "^8.0.0",
- "@metamask/eth-json-rpc-middleware": "^11.0.2",
"@metamask/eth-ledger-bridge-keyring": "^8.0.0",
"@metamask/eth-query": "^4.0.0",
"@metamask/eth-sig-util": "^8.0.0",
@@ -172,8 +170,8 @@
"@metamask/ethjs-contract": "^0.4.1",
"@metamask/ethjs-query": "^0.7.1",
"@metamask/ethjs-unit": "^0.3.0",
- "@metamask/json-rpc-engine": "^10.0.0",
"@metamask/gas-fee-controller": "^22.0.2",
+ "@metamask/json-rpc-engine": "^10.0.0",
"@metamask/json-rpc-middleware-stream": "^8.0.2",
"@metamask/key-tree": "^9.0.0",
"@metamask/keyring-api": "^10.1.0",
@@ -200,7 +198,7 @@
"@metamask/selected-network-controller": "^19.0.0",
"@metamask/signature-controller": "^23.1.0",
"@metamask/slip44": "^4.1.0",
- "@metamask/smart-transactions-controller": "^15.0.0",
+ "@metamask/smart-transactions-controller": "^16.0.1",
"@metamask/snaps-controllers": "^9.15.0",
"@metamask/snaps-execution-environments": "^6.10.0",
"@metamask/snaps-rpc-methods": "^11.7.0",
@@ -208,10 +206,9 @@
"@metamask/snaps-utils": "^8.6.1",
"@metamask/stake-sdk": "^0.3.0",
"@metamask/swappable-obj-proxy": "^2.1.0",
- "@metamask/swaps-controller": "^11.0.0",
+ "@metamask/swaps-controller": "^12.0.0",
"@metamask/transaction-controller": "^42.0.0",
"@metamask/utils": "^10.0.1",
- "@metamask/swaps-controller": "^11.0.0",
"@ngraveio/bc-ur": "^1.1.6",
"@notifee/react-native": "^9.0.0",
"@react-native-async-storage/async-storage": "^1.23.1",
@@ -386,6 +383,7 @@
"@ethersproject/contracts": "^5.7.0",
"@ethersproject/providers": "^5.7.2",
"@lavamoat/allow-scripts": "^3.0.4",
+ "@lavamoat/git-safe-dependencies": "^0.1.0",
"@metamask/browser-passworder": "^5.0.0",
"@metamask/build-utils": "^1.0.0",
"@metamask/eslint-config-typescript": "^9.0.0",
diff --git a/yarn.lock b/yarn.lock
index 08aefe72a66..f24bb21a2c1 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -4219,6 +4219,15 @@
npm-normalize-package-bin "3.0.1"
yargs "17.7.2"
+"@lavamoat/git-safe-dependencies@^0.1.0":
+ version "0.1.0"
+ resolved "https://registry.yarnpkg.com/@lavamoat/git-safe-dependencies/-/git-safe-dependencies-0.1.0.tgz#5896d4e3972964f900f74809b207a03bbcbb90c5"
+ integrity sha512-KhtdqJkOroMyiqfFJbyKOYxLkay+ZoXeNaPcjty5rLSJ2Yy0Bwhuk2twQF3C3IRAR0FF36KVzTsAA4281imMKA==
+ dependencies:
+ glob "11.0.0"
+ hosted-git-info "8.0.2"
+ lockfile-lint-api "^5.9.1"
+
"@ledgerhq/cryptoassets-evm-signatures@^13.5.0":
version "13.5.0"
resolved "https://registry.yarnpkg.com/@ledgerhq/cryptoassets-evm-signatures/-/cryptoassets-evm-signatures-13.5.0.tgz#19ad9c567fe40efa822b9f5a8d3968210024e704"
@@ -4360,14 +4369,6 @@
resolved "https://registry.yarnpkg.com/@mantine/hooks/-/hooks-7.8.0.tgz#fc32e07746689459c4b049dc581d1dbda5545686"
integrity sha512-+70fkgjhVJeJ+nJqnburIM3UAsfvxat1Low9HMPobLbv64FIdB4Nzu5ct3qojNQ58r5sK01tg5UoFIJYslaVrg==
-"@metamask/abi-utils@^1.2.0":
- version "1.2.0"
- resolved "https://registry.yarnpkg.com/@metamask/abi-utils/-/abi-utils-1.2.0.tgz#068e1b0f5e423dfae96961e0e5276a7c1babc03a"
- integrity sha512-Hf7fnBDM9ptCPDtq/wQffWbw859CdVGMwlpWUEsTH6gLXhXONGrRXHA2piyYPRuia8YYTdJvRC/zSK1/nyLvYg==
- dependencies:
- "@metamask/utils" "^3.4.1"
- superstruct "^1.0.3"
-
"@metamask/abi-utils@^2.0.3", "@metamask/abi-utils@^2.0.4":
version "2.0.4"
resolved "https://registry.yarnpkg.com/@metamask/abi-utils/-/abi-utils-2.0.4.tgz#20908c1d910f7a17a89fdf5778a5c59d5cb8b8be"
@@ -4555,13 +4556,13 @@
"@metamask/utils" "^9.2.1"
ethereum-cryptography "^2.1.2"
-"@metamask/eth-json-rpc-filters@^8.0.0":
- version "8.0.0"
- resolved "https://registry.yarnpkg.com/@metamask/eth-json-rpc-filters/-/eth-json-rpc-filters-8.0.0.tgz#fd0ca224dc198e270e142c1f2007e05cacb5f16a"
- integrity sha512-kDwSoas8gYWtN79AO4vvyKvaL8bIMstpuwZdsWTSc1goBFTOJEscCD6zUX+MOQFnQohFoC512mNeA5tPLRV46A==
+"@metamask/eth-json-rpc-filters@^9.0.0":
+ version "9.0.0"
+ resolved "https://registry.yarnpkg.com/@metamask/eth-json-rpc-filters/-/eth-json-rpc-filters-9.0.0.tgz#9efe770d12f7d1d8289d9f2ed601911c642c31b9"
+ integrity sha512-mn3clrrNF1zl3E729IgNHV9ia6wvRl+eRwc98e38GM+Se2EcDqBvx1oa9e3oo6BTlqmzzIwdeTvF4/jHU1CDWQ==
dependencies:
"@metamask/eth-query" "^4.0.0"
- "@metamask/json-rpc-engine" "^9.0.0"
+ "@metamask/json-rpc-engine" "^10.0.0"
"@metamask/safe-event-emitter" "^3.0.0"
async-mutex "^0.5.0"
pify "^5.0.0"
@@ -4576,25 +4577,10 @@
"@metamask/rpc-errors" "^7.0.0"
"@metamask/utils" "^9.1.0"
-"@metamask/eth-json-rpc-middleware@^11.0.2":
- version "11.0.2"
- resolved "https://registry.yarnpkg.com/@metamask/eth-json-rpc-middleware/-/eth-json-rpc-middleware-11.0.2.tgz#85e6639f5d159a3277d13609dea9f12ebfb5b4e8"
- integrity sha512-/HqtuK/6E8sIJmzg0O3Ey5JsgK6O/VbDqg5R9thHFQMi9EtKXnnZFc8Blir7IOQraGVJFiZQIKZMHRTNQRyreg==
- dependencies:
- "@metamask/eth-json-rpc-provider" "^1.0.0"
- "@metamask/eth-sig-util" "^6.0.0"
- "@metamask/utils" "^5.0.1"
- clone "^2.1.1"
- eth-block-tracker "^7.0.1"
- eth-rpc-errors "^4.0.3"
- json-rpc-engine "^6.1.0"
- pify "^3.0.0"
- safe-stable-stringify "^2.3.2"
-
-"@metamask/eth-json-rpc-middleware@^15.0.1":
- version "15.0.1"
- resolved "https://registry.yarnpkg.com/@metamask/eth-json-rpc-middleware/-/eth-json-rpc-middleware-15.0.1.tgz#65a4382bdf87fa6c84fe9dc97a4d9c40b47bcbcb"
- integrity sha512-AstO4eE6HmAn81pYyTeCIiFGYKJIRY2x7dWENF/IBkxYrf7eg90mFr1zjldZiacMeEMnkgzd9/tipanWGXT+wA==
+"@metamask/eth-json-rpc-middleware@^15.0.0":
+ version "15.0.0"
+ resolved "https://registry.yarnpkg.com/@metamask/eth-json-rpc-middleware/-/eth-json-rpc-middleware-15.0.0.tgz#167288ad4618438af9d1bda75d238cb0facfde3f"
+ integrity sha512-RkmaPQPWGH1qggaq0sStwVIeamiJOjf/2jBJfbX78r/nDCai8ddY/zHpATJr42SvtRYD0JrCPjo6v356IDzjQw==
dependencies:
"@metamask/eth-block-tracker" "^11.0.3"
"@metamask/eth-json-rpc-provider" "^4.1.5"
@@ -4608,15 +4594,6 @@
pify "^5.0.0"
safe-stable-stringify "^2.4.3"
-"@metamask/eth-json-rpc-provider@^1.0.0":
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/@metamask/eth-json-rpc-provider/-/eth-json-rpc-provider-1.0.1.tgz#3fd5316c767847f4ca107518b611b15396a5a32c"
- integrity sha512-whiUMPlAOrVGmX8aKYVPvlKyG4CpQXiNNyt74vE1xb5sPvmx5oA7B/kOi/JdBvhGQq97U1/AVdXEdk2zkP8qyA==
- dependencies:
- "@metamask/json-rpc-engine" "^7.0.0"
- "@metamask/safe-event-emitter" "^3.0.0"
- "@metamask/utils" "^5.0.1"
-
"@metamask/eth-json-rpc-provider@^4.1.5", "@metamask/eth-json-rpc-provider@^4.1.6":
version "4.1.6"
resolved "https://registry.yarnpkg.com/@metamask/eth-json-rpc-provider/-/eth-json-rpc-provider-4.1.6.tgz#5d86ee7db6ff94b0abe1f00ef02aeffa60536497"
@@ -4648,19 +4625,6 @@
json-rpc-random-id "^1.0.0"
xtend "^4.0.1"
-"@metamask/eth-sig-util@^6.0.0":
- version "6.0.2"
- resolved "https://registry.yarnpkg.com/@metamask/eth-sig-util/-/eth-sig-util-6.0.2.tgz#d81dc87e0cd5a6580010911501976b48821746ad"
- integrity sha512-D6IIefM2vS+4GUGGtezdBbkwUYQC4bCosYx/JteUuF0zfe6lyxR4cruA8+2QHoUg7F7edNH1xymYpqYq1BeOkw==
- dependencies:
- "@ethereumjs/util" "^8.1.0"
- "@metamask/abi-utils" "^1.2.0"
- "@metamask/utils" "^5.0.2"
- ethereum-cryptography "^2.1.2"
- ethjs-util "^0.1.6"
- tweetnacl "^1.0.3"
- tweetnacl-util "^0.15.1"
-
"@metamask/eth-sig-util@^7.0.3":
version "7.0.3"
resolved "https://registry.yarnpkg.com/@metamask/eth-sig-util/-/eth-sig-util-7.0.3.tgz#be9e444fe0b8474c04e2ff42fd983173767f6ac0"
@@ -4801,15 +4765,6 @@
"@metamask/safe-event-emitter" "^3.0.0"
"@metamask/utils" "^10.0.0"
-"@metamask/json-rpc-engine@^7.0.0":
- version "7.3.3"
- resolved "https://registry.yarnpkg.com/@metamask/json-rpc-engine/-/json-rpc-engine-7.3.3.tgz#f2b30a2164558014bfcca45db10f5af291d989af"
- integrity sha512-dwZPq8wx9yV3IX2caLi9q9xZBw2XeIoYqdyihDDDpuHVCEiqadJLwqM3zy+uwf6F1QYQ65A8aOMQg1Uw7LMLNg==
- dependencies:
- "@metamask/rpc-errors" "^6.2.1"
- "@metamask/safe-event-emitter" "^3.0.0"
- "@metamask/utils" "^8.3.0"
-
"@metamask/json-rpc-engine@^8.0.1":
version "8.0.2"
resolved "https://registry.yarnpkg.com/@metamask/json-rpc-engine/-/json-rpc-engine-8.0.2.tgz#29510a871a8edef892f838ee854db18de0bf0d14"
@@ -4819,15 +4774,6 @@
"@metamask/safe-event-emitter" "^3.0.0"
"@metamask/utils" "^8.3.0"
-"@metamask/json-rpc-engine@^9.0.0":
- version "9.0.3"
- resolved "https://registry.yarnpkg.com/@metamask/json-rpc-engine/-/json-rpc-engine-9.0.3.tgz#491eb6085b63b040979d4c65f2a01107d22a162a"
- integrity sha512-efeRXW7KaL0BJcAeudSGhzu6sD3hMpxx9nl3V+Yemm1bsyc66yVUhYPR+XH+Y6ZvB2p05ywgvd1Ev5PBwFzr/g==
- dependencies:
- "@metamask/rpc-errors" "^6.3.1"
- "@metamask/safe-event-emitter" "^3.0.0"
- "@metamask/utils" "^9.1.0"
-
"@metamask/json-rpc-middleware-stream@^7.0.1":
version "7.0.1"
resolved "https://registry.yarnpkg.com/@metamask/json-rpc-middleware-stream/-/json-rpc-middleware-stream-7.0.1.tgz#3e10c93c88507b1a55eea5d125ebf87db0f8fead"
@@ -5229,7 +5175,7 @@
"@metamask/utils" "^10.0.0"
cockatiel "^3.1.2"
-"@metamask/rpc-errors@7.0.1", "@metamask/rpc-errors@^6.2.1", "@metamask/rpc-errors@^6.3.1", "@metamask/rpc-errors@^7.0.0", "@metamask/rpc-errors@^7.0.1":
+"@metamask/rpc-errors@7.0.1", "@metamask/rpc-errors@^6.2.1", "@metamask/rpc-errors@^7.0.0", "@metamask/rpc-errors@^7.0.1":
version "7.0.1"
resolved "https://registry.yarnpkg.com/@metamask/rpc-errors/-/rpc-errors-7.0.1.tgz#0eb2231a1d5e6bb102df5ac07f365c695bf70055"
integrity sha512-EeQGYioq845w2iBmiR9LHYqHhYIaeDTmxprHpPE3BTlkLB74P0xLv/TivOn4snNLowiC5ekOXfcUzCQszTDmSg==
@@ -5294,10 +5240,10 @@
resolved "https://registry.yarnpkg.com/@metamask/slip44/-/slip44-4.1.0.tgz#6f2702de7ba64dad3ab6586ea3ac4e5647804b0a"
integrity sha512-RQ2MJO0X3QLnJo0rFlb83h2tNAkqqx/VNOPLc3/S2CvY3/cXy3UAEw/xRM/475BeAAkWI93yiIn/FoGUy3E0Ig==
-"@metamask/smart-transactions-controller@^15.0.0":
- version "15.0.0"
- resolved "https://registry.yarnpkg.com/@metamask/smart-transactions-controller/-/smart-transactions-controller-15.0.0.tgz#d9a3c2b3e3b1c5d9ddf68c03c0a537d348119fab"
- integrity sha512-IN3mtNDt6YZZBlBn0hk5M+9ShUVD+I4IhAkwbKGp5aom1NdGqVqvl/N0axuhFCqgjBG9JM4zt+orvXIDIhDLXw==
+"@metamask/smart-transactions-controller@^16.0.1":
+ version "16.0.1"
+ resolved "https://registry.yarnpkg.com/@metamask/smart-transactions-controller/-/smart-transactions-controller-16.0.1.tgz#daf658e98b22f5bf57dd960a6d5d5836b0f40d34"
+ integrity sha512-ZKvBd0pMiZn6baVDVYmf9NG7HS8dWuyVz8dOVZ8ddYAGY9mBvsf9VldqHmUdAqzGqew89uLpeJbAnCYbmc4nXg==
dependencies:
"@babel/runtime" "^7.24.1"
"@ethereumjs/tx" "^5.2.1"
@@ -5309,7 +5255,6 @@
"@metamask/eth-query" "^4.0.0"
"@metamask/polling-controller" "^12.0.0"
bignumber.js "^9.0.1"
- events "^3.3.0"
fast-json-patch "^3.1.0"
lodash "^4.17.21"
@@ -5453,10 +5398,10 @@
resolved "https://registry.yarnpkg.com/@metamask/swappable-obj-proxy/-/swappable-obj-proxy-2.3.0.tgz#276819d24f1b411c768441efb6098c1743d6f67a"
integrity sha512-+VFE6wVWve86SLiUI3jyhJjizUezpOnwvRyem7EP79Mml+oSm48gQ4W8QqeQqTugbrlCsxtFI4QNEPotQsll6Q==
-"@metamask/swaps-controller@^11.0.0":
- version "11.0.0"
- resolved "https://registry.yarnpkg.com/@metamask/swaps-controller/-/swaps-controller-11.0.0.tgz#7f77e4c65addb5f03bcad8c651ca6a5d74f94fd5"
- integrity sha512-SdFEIiHWRZcHrkWkyhNUO5/Cr1GjOYv7RFS3D0jaCVhgCz/0yvHlgKAq5iOgS87DVHh1Iv/uFrFswwJyRin6gQ==
+"@metamask/swaps-controller@^12.0.0":
+ version "12.0.0"
+ resolved "https://registry.yarnpkg.com/@metamask/swaps-controller/-/swaps-controller-12.0.0.tgz#60f256c10906f417225ebc7c99b587cafe6808a6"
+ integrity sha512-sjpN1iZnKu4BzWeIi7wUiZAa+rX+EA+SCLAmkrBcACrJQhjsKqBA4Wtrw8gI8uZrwwSfTIRFeMB6ksSiHFPzhQ==
dependencies:
"@ethersproject/contracts" "^5.7.0"
"@ethersproject/providers" "^5.7.0"
@@ -5499,7 +5444,7 @@
lodash "^4.17.21"
uuid "^8.3.2"
-"@metamask/utils@^10.0.0", "@metamask/utils@^10.0.1", "@metamask/utils@^3.4.1", "@metamask/utils@^5.0.1", "@metamask/utils@^5.0.2", "@metamask/utils@^8.2.0", "@metamask/utils@^8.3.0", "@metamask/utils@^9.0.0", "@metamask/utils@^9.1.0", "@metamask/utils@^9.2.1", "@metamask/utils@^9.3.0":
+"@metamask/utils@^10.0.0", "@metamask/utils@^10.0.1", "@metamask/utils@^8.2.0", "@metamask/utils@^8.3.0", "@metamask/utils@^9.0.0", "@metamask/utils@^9.1.0", "@metamask/utils@^9.2.1":
version "10.0.1"
resolved "https://registry.yarnpkg.com/@metamask/utils/-/utils-10.0.1.tgz#a765f96c20e35fc51c068fb9f88a3332b40b215e"
integrity sha512-zHgAitJtRwviVVFnRUA2PLRMaAwatr3jiHgiH7mPicJaeSK4ma01aGR4fHy0iy5tlVo1ZiioTmJ1Hbp8FZ6pSg==
@@ -11386,6 +11331,14 @@
resolved "https://registry.yarnpkg.com/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz#e77a97fbd345b76d83245edcd17d393b1b41fb31"
integrity sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ==
+"@yarnpkg/parsers@^3.0.0-rc.48.1":
+ version "3.0.2"
+ resolved "https://registry.yarnpkg.com/@yarnpkg/parsers/-/parsers-3.0.2.tgz#48a1517a0f49124827f4c37c284a689c607b2f32"
+ integrity sha512-/HcYgtUSiJiot/XWGLOlGxPYUG65+/31V8oqk17vZLW1xlCoR4PampyePljOxY2n8/3jz9+tIFzICsyGujJZoA==
+ dependencies:
+ js-yaml "^3.10.0"
+ tslib "^2.4.0"
+
Base64@~0.2.0:
version "0.2.1"
resolved "https://registry.yarnpkg.com/Base64/-/Base64-0.2.1.tgz#ba3a4230708e186705065e66babdd4c35cf60028"
@@ -13712,7 +13665,7 @@ clone@^1.0.2:
resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.4.tgz#da309cc263df15994c688ca902179ca3c7cd7c7e"
integrity sha1-2jCcwmPfFZlMaIypAheco8fNfH4=
-clone@^2.1.1, clone@^2.1.2:
+clone@^2.1.2:
version "2.1.2"
resolved "https://registry.yarnpkg.com/clone/-/clone-2.1.2.tgz#1b7f4b9f591f1e8f83670401600345a02887435f"
integrity sha512-3Pe/CF1Nn94hyhIYpjtiLhdCoEoz0DqQ+988E9gmeEdQZlojxnOb74wctFyuwWQHzqyf9X7C7MG8juUpqBJT8w==
@@ -16375,17 +16328,6 @@ etag@~1.8.1:
resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887"
integrity sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=
-eth-block-tracker@^7.0.1:
- version "7.1.0"
- resolved "https://registry.yarnpkg.com/eth-block-tracker/-/eth-block-tracker-7.1.0.tgz#dfc16085c6817cc30caabba381deb8d204c1c766"
- integrity sha512-8YdplnuE1IK4xfqpf4iU7oBxnOYAc35934o083G8ao+8WM8QQtt/mVlAY6yIAdY1eMeLqg4Z//PZjJGmWGPMRg==
- dependencies:
- "@metamask/eth-json-rpc-provider" "^1.0.0"
- "@metamask/safe-event-emitter" "^3.0.0"
- "@metamask/utils" "^5.0.1"
- json-rpc-random-id "^1.0.1"
- pify "^3.0.0"
-
eth-ens-namehash@2.0.8, eth-ens-namehash@^2.0.8:
version "2.0.8"
resolved "https://registry.yarnpkg.com/eth-ens-namehash/-/eth-ens-namehash-2.0.8.tgz#229ac46eca86d52e0c991e7cb2aef83ff0f68bcf"
@@ -16417,13 +16359,6 @@ eth-phishing-detect@^1.2.0:
dependencies:
fast-levenshtein "^2.0.6"
-eth-rpc-errors@^4.0.2, eth-rpc-errors@^4.0.3:
- version "4.0.3"
- resolved "https://registry.yarnpkg.com/eth-rpc-errors/-/eth-rpc-errors-4.0.3.tgz#6ddb6190a4bf360afda82790bb7d9d5e724f423a"
- integrity sha512-Z3ymjopaoft7JDoxZcEb3pwdGh7yiYMhOwm2doUt6ASXlMavpNlK6Cre0+IMl2VSGyEU9rkiperQhp5iRxn5Pg==
- dependencies:
- fast-safe-stringify "^2.0.6"
-
eth-url-parser@1.0.4:
version "1.0.4"
resolved "https://registry.yarnpkg.com/eth-url-parser/-/eth-url-parser-1.0.4.tgz#310a99f331abdb8d603c74131568fb773e609cd8"
@@ -16649,7 +16584,7 @@ ethjs-util@0.1.3:
is-hex-prefixed "1.0.0"
strip-hex-prefix "1.0.0"
-ethjs-util@0.1.6, ethjs-util@^0.1.3, ethjs-util@^0.1.6:
+ethjs-util@0.1.6, ethjs-util@^0.1.3:
version "0.1.6"
resolved "https://registry.yarnpkg.com/ethjs-util/-/ethjs-util-0.1.6.tgz#f308b62f185f9fe6237132fb2a9818866a5cd536"
integrity sha512-CUnVOQq7gSpDHZVVrQW8ExxUETWrnrvXYvYz55wOU8Uj4VCgw56XC2B/fVqQN+f7gmrnRHSLVnFAwsCuNwji8w==
@@ -18135,6 +18070,18 @@ glob@10.4.5, glob@^10.0.0, glob@^10.2.2, glob@^10.3.10, glob@^10.3.4, glob@^10.4
package-json-from-dist "^1.0.0"
path-scurry "^1.11.1"
+glob@11.0.0:
+ version "11.0.0"
+ resolved "https://registry.yarnpkg.com/glob/-/glob-11.0.0.tgz#6031df0d7b65eaa1ccb9b29b5ced16cea658e77e"
+ integrity sha512-9UiX/Bl6J2yaBbxKoEBRm4Cipxgok8kQYcOPEhScPwebu2I0HoQOuYdIO6S3hLuWoZgpDpwQZMzTFxgpkyT76g==
+ dependencies:
+ foreground-child "^3.1.0"
+ jackspeak "^4.0.1"
+ minimatch "^10.0.0"
+ minipass "^7.1.2"
+ package-json-from-dist "^1.0.0"
+ path-scurry "^2.0.0"
+
glob@7.1.6:
version "7.1.6"
resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6"
@@ -18602,6 +18549,13 @@ homedir-polyfill@^1.0.1:
dependencies:
parse-passwd "^1.0.0"
+hosted-git-info@8.0.2:
+ version "8.0.2"
+ resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-8.0.2.tgz#5bd7d8b5395616e41cc0d6578381a32f669b14b2"
+ integrity sha512-sYKnA7eGln5ov8T8gnYlkSOxFJvywzEx9BueN6xo/GKO8PGiI6uK6xx+DIGe45T3bdVjLAQDQW1aicT8z8JwQg==
+ dependencies:
+ lru-cache "^10.0.1"
+
hosted-git-info@^2.1.4:
version "2.8.9"
resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.9.tgz#dffc0bf9a21c02209090f2aa69429e1414daf3f9"
@@ -19778,6 +19732,13 @@ jackspeak@^3.1.2:
optionalDependencies:
"@pkgjs/parseargs" "^0.11.0"
+jackspeak@^4.0.1:
+ version "4.0.2"
+ resolved "https://registry.yarnpkg.com/jackspeak/-/jackspeak-4.0.2.tgz#11f9468a3730c6ff6f56823a820d7e3be9bef015"
+ integrity sha512-bZsjR/iRjl1Nk1UkjGpAzLNfQtzuijhn2g+pbZb98HQ1Gk8vM9hfbxeMBP+M2/UUdwj0RqGG3mlvk2MsAqwvEw==
+ dependencies:
+ "@isaacs/cliui" "^8.0.2"
+
jake@^10.8.5:
version "10.8.5"
resolved "https://registry.yarnpkg.com/jake/-/jake-10.8.5.tgz#f2183d2c59382cb274226034543b9c03b8164c46"
@@ -20338,7 +20299,7 @@ js-sha3@^0.9.2:
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499"
integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==
-js-yaml@^3.12.1, js-yaml@^3.13.1, js-yaml@^3.14.1:
+js-yaml@^3.10.0, js-yaml@^3.12.1, js-yaml@^3.13.1, js-yaml@^3.14.1:
version "3.14.1"
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537"
integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==
@@ -20457,14 +20418,6 @@ json-pointer@^0.6.2:
dependencies:
foreach "^2.0.4"
-json-rpc-engine@^6.1.0:
- version "6.1.0"
- resolved "https://registry.yarnpkg.com/json-rpc-engine/-/json-rpc-engine-6.1.0.tgz#bf5ff7d029e1c1bf20cb6c0e9f348dcd8be5a393"
- integrity sha512-NEdLrtrq1jUZyfjkr9OCz9EzCNhnRyWtt1PAnvnhwy6e8XETS0Dtc+ZNCO2gvuAoKsIn2+vCSowXTYE4CkgnAQ==
- dependencies:
- "@metamask/safe-event-emitter" "^2.0.0"
- eth-rpc-errors "^4.0.2"
-
json-rpc-random-id@^1.0.0, json-rpc-random-id@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/json-rpc-random-id/-/json-rpc-random-id-1.0.1.tgz#ba49d96aded1444dbb8da3d203748acbbcdec8c8"
@@ -21101,6 +21054,15 @@ locate-path@^7.1.0:
dependencies:
p-locate "^6.0.0"
+lockfile-lint-api@^5.9.1:
+ version "5.9.1"
+ resolved "https://registry.yarnpkg.com/lockfile-lint-api/-/lockfile-lint-api-5.9.1.tgz#12b10434792fa8b8dd0e332ddfbac55ea70a9e08"
+ integrity sha512-us5IT1bGA6KXbq1WrhrSzk9mtPgHKz5nhvv3S4hwcYnhcVOKW2uK0W8+PN9oIgv4pI49WsD5wBdTQFTpNChF/Q==
+ dependencies:
+ "@yarnpkg/parsers" "^3.0.0-rc.48.1"
+ debug "^4.3.4"
+ object-hash "^3.0.0"
+
lockfile@1.0.4:
version "1.0.4"
resolved "https://registry.yarnpkg.com/lockfile/-/lockfile-1.0.4.tgz#07f819d25ae48f87e538e6578b6964a4981a5609"
@@ -21355,6 +21317,11 @@ lru-cache@10.4.3, lru-cache@^10.0.0, lru-cache@^10.0.1, lru-cache@^10.0.2, lru-c
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-10.4.3.tgz#410fc8a17b70e598013df257c2446b7f3383f119"
integrity sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==
+lru-cache@^11.0.0:
+ version "11.0.2"
+ resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-11.0.2.tgz#fbd8e7cf8211f5e7e5d91905c415a3f55755ca39"
+ integrity sha512-123qHRfJBmo2jXDbo/a5YOQrJoHF/GNQTLzQ5+IdK5pWpceK17yRc6ozlWd25FxvGKQbIUs91fDFkXmDHTKcyA==
+
lru-cache@^4.0.1:
version "4.1.5"
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.5.tgz#8bbe50ea85bed59bc9e33dcab8235ee9bcf443cd"
@@ -22027,6 +21994,13 @@ minimalistic-crypto-utils@^1.0.1:
dependencies:
brace-expansion "^1.1.7"
+minimatch@^10.0.0:
+ version "10.0.1"
+ resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-10.0.1.tgz#ce0521856b453c86e25f2c4c0d03e6ff7ddc440b"
+ integrity sha512-ethXTt3SGGR+95gudmqJ1eNhRO7eGEGIgYA9vnPatK4/etz2MEVDno5GMCibdMTuBMyElzIlgxMna3K94XDIDQ==
+ dependencies:
+ brace-expansion "^2.0.1"
+
minimatch@^5.0.0, minimatch@^5.0.1, minimatch@^5.1.0:
version "5.1.6"
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-5.1.6.tgz#1cfcb8cf5522ea69952cd2af95ae09477f122a96"
@@ -22857,6 +22831,11 @@ object-assign@^4, object-assign@^4.0.1, object-assign@^4.1.0, object-assign@^4.1
resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863"
integrity sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==
+object-hash@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/object-hash/-/object-hash-3.0.0.tgz#73f97f753e7baffc0e2cc9d6e079079744ac82e9"
+ integrity sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw==
+
object-inspect@^1.10.3, object-inspect@^1.13.1, object-inspect@^1.6.0:
version "1.13.1"
resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.13.1.tgz#b96c6109324ccfef6b12216a956ca4dc2ff94bc2"
@@ -23509,6 +23488,14 @@ path-scurry@^1.10.1, path-scurry@^1.11.1, path-scurry@^1.6.1:
lru-cache "^10.2.0"
minipass "^5.0.0 || ^6.0.2 || ^7.0.0"
+path-scurry@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/path-scurry/-/path-scurry-2.0.0.tgz#9f052289f23ad8bf9397a2a0425e7b8615c58580"
+ integrity sha512-ypGJsmGtdXUOeM5u93TyeIEfEhM6s+ljAhrk5vAvSx8uyY/02OvrZnA0YNGUrPXfpJMgI1ODd3nwz8Npx4O4cg==
+ dependencies:
+ lru-cache "^11.0.0"
+ minipass "^7.1.2"
+
path-to-regexp@0.1.12:
version "0.1.12"
resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.12.tgz#d5e1a12e478a976d432ef3c58d534b9923164bb7"
@@ -26153,7 +26140,7 @@ safe-regex-test@^1.0.3:
es-errors "^1.3.0"
is-regex "^1.1.4"
-safe-stable-stringify@^2.1.0, safe-stable-stringify@^2.3.1, safe-stable-stringify@^2.3.2, safe-stable-stringify@^2.4.3:
+safe-stable-stringify@^2.1.0, safe-stable-stringify@^2.3.1, safe-stable-stringify@^2.4.3:
version "2.5.0"
resolved "https://registry.yarnpkg.com/safe-stable-stringify/-/safe-stable-stringify-2.5.0.tgz#4ca2f8e385f2831c432a719b108a3bf7af42a1dd"
integrity sha512-b3rppTKm9T+PsVCBEOUR46GWI7fdOs00VKZ1+9c1EWDaDMvjQc6tUwuFyIprgGgTcWoVHSKrU8H31ZHA2e0RHA==
@@ -27978,11 +27965,6 @@ tunnel-agent@^0.6.0:
dependencies:
safe-buffer "^5.0.1"
-tweetnacl-util@^0.15.1:
- version "0.15.1"
- resolved "https://registry.yarnpkg.com/tweetnacl-util/-/tweetnacl-util-0.15.1.tgz#b80fcdb5c97bcc508be18c44a4be50f022eea00b"
- integrity sha512-RKJBIj8lySrShN4w6i/BonWp2Z/uxwC3h4y7xsRrpP59ZboCd0GpEVsOnMDYLMmKBpYhb5TgHzZXy7wTfYFBRw==
-
tweetnacl@^0.14.3, tweetnacl@~0.14.0:
version "0.14.5"
resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64"