getBlock - Solana

getBlock. Retrieves detailed information about a specific block

getBlock - solana [Value: 66CU]
Retrieves detailed information about a specific block
Use cases

Use cases

  • Retrieve detailed block data for analysis
  • Monitor transaction details within specific blocks for auditing
  • Extract transaction data for blockchain application development
Constraints

Constraints

  • Requires valid block number parameter
  • Network latency may delay response time
  • High traffic may lead to rate limiting
Get started
Unlock Access to 50+ chains
Boost your app's speed and reliability with dRPC - get your access API key

Language

Request
Examples
curl --location --request POST 'https://solana.drpc.org' \
--header 'Content-Type: application/json' \
--data-raw '{"jsonrpc": "2.0","id":1,"method":"getBlock","params":[430, {"encoding": "json","transactionDetails":"full","rewards":false}]}'
Copy
Response
200
{
  "jsonrpc": "2.0",
  "result": {
    "blockHeight": 428,
    "blockTime": null,
    "blockhash": "3Eq21vXNB5s86c62bVuUfTeaMif1N2kUqRPBmGRJhyTA",
    "parentSlot": 429,
    "previousBlockhash": "mfcyqEXB3DnHXki6KjjmZck6YjmZLvpAByy2fj4nh6B",
    "transactions": [
      {
        "meta": {
          "err": null,
          "fee": 5000,
          "innerInstructions": [],
          "logMessages": [],
          "postBalances": [499998932500, 26858640, 1, 1, 1],
          "postTokenBalances": [],
          "preBalances": [499998937500, 26858640, 1, 1, 1],
          "preTokenBalances": [],
          "status": {
            "Ok": null
          }
        },
        "transaction": {
          "message": {
            "accountKeys": [
              "3UVYmECPPMZSCqWKfENfuoTv51fTDTWicX9xmBD2euKe",
              "AjozzgE83A3x1sHNUR64hfH7zaEBWeMaFuAN9kQgujrc",
              "SysvarS1otHashes111111111111111111111111111",
              "SysvarC1ock11111111111111111111111111111111",
              "Vote111111111111111111111111111111111111111"
            ],
            "header": {
              "numReadonlySignedAccounts": 0,
              "numReadonlyUnsignedAccounts": 3,
              "numRequiredSignatures": 1
            },
            "instructions": [
              {
                "accounts": [1, 2, 3, 0],
                "data": "37u9WtQpcm6ULa3WRQHmj49EPs4if7o9f1jSRVZpm2dvihR9C8jY4NqEwXUbLwx15HBSNcP1",
                "programIdIndex": 4
              }
            ],
            "recentBlockhash": "mfcyqEXB3DnHXki6KjjmZck6YjmZLvpAByy2fj4nh6B"
          },
          "signatures": [
            "2nBhEBYYvfaAe16UMNqRHre4YNSskvuYgx3M6E4JP1oDYvZEJHvoPzyUidNgNX5r9sTyN1J9UxtbCXy2rqYcuyuv"
          ]
        }
      }
    ]
  },
  "id": 1
}
Copy

Request params

idinteger
jsonrpcstring
methodstring
Parametersarray
array
blockNumberstring
This describes the block number to fetch the transaction by.
configobject
Configuration object containing optional parameters:
array
encodingstring
Specifies the data encoding for each returned transaction. Options include: json, jsonParsed, base58, base64
transactionDetailsstring
Determines the level of transaction detail returned. Options include: full, signatures, none
rewardsboolean
Indicates whether to include the rewards array
commitmentstring
Sets the commitment level for the blocks queried. Valid options are: finalized, confirmed, processed
minContextSlotobject
The minimum slot number at which the request can be evaluated.

Response

200
Contains detailed information about the block

Response params

object
idinteger
jsonrpcstring
resultstring
object
blockHeightinteger
The height of the block in the blockchain
blockTimeint64
The timestamp of the block. null indicates that the time is not available.
blockhashstring
The unique identifier (hash) of the block.
parentSlotinteger
The slot number of the parent block.
previousBlockhashstring
The hash of the previous block in the chain.
transactionsarray_of_objects
A list of transactions included in the block.
object
metaobject
Metadata about the transaction
object
errobject
Error information, null if no error.
feeuint64
Transaction fee in lamports.
innerInstructionsarray
List of inner instructions.
logMessagesarray
Log messages from the transaction execution.
postBalancesarray
Balances of accounts after the transaction.
postTokenBalancesarray
Token balances of accounts after the transaction
preBalancesarray
TBalances of accounts before the transaction.
preTokenBalancesarray
Token balances of accounts before the transaction
statusarray
loadedAddressesobject
Addresses loaded from address lookup tables for the transaction. This is undefined if maxSupportedTransactionVersion was not specified in the request parameters.
object
writablearray_of_strings
readonlyarray_of_strings
versionnumber
The version of the transaction. It is undefined if maxSupportedTransactionVersion was not set in the request parameters.
transactionobject
Details of the transaction
signaturesarray_of_strings
List of signatures for the transaction.
rewardsboolean
Indicates whether to include the rewards array
object
pubkeystring
The public key of the account that received the reward, encoded in base-58.
lamportsinteger
The number of lamports (i64) credited or debited to the account as a reward.
postBalanceinteger
The account's balance in lamports (u64) after the reward was applied.
rewardTypestring
The type of reward received. Possible values are "fee", "rent", "voting", and "staking".
commissioninteger
The commission taken by the vote account when the reward was credited. This is only present for voting and staking rewards.