Skip to content

Regarding the potential numeric overflow issue when querying asset values #6568

@davidapp

Description

@davidapp

Background

Rationale

API example:
https://nile.trongrid.io/wallet/getaccount?address=TQUsaH7DzTAPQEVsUvQsVyzvwqwT2p7WEm&visible=true

The returned value field is currently of numeric type, and its maximum value can reach the int64 limit.

When using JavaScript (e.g., with Axios or other HTTP clients) to send requests, the response body is parsed by default using JSON.

Image

parse(). This automatically converts all numeric values into the Number type, which has a maximum safe integer limit of 2^53 - 1. Therefore, all JavaScript-based integrations may encounter this issue.

Specification

For the returned value field, add an additional “value_string” field that returns the value as a string type to avoid precision loss.

Test Specification

Scope Of Impact

Implementation

Do you have ideas regarding the implementation of this feature?

Are you willing to implement this feature?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions