eth_estimateGas

Generates and returns an estimate of how much gas is necessary to allow the transaction to complete. The transaction will not be added to the blockchain.

Returns

QUANTITY - the amount of gas used.

Example

Request

curl https://rpc-mainnet.u2u.xyz \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_estimateGas","params":[{see above}],"id":1}'

Result

{
  "id":1,
  "jsonrpc": "2.0",
  "result": "0x5208" // 21000
}

Last updated