ergoplatform / ergoplatform/ergo-node-interface

Node Interface cannot represent large token amounts

Open
#62 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
2
Forks
8
PR merge metrics
No merged PRs in 30d

Description

The node interface is unable to accurately represent large token amounts. The actual amount of these tokens is 9223372036854775807.

![image](https://github.com/ergoplatform/ergo-node-interface/assets/9436380/b903529c-6739-4912-bfc0-71367ec52a5e)

I believe the way to solve this is to use lossless-json to preserve precision when deserializing responses in axios. https://stackoverflow.com/questions/43787712/axios-how-to-deal-with-big-integers

I haven't tested whether you can send a large token amount using the node interface but I would imagine it suffers from a similar issue since javascript's number type can't represent numbers larger than ~53 bits.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.