From 88f294664f837442ac7b0bbd5db1cb4563714583 Mon Sep 17 00:00:00 2001 From: Danyal Prout Date: Mon, 14 Aug 2023 08:22:02 -0700 Subject: [PATCH] Specify that Base is a multilayer network (#20097) --- shared/constants/network.ts | 4 ++++ ui/selectors/selectors.js | 15 +++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/shared/constants/network.ts b/shared/constants/network.ts index c3eb9dc1d..a36d1961a 100644 --- a/shared/constants/network.ts +++ b/shared/constants/network.ts @@ -138,6 +138,8 @@ export const CHAIN_IDS = { BSC_TESTNET: '0x61', OPTIMISM: '0xa', OPTIMISM_TESTNET: '0x1a4', + BASE: '0x2105', + BASE_TESTNET: '0x14a33', POLYGON: '0x89', POLYGON_TESTNET: '0x13881', AVALANCHE: '0xa86a', @@ -542,6 +544,8 @@ export const BUYABLE_CHAINS_MAP: { ChainId, | typeof CHAIN_IDS.LOCALHOST | typeof CHAIN_IDS.OPTIMISM_TESTNET + | typeof CHAIN_IDS.BASE_TESTNET + | typeof CHAIN_IDS.BASE | typeof CHAIN_IDS.BSC_TESTNET | typeof CHAIN_IDS.POLYGON_TESTNET | typeof CHAIN_IDS.AVALANCHE_TESTNET diff --git a/ui/selectors/selectors.js b/ui/selectors/selectors.js index 079c1f493..9cc5b74f3 100644 --- a/ui/selectors/selectors.js +++ b/ui/selectors/selectors.js @@ -1291,11 +1291,22 @@ export function getIsOptimism(state) { ); } +export function getIsBase(state) { + return ( + getCurrentChainId(state) === CHAIN_IDS.BASE || + getCurrentChainId(state) === CHAIN_IDS.BASE_TESTNET + ); +} + +export function getIsOpStack(state) { + return getIsOptimism(state) || getIsBase(state); +} + export function getIsMultiLayerFeeNetwork(state) { - return getIsOptimism(state); + return getIsOpStack(state); } /** - * To retrieve the maxBaseFee and priotitFee teh user has set as default + * To retrieve the maxBaseFee and priorityFee the user has set as default * * @param {*} state * @returns Boolean