π Read-only contract call (eth_call)
Code samples
POST /api/v1/eth/account/call
curl -X POST 'https://settla.net/api/v1/eth/account/call' \
-H 'X-API-Key: $SETTLA_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"transaction": {
"to": "0xdac17f958d2ee523a2206206994597c13d831ec7",
"data": "0x70a0823100000000000000000000000028c6c06298d514db089934071355e5743bf21d60"
},
"block": "latest"
}'
Executes a read-only call to a contract using eth_call without creating a transaction.
The example below reads an ERC-20 balance: data is the 4-byte selector of balanceOf(address) (0x70a08231) followed by the queried address padded to 32 bytes. The reply is raw ABI output β a 32-byte word you decode yourself; for USDT (6 decimals) 0xβ¦029e67c7d1182a is 737118524610602 base units, i.e. 737 118 524.610602 USDT.
Body parameter
{
"transaction": {
"to": "0xdac17f958d2ee523a2206206994597c13d831ec7",
"data": "0x70a0823100000000000000000000000028c6c06298d514db089934071355e5743bf21d60"
},
"block": "latest"
}
π οΈ Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| body | body | object | true | none |
| Β» transaction | body | object | true | Ethereum transaction parameters used with eth_call, eth_estimateGas and eth_sendTransaction. |
| »» from | body | string | false | Sender address. |
| »» to | body | string¦null | false | Recipient address, or null for contract creation. |
| »» gas | body | string | false | Gas limit as hex QUANTITY. |
| »» gasPrice | body | string | false | Legacy gas price as hex QUANTITY. |
| »» maxFeePerGas | body | string | false | EIP-1559 max fee per gas as hex QUANTITY. |
| »» maxPriorityFeePerGas | body | string | false | EIP-1559 priority fee per gas as hex QUANTITY. |
| »» value | body | string | false | Amount of wei to send as hex QUANTITY. |
| »» data | body | string | false | Call data or contract deployment bytecode. |
| »» nonce | body | string | false | Nonce as hex QUANTITY. |
| Β» block | body | string | false | Optional block number or tag; defaults to latest. |
Example responses
200 Response
{
"result": "0x00000000000000000000000000000000000000000000000000029e67c7d1182a"
}
422 Response
{
"error": "Field \"transaction\" is required and must be an object"
}
500 Response
{
"error": "Could not connect to ETH node."
}
π Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Raw return data from contract, ABI-encoded and not decoded by the API | Inline |
| 422 | Unprocessable Entity | Invalid request body (missing or invalid transaction) | Inline |
| 500 | Internal Server Error | Node unreachable, or the call reverted. Both map to the same message. | Inline |
π Response Schema
Status Code 200
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| Β» result | string | false | none | Hex-encoded return data from eth_call. |
Status Code 422
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| Β» error | string | false | none | none |
Status Code 500
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| Β» error | string | false | none | none |