Hello! I have encountered a problem with the runContractFunction from the Moralis API. When I run the function inside my react application it returns with an error code 400 and Moralis SDK Core Error: [C0006] Request failed, (400): invalid type (argument="type", value="a", code=INVALID_ARGUMENT, version=abi/5.0.7)
.
The code looks like this
export default function useRetrievePoolLiquidity(lpAddress) {
const retrieve = async () => {
await Moralis.start({
apiKey: process.env.MORALIS_API_KEY,
})
const response = await Moralis.EvmApi.utils.runContractFunction({
address: lpAddress,
chain: config.chainId,
abi: tlpAbi,
functionName: "getPoolLiquidity",
params: {},
})
console.log(response)
}
useEffect(() => {
retrieve()
}, [])
}
config.chainId
, tlpAbi
, process.env.MORALIS_API_KEY
and Moralis
are provided and imported correctly. Any guess to why the function still returns the error?