var sendTrans = userWallet.sendTransaction({
to: address,
value: ethers.utils.parseEther(value) // value being any decimal eg: 0.5
});
This code throws:
Error: invalid decimal value (arg="value", value={"_hex":"0x06f05b59d3b20000"}, version=4.0.33)
at Object.throwError (C:\Users\Martino\Desktop\React\etherumble\backend\node_modules\ethers\errors.js:76:17)
at parseUnits (C:\Users\Martino\Desktop\React\etherumble\backend\node_modules\ethers\utils\units.js:124:16)
at Object.parseEther (C:\Users\Martino\Desktop\React\etherumble\backend\node_modules\ethers\utils\units.js:171:12)
at C:\Users\Martino\Desktop\React\etherumble\backend\socket.js:64:57
at processTicksAndRejections (internal/process/task_queues.js:85:5) {
reason: 'invalid decimal value',
code: 'INVALID_ARGUMENT',
arg: 'value',
value: BigNumber { _hex: '0x06f05b59d3b20000' }
}
When I try to set any decimal value, it throws that error, even though the transaction was sent: transaction
Looking into this now...
Oh my god, I'm so dumb... The error was because I was misusing ethers.utils.parseEther a few lines below. Guess I need to sleep. Sorry for wasting your time...
Ha ha, no worries.
You had me a bit worried for a minute. ;)
Thanks!
@bruxo00 How update your code? I hope to know about you and your code.