Skip to main content
2 of 3
edited tags; edited title
eth
  • 86.6k
  • 54
  • 289
  • 418

eth-lightwallet: what is the difference between a functionTx and a valueTx?

In [eth-lightwallet][1], there are two types of Tx creation functions;

txutils.valueTx(txObject) 

and

txutils.functionTx(abi, functionName, args, txObject) 

My guess is; although their inputs are very different, they both result in a Tx object that looks like this:

tx = { nonce: '..', gasPrice: '..', gasLimit: '..', to: '..', value: '..', data: '...' } 

and the only difference is that data is empty in valueTx, and it's the hex-encoded version of the function call in functionTx. Is this correct? Is data the only difference between two?

Also, how can I compute data myself, given that I know the contract address, abi and the function name/parameters? Is there another library for this?

Thanks, [1]: https://github.com/ConsenSys/eth-lightwallet

jeff
  • 2.6k
  • 2
  • 21
  • 41