ethjs-contract icon indicating copy to clipboard operation
ethjs-contract copied to clipboard

contract.method.getData

Open wighawag opened this issue 8 years ago • 2 comments

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..'

wighawag avatar Oct 03 '17 21:10 wighawag

I can offer this in the new update.

SilentCicero avatar Oct 11 '17 19:10 SilentCicero

@wighawag Ethjs-abi has a function to achieve similar.

https://github.com/ethjs/ethjs-abi/blob/e63f92966179d9017b57c9eadef78384a6899a51/src/index.js#L113

pau1m avatar Dec 17 '17 19:12 pau1m