0

sorry I'm too stupid to transfer eth from one account to another.

I want to transfer all eth from one wallet to the other. With eth.getbalance the value is: 26303362261697318 About 0.12193 eth

web3.eth.sendTransaction({ from: "0xssss", to: "0xtttt", gas: "0x76c0", gasPrice: "0x9184e72a000", value: "0x52CA48D5AE4326" })

but I always get back errors like "insufficient funds for gas"

Can please someone give me the exact numbers for gas, gasprice and my eth value to transfer the all from one wallet to the other?

Thanks!!

0

1 Answer 1

0

According to the documentation, you can't pass a hexadecimal to the value argument:

value - Number|String|BN|BigNumber: (optional) The value transferred for the transaction in wei, also the endowment if it’s a contract-creation transaction.

Example:

web3.eth.sendTransaction({
    from: '0xde0B295669a9FD93d5F28D9Ec85E40f4cb697BAe',
    to: '0x11f4d0A3c12e86B4b5F39B213F7E19D048276DAe',
    value: '1000000000000000'
}).then(console.log);

Additionally, you should also explicitly set a gas limit using gas:

gas - Number: (optional, default: To-Be-Determined) The amount of gas to use for the transaction (unused gas is refunded).

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