> Source: https://developers.terrawallet.us/docs/connect/walletconnect . Terra Wallet developer docs (early access).

# WalletConnect

Terra Wallet supports WalletConnect v2 in the mobile app and in the extension. If your dApp already offers
WalletConnect, Terra Wallet users can connect today: they scan your QR code in Terra Wallet.

## Minimal setup

You need a project id from your WalletConnect (Reown) dashboard.

```js
// Works today. npm install @walletconnect/ethereum-provider
import { EthereumProvider } from "@walletconnect/ethereum-provider";

const provider = await EthereumProvider.init({
  projectId: "<your-walletconnect-project-id>",
  chains: [1],                     // Ethereum
  optionalChains: [56, 137, 8453], // BNB Smart Chain, Polygon, Base
  showQrModal: true,
  metadata: {
    name: "Example Shop",
    description: "Pay with your wallet",
    url: "https://shop.example.com",
    icons: ["https://shop.example.com/icon.png"],
  },
});

const accounts = await provider.enable(); // shows the QR code
```

The provider is EIP-1193, so the signing and chain-switching calls in
[EIP-6963 and EIP-1193](https://developers.terrawallet.us/docs/connect/eip-6963.md) work the same way.

## What Terra Wallet does with a session

- It shows your dApp's metadata and the WalletConnect Verify result as a risk label: verified, mismatch or scam.
  Make sure `metadata.url` is your real domain, so Verify can match it.
- Read-only requests are answered at once. Signing requests wait until the user unlocks the wallet and approves.
- `eth_sign` is refused for every session. Use `personal_sign` or `eth_signTypedData_v4`.
- Requests for a chain the session does not include are refused.

## Networks

Request only the chains you need. Terra Wallet supports dApp sessions on Ethereum, BNB Smart Chain, Polygon,
Avalanche, Arbitrum, Optimism, Base, Fantom and Solana.

## On mobile

When your dApp runs on the same phone as Terra Wallet, a QR code is awkward. Open Terra Wallet directly with the
pairing URI instead: see [Deep links](https://developers.terrawallet.us/docs/connect/deep-links.md).
