I come from an EVM background and wonder how to listen to Solana events in my dapp such as token/nft deposits/withdrawals to/from a specific user account, creation of new pools, swaps etc.
I tried solanaConnection.onAccountChange() to catch balance changes. but for non-native token balances, I assume the changes are logged with the AccountInfo.data field but this is a hex buffer and I'm not sure how to convert to a meaningful json.
Another way I came across is https://docs.solana.com/api/websocket#accountsubscribe which seems similar to getAccountInfo() but again facing the conversion of data field from base58 encoding to meaningful json.
i have already tried JSON.parse(buf.toString());