I currently have a demand for a project that needs to listen to SWAP transactions between tokens, preferably via websocket.
Currently I only found the programSubscribe method on the nodes, but it gives me transaction information in a coded form, like the one below:
{
jsonrpc: "2.0",
method: "programNotification",
params: {
result: {
context: { slot: 240418289 },
value: {
pubkey: "8ZxRqWLQ7rdp9Y354krM3PHx1MbdC7JKN7u3ew77zX8R ",
account: {
lamports: 6124800,
data: [
"BgAAAAAAAAD+AAAAAAAAAAcAAAAAAAAAwAAAAAAAAAIAAAAAAAAAAkAAAAAAAAAAQAAAAAAAAAAAAAAAAAAKCGAQAAAAAA9AEAAAAAAABAS0wAAAAAABAnAAAAAAAAoIYBAAAAAAABAAAAAAAAAADKmjsAAAAAAMqaOwAAAAAFAAAAAAAAABAnAAAAAAAGQAAAAAAAAAQJ wAAAAAAAAAwAAAAAAAAAZAAAAAAAZAAAAAAAAABAnAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABk45dlAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFiHtgyBPocCAAAAAAAAAABndpeydAAAAAAAAAAAA2UPJTwAAAADftnmqfAAAAAAAAAAAAAAAG5Ct/zQFMQMAAAAAAAAAAONCjXs8ngEAfb6UWLDXGRn9fLOO yaE1RL3P1f88SOi/0uzC3iWV5tUZ3gMmtETy3rLZtotJl8BUuU0LBVbU5dxLKdBjnOnB2JQFPty3wQ1hV0tpnjbr2VNroHEaXbCwC+f+Qx3KL0FcBpuIV/6rgYT7aH9jRhjANdrEOdwa6ztV mKDwAAAAAAGSCBfgAivwg9yl06mIFns7yaitmbCIl+ByYjLvR4JlqdOqPI4Bcf7VzvUpDEXtH2k+pH/kA8hWf0xZM2kgCw9yuARDwGJH/VfGJAOiPXWt0albGhOM+uKqaSuchF7q0jINB1GoKC2mEwX+KZw 3uZjlhHHbETUDcxD4vhBFpgr27sQODi4QaL1jU/ZzCbeybkDLZ5K/3dB2lx1HU8INflY7AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOW2K2XLO72m9WiI5m/ujmTcVWAZnA +IsR/ic70Fnoqhx208k3gdAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=",
"base64",
],
owner: "675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8",
executable: false,
rentEpoch: 0,
space: 752,
},
},
},
subscription: 194814,
},
};
Does anyone have any idea what I can do? If there is any other way, or how could I decode these transactions above?