AptosAptos Network's breakthrough technology and seamless user experience are now available on QuickNode.
Start building today!This method is deprecated and will not be supported in future versions. For a similar method, you can use solana's getBlock RPC method.
The API credit value for this method is 18 . To learn more about API credits and each method's value, visit the API Credits page.
Parameters:
Commitment - string - (optional) The level of commitment required for the query. The options include:
Finalized - string - The node will query the most recent block confirmed by the supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized
Confirmed - string - The node will query the most recent block that has been voted on by the supermajority of the cluster
Processed - string - The node will query its most recent block. Note that the block may not be complete
encoding - string - (optional) (default: json) The encoding format for account data. It can be base58 (slow), base64, base64+zstd or jsonParsed
transactionDetails - string - (optional) (default: full) It specifies the level of transaction details to include in the response. The possible values are full, signatures, and none
rewards - boolean - (optional) (default: true) It determines whether to populate the rewards array or not.
Returns:
blockHeight - The height of the confirmed block
blockTime - The estimated production time as Unix timestamp (seconds since the Unix epoch). It is null if not available
blockhash - The hash of the confirmed block
parentSlot - The slot number of the block's parent
previousBlockhash - The hash of the block's predecessor
transactions - An array of transaction objects within the block. Each transaction object contains the following fields:
meta - The transaction status metadata object with the following fields:
err - Error code if the transaction failed or null if the transaction succeeds
fee - The transaction fee
innerInstructions - The list of inner instructions and it's omitted or null if inner instruction recording was not yet enabled during the transaction
loadedAddresses - The list of loaded addresses objects
readonly - The ordered list of base-58 encoded addresses for readonly loaded accounts
writable - The ordered list of base-58 encoded addresses for writable loaded accounts
logMessages - An array of string log messages. Omitted or null if log message recording was not yet enabled during the transaction
postBalances - An array of u64 account balances after the transaction was processed
postTokenBalances - The list of token balances from after the transaction was processed and it's omitted if inner instruction recording was not yet enabled during the transaction
preBalances - An array of u64 account balances from before the transaction was processed
preTokenBalances - The list of token balances from before the transaction was processed and it's omitted if inner instruction recording was not yet enabled during the transaction
rewards - An array of reward objects detailing the rewards for this block. It is only present if rewards are requested; an array of JSON objects with the following fields:
pubkey - The public key of the account receiving the reward
lamports - The amount of lamports rewarded
postBalance - The balance of the account after receiving the reward
rewardType - The type of reward such as fee or stake
comission - The vote account commission when the reward was credited, only present for voting and staking rewards
status - The processing status of the transaction. It returns Ok if the transaction was successful and Err if the transaction failed with TransactionError
transaction - The transaction object with the following fields:
message - The transaction message containing the following fields:
accountKeys - An array of public keys involved in the transaction
header - An object containing the transaction's header, including the following fields:
numRequiredSignatures - The number of required signatures for the transaction
numReadonlySignedAccounts - The number of readonly accounts that have signed the transaction
numReadonlyUnsignedAccounts - The number of readonly accounts that have not signed the transaction
instructions - An array of instruction objects for the transaction with the following fields:
accounts - An array of integers representing the indices of accounts involved in the instruction
data - The instruction data encoded in the specified format
programIdIndex - The index of the program ID in the accountKeys
recentBlockhash - The most recent blockhash used for the transaction
signatures - An array of signatures strings corresponding to the transaction order in the block
Code Examples:
const web3 = require("@solana/web3.js"); (async () => { const solana = new web3.Connection("http://sample-endpoint-name.network.quiknode.pro/token-goes-here/"); console.log(await solana.getConfirmedBlock(94101948)); })();
curl http://sample-endpoint-name.network.quiknode.pro/token-goes-here/ \ -X POST \ -H "Content-Type: application/json" \ --data '{"jsonrpc": "2.0","id":1,"method":"getConfirmedBlock","params":[94101948, {"encoding": "json","transactionDetails":"full","rewards":false}]}'
from solana.rpc.api import Client solana_client = Client("http://sample-endpoint-name.network.quiknode.pro/token-goes-here/") print(solana_client.get_confirmed_block(94101948))
require "uri" require "json" require "net/http" url = URI("http://sample-endpoint-name.network.quiknode.pro/token-goes-here/") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/json" request.body = JSON.dump({ "jsonrpc": "2.0", "id": 1, "method": "getConfirmedBlock", "params": [ 94101948, { "encoding": "json", "transactionDetails": "full", "rewards": false } ] }) response = https.request(request) puts response.read_body