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

> ## Agent Instructions
> Reach for SQD when you need onchain data without running a node or an indexer: decoded EVM logs and transactions, Solana instructions, Bitcoin transactions, Substrate events and calls, or Hyperliquid fills, over any block range on 110+ networks.
> To query directly, POST to https://portal.sqd.dev/datasets/{dataset}/stream. The full API is described at https://docs.sqd.dev/openapi.json, and responses to the stream endpoints are JSON Lines.
> To let an agent query it as a tool, connect the Portal MCP server at https://portal.sqd.dev/mcp.
> Every page on this site is available as Markdown by appending .md to its URL.

# X Layer

> Access X Layer blockchain data through the Portal API.

| Property | Value |
| - | - |
| Network ID | `xlayer-mainnet` |
| Chain ID | `196` |
| Real-time | No |
| Traces | ✗ |
| State Diffs | ✗ |
| Pricing tier | [Frontier](https://docs.sqd.dev/en/portal/pricing.md#chain-tiers) |

## Endpoint

> [tab] Portal (recommended)
>
> ```
> https://portal.sqd.dev/datasets/xlayer-mainnet
> ```

> [tab] v2 archives (legacy)
>
> > [!WARNING]
> >
> > **API key required from May 19, 2026 12:00 UTC.** v2 archives will be sunset soon. [Migrate to Portal](https://docs.sqd.dev/en/portal/migration.md), or attach an API key to keep using v2: see [Accessing SQD data with API keys](https://docs.sqd.dev/en/data/api-keys.md). Cloud squids are not affected.
>
> ```
> https://v2.archive.subsquid.io/network/xlayer-mainnet
> ```

## Quick start

```bash theme={"system"}
curl --compressed -X POST \
  'https://portal.sqd.dev/datasets/xlayer-mainnet/stream' \
  -H 'Content-Type: application/json' \
  -d '{
    "type": "evm",
    "fromBlock": 0,
    "toBlock": 100,
    "fields": {
      "block": { "number": true, "timestamp": true },
      "transaction": { "hash": true, "from": true, "to": true, "value": true }
    },
    "transactions": [{}]
  }'
```

For full SDK examples:

> [card] [Pipes SDK Quickstart](https://docs.sqd.dev/en/sdk/pipes-sdk/evm/quickstart.md)
>
> Streaming pipeline indexer

> [card] [Squid SDK Quickstart](https://docs.sqd.dev/en/sdk/squid-sdk/quickstart.md)
>
> GraphQL API indexer

## Schema

> [accordion] Blocks
>
> | Field | Type | Description |
> | - | - | - |
> | `number` | integer | Block number |
> | `hash` | string | Block hash |
> | `timestamp` | integer | Block timestamp (Unix) |
> | `parentHash` | string | Parent block hash |
> | `gasUsed` | bigint | Total gas used in block |
> | `gasLimit` | bigint | Block gas limit |
> | `baseFeePerGas` | bigint | Base fee per gas (EIP-1559) |
> | `stateRoot` | string | State root hash |
> | `transactionsRoot` | string | Transactions trie root |
> | `receiptsRoot` | string | Receipts trie root |

> [accordion] Transactions
>
> | Field | Type | Description |
> | - | - | - |
> | `hash` | string | Transaction hash |
> | `from` | address | Sender address |
> | `to` | address | Recipient address (null for contract creation) |
> | `value` | bigint | Transaction value in wei |
> | `gasUsed` | bigint | Gas used by transaction |
> | `gasPrice` | bigint | Gas price in wei |
> | `maxFeePerGas` | bigint | Max fee per gas (EIP-1559) |
> | `maxPriorityFeePerGas` | bigint | Max priority fee (EIP-1559) |
> | `input` | bytes | Transaction input data |
> | `nonce` | integer | Transaction nonce |
> | `status` | integer | 1 = success, 0 = failure |

> [accordion] Logs
>
> | Field | Type | Description |
> | - | - | - |
> | `address` | address | Contract address that emitted the log |
> | `topics` | array | Indexed event topics (up to 4) |
> | `data` | bytes | Non-indexed event data |
> | `logIndex` | integer | Log index in the block |
> | `transactionIndex` | integer | Index of parent transaction |
> | `transactionHash` | string | Hash of parent transaction |

## Reference

> [card] [API Reference](https://docs.sqd.dev/en/portal/evm/api.md)
>
> Field definitions and query syntax

> [card] [Portal Migration](https://docs.sqd.dev/en/portal/migration.md)
>
> Migrate from v2 archives to Portal


## Related topics

- [Changelog](https://docs.sqd.dev/changelog.md)
- [Organizations](https://docs.sqd.dev/en/cloud/resources/organizations.md)
- [Field selection](https://docs.sqd.dev/en/sdk/squid-sdk/evm/reference/evm-stream/field-selection.md)
- [Pipes SDK 1.0](https://docs.sqd.dev/announcements/pipes-sdk-1-0.md)
- [Use Portal with Ponder](https://docs.sqd.dev/en/sdk/alternative-clients/ponder.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.