Add a .toBigInt() method to BigNumber type #1415
Labels
enhancement
New feature or improvement.
fixed/complete
This Bug is fixed or Enhancement is complete and published.
Ethers accepts BigInt's as inputs for BigNumberish types, but getting a BigInt from a returned BigNumber is a bit clunky with
BigInt(myBigNumber.toString())
I saw in #594 (comment) you mentioned that "There will likely be an instance method that will return a BigInt (similar to the
instance.toNumber()
)", though that method still doesn't exist.I'm happy to submit a PR for it, as long as you still support adding an
instance.toBigInt()
method, and my only question would be whether to throw or returnnull
on platforms that don't support BigIntThe text was updated successfully, but these errors were encountered: