Smart Contracts

Call read-only function

Call a read-only public function on a given smart contract.

The smart contract and function are specified using the URL path. The arguments and the simulated tx-sender are supplied via the POST body in the following JSON format:

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

Path parameters

contract_addressstring required

Stacks address

contract_namestring required

Contract name

function_namestring required

Function name

Query parameters

tipstring

The Stacks chain tip to query from. If tip == latest, the query will be run from the latest known tip (includes unconfirmed state).

Request body

ReadOnlyFunctionArgsSchemaJson required— unresolved $ref

Response

Success

PostCallReadOnlyFnSchemaJson required— unresolved $ref

Changes

Changed in 5 of the 21 revisions of this API.122