0

I would like know if there is a way to decode data received at "OnLogs" callback.

I saw this issue : https://github.com/solana-labs/solana-web3.js/issues/2841 However, it seems closed and there is no answer sadly.

I tried below code part, but no help.

logs.forEach((log)=>{ let type = web3.SYSTEM_INSTRUCTION_LAYOUTS.Transfer; let data = type.layout.decode(log); console.log(data); })

How can I find the transfered token amounts without calling getParsedTransactions ?

1 Answer 1

1

Unfortunately, what you're trying to achieve is not possible using the logsSubscribe RPC method. This method only streams the signature and the logs of the transactions.

The transfer amount is embedded within the transaction data itself, which isn't included in the data returned by the logsSubscribe method.

It’s possible that the program you're trying to index does log the transfer amount, but this is not common.

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.