0

I'm trying to create something like solscan Token Transfers table for my token, like this:

 like this:

I fetch transfers with logsSubscribe, but it returns like this:

{ "jsonrpc": "2.0", "method": "logsNotification", "params": { "result": { "context": { "slot": 285187688 }, "value": { "signature": "5vKUrLtJZ31sHt937DhBvKw6ciTzzBB7hNYFKxGzN7iBVimZ5QCzF7cRkPRkqQAvRghiHmxeNcX4AWnwiAbNhVsw", "err": null, "logs": [ "Program ComputeBudget111111111111111111111111111111 invoke 1", "Program ComputeBudget111111111111111111111111111111 success", "Program ComputeBudget111111111111111111111111111111 invoke 1", "Program ComputeBudget111111111111111111111111111111 success", "Program SW1TCH7qEPTdLsDHRgPuMQjbQxKdH2aBStViMFnt64f invoke 1", "Program log: Instruction: AggregatorSaveResult", "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [2]", "Program log: Instruction: Transfer", "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 4736 of 258278 compute units", "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success", "Program data: Dk7x7N2nVamjdokFdaa++3ClOmo2VJcejdN2ejwdTCWlI0gyCI0b7Wie/xAAAAAARd/yZQAAAAAKAAAAAAAAAA==", "Program data: A5o8/ZicmX6jdokFdaa++3ClOmo2VJcejdN2ejwdTCWlI0gyCI0b7UQzLUYAAAAAAAAAAAAAAAAJAAAAaJ7/EAAAAABF3/JlAAAAACdiSZSd8WPibtPO0qe9udGv2lY/3XQKaXRnpeHa0BnCAAAAAA==", "Program data: TOkj7nevZ9ajdokFdaa++3ClOmo2VJcejdN2ejwdTCWlI0gyCI0b7QAAAAAAAAAAJ2JJlJ3xY+Ju087Sp7250a/aVj/ddAppdGel4drQGcLBxFiwAAAAAMHEWLAAAAAA", "Program data: cB8z6WFkK/WjdokFdaa++3ClOmo2VJcejdN2ejwdTCWlI0gyCI0b7d2Hpm8bAAAAAAAAAAAAAAALAAAAaJ7/EAAAAABF3/JlAAAAAAAAAAAAAAAA", "Program data: TOkj7nevZ9ajdokFdaa++3ClOmo2VJcejdN2ejwdTCWlI0gyCI0b7dQwAAAAAAAAJ2JJlJ3xY+Ju087Sp7250a/aVj/ddAppdGel4drQGcLBxFiwAAAAADlpimIMAAAA", "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [2]", "Program log: Instruction: Transfer", "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 4736 of 164467 compute units", "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success", "Program SW1TCH7qEPTdLsDHRgPuMQjbQxKdH2aBStViMFnt64f consumed 143542 of 299700 compute units", "Program SW1TCH7qEPTdLsDHRgPuMQjbQxKdH2aBStViMFnt64f success" ] } }, "subscription": 1919 } }

How i can turn this data to like solscan's transfers table? Thank You.

1 Answer 1

0

Most of these tables use the preTokenBalances and postTokenBalances fields when fetching a transaction with getTransaction. You can see how they're defined at https://solana.com/docs/rpc/http/gettransaction

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.