1

I’m using ethers v6 and comparing the converted numbers, but I’m facing this error:

TypeError: ethers.toBigInt(...).eq is not a function
1
  • If changing the version doesn't work, please provide the complete code so I can assist you more effectively. I'm not entirely sure what you're trying to accomplish. Commented Aug 13 at 11:23

2 Answers 2

2

In ethers v6, instead of eq you’ve to use the == operator for equality comparison, like:

value1 = ethers.toBigInt("1000");
value2 = ethers.toBigInt("1000");
isEqual = (value1 == value2);

You can refer to the Big Numbers migration section of the ethers v6 doc.

0

I think You need to try the ether.js 5.7.2 version as it is stable and works.

npm install [email protected]

Or

yarn add [email protected]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.