diff options
author | Marek Kotewicz <marek.kotewicz@gmail.com> | 2014-11-13 19:24:34 +0800 |
---|---|---|
committer | Marek Kotewicz <marek.kotewicz@gmail.com> | 2014-11-13 19:24:34 +0800 |
commit | 0e67fcd361ea1681f989077969417e166ea8453e (patch) | |
tree | 29b8ef683fe7784b9e2507f9c239dd43be93bcaa /lib/abi.js | |
parent | d99fea2db682c454581e1f9f60b2cea27d02c36e (diff) | |
download | dexon-0e67fcd361ea1681f989077969417e166ea8453e.tar dexon-0e67fcd361ea1681f989077969417e166ea8453e.tar.gz dexon-0e67fcd361ea1681f989077969417e166ea8453e.tar.bz2 dexon-0e67fcd361ea1681f989077969417e166ea8453e.tar.lz dexon-0e67fcd361ea1681f989077969417e166ea8453e.tar.xz dexon-0e67fcd361ea1681f989077969417e166ea8453e.tar.zst dexon-0e67fcd361ea1681f989077969417e166ea8453e.zip |
contract object
Diffstat (limited to 'lib/abi.js')
-rw-r--r-- | lib/abi.js | 15 |
1 files changed, 12 insertions, 3 deletions
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; + |