Documentation Index
Fetch the complete documentation index at: https://docs.dynamic.xyz/docs/llms.txt
Use this file to discover all available pages before exploring further.
Overview
WalletConnect integration lets your end-users connect their Dynamic embedded wallet to any WalletConnect-compatible dApp. Users scan a QR code (or paste a URI) from a dApp, approve the session, and can then sign transactions and messages directly from your app. This turns your app into a full-featured wallet that works across the web3 ecosystem.This feature is currently restricted to EVM embedded wallets. Solana support may be added as more dApps adopt WalletConnect for Solana.
Prerequisites
- Dynamic SDK initialized with a Reown Project ID (see Quickstart)
- User authenticated (see Authentication)
- An EVM embedded wallet created (see Wallet Creation)
- The
mobile_scannerpackage for QR scanning:
- Camera permission configured:
- iOS: Add to
Info.plist: - Android: Add to
AndroidManifest.xml:
- iOS: Add to
How It Works
- User opens a dApp on desktop or another device and clicks “Connect Wallet”
- The dApp shows a WalletConnect QR code
- User scans the QR code (or pastes the
wc:URI) in your app - Your app shows a session proposal with the dApp’s details and requested chains
- User approves or rejects the connection
- Once connected, signing requests from the dApp appear as approval dialogs in your app
- User approves or rejects each request
Setup
1. Configure the Reown Project ID
Pass your Reown (formerly WalletConnect) project ID when initializing the SDK. Get one at cloud.reown.com.2. Add the Global Listener
TheWcGlobalListener is a widget that handles the entire WalletConnect lifecycle: initialization, session proposals, signing requests, and disconnection events. Place it at the root of your app so it can show approval dialogs from any screen.
3. Implement the WcGlobalListener
This is the full implementation. It auto-initializes WC when the user logs in and shows dialogs for session proposals and signing requests.4. Build the WalletConnect Screen
This screen provides the UI for scanning QR codes, pasting URIs, and managing active sessions.5. Build the QR Scanner
The QR scanner uses themobile_scanner package to detect WalletConnect QR codes (URIs starting with wc:).
Session Card Component
A reusable card widget for displaying connected session details:WalletConnect API Reference
WalletConnectModule
| Method | Description |
|---|---|
initialize() | Initialize WalletConnect. Call after user authentication. |
pair({required String uri}) | Pair with a dApp using a WalletConnect URI from a QR code. |
confirmPairing({required bool confirm}) | Approve or reject a pending session proposal. |
respondSessionRequest({required int id, required String topic, required bool approved}) | Approve or reject a signing request. |
disconnectSession({required String topic}) | Disconnect a specific session. |
disconnectAll() | Disconnect all sessions and clean up storage. |
getConnectedSessions() | Retrieve all active sessions. |
getPendingPairing() | Get the current pending session proposal (if any). |
Properties & Streams
| Property | Type | Description |
|---|---|---|
initialized | bool | Whether WalletConnect has been initialized. |
sessions | Map<String, WcSession> | Currently active sessions keyed by topic. |
sessionsChanges | Stream<Map<String, WcSession>> | Reactive stream of session updates. |
onSessionProposal | Stream<WcSessionProposal?> | Fires when a dApp proposes a new session. |
onSessionRequest | Stream<WcSessionRequest?> | Fires when a dApp sends a signing request. |
onSessionDelete | Stream<String?> | Fires when a session is disconnected (emits the topic). |
initializedChanges | Stream<bool> | Fires when initialization state changes. |
Data Models
Best Practices
- Place
WcGlobalListenerat the app root so session proposals and signing requests are handled regardless of which screen the user is on. - Set
wcNavigatorKeyon yourMaterialAppso the global listener can show dialogs from any context. - Always initialize WalletConnect after authentication — the module requires an active auth token.
- Show clear approval UIs — display the dApp name, URL, and requested chains so users can make informed decisions.
- Handle disconnections gracefully — listen to
onSessionDeleteand update your UI accordingly.