contract object
This commit is contained in:
15
lib/abi.js
15
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;
|
||||
|
||||
|
Reference in New Issue
Block a user