eth_call
https://triport.io/rpc/bscExecute a read-only EVM call.
eth_call executes a read-only EVM message call against BNB Smart Chain state and returns the raw output bytes without creating a transaction.
Use it for contract getters, simulation, and ABI-encoded calls. The result is 0x-prefixed byte data; the caller must decode it with the target contract ABI. The optional block tag selects the state snapshot and defaults to the upstream node's current state when omitted.
Unlike eth_estimateGas, this method returns call output rather than a gas estimate. It never submits a transaction, and raw transaction submission is not exposed for BSC. Historical state is available only on the two confirmed archive-state pool nodes.
Parameters
JSON-RPC params is a positional array: [call, block?].
callobjectrequiredaccessListarray<object>optionaladdress and storageKeys.datastring (hex data)optionalinput.fromstring (address)optionalgasstring (hex quantity)optionalgasPricestring (hex quantity)optionalinputstring (hex data)optionaldata.maxFeePerGasstring (hex quantity)optionalmaxPriorityFeePerGasstring (hex quantity)optionaltostring (address)optionalvaluestring (hex quantity)optionalblockstring (block tag or hex quantity)optionallatest, earliest, pending, or an EVM hex block number.accessList[]objectaddressstring (address)requiredstorageKeysarray<string>requiredResponse
The response below is the checked fixture for this method; it is reproduced without changing its fields or values.
resultstring (hex data)Errors
Errors use the standard JSON-RPC error envelope. See BSC errors for network-specific classification and the linked shared reference.
| Code | Meaning | When it happens |
|---|---|---|
-32602 | Invalid params | A required positional parameter is missing or a value does not match the OpenRPC schema. |
-32000 | Upstream request failure | Interpret the message with the code: header not found means a missing block; pruned/unsupported state text means unavailable historical state. |
401 | Unauthorized | The x-token API key is missing or invalid. |
429 | Rate limited | The request exceeds the configured category RPS for the caller's tier. |
Examples
JavaScript (fetch)
const response = await fetch("https://triport.io/rpc/bsc", {
method: "POST",
headers: {
"x-token": process.env.TRIPORT_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
"jsonrpc": "2.0",
"id": 1,
"method": "eth_call",
"params": [
{
"to": "0x0000000000000000000000000000000000000000",
"data": "0x"
},
"latest"
]
}),
});
const payload = await response.json();
console.log(payload.result);Notes
- Historical state is confirmed on two pool nodes. A historical request can fail when no eligible archive-state node is available.
- Treat upstream
-32000by both code and message:header not foundand pruned historical state are different conditions. - The BSC categories use configured defaults of 15 / 20 / 100 / 250 RPS; they are marked unmeasured in the tier matrix.
- Related methods:
eth_estimateGas,eth_getCode,eth_getStorageAt.