Hi. I migrated from web3.js to ethers.js and see that ethers displays all numbers with n at the end, like 110n, and because of this when I open redux devtool it shows me an error "TypeError: Do not know how to serialize a BigInt"

Is there any way to configure ethers.js not to put the n letter at the end?

Nov 17, 2023, 6:32 PM
toString() ?
ethers 6 by default use BigInt and not BigNumber anymore
so things like
myNumber.mul(5) becomes myNumber * 5 and it will work
but the output will still be BigInt and you can convert it to string, removing the "n" at the end
Nov 17, 2023, 6:50 PM
so I should manually go through each value and convert it to a string?
Nov 17, 2023, 6:51 PM
yeah :\
i gave up on fixing all my old workspaces since the new update, switched to foundry and never looked back
Nov 17, 2023, 6:55 PM
you mean this https://book.getfoundry.sh
Nov 17, 2023, 6:57 PM
Yep
Nov 17, 2023, 7:09 PM

© 2024 Draquery.com All rights reserved.