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

Can't import fetchLookupTables function #93

Open
BladeRunner713 opened this issue Feb 3, 2025 · 3 comments
Open

Can't import fetchLookupTables function #93

BladeRunner713 opened this issue Feb 3, 2025 · 3 comments
Labels
bug Something isn't working

Comments

@BladeRunner713
Copy link

BladeRunner713 commented Feb 3, 2025

Overview

fetchLookupTables function not exported in file packages/library/src/decompile-transaction-message-fetching-lookup-tables.ts

Steps to reproduce

Description of bug

@BladeRunner713 BladeRunner713 added the bug Something isn't working label Feb 3, 2025
@BladeRunner713 BladeRunner713 changed the title Can't import fetchLookupTables Can't import fetchLookupTables function Feb 3, 2025
@mcintyre94
Copy link
Contributor

Hmm fair point, it's currently just used as part of the implementation for decompileTransactionMessageFetchingLookupTables. But we do use its return type AddressesByLookupTableAddress throughout the library, so it could be useful in other places.

Could you give a rough idea of what you're looking to use it for? Just to make sure it's a sensible API and see if it could be exported as-is.

@BladeRunner713
Copy link
Author

BladeRunner713 commented Feb 4, 2025

Hmm fair point, it's currently just used as part of the implementation for decompileTransactionMessageFetchingLookupTables. But we do use its return type AddressesByLookupTableAddress throughout the library, so it could be useful in other places.

Could you give a rough idea of what you're looking to use it for? Just to make sure it's a sensible API and see if it could be exported as-is.

I used Jupiter's API to get swap instructions https://station.jup.ag/docs/api/swap-instructions. The API returns a list of lookup table addresses (addressLookupTableAddresses) , and I need to fetch look up table on chain using these addresses. By using these lookup tables with compressTransactionMessageUsingAddressLookupTables, I could keep the transaction size under the limit. Not sure if there are other ways to achieve this. Of course I can have fetchLookupTables function locally, but it's better to have it in the SDK.

@mcintyre94
Copy link
Contributor

Gotcha, we can definitely publish this, makes sense to bridge the gap between a list of lookup tables and that input to compress a transaction.

We should move it to its own file and add some unit tests, which can probably be loosely based on the existing ones for the decompress using lookup tables function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants