-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
ES10 BigInt datatype #594
Comments
The v5 of ethers already supports the native BigInt any place a BigNumberish can be used, and will not throw exceptions when used for values that are unsafe for IEEE 754 values. The results of all functions are still the BigNumber class though, since most environments will not support the BigInt for a while. I aim to continue supporting a variety of platforms, and Expo/ReactNative apps don't support it (maybe the newest version? but not most people maintaining their apps are running these), and PhantomJS is still a target (which may be dropped for v5), Duktape, Otto, slightly old nodejs and slightly old Andriod/iOS, and Safari do not support it yet. Basically, it cannot replace BigNumber... yet. But this is also the reason why ethers uses its own BigNumber wrapper, which will make it easier to swap out without affecting any consumers. There will likely be an instance method that will return a BigInt (similar to the I do worry a bit about people using the BigInt, since all the same problems still exist, they just become far less obvious. Their existence is still a huge win, and I'm looking forward to using them, but I can already imagine the beginning of all the issues that will arise as a result of Long story short, yes, it's in the pipeline. :) |
That's great, I'll try out v5. Used to see it always in
Just like |
Hi, I've been using Ethers.js for a while and very much loving it. I just noticed the new ES10 BigInt primitive datatype (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) implemented in my Chrome browser.
At my company, non-blockchain developers always have a hard time understanding the concept of Big Number objects and why they need a separate library for adding and subtracting numbers in Javascript while there is no need in Python. But finally, now that we have a native BigInt type in JavaScript, we can make things better.
My purpose for creating this issue is to know if Ethers.js community is already planning to implement this in the upcoming versions, if yes then can I help on it?
Got my entire office changed from web3.js to ethers.js because this library is doing great. I would like to contribute my time to make it even better for new developers joining the Web3.0 world.
The text was updated successfully, but these errors were encountered: