From 0482726210249c221dd6603fb598030d63bd889f Mon Sep 17 00:00:00 2001 From: Eiman Date: Thu, 12 Feb 2026 15:15:29 -0600 Subject: [PATCH] [SDK] Fix Safe wallet WalletConnect connection on Berachain Add Berachain (80094) to the Safe supported chains whitelist and stop dropping the users requested chain when it is not in that list. This allows Safe wallets on Berachain to approve WalletConnect session proposals. Also remove duplicated dead-code Safe chain filtering in initProvider where the computed values were never consumed. Co-Authored-By: Claude Opus 4.6 --- .../src/wallets/wallet-connect/controller.ts | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/packages/thirdweb/src/wallets/wallet-connect/controller.ts b/packages/thirdweb/src/wallets/wallet-connect/controller.ts index 6ae873d692f..0295be8d25e 100644 --- a/packages/thirdweb/src/wallets/wallet-connect/controller.ts +++ b/packages/thirdweb/src/wallets/wallet-connect/controller.ts @@ -110,14 +110,11 @@ export async function connectWC( } let optionalChains: Chain[] | undefined = wcOptions?.optionalChains; - let chainToRequest = options.chain; + const chainToRequest = options.chain; // ignore the given options chains - and set the safe supported chains if (walletId === "global.safe") { optionalChains = chainsToRequestForSafe.map(getCachedChain); - if (chainToRequest && !optionalChains.includes(chainToRequest)) { - chainToRequest = undefined; - } } // For UniversalProvider, we still need chain configuration for session management @@ -386,17 +383,6 @@ async function initProvider( "@walletconnect/universal-provider" ); - let optionalChains: Chain[] | undefined = wcOptions?.optionalChains; - let chainToRequest = options.chain; - - // ignore the given options chains - and set the safe supported chains - if (walletId === "global.safe") { - optionalChains = chainsToRequestForSafe.map(getCachedChain); - if (chainToRequest && !optionalChains.includes(chainToRequest)) { - chainToRequest = undefined; - } - } - const provider = await UniversalProvider.init({ metadata: { description: @@ -736,4 +722,5 @@ const chainsToRequestForSafe = [ 1101, // Polygon zkEVM Mainnet 324, // zkSync Era mainnet 534352, // Scroll mainnet + 80094, // Berachain mainnet ];