I am monitoring swap transactions on Jupiter, but I am encountering an issue because Jupiter uses different routes for transactions each time, resulting in data appearing in different indices. Is there a way to create a generic implementation to obtain input/output addresses?
For example, if I fetch a transaction with a signature like this:
const tx = await connectionMainnet.getParsedTransaction('2v36qHKKirrp6nsP2R92SN16NDc1dtZYNtnyXAKQZNBWrQeWsRxZkAMbQcodeLfbafRjye2J3JM32VS9aEQyJeVr', {maxSupportedTransactionVersion:0 });
I am looking for a generic function that takes a transaction and returns the input/output mint addresses of the token.
Input token: Sol - So11111111111111111111111111111111111111112
Output token: USDC - EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v