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

newFlashblocks - Flashblocks

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

This subscribes to the full Flashblocks payload stream as each preconfirmed sub-block is built. Each notification delivers a Flashblocks Object containing payload_id, index (0-9 on Base, 0-7 on Optimism), diff (the delta since the previous Flashblocks), and — on the first Flashblocks of a new block (index: 0) — a base field with the block's initial state. This is the lowest-latency Flashblocks subscription and the canonical way to build sub-block indexers.

Parameters

Parameter
Type
Required
Description

subscriptionType

string

Yes

Must be "newFlashblocks"

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": ["newFlashblocks"], "id": "getblock.io"}

Response Example

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

Response Parameters

Field
Type
Description

result

string

Hex-encoded subscription ID. Each subsequent eth_subscription notification carries a Flashblocks Object payload with payload_id, index, diff, and (on index 0) base

Use Cases

  • Sub-block indexers — the primary streaming source for Flashblocks-native data

  • Real-time analytics dashboards showing block construction in progress

  • Trading infrastructure that needs the earliest possible view of sequencer-ordered transactions

  • MEV monitoring — observing preconfirmed transactions as they land

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

newFlashblocks subscription called over HTTP; use WebSocket

SDK Integration

Last updated

Was this helpful?