post https://api.infstones.com/okc/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": [
"0xB994DD",
false
]
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 transactions objects or array of transactions 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":["0xB994DD", false],"id":0}'
Return
{
"jsonrpc": "2.0",
"id": 0,
"result": {
"number": "0xb994dd",
"hash": "0xac39be33905675520b82ae390dd912bcf9d0a6974879c4cdfabb93acc710607f",
"parentHash": "0x3204e03263a92a367bced272684033a974fd914367a566caf1b57974b4eb4d3e",
"nonce": "0x0000000000000000",
"sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"logsBloom": "0x0000000000000011020000000020000000000000000000000000000000000000000000000000000000000000000800000000008100000008004020000000000000000000000000000002000800000000024000000000002000800048000010000010a04000040000a000000000000000000000000020400000000030000000000000000000002000100000000008000000000000000000000000010800000000002800000000000400000010000000000010000000000000000400000000000000000002000106010040000000000000002000000800400010000000000000000200100000040000000000000000000000000000000000000000000400000000",
"transactionsRoot": "0xb94de89da52909bb8aab7680894f559eac1a5a1e5cf8263c3d5e50ab1823c38e",
"stateRoot": "0x1039b77ae5b427d0d511f2ec87a70b2cab08c18b4045f6aa794407b2110ce842",
"miner": "0xd7958e043a8fcff9405f043e1f8effb9c1147f60",
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"difficulty": "0x0",
"totalDifficulty": "0x0",
"extraData": "0x",
"size": "0x15f4",
"gasLimit": "0xffffffff",
"gasUsed": "0x1d21fe",
"timestamp": "0x62bdc8f7",
"uncles": [],
"receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"transactions": [
"0x859dd0c5319b71af9ec6e16c32ecf494bad9aa4c9349bace6f27d081f50e9e24",
"0xcd15d46e74dcc7888522b9a3af218644966f6c4dd1806dce688d0a1777781de7",
"0xd1e255afc01a68c850afb6d93b74a5ee0b04f45bafac8fe000deabe514993a7f",
"0x855e3b263cd3df81aa2f48909fb5514292aceb52234ed906bf83aaf2497a804f",
"0xd5ba78b990f6facd0f47936aa746395933718530c4e21b3d7ae9ecf3f8f4a6fd",
"0x1352f696a42fabe18ef0b7b74b5bb5a15946bc49303516e99ea0b80446882d88",
"0xf29cbc3530cfe8cd0f26291df81940a7b99c3b95c6d766cdee50f1ccc6bd4723"
]
}
}