Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/BlockRazorinc/docs_en/llms.txt

Use this file to discover all available pages before exploring further.

The BSC Block Stream delivers confirmed block data from the BNB Smart Chain to your application with minimal latency. As soon as a new block is produced, BlockRazor’s infrastructure pushes the full block payload — including the complete transaction list — to every connected subscriber. This stream is built for trading programs that need to monitor confirmed signal transactions, detect on-chain events, or maintain a synchronized view of the BSC chain state. The service is priced at $500 per stream per month.
Block Stream uses the NewBlocks method. Each message represents one fully confirmed block, including all transactions within it. For unconfirmed activity, see the Public Mempool or Private Mempool streams.

Connection Details

PropertyValue
ProtocolWebSocket (WSS) or gRPC
WS Endpointwss://blockstream.blockrazor.io/bsc?auth=YOUR_AUTH_TOKEN
MethodNewBlocks
Pricing$500 / stream / month
ChainBNB Smart Chain (BSC)
Replace YOUR_AUTH_TOKEN with the API token from your BlockRazor dashboard. Both WebSocket and gRPC transports require this token for authentication.

Authentication

For the WebSocket transport, pass the token as a query parameter:
wss://blockstream.blockrazor.io/bsc?auth=YOUR_AUTH_TOKEN
For gRPC, attach the token as a Bearer token in the authorization metadata header on your outgoing context.

Code Examples

const WebSocket = require('ws');

const ws = new WebSocket(
  'wss://blockstream.blockrazor.io/bsc?auth=YOUR_AUTH_TOKEN'
);

ws.on('open', () => console.log('Connected to BSC Block Stream'));

ws.on('message', (data) => {
  const block = JSON.parse(data);
  console.log(
    'New block:', block.number,
    'txs:', block.transactions.length,
    'hash:', block.hash
  );
});

ws.on('error', (err) => console.error('WebSocket error:', err));
ws.on('close', () => console.log('Stream connection closed'));
Decode block.number from its hex string with parseInt(block.number, 16) in JavaScript or new(big.Int).SetString(block.Number[2:], 16) in Go for numeric comparisons.

Response Fields

Each WebSocket or gRPC message represents a single confirmed BSC block.
number
string
required
The block number as a hex-encoded string (e.g. "0x1A2B3C"). Decode to decimal for sequential comparisons.
hash
string
required
The 32-byte block hash uniquely identifying this block on the BSC chain (e.g. 0xd4e5...).
timestamp
string
required
Unix timestamp of block production, hex-encoded (e.g. "0x6612FC80"). Represents the time the block was sealed by the validator.
transactions
array
required
Array of transaction objects included in this block. Each object carries the same fields as a mempool transaction message: hash, from, to, value, gas, gasPrice, and data.

Example Message

{
  "number": "0x1A7F3C2",
  "hash": "0xc2d1e3f4a5b6c7d8e9f0a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2",
  "timestamp": "0x6612FC80",
  "transactions": [
    {
      "hash": "0xf1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f9a0b1c2d3e4f5a6b7c8d9e0f1a2",
      "from": "0xDe0B295669a9FD93d5F28D9Ec85E40f4cb697BA",
      "to": "0x10ED43C718714eb63d5aA57B78B54704E256024E",
      "value": "0x0",
      "gas": "0x493E0",
      "gasPrice": "0x12A05F200",
      "data": "0x38ed1739..."
    }
  ]
}

Pricing & Discounts

Subscription PeriodDiscount
1 month
3 months5% off
6 months10% off
9 months15% off
12 months20% off
The BSC Block Stream is also available as part of the BSC Package bundle. See the Pricing page for details.

Build docs developers (and LLMs) love