I have a list of transactions that I periodically fetch via Solana API. Out of those, I need to identify the ones that are:
- incoming that transfer SOL
- incoming that transfer a token (USDT, USDC, maybe 1-2 more)
That is, I need to implement a simple way of watching "top up" TX-s, for SOL and the stablecoins, for a list of accounts of mine.
So how to clearly identify the type of transfer of a TX I'm parsing: whether it's EITHER SOL transfer, OR a token transfer? As well as the amount.
Will it be by the presence of the field lamports
- SOL transfer? Namely, instructions[X].parsed.info["lamports"]
Will be a reliable way?
On the contrary: how to identify if a TX is a pure "token transfer" one? Not the one that may involve "token transfer" among other instructions, but is only "token transfer" one.
I don't expect any other, more complex types of TX in my list of addresses. If such TX-s happen to occur, I'll filter them out during parsing.