DEV Community

Cover image for Parsing Solana Program Transactions using Typescript - Part(1/2)

Parsing Solana Program Transactions using Typescript - Part(1/2)

Oluwatobiloba Emmanuel on October 28, 2024

Last month, I came across a tweet by kiryl requesting an open-source transaction parser for popular DEFI apps. This led me to develop a minimal ope...
Collapse
 
v1rtu0so profile image
v1rtu0so

This is exactly what I have been looking for.. A straight forward and clear guide on how you can quickly and easily map and parse information from the solana blockchain.

I have been using IDL mappings and then trying to find the offsets by searching through SDK variables. Thank you for this!

Collapse
 
teepy profile image
Oluwatobiloba Emmanuel

You're welcome
Will be releasing the second part soon which will focus on native rust programs

Collapse
 
jjtt profile image
Jake, Tri Tran

Where can you find the IDL for Raydium v4? I'm struggling with that

Collapse
 
teepy profile image
Oluwatobiloba Emmanuel

Raydium V4 does not have an IDL as it was written using native Rust, not Anchor. Will be releasing an article soon on how to parse transactions using Raydium V4.

Collapse
 
itsmxr_0 profile image
Hasan Saadi

Great work sir,
is it possible to make this code decode and parse local JSONfiles of fetched transaction? I'm trying to run all the processing locally and minimize interaction with rpcs, any help would be greatly appreciated!!

Collapse
 
teepy profile image
Oluwatobiloba Emmanuel

Yes. You can replace the line that fetches the transaction from RPC with your transaction JSON.

Collapse
 
failedblock profile image
Saba Udzilauri (FailedBlock)

If you copy this code all's good except buySellIxs ends being an empty array?

Collapse
 
failedblock profile image
Saba Udzilauri (FailedBlock)

Issue was I was using a handmade sha256 function not the one from @nobles/hashes

Collapse
 
teepy profile image
Oluwatobiloba Emmanuel

Great ✨ī¸

Collapse
 
grand_city_8f739c133222e0 profile image
Grand City

where is the second part.. Can't wait to see it.

Collapse
 
vancity profile image
vancity

does this decode the vdt as well?