eth_subscribe
Creates a subscription to receive real-time updates for various events on the Ethereum blockchain
Request
Examples
wscat -c wss://rpc.xone.org
{"jsonrpc":"2.0","id": 2, "method": "eth_subscribe", "params": ["newHeads"]}'
Response
200 OK
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x1234567890abcdef1234567890abcdef"
}
Request params
Name | Type | Description |
---|---|---|
id | integer | Request identifier |
jsonrpc | string | JSON-RPC version |
method | string | API method name |
Parameters | array of strings | |
subscription_name | string | Specifies the event type for subscription. Supported types include: |
data | object | Is specifically used for logs subscriptions. Arguments like address, multiple addresses, and topics. |
Response
200
The subscription ID, represented as a hexadecimal string. Name | Type | Description |
---|---|---|
Parameters | object | |
id | integer | |
jsonrpc | string | |
result | string |