Web3Wallet to Wallet SDK
Upgrade from Web3Wallet to WalletKit for Flutter
Upgrade to 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:
/* highlight-delete-start */
walletconnect_flutter_v2: ^X.Y.Z
/* highlight-delete-end */
/* highlight-add-start */
reown_walletkit: ^1.0.0
/* highlight-add-end */Run flutter clean && flutter pub get after replacing the packages
Then replace the imports...
/* highlight-delete-start */
import 'package:walletconnect_flutter_v2/walletconnect_flutter_v2.dart';
/* highlight-delete-end */
/* highlight-add-start */
import 'package:reown_walletkit/reown_walletkit.dart';
/* highlight-add-end */Step 2. Update main classes
| Old | New |
|---|---|
Web3Wallet | ReownWalletKit |
Core | ReownCore |
Step 3. Update error definitions
/* highlight-delete-start */
Errors.getSdkError(Errors.USER_REJECTED);
/* highlight-delete-end */
/* highlight-add-start */
Errors.getSdkError(Errors.USER_REJECTED).toSignError();
/* highlight-add-end */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