You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With the new response structure and additional objects, the team has recommended to use jsonParsed encoding instead of json, so that all the transactions account keys including those from lookup tables are found in the accountKeys object itself.
While this is possible when making HTTP POST requests directly, it's not possible (for the getBlock method) using the solana-web3.js library. solana-web3.js has a getParsedTransaction method that is basically getTransaction with jsonParsed, but there's no similar option for getBlock. And, if we pass the encoding parameter as jsonParsed with the GetBlockConfig object of the getBlock method, it throws an error:
StructError: At path: transactions.0.transaction.message.accountKeys.0 -- Expected a string, but received: [object Object]
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: