From js, I typically call a function with something like this:
theFunction=someAbi.at(0x1234...);
theFunction.someMethod(param1, param2, param3,
{"from": 0x111222..., "to": 0x1234..., "value":web3.toWei(2, 'ether')});
I would like to also display for the users how they would achieve the same manually, using the geth console, something like
web3.eth.sendTransaction({'from':0x111222..., 'to':0x1234,
'value':web3.toWei(2, 'ether'), 'data': 0xXXXXXXX})
So, how do I get the 0xXXXXXXXX part from my original theFunction.someMethod(…) call? I know it can be calculated, but web3 can obviously do so already, so I don't want to reinvent the wheel.
Best Answer
Use
getData
.Example: