Docs

starknet_getBlockWithTxHashes - Get block I...

Get block information with transaction hashes given the block id

Get block information with transaction hashes given the block id

Parameters

ParameterTypeDescription
block_idstringBlock reference ("latest", "l1_accepted", block hash, or block number)

Request

JSON
{
  "jsonrpc": "2.0",
  "method": "starknet_getBlockWithTxHashes",
  "params": [
    {
      "block_hash": "0x05abbad1e5"
    }
  ],
  "id": 1
}

Returns

The resulting block information with transaction hashes

Block information with transaction hashes

Errors

CodeMessage
24Block not found

Examples

Bash
curl -X POST https://api-starknet-mainnet.n.dwellir.com/YOUR_API_KEY \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "method": "starknet_getBlockWithTxHashes",
    "params": [
      {
        "block_hash": "0x05abbad1e5"
      }
    ],
    "id": 1
  }'
JavaScript
import { RpcProvider } from 'starknet';

const provider = new RpcProvider({
  nodeUrl: 'https://api-starknet-mainnet.n.dwellir.com/YOUR_API_KEY',
});

const payload = {
  method: 'starknet_getBlockWithTxHashes',
  params: [
    {
      "block_hash": "0x05abbad1e5"
    }
  ]
};

const result = await provider.fetchEndpoint(payload.method, payload.params);
console.log(result);

On this page