async function viewmyactivedeposits() {
const result = await myLoanContract.methods
.viewMyActiveDeposits()
.call()
.then(function (result) {
let data = Array.from(result);
$("#viewdepositid").html(
"<br> My active deposit ID's are : " + JSON.stringify(data)
);
console.log(result);
})
.catch((err) => {
console.log("error :::::", err);
});
}
I have been trying to access a smart contract method that returns multiple values and pass it into a javascript function. But the result is showing out as an empty array.
I have already checked the smart contract from the backend on remix and it is working perfectly fine there and returning the requisite values. Does anybody have any idea why this is happening? Any help will be greatly appreciated.