Support WalletConnect multi-chain sessions#6451
Open
YeungKC wants to merge 6 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
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
bip122namespace support forgetAccountAddressesandsignMessagerequests, 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 usingchainReference(e.g. "1", "8453") but WalletConnect proposalchainsare CAIP-2 strings (e.g. "eip155:1"). This makesc.getChain()return null for EVM proposals, leaving the UI defaulting toChain.Ethereumeven 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
getAccountAddressesandsignMessagewithout advertising unsupported transfer or PSBT methods.Validation
git diff --check./gradlew :app:testOtherChannelDebugUnitTest --tests one.mixin.android.tip.wc.internal.WalletConnectNamespaceTest