Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gui: use string for large ints in json #4617

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jherrera-jump
Copy link
Contributor

@jherrera-jump jherrera-jump commented Mar 24, 2025

JSON.parse for typical js clients will automatically parse any number as a javascript number, which can store numbers smaller than ~2^53 without loosing accuracy. For numbers we expect to be larger than this (i.e. timestamps and lamports), we should explicitly use strings. Application code and convert to bigint as needed.

@jherrera-jump jherrera-jump force-pushed the jherrera/gui-fix-big-ints-json branch from 9fff637 to 3612f11 Compare March 24, 2025 16:06
@jherrera-jump jherrera-jump marked this pull request as ready for review March 24, 2025 16:07
@jherrera-jump jherrera-jump marked this pull request as draft March 24, 2025 16:21
@jherrera-jump jherrera-jump marked this pull request as ready for review March 24, 2025 16:25
@jherrera-jump jherrera-jump force-pushed the jherrera/gui-fix-big-ints-json branch 11 times, most recently from 2729ddd to 764ad6c Compare March 28, 2025 01:45
@jherrera-jump jherrera-jump requested review from mmcgee-jump and removed request for mmcgee-jump March 28, 2025 01:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant