Skip to main content
The RPC API enables you to query the network and get details about specific blocks or chunks.

Quick Reference

MethodDescriptionParameters
blockGet block details by height, hash, or finalityfinality OR block_id
block_effectsGet changes in a specific blockfinality OR block_id
chunkGet chunk details by chunk_id or block_id + shard_idchunk_id OR block_id + shard_id

Block Details

Queries network and returns block for given height or hash. You can also use finality param to return latest block details. Note: You may choose to search by a specific block or finality, you cannot choose both.
  • method: block
  • params: finality OR block_id
{
  "jsonrpc": "2.0",
  "id": "dontcare",
  "method": "block",
  "params": {
    "finality": "final"
  }
}
{
  "jsonrpc": "2.0",
  "result": {
    "author": "node2",
    "chunks": [
      {
        "chunk_hash": "CzPafxtJmM1FnRoasKWAVhceJzZzkz9RKUBQQ4kY9V1v",
        "shard_id": 0,
        "gas_limit": 1000000000000000,
        "gas_used": 0,
        "height_created": 187310138,
        "height_included": 187310138
      }
    ],
    "header": {
      "hash": "6RWmTYhXCzjMjoY3Mz1rfFcnBm8E6XeDDbFEPUA4sv1w",
      "height": 187310138,
      "timestamp": 1739254177539033760,
      "gas_price": "100000000",
      "latest_protocol_version": 73
    }
  },
  "id": "dontcare"
}

Block Effects

Returns changes in a block for given block height or hash. Includes changes like account_touched, access_key_touched, data_touched, contract_code_touched.
  • method: block_effects
  • params: finality OR block_id
{
  "jsonrpc": "2.0",
  "id": "dontcare",
  "method": "block_effects",
  "params": {
    "finality": "final"
  }
}
{
  "jsonrpc": "2.0",
  "result": {
    "block_hash": "6RWmTYhXCzjMjoY3Mz1rfFcnBm8E6XeDDbFEPUA4sv1w",
    "block_effects": [
      { "account_id": "account.rpc-examples.testnet", "type": "account_touched" },
      { "account_id": "ping-account.testnet", "type": "account_touched" },
      { "account_id": "account.rpc-examples.testnet", "type": "access_key_touched" },
      { "account_id": "dev2-nsp.testnet", "type": "data_touched" }
    ]
  },
  "id": "dontcare"
}

Chunk Details

Returns details of a specific chunk. You can run a block details query to get a valid chunk hash.
  • method: chunk
  • params: chunk_id OR block_id + shard_id
{
  "jsonrpc": "2.0",
  "id": "dontcare",
  "method": "chunk",
  "params": {
    "chunk_id": "CzPafxtJmM1FnRoasKWAVhceJzZzkz9RKUBQQ4kY9V1v"
  }
}
{
  "jsonrpc": "2.0",
  "result": {
    "author": "kiln.pool.f863973.m0",
    "header": {
      "chunk_hash": "CzPafxtJmM1FnRoasKWAVhceJzZzkz9RKUBQQ4kY9V1v",
      "shard_id": 0,
      "gas_limit": 1000000000000000,
      "gas_used": 0,
      "height_created": 187310138,
      "height_included": 187310138
    },
    "receipts": [],
    "transactions": [
      {
        "hash": "J3KbUXF9YPu2eGnbDCACxGvmMDZMdP7acGYhVLHGu9y2",
        "signer_id": "account.rpc-examples.testnet",
        "receiver_id": "contract.rpc-examples.testnet"
      }
    ]
  },
  "id": "dontcare"
}

Error Handling

Error CodeDescriptionSolution
UNKNOWN_BLOCKBlock not found or garbage-collectedCheck block validity; use archival node for old blocks
UNKNOWN_CHUNKChunk not found in databaseVerify chunk ID; use archival node for old chunks
INVALID_SHARD_IDShard ID does not existProvide valid shard ID for existing shard
NOT_SYNCED_YETNode still syncingWait for sync completion or use different node
PARSE_ERRORInvalid request parametersCheck parameter format and completeness
INTERNAL_ERRORServer-side issueRetry request or try different RPC endpoint