Use ethereumjs-abi for encoding requests

pull/1/head
Alex Beregszaszi 9 years ago
parent f738864d45
commit 5168455428
  1. 8
      src/universal-dapp.js

@ -274,8 +274,12 @@ UniversalDApp.prototype.getInstanceInterface = function (contract, address, $tar
$instance.append(self.getCallButton({ $instance.append(self.getCallButton({
abi: funABI, abi: funABI,
encode: function (args) { encode: function (args) {
var obj = web3contract.at('0x00')[funABI.name]; var types = [];
return obj.getData.apply(obj, args); for (var i = 0; i < funABI.inputs.length; i++) {
types.push(funABI.inputs[i].type);
}
return Buffer.concat([ ethJSABI.methodID(funABI.name, types), ethJSABI.rawEncode(types, args) ]).toString('hex');
}, },
address: address address: address
})); }));

Loading…
Cancel
Save