Upgrade from Web3Wallet to WalletKit for Flutter
Upgrade to Reown WalletKit
This document outlines the steps to migrate from the old walletconnect_flutter_v2
package to the new reown_walletkit
packages in your Flutter project.
Step 1. Replace the corresponding dependency
Remove walletconnect_flutter_v2
dependency from pubspec.yaml and add reown_walletkit
:
walletconnect_flutter_v2: ^X.Y.Z
reown_walletkit: ^1.0.0
Run flutter clean && flutter pub get
after replacing the packages
Then replace the imports...
import 'package:walletconnect_flutter_v2/walletconnect_flutter_v2.dart';
import 'package:reown_walletkit/reown_walletkit.dart';
Step 2. Update main classes
Old | New |
---|---|
Web3Wallet | ReownWalletKit |
Core | ReownCore |
Step 3. Update error definitions
Errors.getSdkError(Errors.USER_REJECTED);
Errors.getSdkError(Errors.USER_REJECTED).toSignError();
Step 5. Update any exception type
Old | New |
---|---|
WalletConnectError | ReownSignError |
Final notes
- Ensure that you have updated all relevant configurations and imports in your project to reflect the changes from Web3Wallet to WalletKit.
- Test your application thoroughly to ensure that the migration has been successful and that all functionality is working as expected.
- Check our WalletKit example for Flutter to compare with your implementation in case you are having issues