I'm Trying to call the apply function on the contract ABI but I'm getting:
TypeError: 'apply' is not a function at :1:1
> myContract
{
abi: [{
constant: false,
inputs: [{...}],
name: "apply",
outputs: [],
payable: false,
stateMutability: "nonpayable",
type: "function"
}, {
constant: true,
inputs: [{...}],
name: "getApplicationID",
outputs: [{...}],
payable: false,
stateMutability: "view",
type: "function"
}],
eth: {},
at: function(address, callback),
getData: function(),
new: function()
}
var abi = [{"constant": false,"inputs":[{"name": "hash","type": "bytes32"}],"name": "apply","outputs": [],"payable": false,"stateMutability": "nonpayable","type": "function"},{"constant": true,"inputs": [{"name": "email","type": "string"}],"name": "getApplicationID","outputs":[{"name": "","type": "uint256"}],"payable": false,"stateMutability": "view","type": "function"}]
var myContract = web3.eth.contract(abi,"0xcbbfbafedb0eb83016d2a96a4e80d30b20fa3e30");
myContract.apply("4183f3a48d92d7b874e0e2dc0353e29aee0031b0a174be6f6a2e7a289e9febca");
web3.js 1.0.0
? If so, I think you might needmyContract.methods.apply(...)
. – user19510 Jan 13 '18 at 16:39