eth_getBlockByNumber

Returns information of the block matching the given block number.

📘

Supported on Fantom (mainnet) only.

Parameters

  • blockNumber/tag - string - The block number in hexadecimal format or the string latest, earliest, pending, safe or finalized
  • transaction detail flag - boolean - (default: false) The method returns the full transaction objects when this value is true otherwise, it returns only the hashes of the transactions

Returns

  • object- A block object, or null when no block was found
    • difficulty- The integer of the difficulty for this block encoded as a hexadecimal
    • extraData- The “extra data” field of this block
    • gasLimit- The maximum gas allowed in this block encoded as a hexadecimal
    • gasUsed- The total used gas by all transactions in this block encoded as a hexadecimal
    • hash- The block hash of the requested block. null if pending
    • logsBloom- The bloom filter for the logs of the block. null if pending
    • miner- The address of the beneficiary to whom the mining rewards were given
    • mixHash- A string of a 256-bit hash encoded as a hexadecimal
    • nonce- The hash of the generated proof-of-work. null if pending
    • number- The block number of the requested block encoded as a hexadecimal. null if pending
    • parentHash- The hash of the parent block
    • receiptsRoot- The root of the receipts trie of the block
    • sha3Uncles- The SHA3 of the uncles data in the block
    • size- The size of this block in bytes as an Integer value encoded as hexadecimal
    • stateRoot- The root of the final state trie of the block
    • timestamp- The unix timestamp for when the block was collated
    • totalDifficulty- The integer of the total difficulty of the chain until this block encoded as a hexadecimal
    • transactions- An array of transaction objects - please see eth_getTransactionByHash for exact shape
    • transactionsRoot- The root of the transaction trie of the block
    • uncles- An array of uncle hashes

API Endpoint

The format of a Fantom API endpoint is
https://open-platform.nodereal.io/{{apiKey}}/fantom/

Here is an example:
https://open-platform.nodereal.io/4c0a1c23661a4e26bcbcwed461e34ea9/fantom/

Example

Request

curl https://open-platform.nodereal.io/{{apiKey}}/fantom/ \
  -X POST \
  -H "Content-Type: application/json" \
  --data '{"method":"eth_getBlockByNumber","params":["0xc5043f",false],"id":1,"jsonrpc":"2.0"}'

Result