NEXUS

Ethereum JSON-RPC API Documentation

block

Block Information APIs

  1. eth_getBlockByHash - Returns information about a block by hash.
  2. eth_getBlockByNumber - Returns information about a block by its number.
  3. eth_getBlockTransactionCountByHash - Returns the number of transactions in a block by hash.
  4. eth_getBlockTransactionCountByNumber - Returns the number of transactions in a block by number.
  5. eth_getUncleCountByBlockHash - Returns the number of uncle blocks in a block by hash.
  6. eth_getUncleCountByBlockNumber - Returns the number of uncle blocks in a block by number.
  7. eth_getBlockReceipts - Returns the receipts of a block by number or hash.

Block Information APIs

1. eth_getBlockByHash

Summary: Returns information about a block by hash.

Parameters:

  • Block hash (Required): The hash of the block to retrieve.
  • Hydrated transactions (Required, Boolean): Whether to include detailed transaction data.

Response:

  • Result Name: Block information
  • Schema:
    • One of:
      • $ref: '#/components/schemas/notFound'
      • $ref: '#/components/schemas/Block'

Example:

{
  "method": "eth_getBlockByHash",
  "params": [
    "0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c",
    false
  ],
  "result": {
    "number": "0x68b3",
    "hash": "0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c",
    "parentHash": "0x1f68ac259155e2f38211ddad0f0a15394d55417b185a93923e2abe71bb7a4d6d",
    "nonce": "0x378da40ff335b070",
    "miner": "0xb42b6c4a95406c78ff892d270ad20b22642e102d",
    "difficulty": "0x66e619a",
    "totalDifficulty": "0x1e875d746ae",
    "size": "0x334",
    "gasLimit": "0x47e7c4",
    "gasUsed": "0x37993",
    "timestamp": "0x5835c54d",
    "transactions": [
      "0xa0807e117a8dd124ab949f460f08c36c72b710188f01609595223b325e58e0fc",
      "0xeae6d797af50cb62a596ec3939114d63967c374fa57de9bc0f4e2b576ed6639d"
    ]
  }
}

2. eth_getBlockByNumber

Summary: Returns information about a block by its number.

Parameters:

  • Block number or tag (Required): The block number (e.g., 0x68b3) or predefined tag (e.g., latest).
  • Hydrated transactions (Required, Boolean): Whether to include full transaction details.

Response:

  • Result Name: Block information
  • Schema:
    • One of:
      • $ref: '#/components/schemas/notFound'
      • $ref: '#/components/schemas/Block'

Example:

{
  "method": "eth_getBlockByNumber",
  "params": [ "0x68b3", false ],
  "result": {
    "number": "0x68b3",
    "hash": "0xd5f1812548be429cbdc6376b29611fc49e06f1359758c4ceaaa3b393e2239f9c",
    "parentHash": "0x1f68ac259155e2f38211ddad0f0a15394d55417b185a93923e2abe71bb7a4d6d",
    "nonce": "0x378da40ff335b070",
    "miner": "0xb42b6c4a95406c78ff892d270ad20b22642e102d",
    "difficulty": "0x66e619a",
    "totalDifficulty": "0x1e875d746ae",
    "size": "0x334",
    "gasLimit": "0x47e7c4",
    "gasUsed": "0x37993",
    "timestamp": "0x5835c54d",
    "transactions": [
      "0xa0807e117a8dd124ab949f460f08c36c72b710188f01609595223b325e58e0fc",
      "0xeae6d797af50cb62a596ec3939114d63967c374fa57de9bc0f4e2b576ed6639d"
    ]
  }
}

...

(이하 모든 API에 대해 같은 형식으로 result의 명칭, 스키마 추가 및 예제 코드의 모든 내용 포함)

© 2025 NEXUS Co., Ltd. All Rights Reserved.