RPC MethodsHTTPgetBlock

Block

getBlock

Returns identity and transaction information about a confirmed block in the ledger.

Parameters

slotu64 required

Slot number.

configobject optional

Configuration object.

commitmentstring

Commitment level ("finalized" or "confirmed").

encodingstring

Encoding for each returned transaction: "json", "jsonParsed", "base58", "base64".

transactionDetailsstring

Level of transaction detail: "full", "accounts", "signatures", or "none".

maxSupportedTransactionVersionnumber

Highest transaction version to return. Set to 1 to include v1 transactions.

rewardsbool

Whether to populate the rewards array.

Result

object | null

If specified block is not confirmed, result will be null.

blockHeightu64 | null

The number of blocks beneath this block.

blockTimei64 | null

Estimated production time, as Unix timestamp.

blockhashstring

The blockhash of this block, as base-58 encoded string.

parentSlotu64

The slot index of this block's parent.

previousBlockhashstring

The blockhash of this block's parent.

transactionsarray

Array of transaction objects.

Example

Request
JSON
curl "https://eu.fluxrpc.com?key=<your-API-key>" -s -X POST -H "Content-Type: application/json" -d '
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "getBlock",
  "params": [
    430,
    { "commitment": "finalized", "encoding": "json", "maxSupportedTransactionVersion": 1, "transactionDetails": "full", "rewards": false }
  ]
}'
Response
JSON
{
"jsonrpc": "2.0",
"result": {
"blockHeight": 428,
"blockTime": null,
"blockhash": "3Eq21vXNB5s86c62bVuUfTeaMif1N2kUqRPBmGRJhyTA",
"parentSlot": 429,
"previousBlockhash": "mfcyqEXB3DnHXki6KjjmZck6YjmZLvpAByy2fj4nh6B",
"transactions": []
},
"id": 1
}