Base Block Stream — BlockStream & FlashBlock Subscriptions
Subscribe to BlockRazor’s low-latency Base block data or ultra-low-latency FlashBlock pre-confirmation data over WebSocket for real-time chain monitoring.
Use this file to discover all available pages before exploring further.
BlockRazor offers two complementary block streaming products for the Base network: GetBlockStream for standard low-latency confirmed block data, and GetFlashBlockStream for ultra-low-latency pre-confirmation FlashBlock data sourced directly from the Base sequencer. Both streams are delivered over WebSocket and target applications that need to react to on-chain events as quickly as possible — from arbitrage bots and copy-trading systems to real-time dashboards and order management systems.
FlashBlock is a pre-confirmation block emitted by the Base sequencer before the full block is finalized and published to the network. FlashBlocks arrive earlier than standard confirmed blocks, giving subscribers a significant time advantage for latency-sensitive strategies.
Replace YOUR_AUTH_TOKEN with the API token from your BlockRazor dashboard. Both stream types share the same base endpoint — the method you call after connection determines which stream you receive.
GetBlockStream subscribes to fully confirmed Base blocks as they are published. Each message contains the complete block payload including all transactions, the block number, hash, and timestamp. This stream is well-suited for applications that need high confidence in data finality while still maintaining low latency.
GetFlashBlockStream subscribes to FlashBlocks — pre-confirmation blocks emitted by the Base sequencer before the full block is published to the network. FlashBlocks contain a partial or complete set of transactions that the sequencer has committed to including in the next block, allowing subscribers to act on this information before the rest of the network sees the confirmed block.Use the ParseFlashBlock helper function to decode the raw FlashBlock payload into a structured object that mirrors the standard block format.
$250 / stream / month — with multi-month discounts up to 20% for 12-month subscriptions.
FlashBlocks represent the sequencer’s current ordering intent and may differ slightly from the finalized block in edge cases such as sequencer restarts. Always verify critical state transitions against confirmed blocks.
const WebSocket = require('ws');const ws = new WebSocket( 'wss://blockstream.blockrazor.io/base?auth=YOUR_AUTH_TOKEN');/** * ParseFlashBlock decodes a raw FlashBlock message payload * into a structured block-like object. * * @param {string|Buffer} rawData - Raw WebSocket message data * @returns {Object} Parsed FlashBlock with number, hash, transactions, timestamp */function ParseFlashBlock(rawData) { const payload = JSON.parse(rawData); return { number: payload.block_number, hash: payload.block_hash, timestamp: payload.timestamp, transactions: payload.txs || [], isFlashBlock: true, sequencerCommit: payload.sequencer_commit, };}ws.on('open', () => { console.log('Connected to Base FlashBlockStream'); // Request the FlashBlock pre-confirmation stream ws.send(JSON.stringify({ method: 'GetFlashBlockStream' }));});ws.on('message', (data) => { const flashBlock = ParseFlashBlock(data); console.log( 'FlashBlock received — block:', flashBlock.number, 'txs:', flashBlock.transactions.length, 'sequencer commit:', flashBlock.sequencerCommit );});ws.on('error', (err) => console.error('FlashBlockStream error:', err));ws.on('close', () => console.log('FlashBlockStream connection closed'));
Compare flashBlock.number against your last confirmed block number to detect new sequencer commitments without waiting for full block finalization. This lets you pipeline transaction analysis and position adjustments ahead of the crowd.