Skip to main content

Upgrade from Web3Wallet to Reown WalletKit for Android

This upgrade guide helps developers transition from using the Web3Wallet library to the WalletKit within reown-kotlin. The guide involves updating imports, modifying class references and updating artefacts dependencies. Follow these steps to ensure a smooth migration.

Step 1. Update the Repository Dependencies

The Web3Wallet library has been deprecated and moved to a new repository under the reown-com organization. Update your dependecies to use WalletKit:

- dependencies {
- implementation(platform("com.walletconnect:android-bom:{BOM version}"))
- implementation("com.walletconnect:android-core")
- implementation("com.walletconnect:web3wallet")
- }
+ dependencies {
+ implementation(platform("com.reown:android-bom:{BOM version}"))
+ implementation("com.reown:android-core")
+ implementation("com.reown:walletkit")
+ }

Step 2. Update Imports in Your Code

All references to Web3Wallet in your import statements should be updated to use WalletKit.

- import com.walletconnect.android.*
- import com.walletconnect.web3.wallet.*
+ import com.reown.android.*
+ import com.reown.walletkit.*

Step 3. Update Class Name

The singleton instance for Web3Wallet has been replaced with WalletKit. Update all instances where Web3Wallet is used with WalletKit.

- Web3Wallet.initialize(Wallet.Params.Init(core = CoreClient), onSuccess, onError)
- Web3Wallet.approveSession(approveProposal, onSuccess, onError)
+ WalletKit.initialize(Wallet.Params.Init(core = CoreClient), onSuccess, onError)
+ WalletKit.approveSession(approveProposal, onSuccess, onError)

Step 4. Update ProGuard file rules

If you have ProGuard rules defined remember to update

- -keep class com.walletconnect.web3.wallet.client.Wallet$Model { *; }
- -keep class com.walletconnect.web3.wallet.client.Wallet { *; }
+ -keep class com.reown.walletkit.client.Wallet$Model { *; }
+ -keep class com.reown.walletkit.client.Wallet { *; }

Step 5. Test Your Changes

After updating all references to Web3Wallet to use WalletKit, thoroughly test your application to ensure that all functionalities work as expected.