klay_getBlockByNumber

Returns information about a block by block number. This API works only on RPC call, not on JavaScript console.

Parameters

TypeDescription

QUANTITY | TAG

Integer or hexadecimal block number, or the string "earliest", "latest" or "pending"

Boolean

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

Return Value

See Klaytn Docs

Example

// Request
curl -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"klay_getBlockByNumber","params":["0x1b4", true],"id":1}' http://klaytn.blockpi.network/v1/rpc/your-api-key