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

rentEpoch in AccountHeader should be a bigint #99

Closed
Juici opened this issue Nov 18, 2023 · 3 comments
Closed

rentEpoch in AccountHeader should be a bigint #99

Juici opened this issue Nov 18, 2023 · 3 comments
Labels
good first issue Good for newcomers

Comments

@Juici
Copy link

Juici commented Nov 18, 2023

rentEpoch return by the RPC is a u64 and should be bigint in AccountHeader in order to not lose precision.

export type AccountHeader = {
executable: boolean;
owner: PublicKey;
lamports: SolAmount;
rentEpoch?: number;
};

If we call getAccountInfo (on devnet) for the public key (vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg) in the example for https://docs.solana.com/api/http#getaccountinfo, then the account info returned is:

{
  "data": ["", "base64"],
  "executable": false,
  "lamports": 88819743038050,
  "owner": "11111111111111111111111111111111",
  "rentEpoch": 18446744073709551615,
  "space": 0
}

Here we can see the value for the rentEpoch is 18446744073709551615, however as a number we lose precision and get 18446744073709552000.

@lorisleiva
Copy link
Collaborator

Hi 👋 Thanks for reporting this. That's something I've also noticed since working on the new web3.js haha. I'm happy to accept a PR change for this change with a minor changeset.

@lorisleiva lorisleiva added the good first issue Good for newcomers label Nov 20, 2023
@HarishPrasannaV
Copy link
Contributor

Hey, I'm a beginner and would like to work on this. Any context and advice are highly appreciated.

@Juici
Copy link
Author

Juici commented Jan 9, 2024

Fixed in #105.

@Juici Juici closed this as completed Jan 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants