I am trying to create a Java (not Javascript!) Solana client that is able to understand/filter/process Meteora transactions. I started using the officially recommended library https://github.com/skynetcap/solanaj (recommended here: https://solana.com/docs/intro/dev#client-side-development) in a Spring Boot Server.
With just a few lines of code, I can already grab finalized transactions from the RPC that interacted with the Meteora DLMM program. It is as easy as this:
String meteoraProgramId = "LBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9YuVaPwxo";
List<SignatureInformation> meteoraSignatures = client.getApi().getSignaturesForAddress(new PublicKey(meteoraProgramId), 1, Commitment.FINALIZED);
ConfirmedTransaction transaction = client.getApi().getTransaction(meteoraSignatures.get(0).getSignature());
When I debug into the resulting ConfirmedTransaction
object, I am able to find all instructions and inner instructions. And as far as I understood, the real value (which instruction it is exactly and what input parameters were given) can only be understood when I decode it with the Meteora IDL.
This one would be available in a JSON format in Meteoras SDK here https://github.com/MeteoraAg/dlmm-sdk/blob/main/ts-client/src/dlmm/idl.ts#L5163.
Sooo, can anyone guide me on the right path how I can decode the instructions? In JS/TS I would need to use a Borsh thingy that can be initialized with the IDL, but I haven't found anything similar in Java.