Skip to content

Support WalletConnect multi-chain sessions#6451

Open
YeungKC wants to merge 6 commits into
masterfrom
feature/walletconnect-multichain
Open

Support WalletConnect multi-chain sessions#6451
YeungKC wants to merge 6 commits into
masterfrom
feature/walletconnect-multichain

Conversation

@YeungKC

@YeungKC YeungKC commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Approve WalletConnect sessions with all available EVM, Solana, and Bitcoin namespaces instead of a single selected chain.
  • Add Bitcoin CAIP-2 namespace support for getAccountAddresses and signMessage without advertising unsupported transfer or PSBT methods.
  • Update session proposal display and account switching to use chain-specific addresses.
  • Add namespace tests for multi-address support and blank-address filtering.

Validation

  • git diff --check
  • ./gradlew :app:testOtherChannelDebugUnitTest --tests one.mixin.android.tip.wc.internal.WalletConnectNamespaceTest

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR expands the app’s WalletConnect v2 support to multi-chain sessions by approving all supported namespaces/addresses (EVM + Solana + Bitcoin) instead of a single selected chain, and adds initial Bitcoin namespace handling for address discovery and message signing.

Changes:

  • Generate approved namespaces from all available wallet addresses (EVM/Solana/Bitcoin) and update session account switching to be chain-aware.
  • Add Bitcoin bip122 namespace support for getAccountAddresses and signMessage requests, plus related models.
  • Update session proposal display/account selection and add unit tests for multi-address namespace building and blank-address filtering.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
app/src/test/java/one/mixin/android/tip/wc/internal/WalletConnectNamespaceTest.kt Adds tests for multi-namespace generation and blank-address filtering.
app/src/main/java/one/mixin/android/web3/js/Web3Signer.kt Switches WalletConnect account updates to pass a full address bundle (EVM/Solana/BTC).
app/src/main/java/one/mixin/android/ui/tip/wc/WalletConnectBottomSheetViewModel.kt Adds a PIN verification helper for V2 session proposals that no longer require deriving a chain private key.
app/src/main/java/one/mixin/android/ui/tip/wc/WalletConnectBottomSheetDialogFragment.kt Updates proposal UI/account text and approval flow for multi-chain sessions.
app/src/main/java/one/mixin/android/tip/wc/WalletConnectV2.kt Approves sessions with all supported namespaces; adds BTC request parsing/approval; updates account switching to be chain-aware.
app/src/main/java/one/mixin/android/tip/wc/internal/WcBitcoin.kt Introduces request/response models for WalletConnect Bitcoin methods.
app/src/main/java/one/mixin/android/tip/wc/internal/Method.kt Adds BTC method constants and supported method lists.
app/src/main/java/one/mixin/android/tip/wc/internal/Chain.kt Adds BTC CAIP-2 namespace/reference and introduces multi-address namespace generation helpers.
Comments suppressed due to low confidence (1)

app/src/main/java/one/mixin/android/tip/wc/internal/Chain.kt:91

  • String.getChain() currently matches EVM chains using chainReference (e.g. "1", "8453") but WalletConnect proposal chains are CAIP-2 strings (e.g. "eip155:1"). This makes c.getChain() return null for EVM proposals, leaving the UI defaulting to Chain.Ethereum even when a different EVM chain was requested.
internal fun String.getChain(): Chain? {
    return when (this) {
        Chain.Ethereum.chainReference -> Chain.Ethereum
        Chain.Base.chainReference -> Chain.Base
        Chain.Arbitrum.chainReference -> Chain.Arbitrum

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@YeungKC YeungKC marked this pull request as ready for review June 11, 2026 08:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants