js
js copied to clipboard
[SDK] - Expose convenience function to do `ethers.utils.formatEther` and `ethers.utils.parseEther`
Background
Working with BigNumber
variables requires importing ethers
and using ethers.utils.formatEther
and parseEther
functions which is not very discoverable through our SDK unless you are already familiar with the ethers dependency.
It would be great to expose convenience functions that expose these directly from our SDK package rather than ethers.
Goal
[] Add toEther
function
- Users can import toEther from the @thirdweb-dev/sdk package and convert a number from wei to formatted value. Use the ethers.utils.formatEther functionality under the hood.
[] Add toWei
function
- Same as above, except use parseEther under the hood.