Hello!
I tried to use the function run_contract_function in python. With the following code
from frozendict import frozendict
from moralis import evm_api
abi = {
"inputs": [],
"name": "getRound",
"outputs": [
{
"internalType": "int256",
"name": "",
"type": "int256",
},
],
"stateMutability": "view",
"type": "function",
}
params = {
"address": "0xD91212683F8F7e3010dAaa9E29031A518453ebd9",
"function_name": "getRound",
"chain": "0x13881",
}
body = {"abi": [frozendict(abi)], "params": {}, "functionName": "getRound"}
result = evm_api.utils.run_contract_function(
api_key=api_key,
params=params,
body=body,
)
print(result)
But then I get the following error back from the typechecking done in schemas.py
openapi_evm_api.exceptions.ApiTypeError: Invalid type. Required value type is frozendict and passed type was tuple at ['args[0]']['abi']
However the abi should be a list of frozendicts. So by commenting out the type checking in _validate_oapg
I get the code run with no issues.
# if base_class not in cls._types:
# raise cls.__get_type_error(
# arg,
# validation_metadata.path_to_item,
# cls._types,
# key_type=False,
# )