Skip to content

Call a Chain Method

Use this endpoint to simulate a smart contract method call without changing on-chain state. Ideal for reading balances, metadata, or any other view/pure functions. No gas is consumed, and no wallet is required.

Before you begin, ensure:

  • You’ve correctly encoded your method calldata (txData)
  • You know the target chainId
POST /v2/chain/call

Request Parameters

{
"txData": "0xabcdef...",
"chainId": 137,
"sentAt": "2025-05-08T12:00:00Z"
}
  • txData: Encoded calldata for the read-only method (e.g. balanceOf(address))
  • chainId: Numeric ID of the chain to query (e.g. 137 for Polygon)
  • sentAt: ISO timestamp for submission

Example Request

call-chain-method.sh
curl -X POST https://api.fsco.io/v2/chain/call \
-H "Authorization: Bearer $FSCO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"txData": "0xabcdef...",
"chainId": 137,
"sentAt": "2025-05-08T12:00:00Z"
}'

Response

response.json
{
"executionId": "12345678-1234-1234-1234-123456789012",
"data": "0x00000000000000000000000000000000000000000000000000000000000003e8"
}

The response includes:

  • executionId: An internal reference for the simulated call
  • data: The raw return value of the method in hex format