Вот проблема, с которой я столкнулся:
//this is just a smart contract i just picked up from etherscan
var c = web3.eth.contract([{"constant":true,"inputs":[{"name":"user","type":"address"},{"name":"token","type":"address"}],"name":"tokenBalance","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"users","type":"address[]"},{"name":"tokens","type":"address[]"}],"name":"balances","outputs":[{"name":"","type":"uint256[]"}],"payable":false,"stateMutability":"view","type":"function"},{"payable":true,"stateMutability":"payable","type":"fallback"}]);
var contract = c.at("0xb1F8e55c7f64D203C1400B9D8555d050F94aDF39");
//This is not working
contract.methods.tokenBalance("0x", "0x").call((err, balance) => {
console.log({err, balance});
})
Это говорит о том, что contract.methods не является функцией.Я не знаю, что я делаю не так.