After trying for a full day getting this to work, I couldnāt find any solutionā¦
Below my code (Moralis @0.0.54):
var ABI4 = [{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"}];
var options = {
chain: "bsc",
address: "0x...",
name: "decimals",
abi: ABI4
};
var decimals = await Moralis.Web3API.native.runContractFunction(options).catch(e => {
console.log(e.message);
});
I keep on getting the same āobject Objectā error when the server sends back a error 400 with this response:
{"code":141,"error":"[object Object]"}
Logs Moralis Server:
2021-09-23T09:21:46.363Z - Error: [object Object]
at fetch (/moralis-server/lib/cloud-code/plugins/convenience/web3Api.js:248:11)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
2021-09-23T09:21:46.359Z - Failed running cloud function runContractFunction for user X with:
Input: {"chain":"bsc","address":"0x...","name":"decimals","abi":[{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"}]}
Error: {"message":"[object Object]","code":141}
Am I doing something wrong?
Iām also wondering if thereās a possibility to add parameters to this function (since most of my contract functions needs added parameters).
Kind Regards