post https://api.infstones.com/bsc/mainnet/
Returns information about a block by block number.
Parameters
Object Name | Required | Type | Detail |
---|---|---|---|
BLOCK PARAMETER | ✅ | String/Object | A hex code of an integer that represents the block number, "latest", "earliest" , "pending" , or hash of a block. The hash of a block is an object specified as: {"blockHash": "\<hash_value>"} . Learn more here. |
SHOW TRANSACTION DETAILS | ✅ | Boolean | If set true , it returns the full transaction objects; if set false , it returns only the transaction hashes. |
"params": [
"0xfb8fbe",
true
]
Result
A block object, or null
when no block found.
Result Fields
Key | Type | Detail |
---|---|---|
difficulty | String | A hex code of an integer that represents the difficulty for this block. |
extraData | String | The "extra data" field of this block. |
gasLimit | String | A hex code of an integer that represents the maximum gas allowed in this block. |
gasUsed | String | A hex code of an integer that represents the total used gas by all transactions in this block. |
hash | String | Hash of the block. null if the returned block is a pending block. |
logsBloom | String | The bloom filter for the logs of the block. null if the returned block is a pending block. |
miner | String | Address of the beneficiary to whom the mining rewards were given. |
nonce | String | Hash of the generated proof-of-work. null if the returned block is a pending block. |
number | String | A hex code of an integer that represents the block number. null if the returned block is a pending block. |
parentHash | String | Hash of the parent block. |
receiptsRoot | String | The root of the receipts trie of the block. |
sha3Uncles | String | SHA3 of the uncles data in the block. |
size | String | A hex code of an integer that represents the size of this block in bytes. |
stateRoot | String | The root of the final state trie of the block. |
timestamp | Integer | The unix timestamp for when the block was collated. |
totalDifficulty | String | A hex code of an integer that represents the difficulty of the chain until this block. |
transactions | Array | Array of transaction objects or array of transaction hashes, depending on the parameter value of SHOW TRANSACTION DETAILS |
transactionsRoot | String | The root of the transaction trie of the block. |
uncles | Array | Array of uncle hashes. |
Example
Request
curl <your-endpoint> \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["0xfb8fbe", false],"id":0}'
Return
{
"id": 0,
"jsonrpc": "2.0",
"result": {
"difficulty": "0x2",
"extraData": "0xd983010108846765746889676f312e31362e3133856c696e75780000c3167bdf8bce581c2fcdfa60c5365cd0b38358ddaccf8f4ddfe062019465e8f6bd8506072990cc477d4b8ef8471ae16c040e9eb02a8edbd9bc16a94b39558da6c1c2b84901",
"gasLimit": "0x4c08619",
"gasUsed": "0x1df0f62",
"hash": "0xef0c14940f208ee5d2928d4a46828e29e40bc0cfe260fe65f5c98f957e844730",
"logsBloom": "0xffff7fffbefff7ffffffffffdfffffef7ff9ffdfff7ffffffff7fdffbfffdfffffffdf77fffffffffffff9fd5fffffffbbffefffbfdf9ebffffffbfeffbfe7bff7ffffdfffff6f7ffff2fdffffffffffffbefffdfff7effebffff7fedfffffff7ffffffffbdfbffff7f797ffbf7beffffffef7fffbfffffef4fffeffffffff7ff7effffffe7ff9ffffdffffbfffffb7effffbedfdfffffbffffffffbfffbdffbf7ffdfffff5b9bfb3f77f7fcfffffffffffdffdfffffffdffffbefbffde6fffff77bfff7bbff777f7f7ffffffdfffe7ffffdf3fffdf77fffdf7cfefffcffffffdef8fffbfffffffdffffffbbfffffdfffffffffff7fffdffff7ffffff5fffbff",
"miner": "0xa6f79b60359f141df90a0c745125b131caaffd12",
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"nonce": "0x0000000000000000",
"number": "0xfb8fbe",
"parentHash": "0x3a7f03fce6de49d1e0689b66b5bcba17c710299aadea1ab5fcb759a3395cb4a1",
"receiptsRoot": "0x006c95806bd612a484b6c1b09c314571e7b5d9b0ad323ae446fba6fc2a9b099f",
"sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"size": "0x1a65a",
"stateRoot": "0x41c5e25dab63c83b9e38a272219ceebb6f9b3733998b71c85085282f1ba94062",
"timestamp": "0x624338b5",
"totalDifficulty": "0x1f40c64",
"transactions": [
"0x2a032638e61f1c229783dab7f35ddf0bcf78a0fed8b67668cf81a991a47e1f9c",
"0x1a67d872a9e2b1ac02ff5cfecd6e4b4208a5f28993e735af744931e02bcb346f",
"0x0ed77d848dbc72e9d784b29535ca81631f2a55a4cc252b3af1c1a2ea6f53985e",
"0x6901876ae3228d19fd83bcc5d74ef6f6f474da6c1cb7a62128bb3179886cc731",
"0x61fe383b47dcc720cee216a5e7d1563c395c9fb51166d3b6725e1b98329a77bd",
...
"0x0bc9270934628f73037135478e963a86ac04b4f07b37da19609aeacd2e9c9d6a",
"0x868180e1005d58450d11fcccd9bfc92a59a26274558b15f25282fddc1fbbb37b",
"0x8fe008fa37e5c52d52b41ee44451c32300334f446a42226aeb55638a6a8cc6d5",
"0x44b6789ba95f254367d1761e826b8ba412196f1db01750c209b25829ab49f9ab",
"0x32e2a32e722a8df4ff4b53329a08c86617df0c6c2a7559f1894bc13b90ce5c1c"
],
"transactionsRoot": "0x886d653a2d6342b8b158d5e78f8ce82cbf0fd9579526332eeecc9a62021ad15b",
"uncles": []
}
}