I intend to get the newest SPL transfers that happen in an account and have tried the WSS methods like programSubscribe
and accountSubscribe
on the Raydium Authority V4 program account.
socket.addEventListener("open", () => {
const subscribeMessage = {
jsonrpc: "2.0",
id: 1,
method: "accountSubscribe",
params: [
"5Q544fKrFoe6tsEbD7S8EmxGTJYAKtTVhAW5Q5pge4j1",
{
encoding: "jsonParsed",
},
],
};
console.log("WSS stream started");
const messageString = JSON.stringify(subscribeMessage);
socket.send(messageString);
});
socket.addEventListener("message", async (event) => {
const receivedMessage = JSON.parse(event.data.toString());
const { params } = receivedMessage;
console.log(params);
});
I am not sure on which method to use to get something similar to the SPL tranfers tab on solscan as seen here. Any way to get the latest SPL transfers for an account or program?