Skip to main content

WalletConnect signer

WalletConnect is an open-source protocol that lets users connect their cryptocurrency wallets to decentralized applications (dApps) in a secure way. It uses QR codes or deep linking to establish a connection between the wallet and the dApp, allowing users to interact with dApps without exposing their private keys.

Install required dependencies

npm install @tari-project/wallet-connect-signer

WalletConnect signer is browser only. This means it requires user interaction.

Establishing connection requires multiple steps.

Request a connection and display wallet connect dialog

import { WalletConnectTariSigner } from "@tari-project/wallet-connect-signer";

const projectId = "1825b9dd9c17b5a33063ae91cbc48a6e";
const signer = new WalletConnectTariSigner(projectId);
await signer.connect();

You should see WalletConnect dialog:

WalletConnect

Click the copy link icon in the top right corner.

Authorize the connection in your wallet

Authorize the connection by clicking Connect with WalletConnect button in your wallet.

WalletConnect

WalletConnect

Success!

Go back to your web application, and the connection should now be established.