Can anyone tell me why it logs nothing when either sol or spl token is deposited to the desired walletAddress? Other methods work perfectly whenever I change onProgramAccountChange to something else. But I want to use this one, since I can't find any other function that will notify me whenever my wallet receives something.
1 Answer
This is a bit confusing, but onProgramAccountChange
actually corresponds to programSubscribe
https://solana.com/docs/rpc/websocket/programsubscribe, which only tells you when an account owned by the given program address is modified.
In your case, the provided address is a wallet, and not a program, so you won't get any notifications.
-
Thank you for your response. What could be a possible solution to this problem? I want to get notified whenever I receive any spl or sol token, even if I've never owned that token before. Commented Apr 13 at 17:29
-
Looks like you already asked about that at solana.stackexchange.com/questions/12693/…, so let's use that question– Jon CCommented Apr 13 at 18:41
-
I dont know how to do that, can you be more precise, like which method should I use and etc. thanks in advance. Commented Apr 13 at 19:00