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

Lamport balance JS floating point issues #3524

Open
marcospgp opened this issue Jan 30, 2025 · 0 comments
Open

Lamport balance JS floating point issues #3524

marcospgp opened this issue Jan 30, 2025 · 0 comments

Comments

@marcospgp
Copy link

marcospgp commented Jan 30, 2025

I'm having a discrepancy with lamport balances in test code and noticed this may be due to JS floating point inaccuracies.

I believe this may have been fixed in the @solana/web3.js package, but since the latest is v1.98.0 and Anchor currently depends on ^1.68.0 it may not yet be on a version containing that update.

Edit: actually there is a v2 it seems!

If I could be wrong here and there's something I could do to get a proper bigint or BN format when retrieving balance with:

(await provider.connection.getAccountInfo(
      publicKey
    ))!.lamports;

I'd appreciate the feedback!

If not, some info on when this update would be available would be great.

Thanks!

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

No branches or pull requests

1 participant