eth_getBlockByNumber (BSC)
Returns information about a block by block number.
Parameters
  • QUANTITY|TAG - integer of a block number, or the string "earliest", "latest" or "pending", as in the default block parameter.
  • Boolean - If true it returns the full transaction objects, if false only the hashes of the transactions.
params: [
'0x119B705',
true
]
Returns
Object - A block object with the following fields, or null when no block was found:
  • number: QUANTITY - the block number. null when its pending block.
  • hash: DATA, 32 Bytes - hash of the block. null when its pending block.
  • parentHash: DATA, 32 Bytes - hash of the parent block.
  • nonce: DATA, 8 Bytes - hash of the generated proof-of-work. null when its pending block.
  • sha3Uncles: DATA, 32 Bytes - SHA3 of the uncles data in the block.
  • logsBloom: DATA, 256 Bytes - the bloom filter for the logs of the block. null when its pending block.
  • transactionsRoot: DATA, 32 Bytes - the root of the transaction trie of the block.
  • stateRoot: DATA, 32 Bytes - the root of the final state trie of the block.
  • receiptsRoot: DATA, 32 Bytes - the root of the receipts trie of the block.
  • miner: DATA, 20 Bytes - the address of the beneficiary to whom the mining rewards were given.
  • difficulty: QUANTITY - integer of the difficulty for this block.
  • totalDifficulty: QUANTITY - integer of the total difficulty of the chain until this block.
  • extraData: DATA - the "extra data" field of this block.
  • size: QUANTITY - integer the size of this block in bytes.
  • gasLimit: QUANTITY - the maximum gas allowed in this block.
  • gasUsed: QUANTITY - the total used gas by all transactions in this block.
  • timestamp: QUANTITY - the unix timestamp for when the block was collated.
  • transactions: Array - Array of transaction objects, or 32 Bytes transaction hashes depending on the last given parameter.
  • uncles: Array - Array of uncle hashes.
  • baseFeePerGas - the minimum fee per gas required for a transaction to be included in the block.
  • mixHash – a unique identifier for that block.
Request example
Curl
Postman
curl https://bsc.api.watchdata.io/node/jsonrpc?api_key=your_api_key
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["0x119B705", true],"id":0}'
URL: https://bsc.api.watchdata.io/node/jsonrpc?api_key=your_api_key
RequestType: POST
Body:
{
"jsonrpc":"2.0",
"method":"eth_getBlockByNumber",
"params":["0x119B705", true],
"id":0
}
Result
{
"jsonrpc": "2.0",
"id": 0,
"result": {
"number": "0x119b705",
"hash": "0x0df2cfd6a75770c9b5103c6deb51318d44081e8f1ddc2b5828510a603a4544ce",
"parentHash": "0x261974b63eea921cfc9be27f4155d84a4724679b30cd83ce92b91e918b82a660",
"nonce": "0x0000000000000000",
"sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"logsBloom": "0x983063000c198152b44840c091880112ad6b1c4b3621011a455106e8814a4f03cf76e0e414221225c38070880206b004f969960b19f8fe28400cec156aa40aa34b1745926df9423241276ee852557bf237d94b3caae6abc1a59f8889d058a3a812ca3b22d623e251365b10703254cb668965df5bb69c44d6c421d11be442de015a2725038c1f70262c956f86b8f867e0382db50d1c2449c88f388e59aba88bb08601c14e04cad802a007f8014b7e4ce86c34a95321af8d64d262a283891b675e22ce7d8e09e812be27c4060604925668709b23104dea6450504e320a8e38f020b0b0d5820148760c057c98996c07572462144e048945145ca90a409c9a099f5a",
"transactionsRoot": "0xb7b85c12c7bb213f2108c02f185054433b324436e2398923851e2b0c05b0ce9c",
"stateRoot": "0x8173efc9fad6f885130c0f9abef78109b52c698986ca6c8dfd2ace4a62d86e90",
"receiptsRoot": "0xbe937a9da3d388edce6157cd844c3b3b42128d82edf497dcc1c39c6ccd3ec98c",
"miner": "0x3f349bbafec1551819b8be1efea2fc46ca749aa1",
"difficulty": "0x2",
"totalDifficulty": "0x22ffe74",
"extraData": "0xd883010109846765746888676f312e31372e36856c696e7578000000c3167bdfc7a004af88244c093280c2ee514e2a07371fd57dab056da28bdcab99339115b41ee7ee6e85a738fecf091ad312159ce682d9a0ea42734ec36b94cfadc381056100",
"size": "0x9e53",
"gasLimit": "0x48da4bf",
"gasUsed": "0xfcedaf",
"timestamp": "0x629e6b2e",
"uncles": [],
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"transactions": [
{
"hash": "0x097573dc0a4512673878362f63382c74b74e5ef45972b0d3c8be2d2d59105cc3",
"nonce": "0x10e88c",
"transactionIndex": "0x0",
"from": "0x90f729f31e20c58b93a7092f1e10bdae9cc4d82b",
"to": "0x6fa0ae33263e500a6aba7535e5837c8766769847",
"value": "0x0",
"gasPrice": "0x3ad9a2d3ae",
"gas": "0x35b62",
"input": "0x0000167800000000000006154845044400000000000000267e4ef19e4f160000429cf6bb26f5f63b00b58bb57f6c06db6a2339070d265528b380773747286d8c2b389f286d52b2d546f1ee7678d100eecad33030c798da5c8f8774b6a39fae699901ff8c276751e691f6ac99f76bf1e332",
"v": "0x93",
"r": "0x573630ff7be77c9fa9336d2336c8ea7556a69be05f060a0ebd166ef8ec54cd72",
"s": "0x60bdc76e0af015400d794988c5a048c33a1294384027c92ae566ec11f068110b",
"chainId": "0x38",
"blockHash": "0x0df2cfd6a75770c9b5103c6deb51318d44081e8f1ddc2b5828510a603a4544ce",
"blockNumber": "0x119b705"
}
]
}
}
Copy link