> ## Documentation Index
> Fetch the complete documentation index at: https://docs.base.org/llms.txt
> Use this file to discover all available pages before exploring further.

# newFlashblocks

> Subscribe to receive full Flashblock payload stream as each pre-confirmed block is built. Only available on Flashblocks WebSocket endpoints.

Subscribe via `eth_subscribe` to receive full block state updates as each Flashblock is built. Each message contains the accumulated pre-confirmed state for the block in progress.

<Info>
  Only available on Flashblocks WebSocket endpoints: `wss://mainnet-preconf.base.org` and `wss://sepolia-preconf.base.org`.
</Info>

<Note>
  Requires [base/base](https://github.com/base/base) minimum client version v0.3.1.
</Note>

<Warning>
  Each subscription emits **one Flashblock Object per WebSocket message**. Events arrive approximately every 200ms. If your handler performs heavy processing per event, throttle or debounce it to avoid blocking.
</Warning>

## Parameters

<ParamField body="subscriptionType" type="string" required>
  Must be `"newFlashblocks"`.
</ParamField>

## Returns

<ResponseField name="result" type="string">
  Hex-encoded subscription ID. Each event notification delivers a **Flashblock Object** — not a standard block object. The payload contains `payload_id`, `index`, `diff`, and (on index 0) `base`. See the [Infrastructure Stream schema](/base-chain/api-reference/flashblocks-api/flashblocks-api-overview#flashblock-object) for the full structure.
</ResponseField>

## Example

<CodeGroup>
  ```json Subscribe theme={null}
  {"jsonrpc": "2.0", "id": 1, "method": "eth_subscribe", "params": ["newFlashblocks"]}
  ```

  ```json Subscription ID Response theme={null}
  {"jsonrpc": "2.0", "id": 1, "result": "0x3b8cd9e5f4a7b2c1d0e3f4a5b6c7d8e9"}
  ```

  ```javascript JavaScript theme={null}
  import WebSocket from 'ws';

  // Use a Flashblocks-enabled provider WSS endpoint in production
  const ws = new WebSocket('wss://mainnet-preconf.base.org');

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

  ws.on('message', (data) => {
    const msg = JSON.parse(data.toString());
    if (msg.method === 'eth_subscription') {
      // Fires every ~200ms with the latest Flashblock state
      console.log('Flashblock update:', msg.params.result);
    }
  });
  ```
</CodeGroup>
