You can use the accountSubscribe
websocket endpoint and put in your wallet address, ie:
{
"jsonrpc": "2.0",
"id": 1,
"method": "accountSubscribe",
"params": [
"<YOUR_WALLET_AS_BASE_58>",
{
"encoding": "jsonParsed",
"commitment": "confirmed"
}
]
}
Note that this will only give you the new amount of SOL in the account. If you want to get information about the amount sent and the sender, you'll need to get the transaction that triggered the notification using getSignaturesForAddress
and then getTransaction
on the most recent signature in the return.
More information at https://solana.com/docs/rpc/websocket/accountsubscribe and https://solana.com/docs/rpc/http/getsignaturesforaddress and https://solana.com/docs/rpc/http/gettransaction