GetBlock
getBlock RPC Method
Returns identity and transaction information about a confirmed block in the ledger.
Parameters
u64
required
Slot number, as u64 integer
object
optional
Configuration object containing the following fields:
encoding string
optional
-
Default:
json
-
Encoding format for each returned Transaction
-
Values:
json
,jsonParsed
,base58
,base64
transactionDetails string
optional
-
Default:
full
-
Level of transaction detail to return
-
Values:
full
,accounts
,signatures
,none
rewards bool
optional
-
Whether to populate the rewards array
-
Default includes rewards
commitment string
optional
-
Default:
finalized
-
Note: processed is not supported
Code Sample
Response
Result Details
The result field will be:
-
<null>
- if specified block is not confirmed -
<object>
- if block is confirmed, containing:-
blockhash: <string>
- the blockhash of this block -
previousBlockhash: <string>
- the blockhash of this block’s parent -
parentSlot: <u64>
- the slot index of this block’s parent -
transactions: <array>
- array of transactions containing:-
transaction: <object>
- transaction object with message and signatures -
meta: <object>
- transaction metadata including:-
err: <object|null>
- error if transaction failed -
computeUnitsConsumed: <number>
- compute units used -
logMessages: <array>
- program log messages
-
-
-
blockTime: <i64|null>
- estimated production time -
blockHeight: <u64|null>
- number of blocks beneath this block
-