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

# eth_subscribe

> Starts a subscription (on WebSockets / IPC / TCP transports) to a particular event. For every event that matches the subscription a JSON-RPC notification with event details and subscription ID will be sent to a client.

### Parameters

**chainId** `string` *required* (default: 10200)

Unique identifier for a blockchain network.

**id** `number` *required* (default: 1)

Request identifier used to match responses.

**jsonrpc** `string` *required* (default: 2.0)

JSON-RPC version.

**method** `string` *required* (default: eth\_subscribe)

JSON-RPC method name.

**params** `object` *required*

Parameters for eth\_subscribe: \[subscriptionType, options]. The second parameter is required only for "logs".

Positional parameters for `eth_subscribe`:

<ul>
  <li>`params[0]`: Subscription type. Must be either "newHeads" or "logs".</li>
  <li>`params[1]`: Filter options for "logs" subscription, or empty object for "newHeads".</li>
</ul>

### Returns

**result** `string`

Assigned subscription ID Example: `"0xb53c4832f1dca4a5"`.

```bash Curl theme={null}
curl --request POST \
  --url https://api.uniblock.dev/uni/v1/json-rpc?chainId=10200 \
  --header 'content-type: application/json' \
  --data '{
    "id": 1,
    "jsonrpc": "2.0",
    "method": "eth_subscribe",
    "params": [
      "logs",
      {
        "fromBlock": "latest",
        "toBlock": "latest"
      }
    ]
  }'
```

```json Success theme={null}
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "0xb53c4832f1dca4a5"
}
```


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