ethjs-contract
ethjs-contract copied to clipboard
contract.method.getData
ethjs-contract
Issue Type
- [ ] Feature
Description
With web3 I make use of the getData functionality to get the data to be sent as part of a transaction
Currently ethjs does not seem to offer that functionality
from web3 doc here : https://github.com/ethereum/wiki/wiki/JavaScript-API#contract-methods
// Get the call data, so you can call the contract through some other means
var myCallData = myContractInstance.myMethod.getData(param1 [, param2, ...]);
// myCallData = '0x45ff3ff6000000000004545345345345..'
I can offer this in the new update.
@wighawag Ethjs-abi has a function to achieve similar.
https://github.com/ethjs/ethjs-abi/blob/e63f92966179d9017b57c9eadef78384a6899a51/src/index.js#L113