Returns a confirmed block for a slot, including block metadata and transaction data in the requested encoding.
Source
$ curl https://api.devnet.solana.com -s -X \> POST -H "Content-Type: application/json" -d '> {> "jsonrpc": "2.0",> "id": 1,> "method": "getBlock",> "params": [> 378967388,> {> "commitment": "finalized",> "encoding": "json",> "transactionDetails": "full",> "maxSupportedTransactionVersion": 0,> "rewards": true> }> ]> }> '
params
u64required
Slot number.
string | objectoptional
Configuration object. For backwards compatibility, this parameter also accepts a bare encoding string, but prefer the object form.
Passing a bare encoding string as the second positional parameter is deprecated. Use the configuration object instead.
When this parameter is an object, it may contain the following fields:
result
Response
{"jsonrpc": "2.0","result": {"blockHeight": 428,"blockTime": null,"blockhash": "3Eq21vXNB5s86c62bVuUfTeaMif1N2kUqRPBmGRJhyTA","parentSlot": 429,"previousBlockhash": "mfcyqEXB3DnHXki6KjjmZck6YjmZLvpAByy2fj4nh6B","rewards": [],"numRewardPartitions": null,"transactions": [{},}}]},"id": 1}
object | null
If specified block is not confirmed result will be null. Otherwise, an object
containing:
Is this page helpful?