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

newFlashblockTransactions - Flashblocks

Example code for the newFlashblockTransactions Flashblocks method. Complete guide on how to use newFlashblockTransactions Flashblocks in GetBlock Web3 documentation.

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.

Parameters

Parameter
Type
Required
Description

subscriptionType

string

Yes

Must be "newFlashblockTransactions"

includeFullObjects

boolean

No

true to receive full transaction objects with logs; false (default) for hashes only

Request Example

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

# Then send:
{"jsonrpc": "2.0", "method": "eth_subscribe", "params": ["newFlashblockTransactions", true], "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": [
        "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);
    }
});

Response Example

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

Response Parameters

Field
Type
Description

result

string

Hex-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 Code
Error Message
Cause

403

Forbidden

Missing or invalid <ACCESS-TOKEN>

-32602

Invalid params

Request parameters are missing or malformed

-32603

Internal error

Server-side error while processing the request

429

Too Many Requests

Rate limit exceeded for your plan

-32600

Invalid Request

Subscription called over HTTP; use WebSocket

SDK Integration

Last updated

Was this helpful?