Skip to content
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

Merged
merged 10 commits into from
Feb 24, 2025
Merged

Conversation

Woody4618
Copy link
Contributor

  • 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()

- 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(
Copy link
Member

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

Copy link
Contributor Author

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.

@nickfrosty nickfrosty merged commit f089c1e into main Feb 24, 2025
1 check passed
@nickfrosty nickfrosty deleted the update-idl-functions branch February 24, 2025 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants