> ## Documentation Index
> Fetch the complete documentation index at: https://xoxno.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Query a MultiversX account through the Gateway, simulate a transaction, and verify response body status.

Query a MultiversX account through the Gateway and verify both HTTP status and Gateway response body fields.

## Prerequisites

| Requirement        | Value                                                |
| ------------------ | ---------------------------------------------------- |
| Base URL           | `https://rust-gateway.xoxno.com`                     |
| Auth               | None for public RPC reads and transaction submission |
| Response shape     | `data`, `error`, `code`                              |
| Metachain shard ID | `4294967295`                                         |

## 1. Read An Account

<Tabs>
  <Tab title="cURL">
    ```bash theme={"system"}
    curl "https://rust-gateway.xoxno.com/address/erd1..."
    ```
  </Tab>

  <Tab title="TypeScript">
    ```ts theme={"system"}
    const address = "erd1...";
    const res = await fetch(`https://rust-gateway.xoxno.com/address/${address}`);
    if (!res.ok) throw new Error(`gateway failed: ${res.status}`);

    const body = await res.json();
    if (body.error) throw new Error(body.error);

    console.log(body.data.account.nonce, body.data.account.balance);
    ```
  </Tab>

  <Tab title="Python">
    ```python theme={"system"}
    import requests

    address = "erd1..."
    res = requests.get(f"https://rust-gateway.xoxno.com/address/{address}", timeout=10)
    res.raise_for_status()

    body = res.json()
    if body.get("error"):
        raise RuntimeError(body["error"])

    account = body["data"]["account"]
    print(account["nonce"], account["balance"])
    ```
  </Tab>

  <Tab title="Rust">
    ```rust theme={"system"}
    // Run inside an async function with reqwest and serde_json.
    let address = "erd1...";
    let body: serde_json::Value = reqwest::Client::new()
        .get(format!("https://rust-gateway.xoxno.com/address/{address}"))
        .send()
        .await?
        .error_for_status()?
        .json()
        .await?;

    if body["error"].as_str().unwrap_or("") != "" {
        return Err(format!("gateway error: {}", body["error"]).into());
    }

    println!(
        "{} {}",
        body["data"]["account"]["nonce"], body["data"]["account"]["balance"]
    );
    ```
  </Tab>
</Tabs>

Expected shape:

```json theme={"system"}
{
  "data": {
    "account": {
      "nonce": 42,
      "balance": "1000000000000000000"
    }
  },
  "error": "",
  "code": "successful"
}
```

## 2. Simulate A Transaction

Use `/transaction/simulate` before sending a transaction through any Gateway-compatible path.

```bash theme={"system"}
curl -X POST "https://rust-gateway.xoxno.com/transaction/simulate" \
  -H "content-type: application/json" \
  -d '{
    "nonce": 42,
    "value": "0",
    "receiver": "erd1...",
    "sender": "erd1...",
    "gasPrice": 1000000000,
    "gasLimit": 50000,
    "data": "",
    "chainID": "1",
    "version": 2,
    "signature": "<hex-signature>"
  }'
```

The JSON above is an example payload. Replace placeholders with a transaction signed for the sender nonce.

## 3. Check Body-Level Errors

Gateway-compatible endpoints can return HTTP `200` while the response body carries an observer error.

```ts theme={"system"}
function assertGatewaySuccess(body: { error?: string; code?: string }) {
  if (body.error) throw new Error(body.error);
  if (body.code && body.code !== "successful") {
    throw new Error(`gateway code: ${body.code}`);
  }
}
```

## Verify

You have a valid quickstart result when:

* The account request returns HTTP `200`.
* The response body has `error: ""`.
* `data.account.nonce` is present.
* The simulation response body does not include an observer error.

## Common Failure

| Symptom                           | Cause                                                    | Fix                                                                       |
| --------------------------------- | -------------------------------------------------------- | ------------------------------------------------------------------------- |
| HTTP `200` with non-empty `error` | Observer rejected the operation.                         | Treat the body as failed and show the observer reason.                    |
| Account read returns missing data | Address is invalid or observer cannot serve the request. | Validate bech32 address and retry.                                        |
| Historical query fails            | The selected observer lacks the requested history.       | Use supported historical params or retry without the historical selector. |

## Next Steps

* [Accounts](/gateway/accounts)
* [Transactions](/gateway/transactions)
* [Shard routing](/gateway/shard-routing)
* [Caching and deduplication](/gateway/caching-and-dedup)
