1

I'm currently developing a web-based application that interacts with the Ethereum blockchain. The application uses several JavaScript libraries, including Web3.js for interacting with Ethereum, Web3Modal for handling the connection to the user's wallet, and WalletConnect for enabling the app to communicate with the wallet on the user's device.

The application was functioning well until recently. However, WalletConnect has deprecated and shut down version 1.0, which my application was using. As a result, I need to upgrade my application to use WalletConnect v2.0.

Here's a simplified version of my current code:

In this code, I'm initializing WalletConnect and Web3Modal, setting up the provider options, and handling the connection logic. I'm also using the following CDN links for the libraries:

<script src="https://unpkg.com/web3@4.0.2/dist/web3.min.js"></script>
<script type="text/javascript" src="https://unpkg.com/web3modal@1.9.12"></script>
<script type="text/javascript" src="https://unpkg.com/@walletconnect/web3-provider@1.8.0"></script>

I've attempted to follow the WalletConnect v2.0 documentation to make this upgrade. However, I'm finding it difficult to understand how to integrate the new version into my existing code. The changes in the new version seem significant, and I'm unsure how to adapt my current implementation to work with it.

I expect to connect my application with trustwallet and other wallets via wallet connect

Emilien
  • 614
  • 1
  • 5
  • 17

0 Answers0