🐹
ChainRPC
  • Welcome to Chain-RPC Docs
  • Getting started
  • Networks
    • Ethereum
      • Concepts
        • Transaction types
        • Filters and subscriptions
      • How to
        • Authenticate requests
        • Make requests
        • Make batch requests
        • Choose a network
        • Subscribe to events
        • Interact with ERC-20 tokens
        • Add a network add-on
        • Secure a project
          • API key
          • API key secret
          • JWTs
          • Rate limits
          • Allowlists
        • Avoid rate limiting
      • JSON-RPC methods
        • eth_accounts
        • eth_blockNumber
        • eth_call
        • eth_chainId
        • eth_coinbase
        • eth_estimateGas
        • eth_feeHistory
        • eth_getBalance
        • eth_gasPrice
        • eth_getBlockByHash
        • eth_getBlockByNumber
        • eth_getBlockTransactionCountByHash
        • eth_getBlockTransactionCountByNumber
        • eth_getCode
        • eth_getLogs
        • eth_getStorageAt
        • eth_getTransactionByBlockHashAndIndex
        • eth_getTransactionByBlockNumberAndIndex
        • eth_getTransactionByHash
        • eth_getTransactionCount
        • eth_getTransactionReceipt
        • eth_getUncleByBlockHashAndIndex
        • eth_getUncleByBlockNumberAndIndex
        • eth_getUncleCountByBlockHash
        • eth_getUncleCountByBlockNumber
        • eth_getWork
        • eth_mining
        • eth_hashrate
        • eth_protocolVersion
        • eth_sendRawTransaction
        • eth_sendTransaction
        • eth_sign
        • eth_submitWork
        • eth_syncing
        • net_listening
        • net_peerCount
        • net_version
        • web3_clientVersion
        • Filter methods
          • eth_newFilter
          • eth_newBlockFilter
          • eth_newPendingTransactionFilter
          • eth_getFilterLogs
          • eth_getFilterChanges
          • eth_uninstallFilter
        • Subscription methods
          • eth_subscribe
          • eth_unsubscribe
    • Arbitrum
      • How to
        • Authenticate requests
        • Make requests
        • Choose a network
        • Secure a project
        • Get testnet ETH
      • JSON-RPC API methods
    • Aurora
      • How to
      • JSON-RPC API methods
    • Avalanche (C-Chain)
      • How to
      • JSON-RPC API methods
    • BNB Chain
      • How to
      • JSON-RPC API methods
    • Celo
      • How to
      • JSON-RPC API methods
    • Cube
      • How to
      • JSON-RPC API methods
    • Fantom
      • How to
      • JSON-RPC API methods
    • Gnosis
      • How to
      • JSON-RPC API methods
    • Heco
      • How to
      • JSON-RPC API methods
    • Klaytn
      • How to
      • JSON-RPC API methods
    • Optimism
      • How to
      • JSON-RPC API methods
    • OEC Chain
      • How to
      • JSON-RPC API methods
    • Polygon PoS
      • How to
      • JSON-RPC API methods
  • Custom APIs
    • Wellat SDK
    • DeX SDK
    • NFT SDK
Powered by GitBook
On this page
  • REQUEST
  • RESPONSE
  1. Networks
  2. Ethereum
  3. JSON-RPC methods

eth_getUncleByBlockHashAndIndex

Returns information about the 'Uncle' of a block by hash and the Uncle index position.

REQUEST

POST https://<network>.chainrpc.io/v3/YOUR-API-KEY

HEADERS

Content-Type: application/json

REQUEST PARAMS

  • BLOCK HASH [required] - a string representing the hash (32 bytes) of a block

  • UNCLE INDEX POSITION [required] - a hex of the integer indicating the uncle's index position.

EXAMPLE

## JSON-RPC over HTTPS POST
## Replace YOUR-API-KEY with an API key from your chainRPC Dashboard
## You can also replace mainnet with a different supported network
curl https://rpc.chainrpc.io/v3/YOUR-API-KEY \
    -X POST \
    -H "Content-Type: application/json" \
    -d '{"jsonrpc":"2.0","method":"eth_getUncleByBlockHashAndIndex","params": ["0xb3b20624f8f0f86eb50dd04688409e5cea4bd02d700bf6e79e9384d47d6a5a35","0x0"],"id":1}'

