← Robinhood Chain overview

Robinhood Chain · eth

eth_getBlockTransactionCountByHash

Returns the number of transactions in a block from a block matching the given block hash.

Parameters

  • Block hash required
    Schema
    {
      "type": "string",
      "title": "32 byte hex value",
      "pattern": "^0x[0-9a-f]{64}$"
    }

cURL

Endpoint: https://rh-mainnet.eu1.azxa.io/<api-key> — replace <api-key> with your API key from the Azxa app .

Terminal
curl -X POST https://rh-mainnet.eu1.azxa.io/<api-key> \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"eth_getBlockTransactionCountByHash","params":["0xb903239f8543d04b5dc1ba6579132b143087c68db1b2168786408fcbce568238"]}'

Example request

JSON-RPC
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "eth_getBlockTransactionCountByHash",
  "params": [
    "0xb903239f8543d04b5dc1ba6579132b143087c68db1b2168786408fcbce568238"
  ]
}

Result

Transaction count

Example response
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "0x8"
}
Schema
{
  "oneOf": [
    {
      "type": "null",
      "title": "Not Found (null)"
    },
    {
      "type": "string",
      "title": "Transaction count",
      "pattern": "^0x(0|[1-9a-f][0-9a-f]*)$"
    }
  ]
}

Test fixture

Fixture: get-block-n

Request
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "eth_getBlockTransactionCountByHash",
  "params": [
    "0x80e911b62f552f563a2544dfef5eb39ec8863d9082c998ca6b657f76e19de38e"
  ]
}
Response
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "0x4"
}