Skip to main content

/v2/contracts/call-read/{contract_address}/{contract_name}/{function_name} REST

Call read-only function.

Updated on
Jun 11, 2024

/v2/contracts/call-read/{contract_address}/{contract_name}/{function_name} REST

Path Parameters

contract_address
string
Stacks address.
contract_name
string
Contract name.
function_name
string
Function name.

Query Parameters

tip
string
The Stacks chain tip to query from.

Body Parameters

sender
string
The simulated tx-sender
arguments
array
An array of hex serialized Clarity values

Returns

object
object
An object which contains the following fields:
okay
boolean
A flag indicating the success or failure of the request. If true, the request was successful; otherwise, it failed.
result
string
The result of the contract source retrieval. It contains the source code of the requested contract.
cause
string
In case of failure, this field provides information about the cause or reason for the failure.
Request
1
curl --location --globoff 'https://docs-demo.stacks-mainnet.quiknode.pro/v2/contracts/call-read/{contract_address}/{contract_name}/{function_name}' \
2
--header 'Content-Type: application/json' \
3
--data '{
4
"sender": "STM9EQRAB3QAKF8NKTP15WJT7VHH4EWG3DJB4W29",
5
"arguments": [
6
"0x0100000000000000000000000000000095"
7
]
8
}'
Don't have an account yet?
Create your QuickNode endpoint in seconds and start building
Get started for free