diff --git a/app/_locales/en/messages.json b/app/_locales/en/messages.json index f125126e878c..65e48e98a6b2 100644 --- a/app/_locales/en/messages.json +++ b/app/_locales/en/messages.json @@ -710,6 +710,9 @@ "baseFee": { "message": "Base fee" }, + "baseNetworkToastMessage": { + "message": "We’ve updated the default RPC for Base to make your experience more reliable." + }, "basic": { "message": "Basic" }, diff --git a/app/scripts/constants/sentry-state.ts b/app/scripts/constants/sentry-state.ts index 1087b5ac608b..d210de6292c9 100644 --- a/app/scripts/constants/sentry-state.ts +++ b/app/scripts/constants/sentry-state.ts @@ -245,6 +245,7 @@ export const SENTRY_BACKGROUND_STATE = { showExtensionInFullSizeView: true, showFiatInTestnets: true, showTestNetworks: true, + showBaseNetworkToast: false, smartTransactionsOptInStatus: true, tokenNetworkFilter: {}, showNativeTokenAsMainBalance: true, diff --git a/app/scripts/controllers/preferences-controller.test.ts b/app/scripts/controllers/preferences-controller.test.ts index 39a2d49648b2..e64126db0e51 100644 --- a/app/scripts/controllers/preferences-controller.test.ts +++ b/app/scripts/controllers/preferences-controller.test.ts @@ -744,6 +744,7 @@ describe('preferences controller', () => { isRedesignedConfirmationsDeveloperEnabled: false, showConfirmationAdvancedDetails: false, showMultiRpcModal: false, + showBaseNetworkToast: false, showNativeTokenAsMainBalance: false, tokenSortConfig: { key: 'tokenFiatAmount', @@ -774,6 +775,7 @@ describe('preferences controller', () => { isRedesignedConfirmationsDeveloperEnabled: false, showConfirmationAdvancedDetails: true, showMultiRpcModal: false, + showBaseNetworkToast: false, showNativeTokenAsMainBalance: false, tokenSortConfig: { key: 'tokenFiatAmount', diff --git a/app/scripts/controllers/preferences-controller.ts b/app/scripts/controllers/preferences-controller.ts index d705be4c3180..7258e09c213c 100644 --- a/app/scripts/controllers/preferences-controller.ts +++ b/app/scripts/controllers/preferences-controller.ts @@ -112,6 +112,7 @@ export type Preferences = { redesignedTransactionsEnabled: boolean; featureNotificationsEnabled: boolean; showMultiRpcModal: boolean; + showBaseNetworkToast: boolean; privacyMode: boolean; isRedesignedConfirmationsDeveloperEnabled: boolean; showConfirmationAdvancedDetails: boolean; @@ -227,6 +228,7 @@ export const getDefaultPreferencesControllerState = isRedesignedConfirmationsDeveloperEnabled: false, showConfirmationAdvancedDetails: false, showMultiRpcModal: false, + showBaseNetworkToast: false, privacyMode: false, shouldShowAggregatedBalancePopover: true, // by default user should see popover; tokenSortConfig: { diff --git a/app/scripts/fixtures/with-preferences.js b/app/scripts/fixtures/with-preferences.js index c3a482ef8f94..b5f6cbdd8ead 100644 --- a/app/scripts/fixtures/with-preferences.js +++ b/app/scripts/fixtures/with-preferences.js @@ -4,6 +4,7 @@ export const FIXTURES_PREFERENCES = { showExtensionInFullSizeView: false, showFiatInTestnets: true, showTestNetworks: true, + showBaseNetworkToast: false, smartTransactionsOptInStatus: true, useNativeCurrencyAsPrimaryCurrency: true, petnamesEnabled: true, diff --git a/app/scripts/lib/backup.test.js b/app/scripts/lib/backup.test.js index 826aa04018d9..317f7155f2b4 100644 --- a/app/scripts/lib/backup.test.js +++ b/app/scripts/lib/backup.test.js @@ -169,6 +169,7 @@ const jsonData = JSON.stringify({ smartTransactionsOptInStatus: true, useNativeCurrencyAsPrimaryCurrency: true, showMultiRpcModal: false, + showBaseNetworkToast: false, }, ipfsGateway: 'dweb.link', ledgerTransportType: 'webhid', diff --git a/app/scripts/migrations/135.test.ts b/app/scripts/migrations/135.test.ts new file mode 100644 index 000000000000..137f55ef2b5c --- /dev/null +++ b/app/scripts/migrations/135.test.ts @@ -0,0 +1,131 @@ +import { cloneDeep } from 'lodash'; +import { NetworkState } from '@metamask/network-controller'; +import { infuraProjectId } from '../../../shared/constants/network'; +import { migrate, version } from './135'; + +const oldVersion = 134; +const BASE_CHAIN_ID = '0x2105'; + +describe('migration #135', () => { + it('updates the version metadata', async () => { + const oldStorage = { + meta: { version: oldVersion }, + data: {}, + }; + + const newStorage = await migrate(cloneDeep(oldStorage)); + + expect(newStorage.meta).toStrictEqual({ version }); + }); + + describe('Base Network Migration', () => { + it('does nothing if networkConfigurationsByChainId is not in state', async () => { + const oldState = { + OtherController: {}, + }; + + const transformedState = await migrate({ + meta: { version: oldVersion }, + data: cloneDeep(oldState), + }); + + expect(transformedState.data).toEqual(oldState); + }); + + it('replaces "https://mainnet.base.org" with "base-mainnet.infura.io" when it exists', async () => { + const oldState = { + NetworkController: { + networkConfigurationsByChainId: { + [BASE_CHAIN_ID]: { + rpcEndpoints: [ + { + url: 'https://mainnet.base.org', + type: 'custom', + networkClientId: 'base-mainnet', + }, + ], + defaultRpcEndpointIndex: 0, + }, + }, + }, + }; + + const transformedState = await migrate({ + meta: { version: oldVersion }, + data: cloneDeep(oldState), + }); + + const updatedNetworkController = transformedState.data + .NetworkController as NetworkState; + + expect( + updatedNetworkController.networkConfigurationsByChainId[BASE_CHAIN_ID] + .rpcEndpoints[0].url, + ).toEqual(`https://base-mainnet.infura.io/v3/${infuraProjectId}`); + }); + + it('does not modify RPC endpoints other than "https://mainnet.base.org"', async () => { + const oldState = { + NetworkController: { + networkConfigurationsByChainId: { + [BASE_CHAIN_ID]: { + rpcEndpoints: [ + { + url: 'https://other.rpc', + type: 'custom', + networkClientId: 'other-mainnet', + }, + ], + defaultRpcEndpointIndex: 0, + }, + }, + }, + }; + + const transformedState = await migrate({ + meta: { version: oldVersion }, + data: cloneDeep(oldState), + }); + + const updatedNetworkController = transformedState.data + .NetworkController as NetworkState; + + expect( + updatedNetworkController.networkConfigurationsByChainId[BASE_CHAIN_ID] + .rpcEndpoints[0].url, + ).toEqual('https://other.rpc'); + }); + + it('keeps defaultRpcEndpointIndex unchanged when replacing "https://mainnet.base.org"', async () => { + const oldState = { + NetworkController: { + networkConfigurationsByChainId: { + [BASE_CHAIN_ID]: { + rpcEndpoints: [ + { + url: 'https://mainnet.base.org', + type: 'custom', + networkClientId: 'base-mainnet', + }, + ], + defaultRpcEndpointIndex: 0, + }, + }, + }, + }; + + const transformedState = await migrate({ + meta: { version: oldVersion }, + data: cloneDeep(oldState), + }); + + const updatedNetworkController = transformedState.data + .NetworkController as NetworkState; + + expect( + updatedNetworkController.networkConfigurationsByChainId[BASE_CHAIN_ID] + .defaultRpcEndpointIndex, + ).toEqual(0); + }); + }); +}); diff --git a/app/scripts/migrations/135.ts b/app/scripts/migrations/135.ts new file mode 100644 index 000000000000..6a4a6e50caf9 --- /dev/null +++ b/app/scripts/migrations/135.ts @@ -0,0 +1,88 @@ +import { hasProperty, isObject } from '@metamask/utils'; +import { cloneDeep } from 'lodash'; +import { infuraProjectId } from '../../../shared/constants/network'; + +export const version = 135; +const BASE_CHAIN_ID = '0x2105'; + +/** + * Replace all occurrences of "https://mainnet.base.org" with + * "https://base-mainnet.infura.io/v3/${infuraProjectId}" in the Base network configuration. + * + * @param originalVersionedData - Versioned MetaMask extension state, exactly + * what we persist to dist. + * @param originalVersionedData.meta - State metadata. + * @param originalVersionedData.meta.version - The current state version. + * @param originalVersionedData.data - The persisted MetaMask state, keyed by + * controller. + * @returns Updated versioned MetaMask extension state. + */ +export async function migrate(originalVersionedData: { + meta: { version: number }; + data: Record; +}) { + const versionedData = cloneDeep(originalVersionedData); + versionedData.meta.version = version; + versionedData.data = transformState(versionedData.data); + return versionedData; +} + +function transformState(state: Record) { + if ( + hasProperty(state, 'NetworkController') && + isObject(state.NetworkController) && + hasProperty(state.NetworkController, 'networkConfigurationsByChainId') && + isObject(state.NetworkController.networkConfigurationsByChainId) + ) { + const { networkConfigurationsByChainId } = state.NetworkController; + + // Check for Base network configuration (chainId 8453 / 0x2105) + const baseNetworkConfig = networkConfigurationsByChainId[BASE_CHAIN_ID]; + if (isObject(baseNetworkConfig)) { + const { rpcEndpoints } = baseNetworkConfig; + + if (Array.isArray(rpcEndpoints)) { + // Find the first occurrence of "https://mainnet.base.org" + // rpc URL are Unique so we can use findIndex + const index = rpcEndpoints.findIndex( + (endpoint) => + isObject(endpoint) && endpoint.url === 'https://mainnet.base.org', + ); + + if (index !== -1) { + // Set `showBaseNetworkToast` based on if the Base network configuration has been updated + if ( + hasProperty(state, 'PreferencesController') && + isObject(state.PreferencesController) && + hasProperty(state.PreferencesController, 'preferences') && + isObject(state.PreferencesController.preferences) + ) { + state.PreferencesController.preferences.showBaseNetworkToast = true; + } + + // Replace the URL with the new Infura URL + rpcEndpoints[index] = { + ...rpcEndpoints[index], + url: `https://base-mainnet.infura.io/v3/${infuraProjectId}`, + }; + + // Update the configuration + networkConfigurationsByChainId[BASE_CHAIN_ID] = { + ...baseNetworkConfig, + rpcEndpoints, + }; + + return { + ...state, + NetworkController: { + ...state.NetworkController, + networkConfigurationsByChainId, + }, + }; + } + } + } + } + + return state; +} diff --git a/app/scripts/migrations/index.js b/app/scripts/migrations/index.js index 887732ad9dbc..459578ba3eda 100644 --- a/app/scripts/migrations/index.js +++ b/app/scripts/migrations/index.js @@ -155,6 +155,7 @@ const migrations = [ require('./132'), require('./133'), require('./134'), + require('./135'), ]; export default migrations; diff --git a/shared/constants/network.test.ts b/shared/constants/network.test.ts index 9d9ca72b46cd..1fe489488f8f 100644 --- a/shared/constants/network.test.ts +++ b/shared/constants/network.test.ts @@ -87,11 +87,11 @@ describe('NetworkConstants', () => { expect(zksyncEraRpc.rpcEndpoints[0].url).not.toContain('infura.io'); }); - it('base entry should not use Infura', () => { + it('base entry should use Infura', () => { const [baseRpc] = FEATURED_RPCS.filter( (rpc) => rpc.chainId === CHAIN_IDS.BASE, ); - expect(baseRpc.rpcEndpoints[0].url).not.toContain('infura.io'); + expect(baseRpc.rpcEndpoints[0].url).toContain('infura.io'); }); }); }); diff --git a/shared/constants/network.ts b/shared/constants/network.ts index 41f1d9fd0d95..5901d8811c5d 100644 --- a/shared/constants/network.ts +++ b/shared/constants/network.ts @@ -1067,7 +1067,7 @@ export const FEATURED_RPCS: AddNetworkFields[] = [ nativeCurrency: CURRENCY_SYMBOLS.ETH, rpcEndpoints: [ { - url: `https://mainnet.base.org`, + url: `https://base-mainnet.infura.io/v3/${infuraProjectId}`, type: RpcEndpointType.Custom, }, ], diff --git a/test/data/mock-send-state.json b/test/data/mock-send-state.json index f9c602808719..8602068c9ded 100644 --- a/test/data/mock-send-state.json +++ b/test/data/mock-send-state.json @@ -133,6 +133,7 @@ "hideZeroBalanceTokens": false, "showFiatInTestnets": false, "showTestNetworks": true, + "showBaseNetworkToast": false, "tokenNetworkFilter": {} }, "seedPhraseBackedUp": null, diff --git a/test/data/mock-state.json b/test/data/mock-state.json index 3131b8335287..108817769353 100644 --- a/test/data/mock-state.json +++ b/test/data/mock-state.json @@ -380,6 +380,7 @@ "showFiatInTestnets": false, "showNativeTokenAsMainBalance": true, "showTestNetworks": true, + "showBaseNetworkToast": false, "smartTransactionsOptInStatus": true, "tokenNetworkFilter": {}, "tokenSortConfig": { diff --git a/test/e2e/default-fixture.js b/test/e2e/default-fixture.js index a6845e40ec4c..e9f8bb7020a0 100644 --- a/test/e2e/default-fixture.js +++ b/test/e2e/default-fixture.js @@ -211,6 +211,7 @@ function defaultFixture(inputChainId = CHAIN_IDS.LOCALHOST) { showNativeTokenAsMainBalance: true, petnamesEnabled: true, showMultiRpcModal: false, + showBaseNetworkToast: false, isRedesignedConfirmationsDeveloperEnabled: false, showConfirmationAdvancedDetails: false, tokenSortConfig: { diff --git a/test/e2e/fixture-builder.js b/test/e2e/fixture-builder.js index d2dc32297737..c3c8929e0ea4 100644 --- a/test/e2e/fixture-builder.js +++ b/test/e2e/fixture-builder.js @@ -76,6 +76,7 @@ function onboardingFixture() { showNativeTokenAsMainBalance: true, petnamesEnabled: true, showMultiRpcModal: false, + showBaseNetworkToast: false, isRedesignedConfirmationsDeveloperEnabled: false, showConfirmationAdvancedDetails: false, tokenSortConfig: { diff --git a/test/e2e/restore/MetaMaskUserData.json b/test/e2e/restore/MetaMaskUserData.json index 7a687ec254c0..77d31fe45ee3 100644 --- a/test/e2e/restore/MetaMaskUserData.json +++ b/test/e2e/restore/MetaMaskUserData.json @@ -36,6 +36,7 @@ "showExtensionInFullSizeView": false, "showFiatInTestnets": false, "showTestNetworks": false, + "showBaseNetworkToast": false, "smartTransactionsOptInStatus": true }, "theme": "light", diff --git a/test/e2e/tests/metrics/state-snapshots/errors-after-init-opt-in-background-state.json b/test/e2e/tests/metrics/state-snapshots/errors-after-init-opt-in-background-state.json index ecd0b1d0db7a..242237fe01db 100644 --- a/test/e2e/tests/metrics/state-snapshots/errors-after-init-opt-in-background-state.json +++ b/test/e2e/tests/metrics/state-snapshots/errors-after-init-opt-in-background-state.json @@ -232,6 +232,7 @@ "showNativeTokenAsMainBalance": true, "petnamesEnabled": true, "showMultiRpcModal": "boolean", + "showBaseNetworkToast": "boolean", "isRedesignedConfirmationsDeveloperEnabled": "boolean", "tokenSortConfig": "object", "shouldShowAggregatedBalancePopover": "boolean", diff --git a/test/e2e/tests/metrics/state-snapshots/errors-after-init-opt-in-ui-state.json b/test/e2e/tests/metrics/state-snapshots/errors-after-init-opt-in-ui-state.json index ccecc8669c81..7bfde1bd32dd 100644 --- a/test/e2e/tests/metrics/state-snapshots/errors-after-init-opt-in-ui-state.json +++ b/test/e2e/tests/metrics/state-snapshots/errors-after-init-opt-in-ui-state.json @@ -34,6 +34,7 @@ "showNativeTokenAsMainBalance": true, "petnamesEnabled": true, "showMultiRpcModal": "boolean", + "showBaseNetworkToast": "boolean", "isRedesignedConfirmationsDeveloperEnabled": "boolean", "tokenSortConfig": "object", "shouldShowAggregatedBalancePopover": "boolean", diff --git a/test/e2e/tests/metrics/state-snapshots/errors-before-init-opt-in-background-state.json b/test/e2e/tests/metrics/state-snapshots/errors-before-init-opt-in-background-state.json index 1a1009c02c23..9ec4ae639829 100644 --- a/test/e2e/tests/metrics/state-snapshots/errors-before-init-opt-in-background-state.json +++ b/test/e2e/tests/metrics/state-snapshots/errors-before-init-opt-in-background-state.json @@ -114,6 +114,7 @@ "tokenSortConfig": "object", "tokenNetworkFilter": {}, "showMultiRpcModal": "boolean", + "showBaseNetworkToast": "boolean", "shouldShowAggregatedBalancePopover": "boolean" }, "selectedAddress": "string", diff --git a/test/e2e/tests/metrics/state-snapshots/errors-before-init-opt-in-ui-state.json b/test/e2e/tests/metrics/state-snapshots/errors-before-init-opt-in-ui-state.json index e7fe6fd2a641..6ce6154c4943 100644 --- a/test/e2e/tests/metrics/state-snapshots/errors-before-init-opt-in-ui-state.json +++ b/test/e2e/tests/metrics/state-snapshots/errors-before-init-opt-in-ui-state.json @@ -131,6 +131,7 @@ "tokenSortConfig": "object", "tokenNetworkFilter": {}, "showMultiRpcModal": "boolean", + "showBaseNetworkToast": "boolean", "shouldShowAggregatedBalancePopover": "boolean" }, "selectedAddress": "string", diff --git a/test/integration/data/integration-init-state.json b/test/integration/data/integration-init-state.json index ac58306adca8..3d6717b95371 100644 --- a/test/integration/data/integration-init-state.json +++ b/test/integration/data/integration-init-state.json @@ -785,6 +785,7 @@ "petnamesEnabled": false, "showConfirmationAdvancedDetails": false, "showMultiRpcModal": false, + "showBaseNetworkToast": false, "tokenNetworkFilter": {} }, "preventPollingOnNetworkRestart": true, diff --git a/test/integration/data/onboarding-completion-route.json b/test/integration/data/onboarding-completion-route.json index 33d0680ab8a0..f900112a65d7 100644 --- a/test/integration/data/onboarding-completion-route.json +++ b/test/integration/data/onboarding-completion-route.json @@ -223,6 +223,7 @@ "showExtensionInFullSizeView": false, "showFiatInTestnets": false, "showTestNetworks": false, + "showBaseNetworkToast": false, "smartTransactionsOptInStatus": true, "hideZeroBalanceTokens": false, "petnamesEnabled": true, diff --git a/test/jest/mock-store.js b/test/jest/mock-store.js index 422c54f13bf1..69721ee68bac 100644 --- a/test/jest/mock-store.js +++ b/test/jest/mock-store.js @@ -143,6 +143,7 @@ export const createSwapsMockStore = () => { smartTransactionsOptInStatus: true, tokenNetworkFilter: {}, showMultiRpcModal: false, + showBaseNetworkToast: false, }, transactions: [ { diff --git a/ui/components/app/toast-master/toast-master.js b/ui/components/app/toast-master/toast-master.js index 18182f37b477..11c79ab9f6a8 100644 --- a/ui/components/app/toast-master/toast-master.js +++ b/ui/components/app/toast-master/toast-master.js @@ -26,6 +26,7 @@ import { useI18nContext } from '../../../hooks/useI18nContext'; import { usePrevious } from '../../../hooks/usePrevious'; import { getCurrentNetwork, + getIsTokenNetworkFilterEqualCurrentNetwork, getOriginOfCurrentTab, getSelectedAccount, getSwitchedNetworkDetails, @@ -35,6 +36,9 @@ import { addPermittedAccount, clearSwitchedNetworkDetails, hidePermittedNetworkToast, + setEditedNetwork, + setShowBaseNetworkToast, + toggleNetworkMenu, } from '../../../store/actions'; import { AvatarAccount, @@ -45,6 +49,11 @@ import { } from '../../component-library'; import { Toast, ToastContainer } from '../../multichain'; import { SurveyToast } from '../../ui/survey-toast'; +import { + BASE_DISPLAY_NAME, + BASE_TOKEN_IMAGE_URL, + CHAIN_IDS, +} from '../../../../shared/constants/network'; import { selectNftDetectionEnablementToast, selectShowConnectAccountToast, @@ -77,6 +86,7 @@ export function ToastMaster() { + @@ -256,6 +266,52 @@ function SwitchedNetworkToast() { ); } +function BaseNetworkToast() { + const t = useI18nContext(); + const dispatch = useDispatch(); + + const isCurrentNetworkFilerSelected = useSelector( + getIsTokenNetworkFilterEqualCurrentNetwork, + ); + + const currentNetwork = useSelector(getCurrentNetwork); + const showBaseNetworkToastPreference = useSelector( + (state) => state.metamask.preferences.showBaseNetworkToast, + ); + + const showBaseNetworkToast = + showBaseNetworkToastPreference && + (!isCurrentNetworkFilerSelected || + currentNetwork?.chainId === CHAIN_IDS.BASE); + return showBaseNetworkToast ? ( + + } + text={t('baseNetworkToastMessage')} + actionText={t('seeDetails')} + onActionClick={() => { + dispatch(setShowBaseNetworkToast(false)); + dispatch(toggleNetworkMenu()); + dispatch( + setEditedNetwork({ + chainId: CHAIN_IDS.BASE, + nickname: BASE_DISPLAY_NAME, + }), + ); + }} + hasLink={false} + onClose={() => dispatch(setShowBaseNetworkToast(false))} + /> + ) : null; +} + function NftEnablementToast() { const t = useI18nContext(); const dispatch = useDispatch(); diff --git a/ui/components/multichain/toast/toast.tsx b/ui/components/multichain/toast/toast.tsx index 1d62a50f75db..a2e2c11721e3 100644 --- a/ui/components/multichain/toast/toast.tsx +++ b/ui/components/multichain/toast/toast.tsx @@ -1,10 +1,18 @@ import React, { useEffect, useState } from 'react'; import { ThemeType } from '../../../../shared/constants/preferences'; -import { BannerBase, Box, ButtonLink, Text } from '../../component-library'; +import { + BannerBase, + Box, + ButtonBase, + ButtonLink, + Text, +} from '../../component-library'; import { BorderRadius, Display, TextVariant, + BackgroundColor, + BorderColor, } from '../../../helpers/constants/design-system'; export const ToastContainer = ({ @@ -17,6 +25,7 @@ export const Toast = ({ startAdornment, text, actionText, + hasLink = true, onActionClick, onClose, borderRadius, @@ -29,6 +38,7 @@ export const Toast = ({ startAdornment: React.ReactNode | React.ReactNode[]; text: string; actionText?: string; + hasLink?: boolean; onActionClick?: () => void; onClose: () => void; borderRadius?: BorderRadius; @@ -76,9 +86,23 @@ export const Toast = ({ {text} - {actionText && onActionClick ? ( - {actionText} - ) : null} + {actionText && onActionClick && ( + <> + {hasLink ? ( + {actionText} + ) : ( + + + {actionText} + + + )} + + )} diff --git a/ui/ducks/metamask/metamask.js b/ui/ducks/metamask/metamask.js index 93550d45fc10..b64b09c80abe 100644 --- a/ui/ducks/metamask/metamask.js +++ b/ui/ducks/metamask/metamask.js @@ -53,6 +53,7 @@ const initialState = { featureNotificationsEnabled: false, privacyMode: false, showMultiRpcModal: false, + showBaseNetworkToast: false, }, firstTimeFlowType: null, completedOnboarding: false, diff --git a/ui/pages/routes/routes.component.test.js b/ui/pages/routes/routes.component.test.js index e661099e1aa2..fd88ed8d098a 100644 --- a/ui/pages/routes/routes.component.test.js +++ b/ui/pages/routes/routes.component.test.js @@ -174,6 +174,7 @@ describe('Routes Component', () => { sortCallback: 'stringNumeric', }, tokenNetworkFilter: {}, + showBaseNetworkToast: false, }, tokenBalances: { '0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc': '0x176270e2b862e4ed3', @@ -309,6 +310,7 @@ describe('toast display', () => { pendingApprovals: {}, pendingApprovalCount: 0, preferences: { + showBaseNetworkToast: false, tokenSortConfig: { key: 'token-sort-key', order: 'dsc', @@ -340,6 +342,7 @@ describe('toast display', () => { newPrivacyPolicyToastShownDate: new Date(0), newPrivacyPolicyToastClickedOrClosed: true, preferences: { + showBaseNetworkToast: false, tokenSortConfig: { key: 'token-sort-key', order: 'dsc', diff --git a/ui/store/actions.ts b/ui/store/actions.ts index 01b8b9e458d9..97a75017eb4e 100644 --- a/ui/store/actions.ts +++ b/ui/store/actions.ts @@ -3150,6 +3150,10 @@ export function setShowMultiRpcModal(value: boolean) { return setPreference('showMultiRpcModal', value); } +export function setShowBaseNetworkToast(value: boolean) { + return setPreference('showBaseNetworkToast', value); +} + export function setAutoLockTimeLimit(value: number | null) { return setPreference('autoLockTimeLimit', value); }