0

When I use python web3 to get an transaction:

w3.eth.getTransaction('0x0ae2e71023a5801e557472d9b58dee483a8617cff3afcdeae171889e0db70ded')

I get:

AttributeDict({'blockHash': HexBytes('0x422914431295157e7b2560bd8f92fb49bc67c3c55f266904771ab860ecaa7bc8'), 'blockNumber': 13435586, 'from': '0x21a31Ee1afC51d94C2eFcCAa2092aD1028285549', 'gas': 207128, 'gasPrice': 112000000000, 'hash': HexBytes('0x0ae2e71023a5801e557472d9b58dee483a8617cff3afcdeae171889e0db70ded'), 'input': '0x', 'nonce': 1924466, 'r': HexBytes('0xc42909ca52009ba8d1b599e5677da00b37318a33a2037e447becc5c2b916dad0'), 's': HexBytes('0x4d476d7752f8e06f6ea1b975af01d3e0a74786262afd8f2f5621c0e81c4e946d'), 'to': '0xc2Cf260adb36Be2f45dC491457a30D6FbeD55E51', 'transactionIndex': 71, 'type': '0x0', 'v': 37, 'value': 780647230000000000})

When I go on etherscan I get a lot more information. Most importantly, the value field on etherscan tells me how much this transaction transferred (0.78064723 Ether).

https://etherscan.io/tx/0x0ae2e71023a5801e557472d9b58dee483a8617cff3afcdeae171889e0db70ded

I read on this forum you may potentially be able to extract that information from the input. (here) but my input is 0x...? what does that mean? how can I get the value field like etherscan?

Thanks

1

In this response you also get the ETH transfered it is the last key - 'value': 780647230000000000. Here is the value of the transaction represented in WEI.

1 ETH = 1*10^18 WEI = 1,000,000,000,000,000,000 WEI
780647230000000000 WEI = 0,78064723 ETH

2
  • right, thanks. so I have another transaction: "0x42d6b283c36150475c75edd67ca3ee76cd8eef863b8d8bfcec836f04c27195b5" and this one has value = 0. whats the difference between these transactions? Oct 27 '21 at 13:52
  • The first send ETH somewhare, the second does not. Don't forget to upvote :) Oct 27 '21 at 13:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.