From 0e9845f5a01844551835d840ad592909e1f89e79 Mon Sep 17 00:00:00 2001 From: Jyoti Puri Date: Tue, 5 Sep 2023 05:43:16 +0530 Subject: [PATCH] Added Specification for opBNB as a multilayer network (#20715) * added configuration for gas calculations for opBNB * updated configuration for gas calculations of opBNB * Specify that opBNB is a multilayer network * fixed prettier issues * Update --------- Co-authored-by: RumeelHussainbnb --- shared/constants/network.ts | 4 ++++ ui/selectors/selectors.js | 10 +++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/shared/constants/network.ts b/shared/constants/network.ts index f7979eb85..50c1ba903 100644 --- a/shared/constants/network.ts +++ b/shared/constants/network.ts @@ -140,6 +140,8 @@ export const CHAIN_IDS = { OPTIMISM_TESTNET: '0x1a4', BASE: '0x2105', BASE_TESTNET: '0x14a33', + OPBNB: '0xcc', + OPBNB_TESTNET: '0x15eb', POLYGON: '0x89', POLYGON_TESTNET: '0x13881', AVALANCHE: '0xa86a', @@ -557,6 +559,8 @@ export const BUYABLE_CHAINS_MAP: { | typeof CHAIN_IDS.OPTIMISM_TESTNET | typeof CHAIN_IDS.BASE_TESTNET | typeof CHAIN_IDS.BASE + | typeof CHAIN_IDS.OPBNB_TESTNET + | typeof CHAIN_IDS.OPBNB | 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 4a2a50698..4d77bcec8 100644 --- a/ui/selectors/selectors.js +++ b/ui/selectors/selectors.js @@ -1353,13 +1353,21 @@ export function getIsBase(state) { ); } +export function getIsOpbnb(state) { + return ( + getCurrentChainId(state) === CHAIN_IDS.OPBNB || + getCurrentChainId(state) === CHAIN_IDS.OPBNB_TESTNET + ); +} + export function getIsOpStack(state) { - return getIsOptimism(state) || getIsBase(state); + return getIsOptimism(state) || getIsBase(state) || getIsOpbnb(state); } export function getIsMultiLayerFeeNetwork(state) { return getIsOpStack(state); } + /** * To retrieve the maxBaseFee and priorityFee the user has set as default *