Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to read internal transaction? #597

Closed
KittenYang opened this issue Jul 25, 2022 · 1 comment
Closed

How to read internal transaction? #597

KittenYang opened this issue Jul 25, 2022 · 1 comment
Labels
FAQ common questions tend to recur about web3 infra

Comments

@KittenYang
Copy link

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.

@mloit
Copy link
Contributor

mloit commented Jul 26, 2022

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.

@Kristenlike1234 Kristenlike1234 added the FAQ common questions tend to recur about web3 infra label Oct 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FAQ common questions tend to recur about web3 infra
Projects
None yet
Development

No branches or pull requests

3 participants