blockbook icon indicating copy to clipboard operation
blockbook copied to clipboard

[ETH] Add totalReceived and totalSent to address response for ETH

Open screw opened this issue 3 years ago • 1 comments

When you query the address endpoint for BTC the response contains 'balance' but also totalReceived and totalSent.

Can you add totalReceived and totalSent to the response for ETH addresses?

Or is there a reason why it's not there?

screw avatar Nov 11 '21 14:11 screw

Yes, there is a reason. In case of Bitcoin type coins, the total balance is calculated as totalReceived-totalSent, where the received and sent are calculated from the transaction history (and there is actually no other way how to get the totals).

In case of Ethereum, the balance is obtained by a direct call to backend eth_getBalance, which returns only the total balance and neither totalReceived nor totalSent. Blockbook currently is not able to get these balances from the transaction history as it is not able (yet) to process internal transactions and the transaction history is incomplete. When we add support of the internal transactions, we may add the totalReceived and totalSent balances also for Ethereum.

martinboehm avatar Nov 11 '21 22:11 martinboehm

Unfortunately, reliable totalReceived and totalSent is not feasible at his moment for the ETH chains.

martinboehm avatar Feb 02 '23 21:02 martinboehm