POSTeth_estimateGas

Estimates the gas required to execute a transaction. Estimates gas only; does not broadcast the transaction.

Request Body
idintegerrequired
jsonrpcstringrequired
methodstringrequired
paramsoneOf[]required

Pass the following parameters as an array with the appropriate types.

  1. call object - Contract address and call data.
params[0]object
fromstring

The transaction sender (from) address as a string.

tostring

The transaction recipient (to) address as a string.

gasstring

The gas limit for the transaction as a hex string. For smart contract calls, use 0x0 since no gas is consumed.

gasPricestring

The gas price per unit as a hex string.

valuestring

The value (amount) for the transaction.

datastring

The method signature hash of the call. See ABI for reference.

Responses

응답 본문이 없습니다.

X-API-KEY
RequestCU20
cURL
curl -X POST "https://ethereum-mainnet.nodit.io/" \
  -H "X-API-KEY: {YOUR_API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "eth_estimateGas",
  "params": [
    {
      "from": "0xc90d3Ac75D1D36dF0b0a229E73D8409FB7F3c4ab",
      "to": "0xd3CdA913deB6f67967B99D67aCDFa1712C293601",
      "value": "0x186a0"
    }
  ]
}'
Response
Example · 200
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "0x5208"
}