newFlashblockTransactions - Flashblocks

This subscribes to individual preconfirmed transactions as they land in Flashblocks. Each notification carries one transaction. Pass true as a second parameter to include full transaction objects with associated logs; omit or pass false to receive only transaction hashes. Lighter-weight than newFlashblocks when you only care about the transaction stream and not the full block state.

WebSocket-only method. This method requires the WebSocket transport at wss://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/. It will not work via HTTP POST. Preconfirmed events arrive at the Flashblock cadence — approximately every 200ms on Base, 250ms on Optimism.

Parameters

ParameterTypeRequiredDescription
subscriptionTypestringYesMust be "newFlashblockTransactions"
includeFullObjectsbooleanNotrue to receive full transaction objects with logs; false (default) for hashes only

Request Example

bash# WebSocket-only. Use wscat (or similar) to connect first:
wscat -c 'wss://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/'

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

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

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

ws.on('message', (data) => {
    const msg = JSON.parse(data.toString());
    if (msg.method === 'eth_subscription') {
        // Preconfirmed data update
        console.log(msg.params.result);
    } else {
        // Subscription ID response
        console.log('Subscribed:', msg.result);
    }
});
pythonimport asyncio
import json
import websockets

async def main():
    async with websockets.connect('wss://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/') as ws:
        await ws.send(json.dumps({
    "jsonrpc": "2.0",
    "method": "eth_subscribe",
    "params": [
        "newFlashblockTransactions",
        true
    ],
    "id": "getblock.io"
}))
        async for message in ws:
            msg = json.loads(message)
            if msg.get('method') == 'eth_subscription':
                # Preconfirmed data update
                print(msg['params']['result'])
            else:
                # Subscription ID response
                print('Subscribed:', msg.get('result'))

asyncio.run(main())
rustuse tokio_tungstenite::connect_async;
use tokio_tungstenite::tungstenite::Message;
use serde_json::json;
use futures_util::{SinkExt, StreamExt};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let (mut ws_stream, _) = connect_async("wss://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/").await?;

    let payload = json!({
        "jsonrpc": "2.0",
        "method": "eth_subscribe",
        "params": [
                "newFlashblockTransactions",
                true
        ],
        "id": "getblock.io"
});
    ws_stream.send(Message::Text(payload.to_string())).await?;

    while let Some(msg) = ws_stream.next().await {
        println!("{:?}", msg?);
    }
    Ok(())
}

Response Example

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

Response Parameters

FieldTypeDescription
resultstringHex-encoded subscription ID. Each subsequent notification carries either a transaction hash (default) or a full transaction object with logs (true param)

Use Cases

  • Wallet infrastructure watching for a specific user's transactions to preconfirm
  • Transaction-level analytics without the overhead of full block payloads
  • Building activity feeds for accounts with sub-second latency
  • Front-running detection at the sub-block level

Error Handling

Status CodeError MessageCause
403ForbiddenMissing or invalid <ACCESS-TOKEN>
-32602Invalid paramsRequest parameters are missing or malformed
-32603Internal errorServer-side error while processing the request
429Too Many RequestsRate limit exceeded for your plan
-32600Invalid RequestSubscription called over HTTP; use WebSocket

SDK Integration

javascriptimport { ethers } from 'ethers';

const provider = new ethers.WebSocketProvider('wss://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/');

// Flashblocks subscription types aren't first-class in ethers — use the raw send interface:
const subscriptionId = await provider.send('eth_subscribe', ["newFlashblockTransactions", true]);
console.log('Subscribed:', subscriptionId);

// Listen for incoming events on the WebSocket transport
provider.websocket.addEventListener('message', (event) => {
    const msg = JSON.parse(event.data);
    if (msg.method === 'eth_subscription' && msg.params?.subscription === subscriptionId) {
        console.log('Flashblocks update:', msg.params.result);
    }
});
javascriptimport { createPublicClient, webSocket } from 'viem';

const client = createPublicClient({
    transport: webSocket('wss://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/')
});

// Flashblocks subscription types use the raw request interface:
const subscriptionId = await client.request({
    method: 'eth_subscribe',
    params: ["newFlashblockTransactions", true]
});
console.log('Subscribed:', subscriptionId);