[SOLVED] runContractFunction balanceOf gives error: account is required

I’m trying to get the balance of a given address, but I get only this error
Before balanceOf I’ve used the totalSupply and this works


const options = {
        chain: CHAIN,
        address: CONTRACT_ADDRESS,
        function_name: "balanceOf",
        abi: CONTRACT_ABI,
        params: { who: address },
    try {
    return await Moralis.Web3API.native.runContractFunction(options);
    } catch (err) {
        console.log("error:", err);

was the parameter named who in that ABI?

Ok, I got it!!!
I’ve changed the “who” in “account” as in my contract and now it works!

1 Like