curl --request POST \
--url https://api.uniblock.dev/uni/v1/json-rpc?chainId=1 \
--header 'content-type: application/json' \
--data '{
"id": 1,
"jsonrpc": "2.0",
"method": "eth_subscribe",
"params": [
"logs",
{
"fromBlock": "latest",
"toBlock": "latest"
}
]
}'
{
"jsonrpc": "2.0",
"id": 1,
"result": "0xb53c4832f1dca4a5"
}
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.
curl --request POST \
--url https://api.uniblock.dev/uni/v1/json-rpc?chainId=1 \
--header 'content-type: application/json' \
--data '{
"id": 1,
"jsonrpc": "2.0",
"method": "eth_subscribe",
"params": [
"logs",
{
"fromBlock": "latest",
"toBlock": "latest"
}
]
}'
{
"jsonrpc": "2.0",
"id": 1,
"result": "0xb53c4832f1dca4a5"
}
eth_subscribe:params[0]: Subscription type. Must be either “newHeads” or “logs”.params[1]: Filter options for “logs” subscription, or empty object for “newHeads”.“0xb53c4832f1dca4a5”.curl --request POST \
--url https://api.uniblock.dev/uni/v1/json-rpc?chainId=1 \
--header 'content-type: application/json' \
--data '{
"id": 1,
"jsonrpc": "2.0",
"method": "eth_subscribe",
"params": [
"logs",
{
"fromBlock": "latest",
"toBlock": "latest"
}
]
}'
{
"jsonrpc": "2.0",
"id": 1,
"result": "0xb53c4832f1dca4a5"
}
Was this page helpful?