-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support legacy IDL + Versioned Transactions #77
Conversation
- Added `sendVersionedTransaction()` to send a versioned transaction with lookup tables. Also adds priority fee support. - Added `createLookupTable()` to easily create a lookup table and extend it with additional addresses - Added `getIDlByProgramId()` to fetch an IDL from a program on-chain - Added `getIDlByIdlPath()` to parse an IDL from a local file path - Added `getIdlParsedAccountData()` to parse account data using an IDL - Added `parseAnchorTransactionEvents()` to parse anchor transaction events using an IDL - Added `decodeAnchorTransaction()` to decode a transaction completely using an IDL - Fixed account data parsing in `decodeAnchorTransaction()`
* ); | ||
* ``` | ||
*/ | ||
export async function sendVersionedTransaction( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this a separate function? instead of a single sendTransaction
function? there is really nothing specific to sending version transactions in here.
please just add version transaction support to the existing sending function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The signature is different. This one takes an array of instructions so that i can still add blockhash and sign and also add the lookupTables.
Transaction and VersionedTransaction are different types and work a bit differently thats why i made it two sperate functions. But i managed to refactor it a bit to have less duplicated code for the sending.
sendVersionedTransaction()
to send a versioned transaction with lookup tables. Also adds priority fee support.createLookupTable()
to easily create a lookup table and extend it with additional addressesgetIDlByProgramId()
to fetch an IDL from a program on-chaingetIDlByIdlPath()
to parse an IDL from a local file pathgetIdlParsedAccountData()
to parse account data using an IDLparseAnchorTransactionEvents()
to parse anchor transaction events using an IDLdecodeAnchorTransaction()
to decode a transaction completely using an IDLdecodeAnchorTransaction()