web3swift
web3swift copied to clipboard
How to read internal transaction?
I write a transaction with a smart contract,but the result what I want to retrieve is inside Internal Transactions. so How can I get the internal transactions? If I can use ‘eth_call’ method to get a tx information? And how can I make it in this repo? Thanks for answering.
As long as you have the TransactionHash you can use web3.eth.getTransactionDetails() to retrieve the transaction itself. getTransactionDetails returns a structure with a meber called .transaction which is the decoded transaction. From there you have access to all the parameters and data that was encoded within the transaction. Note that if the transaction was a contract call, you will need to do some further decoding of the data field to get at that data, as that will be contract specific.