This repository has been archived by the owner on Jan 22, 2025. It is now read-only.
getBlock with jsonParsed using solana-web3.js throws error #28321
Labels
community
Community contribution
As we know that Solana is going to activate Versioned Transactions in the upcoming epoch with the support for lookup tables.
This feature activation would affect two methods:
getBlock
getTransaction
With the new response structure and additional objects, the team has recommended to use
jsonParsed
encoding instead ofjson
, so that all the transactions account keys including those from lookup tables are found in theaccountKeys
object itself.While this is possible when making HTTP POST requests directly, it's not possible (for the
getBlock
method) using thesolana-web3.js
library.solana-web3.js
has agetParsedTransaction
method that is basicallygetTransaction
withjsonParsed
, but there's no similar option forgetBlock
. And, if we pass the encoding parameter asjsonParsed
with the GetBlockConfig object of thegetBlock
method, it throws an error:For e.g.,
will throw
Is it possible to add something like
getParsedBlock
or make changes to the GetBlockConfig to acceptjsonParsed
encoding?The text was updated successfully, but these errors were encountered: