Transaction.value missing?

In this transaction ( the user receives 20k ETH but when I access this transaction through the Moralis API ( it says value=0.

Why is transaction.value set to 0 instead of 20k in this case?
How do I programmatically detect the transfer of 20k eth to the user (justin sun in this case)? This means input=transaction ID and output=native coin units received by the user initiating the transaction.


According to my understanding, Because this is WETH transfer and the actual ETH transferred here is 0.

I disagree. The transfer is for native Ether. See screnshot.

If it were a WETH transfer, it would appear in the erc20 token transfers endpoint. Unfortunately, it doesn’t.

Whatever transfer it is, my question is how to read it from this transaction.

1 Like

if you look in etherscan you will also see that the value is 0, that value is the value that was sent in that transaction.

if you want to get more information about other transfers that happened in the same transaction you can try to process the logs for that transaction

Thanks. Yes, I see the value in Etherscan is zero. Can you suggest some Moralis code that will process the logs in this transaction to extract the fact that 20k ether was received by the wallet that initiated this tx?

I think that you would need to know the ABI for those particular events from logs and after that maybe you can find a library to map an event data. I don’t know Moralis code that could help you with this directly.

As the screenshot suggests, it explicitly mentions “Tokens transferred”

Like @cryptokid suggested, you might wanna track their events through Moralis. You can follow this for more reference -

Thanks guys, but on Etherscan, it looks like they have figured out how to put all the transfers in their own section, just below “contract” but above the “Tokens transferred” section. I could be wrong, but this UI does not make it look like this is a feature that is specific to each contract. It looks generic. Any ideas how they did that?

Well, we’ll have to dive a little deep into the contract to see which events are emitting logs that show the token transfer.

According to my short analysis, it might be the BalanceTransfer event. You can add this event to track in the Moralis server and see what data you get.

Yes, etherscan processes automatically some events that they know about them from some contract source code. Etherscan also has the option to validate a smart contract where you upload the source code.

Thanks @malik. Why do you believe it’s the BalanceTransfer event? I saw a few other events with the same value, like

and and

@cryptokid is there a “common” or “standard” transfer method you have encountered?

Also, do I have to set up Moralis to monitor these events ahead of time, or can I parse the logs for this specific transaction using Javascript code? I was thinking of a “Moralis” version of this code:

You can also process the events directly from a transaction list of events. You will need a library that does that

Thanks @cryptokid. Any suggestions for code or library?

Maybe it is something in etherjs, I don’t know exactly now what you can use, you will also need the abi for those events that you want to process.