JsonReaderException: Unexpected character encountered while parsing value: {. Path 'result', line 1, position 11

Hello everyone I am facing this error JsonReaderException: Unexpected character encountered while parsing value: {. Path 'result', line 1, position 11.

OnRunContractFunctionLeaderBoard(string, int)

static async UniTask<string> OnRunContractFunctionLeaderBoard(string functionName, int index)
        {
            //Defining contract data
            string address = LeaderBoardContractData.Address;
            ChainList chain = LeaderBoardContractData.requiredChain;
            object[] abi = new object[1];
            //readStructFromMapping
            object[] readStructFromMappingInputParams = new object[1];
            readStructFromMappingInputParams[0] = new { internalType = "uint8", name = "position", type = "uint8" };
            object[] readStructFromMappingOutputParams = new object[2];
            readStructFromMappingOutputParams[0] = new { internalType = "address", name = "refUser", type = "address" };
            readStructFromMappingOutputParams[1] = new { internalType = "uint256", name = "refScore", type = "uint256" };
            abi[0] = new { inputs = readStructFromMappingInputParams, outputs = readStructFromMappingOutputParams, name = LeaderBoardContractData.LEADERBOARD_CALL, stateMutability = "view", type = "function" };
            RunContractDto runContractDto = new RunContractDto()
            {
                Abi = abi,
                Params = new { position = index }
            };
            MoralisClient moralisClient = Moralis.GetClient();
            string result = await moralisClient.Web3Api.Native.RunContractFunction(address, functionName, runContractDto, chain);
            return result;
        }

I have tried to check same error on other threads in the forum seems none helped.

Try to reduce this code down even if it doesnโ€™t work in RunContractFunction until you can see where this error is coming from e.g. one of the param objects.

The error comes within RunContractFunction, Iโ€™m returning a json which the function fails to parse.

You can check the parameters youโ€™re passing into runContractFunction. It should work by default with any recent Unity SDK Version.