Skip to content

feat: wallet switch#5717

Open
cuzz-venus wants to merge 4 commits into
mainfrom
fix/wallet-switch
Open

feat: wallet switch#5717
cuzz-venus wants to merge 4 commits into
mainfrom
fix/wallet-switch

Conversation

@cuzz-venus

@cuzz-venus cuzz-venus commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

@changeset-bot

changeset-bot Bot commented Jul 23, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: ca4267c

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

@vercel

vercel Bot commented Jul 23, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
dapp-preview Ready Ready Preview Jul 23, 2026 12:41pm
dapp-testnet Ready Ready Preview Jul 23, 2026 12:41pm
venus.io Ready Ready Preview Jul 23, 2026 12:41pm

Request Review

@greptile-apps

greptile-apps Bot commented Jul 23, 2026

Copy link
Copy Markdown

Greptile Summary

This PR adds wallet switching and Binance Wallet support. The main changes are:

  • Adds the Binance RainbowKit and wagmi connectors.
  • Synchronizes the wallet chain after a modal connection.
  • Exports the new wallet-chain synchronization hook.
  • Removes the previous connection recovery timer.

Confidence Score: 4/5

The remaining wallet synchronization issues should be fixed before merging.

  • Chain reconciliation remains limited to the connect-modal flow.
  • The synchronization hook still requires router context at the wrapper level.
  • No additional distinct blocking issue was found in this update.

apps/evm/src/libs/wallet/hooks/useSyncWalletChainOnConnect/index.tsx and apps/evm/src/libs/wallet/Web3Wrapper/RainbowKitWrapper/index.tsx

Important Files Changed

Filename Overview
apps/evm/src/libs/wallet/hooks/useSyncWalletChainOnConnect/index.tsx Adds modal-triggered wallet-chain synchronization.
apps/evm/src/libs/wallet/Web3Wrapper/RainbowKitWrapper/index.tsx Mounts the chain synchronization hook and removes connection recovery.
apps/evm/src/libs/wallet/Web3Wrapper/config.ts Uses Binance's dedicated RainbowKit wallet connector.
apps/evm/package.json Adds the Binance wallet connector dependencies.

Reviews (3): Last reviewed commit: "fix: chain select" | Re-trigger Greptile

Comment thread apps/evm/src/libs/wallet/Web3Wrapper/RainbowKitWrapper/index.tsx Outdated
Comment thread apps/evm/src/libs/wallet/Web3Wrapper/RainbowKitWrapper/index.tsx Outdated
@cuzz-venus

Copy link
Copy Markdown
Contributor Author

@greptile review again

@cuzz-venus

Copy link
Copy Markdown
Contributor Author

@greptile review again

Comment on lines +29 to +44
if (config.isSafeApp) {
return;
}

if (status !== 'connected' || walletChainId === undefined) {
return;
}

if (!userConnectPendingRef.current) {
return;
}
userConnectPendingRef.current = false;

if (walletChainId === appChainIdRef.current) {
return;
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can simplify this:

Suggested change
if (config.isSafeApp) {
return;
}
if (status !== 'connected' || walletChainId === undefined) {
return;
}
if (!userConnectPendingRef.current) {
return;
}
userConnectPendingRef.current = false;
if (walletChainId === appChainIdRef.current) {
return;
}
if (config.isSafeApp || !isConnected || !userConnectPendingRef.current || walletChainId === appChainIdRef.current) {
return;
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! I'll address it

Comment thread apps/evm/src/libs/wallet/Web3Wrapper/RainbowKitWrapper/index.tsx
@github-actions

Copy link
Copy Markdown
Contributor

Coverage Report for ./apps/evm

Status Category Percentage Covered / Total
🔵 Lines 77.28% 47769 / 61811
🔵 Statements 77.28% 47769 / 61811
🔵 Functions 71.64% 1440 / 2010
🔵 Branches 84.94% 6972 / 8208
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
apps/evm/src/libs/wallet/index.ts 100% 100% 100% 100%
apps/evm/src/libs/wallet/Web3Wrapper/config.ts 100% 100% 100% 100%
apps/evm/src/libs/wallet/Web3Wrapper/RainbowKitWrapper/index.tsx 100% 100% 100% 100%
apps/evm/src/libs/wallet/hooks/useSyncWalletChainOnConnect/index.tsx 76.31% 66.66% 100% 76.31% 24-25, 30-31, 40-46
Generated in workflow #13903 for commit ca4267c by the Vitest Coverage Report Action

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants