blockbook
blockbook copied to clipboard
[ETH] Add totalReceived and totalSent to address response for ETH
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?
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.
Unfortunately, reliable totalReceived
and totalSent
is not feasible at his moment for the ETH chains.