Skip to content

Add a .toBigInt() method to BigNumber type #1415

Closed
@mds1

Description

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 return null on platforms that don't support BigInt

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or improvement.fixed/completeThis Bug is fixed or Enhancement is complete and published.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions