Skip to main content

Execute view function of a module

POST

Call functions defined as view.
Path Parameters
chainstringrequired
Parameter specifying the target chain to query.
networkstringrequired
Parameter specifying the network of the target chain.
Request Body
functionstringrequired
Field for entering the view function defined in the deployed module. Enter in the following format:
  • Format: {address}::{module_name}::{function_name}
type_argumentsarrayrequired
Field for entering the function's type arguments. For functions that do not take generic type arguments, enter an empty array.
argumentsarrayrequired
Field for entering the function's arguments. For functions that take no arguments, enter an empty array in this field.
Responses
codestringrequired
Code identifying the cause of the failed request.
messagestringrequired
Detailed message including the name and value of the invalid parameter.
{
"code": "ERROR_CODE",
"message": "Bad Request"
}
cURL
curl -X POST 'https://aptos-mainnet.nodit.io/v1/view' \
-H 'Content-Type: application/json' \
-H 'X-API-KEY: nodit-demo' \
-d '{}'