From 0e67fcd361ea1681f989077969417e166ea8453e Mon Sep 17 00:00:00 2001 From: Marek Kotewicz Date: Thu, 13 Nov 2014 12:24:34 +0100 Subject: contract object --- lib/abi.js | 15 ++++++++++++--- lib/main.js | 4 +--- 2 files changed, 13 insertions(+), 6 deletions(-) (limited to 'lib') diff --git a/lib/abi.js b/lib/abi.js index 0ac27e6b8..1e3759918 100644 --- a/lib/abi.js +++ b/lib/abi.js @@ -148,8 +148,17 @@ var fromAbiOutput = function (json, methodName, output) { return result; }; -module.exports = { - toAbiInput: toAbiInput, - fromAbiOutput: fromAbiOutput +var load = function (json) { + var contract = {}; + json.forEach(function (method) { + contract[method.name] = function () { + var params = Array.prototype.slice.call(arguments); + return toAbiInput(json, method.name, params); + }; + }); + + return contract; }; +module.exports = load; + diff --git a/lib/main.js b/lib/main.js index d7f8531d2..fc0170287 100644 --- a/lib/main.js +++ b/lib/main.js @@ -86,9 +86,7 @@ var ethMethods = function () { { name: 'uncle', call: uncleCall }, { name: 'compilers', call: 'eth_compilers' }, { name: 'lll', call: 'eth_lll' }, - { name: 'solidity', call: 'eth_solidity' }, - { name: 'contractCreate', call: 'eth_contractCreate' }, - { name: 'contractCall', call: 'eth_contractCall' } + { name: 'solidity', call: 'eth_solidity' } ]; return methods; }; -- cgit v1.2.3