> For the complete documentation index, see [llms.txt](https://docs.varialwallet.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.varialwallet.com/mobile-walletconnect/mobile.md).

# Overview

Connect your dapp to the Varial mobile app using the [WalletConnect v2](https://docs.walletconnect.network/app-sdk/overview) protocol. All methods follow the standard JSON-RPC 2.0 request/response format over a WalletConnect session.

## Supported Chains

| Network          | Chain ID          |
| ---------------- | ----------------- |
| Mainnet (PUBLIC) | `stellar:pubnet`  |
| Testnet          | `stellar:testnet` |

## API Reference

| Method                                                                                  | Description                                                                                                                                         |
| --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| [`stellar_signXDR`](/mobile-walletconnect/signing.md#stellar_signxdr)                   | Sign a transaction and return the signed XDR                                                                                                        |
| [`stellar_signAndSubmitXDR`](/mobile-walletconnect/signing.md#stellar_signandsubmitxdr) | Sign and submit a transaction to Horizon                                                                                                            |
| [`stellar_signMessage`](/mobile-walletconnect/signing.md#stellar_signmessage)           | Sign an arbitrary UTF-8 message ([SEP-53](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0053.md))                           |
| [`stellar_signAuthEntry`](/mobile-walletconnect/signing.md#stellar_signauthentry)       | Sign a Soroban authorization entry preimage (as defined in [SEP-43](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0043.md)) |

## Error Handling

All error responses use JSON-RPC 2.0 format with code `5000`:

```json
{
  "id": 1234567890,
  "jsonrpc": "2.0",
  "error": {
    "code": 5000,
    "message": "User rejected the request"
  }
}
```

{% hint style="warning" %}
The Varial mobile app validates that the `chainId` in the request matches the wallet's active network. If the user is on the wrong network, the request is rejected. Always specify `chainId` as a separate argument to `provider.request()`, not inside `params`.
{% endhint %}

## Security

The Varial mobile app uses **Blockaid** scanning to protect users:

| Scan type            | When it runs                                                  |
| -------------------- | ------------------------------------------------------------- |
| **Site scan**        | Once during WalletConnect session connection                  |
| **Transaction scan** | For `stellar_signXDR` and `stellar_signAndSubmitXDR` requests |

`stellar_signMessage` and `stellar_signAuthEntry` do not trigger additional scans — the site was already scanned during connection.

## See also

* [WalletConnect v2 Docs](https://docs.walletconnect.network/app-sdk/overview)
* [Stellar Smart Contracts Auth](https://developers.stellar.org/docs/smart-contracts/guides/auth/authorization)
* [SEP-53: Message Signing](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0053.md)
* [SEP-43: Auth Entry Signing](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0043.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.varialwallet.com/mobile-walletconnect/mobile.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
