Wallet Guide
This guide provides step-by-step instructions to integrate and use Hedera Wallet Connect within your wallet. Ensure you have followed the installation instructions before proceeding.
Required Dependencies
Additionally, in this guide we will use the @walletconnect/web3wallet
package. Install it using npm or yarn:
npm install @walletconnect/web3wallet
Event Listeners
WalletConnect emits various events during a session. Listen to these events to synchronize the state of your application:
// Handle pairing proposals
signClient.on('session_proposal', (event) => {
// Display session proposal to the user and decide to approve or reject
})
// Handle session requests, like signing transactions or messages
signClient.on('session_request', (event) => {
// Process the session request
})
// Handle session deletions
signClient.on('session_delete', (event) => {
// React to session termination
})
Pairing with dApps
Pairing establishes a connection between the wallet and a dApp. Once paired, the dApp can send session requests to the wallet.