Wallet connect multi chain support - #4359
Open
Tomasvrba wants to merge 11 commits into
Open
Conversation
Update WalletKit to the final Apache-2.0 release and align Core, Types, and Utils with its 2.21.7 dependency set. Declare directly imported packages and remove the unused direct jsonrpc-types dependency. Override viem's exact ws 8.18.2 dependency with 8.21.0 to include the fixes for GHSA-58qx-3vcg-4xpx and GHSA-96hv-2xvq-fx4p. Keep the override until the pinned WalletConnect graph provides a fixed ws release.
Display unexpected pairing errors using the correct message field. Remove the unused malformed connection status so the type reflects the states the pairing flow can actually enter.
Require an explicit non-zero request chain ID, forward it unchanged for typed-data signing, and reject conflicting transaction chain IDs or unsupported input aliases. This prevents omitted values from becoming chain zero and keeps the authorized request chain authoritative before signing.
Validate WalletConnect chains, methods, approved accounts, and method-specific parameters before opening the signing dialog, returning one protocol-correct JSON-RPC response on every path. Use the authorized request chain for backend signing so malformed or unauthorized requests cannot reach the signer.
Track one active request, block duplicate actions and replacement requests, and make the dialog non-dismissible during device confirmation. Clean up delayed success state on unmount so each request has one stable UI lifecycle and one response.
Build approved namespaces from shared WalletConnect capabilities. Handle unsupported proposals and rejection failures safely.
WalletConnect advertises several EVM networks, but the backend previously accepted transactions only on the account's native network. This caused requests for networks such as Optimism, Base, and Arbitrum to fail. Use the network requested by WalletConnect when getting transaction data, signing, and broadcasting. Keep pending transactions from different networks separate to prevent incorrect nonce selection. Reuse the normal Ethereum signing path instead of maintaining a separate WalletConnect signer. Keep the underlying transaction code independent of WalletConnect so it can also support native multichain features later.
- Centralize metadata for the ten EVM networks supported by the backend. - Derive WalletConnect chain entries from numeric IDs. - Render the registry's SVG assets in pairing and signing requests.
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.
This PR adds WalletConnect support for multiple EVM networks:
The BitBoxApp now:
transactions.
This depends on #4267 but would be nice to get into the next release. Only the top 3 commits are for this PR.