When I use contract.method.getData(params) it throws an error getData is undefined. I searched on github and saw someone used request instead, and I used contract.method.request and it has successed!

Why getData is undefined with web3.js@0.20.1 and geth Version: 1.7.3-stable?

  • Your contract ABI seems not having the method name you are trying to call. – Rajesh Mar 9 '18 at 9:48
  • @Rajesh got it . i want to know that .request method`s result is a hex string , what it means ,do you know? – Jack LI Mar 9 '18 at 9:56
  • Whatever you interact with the ethereum blockchain will be of hex. Even getData yields the result in hex. – Rajesh Mar 9 '18 at 9:59
  • That sound like a bug. Are you using other framework like Truffle? Do you have the abi used? – Ismael Mar 9 '18 at 16:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.