contract object

This commit is contained in:
Marek Kotewicz
2014-11-13 12:24:34 +01:00
parent d99fea2db6
commit 0e67fcd361
6 changed files with 21 additions and 14 deletions

View File

@ -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;