New Here? Claim Your 30% Discount on Your First Blockchain Node Access!

banner image
one

ONE

POST

GET

eth_accounts
eth_blockNumber
eth_call
eth_chainId
eth_estimateGas
eth_gasPrice
eth_getBalance
eth_getBlockByHash
eth_getBlockByNumber
eth_getBlockReceipts
eth_getBlockTransactionCountByHash
eth_getBlockTransactionCountByNumber
eth_getCode
eth_getFilterChanges
eth_getLogs
eth_getProof
eth_getStorageAt
eth_getTransactionByBlockHashAndIndex
eth_getTransactionByBlockNumberAndIndex
eth_getTransactionByHash
eth_getTransactionCount
eth_getTransactionReceipt
eth_newBlockFilter
eth_newFilter
eth_newPendingTransactionFilter
eth_syncing
eth_uninstallFilter
hmy_accounts
hmy_blockNumber
hmy_call
hmy_chainId
hmy_estimateGas
hmy_gasPrice
hmy_getBalance
hmy_getBlockByHash
hmy_getBlockByNumber
hmy_getBlockReceipts
hmy_getBlockTransactionCountByHash
hmy_getBlockTransactionCountByNumber
hmy_getCode
hmy_getFilterChanges
hmy_getLogs
hmy_getProof
hmy_getStorageAt
hmy_getTransactionByBlockHashAndIndex
hmy_getTransactionByBlockNumberAndIndex
hmy_getTransactionByHash
hmy_getTransactionCount
hmy_getTransactionReceipt
hmy_newBlockFilter
hmy_newFilter
hmy_newPendingTransactionFilter
hmy_syncing
hmy_uninstallFilter
hmyv2_accounts
hmyv2_blockNumber
hmyv2_call
hmyv2_chainId
hmyv2_estimateGas
hmyv2_gasPrice
hmyv2_getBalance
hmyv2_getBlockByHash
hmyv2_getBlockByNumber
hmyv2_getBlockReceipts
hmyv2_getBlockTransactionCountByHash
hmyv2_getBlockTransactionCountByNumber
hmyv2_getCode
hmyv2_getProof
hmyv2_getStorageAt
hmyv2_getTransactionByBlockHashAndIndex
hmyv2_getTransactionByBlockNumberAndIndex
hmyv2_getTransactionByHash
hmyv2_getTransactionCount
hmyv2_getTransactionReceipt
hmyv2_syncing
net_peerCount
net_version
web3_clientVersion
chevron-right

Last updated on January 1, 1970

2 min read

Method hmy_getBlockByNumber undefined ()
connect with JSON-RPC protocol

hmy_getBlockByNumber

info-circle-fill

Returns information about a block by block number.

Parameters

QUANTITY|TAG - hex string

Integer representing a block number or one of the string tags latest, earliest, or pending, as described in Block Parameter.

Boolean - boolean

If true, returns the full transaction objects; if false, returns only the hashes of the transactions.

Request

curl --location --request POST 'https://one.getblock.io/mainnet/' 
--header 'x-api-key: YOUR-API-KEY' 
--header 'Content-Type: application/json' 
--data-raw '{"jsonrpc": "2.0",
"method": "hmy_getBlockByNumber",
"params": ["0x8252EC", true],
"id": "getblock.io"}'

Response

{
    "id": "getblock.io",
    "jsonrpc": "2.0",
    "result": {
        "difficulty": 0,
        "epoch": "0x1b1",
        "extraData": "0x",
        "gasLimit": "0x4c4b400",
        "gasUsed": "0x0",
        "hash": "0x150b67519eeb0694d5651f3f51a7448f3e7de3843a80281c87d48acb6c4b53b8",
        "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
        "miner": "one1gh043zc95e6mtutwy5a2zhvsxv7lnlklkj42ux",
        "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
        "nonce": 0,
        "number": "0x8252ec",
        "parentHash": "0x1148b6d29fe80cc536cc4b8271e1c6b64e321d9c32124b3cd4ee2aab2ffd5660",
        "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
        "size": "0x590",
        "stakingTransactions": [],
        "stateRoot": "0x215566cfecbd28f6f58331fe0cc113617da73804fc4f69bab0ea6bd7dea55ab1",
        "timestamp": "0x6013f7e7",
        "transactions": [],
        "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
        "uncles": [],
        "viewID": "0x825418",
        "vrf": "0x0000000000000000000000000000000000000000000000000000000000000000",
        "vrfProof": "0x"
    }
}
banner icon

Start Building with GetBlock RPCs for Free