I'm trying to call a simple contract method that just returns a string of data. I've based my code on the example that can be found in the docs => https://developers.tron.network/reference#methodcall
tronWeb.trx.getContract("TFWbGYFVjUMKrHALdU4MnFWNYY9Uc5W9SZ").then(async contract => {
console.log(contract);
let abi = contract.abi;
console.log(abi);
let c = await tronWeb.contract({
abi
});
let result = await c.getBadgeOwner('something is up').call();
console.log(result);
});
The difference with what can be found in the docs, is that I'm loading the abi from my loaded contract, instead of hard coding it like in the example.
The error I get is index.js:105 Uncaught (in promise) TypeError: e.forEach is not a function
which seems to refer to the abi somehow: