ruby-eth
ruby-eth copied to clipboard
hex_data for creating a new transaction
I want to build a new transaction. What is the hex_data I need to provide?
tx = Eth::Tx.new({
data: hex_data,
gas_limit: 21_000,
gas_price: 3_141_592,
nonce: 1,
to: key2.address,
value: 1_000_000_000_000,
})
Are you sending any data in the transaction? If you just want to transfer ether, than you'll need to make the data attribute an empty string.
Requiring an empty string instead of just allowing it to be null is not a great experience. On my list of things to improve is adding sane defaults for new transactions.
No reply. Closing. Feel free to reopen with more details.