## JSON-RPC over WSS
## Replace YOUR-API-KEY with an API key from your chainRPC Dashboard
## You can also replace mainnet with a different supported network
wscat -c wss://eth.chainrpc.io/v3/YOUR-API-KEY
>{"jsonrpc":"2.0","method":"eth_getUncleByBlockHashAndIndex","params": ["0xb3b20624f8f0f86eb50dd04688409e5cea4bd02d700bf6e79e9384d47d6a5a35","0x0"],"id":1}

RESPONSE

RESULT FIELDS

  • BLOCK - A block object, or null when no block was found

    • number: the block number. Null when the returned block is the pending block.

    • hash: 32 Bytes - hash of the block. null when its pending block.

    • parentHash: 32 Bytes - hash of the parent block.

    • nonce: 8 Bytes - hash of the generated proof-of-work. Null when the returned block is the pending block.

    • sha3Uncles: 32 Bytes - SHA3 of the uncles data in the block.

    • logsBloom: 256 Bytes - the bloom filter for the logs of the block. Null when the returned block is the pending block.

    • transactionsRoot: 32 Bytes - the root of the transaction trie of the block.

    • stateRoot: 32 Bytes - the root of the final state trie of the block.

    • receiptsRoot: 32 Bytes - the root of the receipts trie of the block.

    • miner: 20 Bytes - the address of the beneficiary to whom the mining rewards were given.

    • difficulty: hexadecimal of the difficulty for this block.

    • totalDifficulty: hexadecimal of the total difficulty of the chain until this block.

    • extraData: the "extra data" field of this block.

    • size: hexadecimal the size of this block in bytes.

    • gasLimit: the maximum gas allowed in this block.

    • gasUsed: the total used gas by all transactions in this block.

    • timestamp: the unix timestamp for when the block was collated.

    • uncles: an Array of uncle hashes.

Note: An uncle doesn't contain individual transactions.

BODY

{
    "jsonrpc": "2.0",
    "id": 1,
    "result": {
        "difficulty": "0xbf93da424b943",
        "extraData": "0x65746865726d696e652d657539",
        "gasLimit": "0x7a121d",
        "gasUsed": "0x79ea62",
        "hash": "0x824cce7c7c2ec6874b9fa9a9a898eb5f27cbaf3991dfa81084c3af60d1db618c",
        "logsBloom": "0x0948432021200401804810002000000000381001001202440000010020000080a016262050e44850268052000400100505022305a64000054004200b0c04110000080c1055c42001054b804940a0401401008a00112d80082113400c10006580140005011a40220020000010001c0a00082300434002000050840010102082801c2000148540201004491814020480080111a0300600000003800640024200109c00202010044000880000106810a1a010000028a0100000422000140011000050a2a44b3080001060800000540c108102102600d000004730404a880100600021080100403000180000062642408b440060590400080101e046f08000000430",
        "miner": "0xea674fdde714fd979de3edf0f56aa9716b898ec8",
        "mixHash": "0x0b15fe0a9aa789c167b0f5ade7b72969d9f2193014cb4e98382254f60ffb2f4a",
        "nonce": "0xa212d6400b89b3f6",
        "number": "0x5bad54",
        "parentHash": "0x05e19fb68d9ec798073808e8b3170875cb327d4b6cde7d6f60fe194677bb26fd",
        "receiptsRoot": "0x90807b32c4aa4610c57289de57fa68ba50ed53f14dd2c25f1862aa049029dcd6",
        "sha3Uncles": "0xf763576c1ea6a8c61a206e16b1a2451bec5cba1c7545d7ff733a1e8c78715569",
        "size": "0x216",
        "stateRoot": "0xebc7a1603bfffe0a14bdb89f898e2f2824abb40f04579beb7b920c56d6e273c9",
        "timestamp": "0x5b54143f",
        "totalDifficulty": null,
        "transactionsRoot": "0x7562cba41e067b364b933e7b566fb2444f6954fef3964a5a487d4cd79d97a56c",
        "uncles": []
    }
}
Previouseth_getTransactionReceiptNexteth_getUncleByBlockNumberAndIndex

Last updated 2 years ago