getConfirmedBlock RPC Method
Returns identity and transaction information about a confirmed block in the ledger
This method is expected to be removed in solana-core v2.0. Please use
getBlock instead.
Parameters#
u64required
slot number, as u64 integer
objectoptional
Configuration object containing the following fields:
The commitment describes how finalized a block is at that point in time.
transactionDetailsstringoptional=
fulllevel of transaction detail to return, either "full", "signatures", or "none"
rewardsbooloptional
whether to populate the rewards array.
Encoding format for Account data
Values:
jsonbase58base64jsonParsedjsonParsedencoding attempts to use program-specific instruction parsers to return more human-readable and explicit data in thetransaction.message.instructionslist.- If
jsonParsedis requested but a parser cannot be found, the instruction falls back to regular JSON encoding (accounts,data, andprogramIdIndexfields).
Result#
The result field will be an object with the following fields:
<null>- if specified block is not confirmed<object>- if block is confirmed, an object with the following fields:blockhash: <string>- the blockhash of this block, as base-58 encoded stringpreviousBlockhash: <string>- the blockhash of this block's parent, as base-58 encoded string; if the parent block is not available due to ledger cleanup, this field will return "11111111111111111111111111111111"parentSlot: <u64>- the slot index of this block's parenttransactions: <array>- present if "full" transaction details are requested; an array of JSON objects containing:transaction: <object|[string,encoding]>- Transaction object, either in JSON format or encoded binary data, depending on encoding parametermeta: <object>- transaction status metadata object, containingnullor:err: <object|null>- Error if transaction failed, null if transaction succeeded. TransactionError definitionsfee: <u64>- fee this transaction was charged, as u64 integerpreBalances: <array>- array of u64 account balances from before the transaction was processedpostBalances: <array>- array of u64 account balances after the transaction was processedinnerInstructions: <array|null>- List of inner instructions ornullif inner instruction recording was not enabled during this transactionpreTokenBalances: <array|undefined>- List of token balances from before the transaction was processed or omitted if token balance recording was not yet enabled during this transactionpostTokenBalances: <array|undefined>- List of token balances from after the transaction was processed or omitted if token balance recording was not yet enabled during this transactionlogMessages: <array|null>- array of string log messages ornullif log message recording was not enabled during this transaction- DEPRECATED:
status: <object>- Transaction status"Ok": <null>- Transaction was successful"Err": <ERR>- Transaction failed with TransactionError
signatures: <array>- present if "signatures" are requested for transaction details; an array of signatures strings, corresponding to the transaction order in the blockrewards: <array>- present if rewards are requested; an array of JSON objects containing:pubkey: <string>- The public key, as base-58 encoded string, of the account that received the rewardlamports: <i64>- number of reward lamports credited or debited by the account, as a i64postBalance: <u64>- account balance in lamports after the reward was appliedrewardType: <string|undefined>- type of reward: "fee", "rent", "voting", "staking"commission: <u8|undefined>- vote account commission when the reward was credited, only present for voting and staking rewards
blockTime: <i64|null>- estimated production time, as Unix timestamp (seconds since the Unix epoch). null if not available
For more details on returned data:#
Code sample#
curl https://api.devnet.solana.com -s -X POST -H "Content-Type: application/json" -d '
{
"jsonrpc": "2.0", "id": 1,
"method": "getConfirmedBlock",
"params": [430, "base64"]
}
'
Response#
{
"jsonrpc": "2.0",
"result": {
"blockTime": null,
"blockhash": "3Eq21vXNB5s86c62bVuUfTeaMif1N2kUqRPBmGRJhyTA",
"parentSlot": 429,
"previousBlockhash": "mfcyqEXB3DnHXki6KjjmZck6YjmZLvpAByy2fj4nh6B",
"rewards": [],
"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": [
"AVj7dxHlQ9IrvdYVIjuiRFs1jLaDMHixgrv+qtHBwz51L4/ImLZhszwiyEJDIp7xeBSpm/TX5B7mYzxa+fPOMw0BAAMFJMJVqLw+hJYheizSoYlLm53KzgT82cDVmazarqQKG2GQsLgiqktA+a+FDR4/7xnDX7rsusMwryYVUdixfz1B1Qan1RcZLwqvxvJl4/t3zHragsUp0L47E24tAFUgAAAABqfVFxjHdMkoVmOYaR1etoteuKObS21cc1VbIQAAAAAHYUgdNXR0u3xNdiTr072z2DVec9EQQ/wNo1OAAAAAAAtxOUhPBp2WSjUNJEgfvy70BbxI00fZyEPvFHNfxrtEAQQEAQIDADUCAAAAAQAAAAAAAACtAQAAAAAAAAdUE18R96XTJCe+YfRfUp6WP+YKCy/72ucOL8AoBFSpAA==",
"base64"
]
}
]
},
"id": 1
}