Skip to content

How do I get all the logs for a given transaction, across all contracts executed in the transaction? #2895

Answered by ricmoo
eliotstock asked this question in Q&A
Discussion options

You must be logged in to vote

If you have the transaction hash, you can use provider.getTransactionReceipt(hash). To parse all the events into Event objects, you can use tx.logs.map((log) => contract.interface.parseLog(log)).

It might make sense in v6 for me to add a contract.queryTransaction(hash) method. I've added a stub for now to investigate further. :)

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@eliotstock
Comment options

Answer selected by eliotstock
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants