Skip to content

[SDK] Fix Safe wallet WalletConnect connection on Berachain#8670

Merged
0xFirekeeper merged 1 commit intomainfrom
sdk/fix-safe-walletconnect-berachain
Feb 13, 2026
Merged

[SDK] Fix Safe wallet WalletConnect connection on Berachain#8670
0xFirekeeper merged 1 commit intomainfrom
sdk/fix-safe-walletconnect-berachain

Conversation

@eabdelmoneim
Copy link
Contributor

@eabdelmoneim eabdelmoneim commented Feb 12, 2026

https://linear.app/thirdweb/issue/PRO-199/berachain-support-for-safe

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.


PR-Codex overview

This PR focuses on simplifying the handling of chainToRequest in the controller.ts file by removing unnecessary checks and reassignments related to optionalChains. It also adds a new chain ID for Berachain mainnet.

Detailed summary

  • Changed let chainToRequest to const chainToRequest for immutability.
  • Removed redundant checks and reassignments for chainToRequest when walletId is "global.safe".
  • Added 80094 for Berachain mainnet to the chainsToRequestForSafe array.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

Summary by CodeRabbit

  • New Features

    • Added support for Berachain mainnet with Safe wallet integration.
  • Bug Fixes

    • Improved WalletConnect initialization stability and chain request handling.

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 <noreply@anthropic.com>
@eabdelmoneim eabdelmoneim requested review from a team as code owners February 12, 2026 21:17
@vercel
Copy link

vercel bot commented Feb 12, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs-v2 Ready Ready Preview, Comment Feb 12, 2026 9:29pm
nebula Ready Ready Preview, Comment Feb 12, 2026 9:29pm
thirdweb_playground Ready Ready Preview, Comment Feb 12, 2026 9:29pm
thirdweb-www Ready Ready Preview, Comment Feb 12, 2026 9:29pm
wallet-ui Ready Ready Preview, Comment Feb 12, 2026 9:29pm

@changeset-bot
Copy link

changeset-bot bot commented Feb 12, 2026

⚠️ No Changeset found

Latest commit: 0482726

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions github-actions bot added packages SDK Involves changes to the thirdweb SDK labels Feb 12, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 12, 2026

Walkthrough

This change adds Berachain mainnet (80094) to Safe wallet's supported chain list and simplifies chain request logic by converting chainToRequest from a mutable variable to a constant, removing conditional reassignment logic for "global.safe" wallet connections.

Changes

Cohort / File(s) Summary
Berachain Support & Chain Request Simplification
packages/thirdweb/src/wallets/wallet-connect/controller.ts
Adds Berachain mainnet (80094) to safe/default chains list, converts chainToRequest from let to const in connectWC, and removes conditional chain reassignment logic in both connectWC and initProvider functions.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 5 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Merge Conflict Detection ⚠️ Warning ❌ Merge conflicts detected (3 files):

⚔️ apps/portal/src/components/Layouts/DocLayout.tsx (content)
⚔️ apps/portal/src/components/others/Sidebar.tsx (content)
⚔️ packages/thirdweb/src/wallets/wallet-connect/controller.ts (content)

These conflicts must be resolved before merging into main.
Resolve conflicts locally and push changes to this branch.
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: fixing Safe wallet WalletConnect connection on Berachain by adding chain support.
Description check ✅ Passed The description clearly explains the changes made and the reasoning, though it does not follow the suggested template format with explicit sections.
Linked Issues check ✅ Passed The PR directly addresses PRO-199 by adding Berachain (80094) to Safe supported chains and fixing the WalletConnect connection handling as required.
Out of Scope Changes check ✅ Passed All changes are directly related to fixing Safe wallet WalletConnect on Berachain; removing dead code and improving immutability are justified cleanup.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch sdk/fix-safe-walletconnect-berachain
⚔️ Resolve merge conflicts (beta)
  • Auto-commit resolved conflicts to branch sdk/fix-safe-walletconnect-berachain
  • Create stacked PR with resolved conflicts
  • Post resolved changes as copyable diffs in a comment

No actionable comments were generated in the recent review. 🎉


Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 12, 2026

size-limit report 📦

Path Size
@thirdweb-dev/nexus (esm) 105.66 KB (0%)
@thirdweb-dev/nexus (cjs) 319.47 KB (0%)

@0xFirekeeper 0xFirekeeper merged commit 19204e4 into main Feb 13, 2026
21 of 23 checks passed
@0xFirekeeper 0xFirekeeper deleted the sdk/fix-safe-walletconnect-berachain branch February 13, 2026 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

packages SDK Involves changes to the thirdweb SDK

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants