Cannot set the gaslimit to executeFunction

When I’m trying to executeFunction from a script that I’m running in a local machine it’s throwing me an error that the gas limit is missing. The function is writable but I cannon find a way to put a gas limit on the request that I’m sending. Error below…

Error: cannot estimate gas; transaction may fail or may require manual gas limit [ See: https://links.ethers.org/v5-errors-UNPREDICTABLE_GAS_LIMIT ] (error={“reason”:“cannot estimate gas; transaction may fail or may require manual gas limit”,“code”:“UNPREDICTABLE_GAS_LIMIT”

Any thoughts?

Does that work if you run it in browser, as in if the execute function with same parameters works in browser

It does, but I need that to run in a script sever. Any suggestion?

you can try to use web3 or ethers directly to call that function

That is complicating things. I signed up for Moralis as an Avalanche infura alternative and if I switch my code to ethers or web3 then I need to run on my own node !!

it is more code to write to work with ethers or web3, it should be equivalent functionality
we recently added this functionality for SDK functions to use a private key and it needs improvements

for example Moralis.transfer works fine on BSC but not on polygon, because of gas price that can not be set now

that gas estimation error could also mean that the function may fail on execution