ruby-eth icon indicating copy to clipboard operation
ruby-eth copied to clipboard

hex_data for creating a new transaction

Open iscott opened this issue 9 years ago • 3 comments

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,
})

iscott avatar Aug 17 '17 19:08 iscott

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.

se3000 avatar Aug 18 '17 16:08 se3000

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.

se3000 avatar Aug 18 '17 16:08 se3000

No reply. Closing. Feel free to reopen with more details.

se3000 avatar Feb 15 '18 19:02 se3000