Call Function
Calls a read‑only function on a smart contract. In Solidity, these are functions with state mutability set to view. This operation currently supports only EVM‑compatible networks.
- HTTP request
- POST/networks/{network}/call-function
- Authentication
-
Authentication Type Supported Organization User (CustomerEmployee) Yes Delegated User (EndUser) Yes Service Account Yes - Required permissions
- No permission required.
- Authorization requirements
-
Header Type Required Description Authorizationstring Yes Bearer token used to authenticate the request. See Authentication flows for instructions on generating this token. - Path parameters
-
Parameter Type Required Description network string Yes Network name formatted in kebab case. - Request body
-
Calls an on‑chain read‑only function.
Field Type Required Description contract string Yes Address of the smart contract to call. abi object Yes ABI definition of the read‑only function being invoked. calldata object No Function call arguments. curl --request POST \ --url https://api.digitalassets.ibm.com/networks/{network}/call-function \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data ' { "contract": "<string>", "abi": { "type": "<string>", "name": "<string>", "stateMutability": "<string>", "inputs": [ { "name": "<string>", "type": "<string>", "components": [ {} ] } ], "outputs": [ { "name": "<string>", "type": "<string>", "components": [ {} ] } ] }, "calldata": {} } ' - Response
- 200: Success