blockchainblockget

Rostrum Electrum for Bitcoin Cash

Overview

The blockchain.block.get method allows retrieving a full block based on its hash or height within the Bitcoin Cash blockchain via Rostrum Electrum. This is particularly useful for obtaining detailed block information, including transactions within the block.

Parameters

NameTypeRequiredDescription
height_or_hashstring or integerYesThe block hash (hex string) or block height (integer).

Returns

This method returns the raw block data as a hexadecimal string:

FieldDescription
blockHexThe full block data encoded as a hexadecimal string.

Example Result

{
  "blockHex": "0100...abcd"
}

Request Example

curl --location 'https://api.tatum.io/v3/blockchain/node/rostrum-mainnet/' \
--header 'Content-Type: application/json' \
--header 'x-api-key: {API_KEY}' \
--data '{
    "method": "blockchain.block.get",
    "params": ["00000000000000000176c6f9e3b8c23a5f9a07ae2b0f6cc6cc2d1b16869f97a3"],
    "id": 1,
    "jsonrpc": "2.0"
}'
// yarn add @tatumio/tatum

import { TatumSDK, Rostrum, Network } from '@tatumio/tatum'

const tatum = await TatumSDK.init<Rostrum>({ network: Network.ROSTRUM })

const blockData = await tatum.rpc.getBlock('00000000000000000176c6f9e3b8c23a5f9a07ae2b0f6cc6cc2d1b16869f97a3')

console.log(blockData)

await rostrum.destroy() // Destroy Tatum SDK - needed for stopping background jobs