post https://api.infstones.com/theta/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": [
"0x1285544",
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 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":["0x1285544", false],"id":0}'
Return
Similar to the returns of the eth_getBlockByHash API. Please see # Example