SDK Explorer

Query the state of a contract by providing the address and blockchain.

Parameters
ReadContractStateRequest
object
Required
abi_function_signature
string

The contract ABI function signature or callData field is required for interacting with the smart contract. The ABI function signature cannot be used simultaneously with callData. e.g. burn(uint256)

abi_parameters
array of

The contract ABI function signature parameters for executing the contract interaction. Supported parameter types include string, integer, boolean, and array. These parameters should be used exclusively with the abiFunctionSignature and cannot be used with callData.

abi_json
string

The contract's ABI in a JSON stringified format.

address
string
Required

Address of the contract to be queried.

blockchain
string
Required

The blockchain network that the resource is to be created on or is currently on. Required along with sourceAddress if you don't provide walletId. The blockchain and walletId fields are mutually exclusive.

Allowed valuesETHETH-SEPOLIAMATICMATIC-AMOYARBARB-SEPOLIAUNIUNI-SEPOLIABASEBASE-SEPOLIAOPOP-SEPOLIA
call_data
string

CallData is input data that encodes method and parameters.

from_address
string

FromAddress is the address that will populate msg.sender in the contract call.

x_request_id
string

Developer-provided parameter used to identify this request. Useful when communicating with Circle Support.

Responses
Example
1from circle.web3 import smart_contract_platform
2from circle.web3 import utils
3
4client = utils.init_smart_contract_platform_client(api_key=key, entity_secret=entitySecret)
5
6api_instance = smart_contract_platform.InteractApi(client)
7request = smart_contract_platform.ReadContractStateRequest.from_dict({
8    "abiFunctionSignature": "ping()",
9    "address": "0x4e2f1c3a5d8b7c9e5f6a8b7c9e5f6a8b7c9e5f6a",
10    "blockchain": "ETH-SEPOLIA"
11})
12response = api_instance.query_contract(read_contract_state_request=request)
13print(response.json())
14
ResponseChoose an example
1{
2  "data": {
3    "output_values": [],
4    "output_data": ""
5  }
6}
Did this page help you?
© 2023-2025 Circle Technology Services, LLC. All rights reserved.