multiversx / mx-api-service

Unified REST API facade for providing data related to the MultiversX blockchain
https://api.multiversx.com
GNU General Public License v3.0
30 stars 48 forks source link

Incorrect MEX Supply vs accounts/sc ammounts on testnet https://testnet-explorer.elrond.com/ #272

Closed elrondex closed 2 years ago

elrondex commented 2 years ago

image

elrondex commented 2 years ago

Same problem on mainnet https://explorer.elrond.com/tokens/WEGLD-6823c1/accounts

image

image

tanghel commented 2 years ago
Screen Shot 2021-11-08 at 12 36 54 Screen Shot 2021-11-08 at 12 38 35

The API returns correct amounts that add up. this is a front-end issue and has been reported internally

tanghel commented 2 years ago

Update: this is actually a javascript issue, since there are precision issues with handling Numbers. Here is an example in Google Chrome's javascript console:

image

The value 0.60395483429230088 when assigned to a Number, actually has the value 0.6039548342923009

elrondex commented 2 years ago

@tanghel Thanks for update. On server side balance and supply is stored as string and sum is done with BigInt, this looks good for me. In that case client need to find better way to convert to decimal number (Bigdecimal or similar)

Thanks for clarification! @elrondex

tanghel commented 2 years ago

The client seems to be fine. The numbers indeed add up if you manually add them up, but not in a javascript console :)

Glad to help!