Skip to main content

eth_getBlockByNumber

Gets a block for a given number

curl --request POST \
--url https://evm.confluxrpc.com \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '
{
"id": 1,
"jsonrpc": "2.0",
"params": ["latest",false],
"method": "eth_getBlockByNumber"
}'

Params

blocknumber required

Block Number or Tags
oneOf
type : string
Pattern : ^0x([1-9a-f][0-9a-f]{0,15}|0)$

includeTransactions required

Schema
type : boolean

Result

Block representation
type : object
  • author author
    type : string
    Pattern : ^0x[0-9,a-f,A-F]{40}$
  • baseFeePerGas baseFeePerGas
    type : string
    Pattern : ^0x([1-9a-f][0-9a-f]{0,63}|0)$
  • difficulty difficulty
    type : string
    Pattern : ^0x([1-9a-f][0-9a-f]{0,63}|0)$
  • extraData extraData
    type : string
    Pattern : ^0x[0-9a-f]*$
  • gasLimit gasLimit
    type : string
    Pattern : ^0x([1-9a-f][0-9a-f]{0,63}|0)$
  • gasUsed gasUsed
    type : string
    Pattern : ^0x([1-9a-f][0-9a-f]{0,63}|0)$
  • hash hash
    type : string
    Pattern : ^0x[0-9,a-f,A-F]{64}$
  • logsBloom logsBloom
    type : string
    Pattern : ^0x[0-9,a-f,A-F]{512}$
  • miner miner
    type : string
    Pattern : ^0x[0-9,a-f,A-F]{40}$
  • mixHash mixHash
    type : string
    Pattern : ^0x[0-9,a-f,A-F]{64}$
  • nonce nonce
    type : string
    Pattern : ^0x[0-9,a-f,A-F]{16}$
  • number number
    type : string
    Pattern : ^0x([1-9a-f][0-9a-f]{0,63}|0)$
  • parentHash parentHash
    type : string
    Pattern : ^0x[0-9,a-f,A-F]{64}$
  • receiptsRoot receiptsRoot
    type : string
    Pattern : ^0x[0-9,a-f,A-F]{64}$
  • sha3uncle sha3uncle
    type : string
    Pattern : ^0x[0-9,a-f,A-F]{64}$
  • size size
    type : string
    Pattern : ^0x([1-9a-f][0-9a-f]{0,63}|0)$
  • stateRoot stateRoot
    type : string
    Pattern : ^0x[0-9,a-f,A-F]{64}$
  • timestamp timestamp
    type : string
    Pattern : ^0x([1-9a-f][0-9a-f]{0,63}|0)$
  • totalDifficulty totalDifficulty
    type : string
    Pattern : ^0x([1-9a-f][0-9a-f]{0,63}|0)$
  • transactions transactions
    oneOf
    type : array
    • items[x] H256
      type : string
      Pattern : ^0x[0-9,a-f,A-F]{64}$
  • transactionsRoot transactionsRoot
    type : string
    Pattern : ^0x[0-9,a-f,A-F]{64}$
  • uncles uncles
    type : array
    • items[x] H256
      type : string
      Pattern : ^0x[0-9,a-f,A-F]{64}$

Examples

Request

curl -X POST --data \
'{
"jsonrpc": "2.0",
"id": 1,
"method": "eth_getBlockByNumber",
"params": [
"latest"
]
}' \
-H "Content-Type: application/json" \
localhost:12539

Response

{
"author": "0x166d0ff7691030b0ca33d4e60e842cd300a3010d",
"difficulty": "0x30058e5",
"extraData": "0x",
"gasLimit": "0x1c9c380",
"gasUsed": "0x0",
"hash": "0xd9c29e2a0574ffed11505d429b75eb8b05e23fca633a3f6ab6de525328106011",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"miner": "0x166d0ff7691030b0ca33d4e60e842cd300a3010d",
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"nonce": "0x75058810f98d0e6e",
"number": "0x43f3b63",
"parentHash": "0xa4800e7b733895d426e975e37ea97965ab242a7e114011dfd35f8be499249330",
"receiptsRoot": "0x09f8709ea9f344a810811a373b30861568f5686e649d6177fd92ea2db7477508",
"sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"size": "0x0",
"stateRoot": "0x1fc00508a2b18740af339125ec6198833703578d6de66b791340cbff425de77a",
"timestamp": "0x62554583",
"totalDifficulty": "0x0",
"transactions": [],
"transactionsRoot": "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",
"uncles": []
}