For the complete documentation index, see llms.txt. This page is also available as Markdown.

eth_subscribe tempo

WebSocket-only method. Available only over the WebSocket transport at wss://go.getblock.io/<ACCESS-TOKEN>/. Calling it over HTTP POST returns an Invalid Request error.

Creates a real-time subscription over a WebSocket connection. Available subscription types are newHeads (new block headers), logs (matching contract events), and newPendingTransactions (mempool). Only available over WebSocket transport — use wss://go.getblock.io/<ACCESS-TOKEN>/.

Parameters

Parameter
Type
Required
Description

subscriptionType

string

Yes

One of "newHeads", "logs", "newPendingTransactions"

filterObject

object

No

For "logs": filter with address and/or topics

Request Example

# WebSocket-only method. Use wscat (or similar) to connect first:
wscat -c 'wss://go.getblock.io/<ACCESS-TOKEN>/'

# Then send:
{"jsonrpc": "2.0", "method": "eth_subscribe", "params": ["newHeads"], "id": "getblock.io"}
import WebSocket from 'ws';

const ws = new WebSocket('wss://go.getblock.io/<ACCESS-TOKEN>/');

ws.on('open', () => {
    ws.send(JSON.stringify({
    "jsonrpc": "2.0",
    "method": "eth_subscribe",
    "params": [
        "newHeads"
    ],
    "id": "getblock.io"
}));
});

ws.on('message', (data) => {
    console.log(JSON.parse(data.toString()));
});

Response Example

{
    "jsonrpc": "2.0",
    "id": "getblock.io",
    "result": "0x9cef478923ff08bf67fde6c64013158d"
}

Response Parameters

Field
Type
Description

result

string

Subscription ID, used to match incoming eth_subscription notifications and to call eth_unsubscribe

Use Cases

  • Real-time payment notifications for merchant integrations

  • Live TIP-20 transfer feeds for wallets

  • Streaming indexers that react to new Tempo blocks instantly

Error Handling

Status Code
Error Message
Cause

403

Forbidden

Missing or invalid <ACCESS-TOKEN>

-32602

Invalid params

Request parameters are missing or malformed

-32601

Method not found

Method does not exist or is not enabled on this node

429

Too Many Requests

Rate limit exceeded for your plan

-32600

Invalid Request

eth_subscribe was called over HTTP; use a WebSocket connection instead

SDK Integration

Was this helpful?