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.