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

# Deep links

On a phone, your dApp can open Terra Wallet directly with your WalletConnect pairing, instead of showing a QR
code the user cannot scan. This works today with the Terra Wallet app.

## Pair: open Terra Wallet with a WalletConnect URI

Your WalletConnect library gives you a pairing URI that starts with `wc:` (the same text a QR code holds).
URL-encode it and open:

```text
terrawallet://wc?uri=<encodeURIComponent(wc: URI)>
```

```js
// Works today: hand a WalletConnect pairing to Terra Wallet on the same phone.
function openTerraWallet(wcUri) {
  window.location.href = `terrawallet://wc?uri=${encodeURIComponent(wcUri)}`;
}
```

In React Native:

```tsx
import { Linking } from "react-native";

export async function openTerraWallet(wcUri: string) {
  await Linking.openURL(`terrawallet://wc?uri=${encodeURIComponent(wcUri)}`);
}
```

The app also opens raw `wc:` links, so a generic "open in wallet" button reaches Terra Wallet when it is the
user's chosen handler for `wc:`.

## Wake: bring Terra Wallet forward for a request

After pairing, when your dApp sends a signing request, bring the wallet to the foreground so the user sees it:

```text
terrawallet://wc?requestId=<id>&sessionTopic=<topic>
```

`terrawallet://` on its own also just opens the wallet.

## Returning to your dApp

Terra Wallet's WalletConnect metadata sets its redirect to the native scheme `terrawallet://`. To bring users
back to your dApp after they approve, set your own `metadata.redirect` (for example `{ native: "yourapp://" }`)
in your WalletConnect setup.

## Notes

- Only WalletConnect v2 URIs are accepted. A v1 URI shows an "older WalletConnect code" message.
- Expired pairings are refused with a message asking for a new code.
- The app does not handle `https` app links, so use the `terrawallet://` scheme. Raw `wc:` URIs and
  `https://terrawallet.us/wc?uri=...` are also recognised when a user scans them inside Terra Wallet.
- A deep link only opens the pairing screen. The user still reviews and approves the connection.
