eth_getUncleByBlockNumberAndIndex
Overview
The 'eth_getUncleByBlockNumberAndIndex' method rReturns information about a uncle of a block given the block number and the uncle index position.
Request
- curl
- python
- ruby
curl https://ethereum-mainnet-geth-archive.node.coinapi.io \
-X POST \
-H "Content-Type: application/json" \
--data '{"method":"eth_getTransactionByBlockNumberAndIndex","params":["0xc5043f", "0x0"],"id":1,"jsonrpc":"2.0"}'
import requests
import json
url = "https://ethereum-mainnet-geth-archive.node.coinapi.io/"
payload = json.dumps({
"method": "eth_getTransactionByBlockNumberAndIndex",
"params": [
"0xc5043f",
"0x0"
],
"id": 1,
"jsonrpc": "2.0"
})
headers = {
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
require "uri"
require "json"
require "net/http"
url = URI("https://ethereum-mainnet-geth-archive.node.coinapi.io/")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request.body = JSON.dump({
"method": "eth_getTransactionByBlockNumberAndIndex",
"params": [
"0xc5043f",
"0x0"
],
"id": 1,
"jsonrpc": "2.0"
})
response = https.request(request)
puts response.read_body
Request Parameters
- block parameter: [ Required ] A hexadecimal block number, or the string 'latest', 'earliest' or 'pending'. Refer to the default block parameter.
- uncle index position: [ Required ] A hexadecimal equivalent of the integer indicating the uncle's index position.
Response
{
"jsonrpc": "2.0",
"id": 1,
"result": null
}
A block object, or null when no block was found. The block object returned will consist of the following keys and their values:
- 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. The 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: The hexadecimal of the difficulty for this block.
- totalDifficulty: The hexadecimal of the total difficulty of the chain until this block.
- extraData: The "extra data" field of this block.
- size: The hexadecimal of the size of this block in bytes.
- gasLimit: Maximum gas allowed in this block.
- gasUsed: Total used gas by all transactions in this block.
- timestamp: The unix timestamp for when the block was collated.
- uncles: (Array). An array of uncle hashes.
Was this section helpful?