eth_estimateGas
BNB Smart Chain / https://triport.io/rpc/bsc
Minimum tier: Free
Last updated:
eth_estimateGas simulates an EVM call against current BNB Smart Chain state and returns the estimated gas requirement as a hex quantity.
Use the estimate to prepare a transaction's gas limit. The call object can supply sender, destination, value, calldata, fee fields, gas, and an access list; it must contain at least one of to, data, or input according to the OpenRPC schema.
Unlike eth_call, this method returns a gas amount rather than contract output. It does not broadcast or mutate state, and raw transaction submission is not exposed for BSC. Execution can still fail for malformed calldata or a reverting call.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| call | Call | Yes |
Returns
| Field | Type |
|---|---|
| gas | Quantity |
Examples
curl https://triport.io/rpc/bsc \
-X POST -H 'Content-Type: application/json' \
-H 'Authorization: Bearer <api-key>' \
-d '{"jsonrpc":"2.0","id":1,"method":"eth_estimateGas","params":["<call>"]}'const res = await fetch("https://triport.io/rpc/bsc", {
method: "POST",
headers: { "Content-Type": "application/json", Authorization: "Bearer <api-key>" },
body: JSON.stringify({
"jsonrpc": "2.0",
"id": 1,
"method": "eth_estimateGas",
"params": [
"<call>"
]
}),
});
const data = await res.json();import requests
resp = requests.post(
"https://triport.io/rpc/bsc",
headers={"Authorization": "Bearer <api-key>"},
json={"jsonrpc":"2.0","id":1,"method":"eth_estimateGas","params":["<call>"]},
)
print(resp.json())Usage
- Transport: HTTP (JSON-RPC).
- Chain: BNB Smart Chain.
- Clusters: mainnet.
- Credit cost: 1 per call.
FAQ
- What does eth_estimateGas do?
- Estimate gas for an EVM call.
- How many credits does eth_estimateGas cost?
- eth_estimateGas costs 1 credit(s) per call on Triport by default.
- Is eth_estimateGas available over WebSocket?
- eth_estimateGas is an HTTP JSON-RPC method.