Saltar al contenido principal

eth_estimateGas

The amount of gas used

Params

(2)

1. transaction (required)

accessList
array[AccessListItem] or null
address
string
Match pattern:
^(NET\d+|CFX|CFXTEST)(:TYPE\..*|):[ABCDEFGHJKMNPRSTUVWXYZ0123456789]{42}$
storageKeys
array[string]
data
string or null
Match pattern:
^0x[0-9a-f]*$
from
string or null
Match pattern:
^0x[0-9,a-f,A-F]{40}$
gas
string or null
Match pattern:
^0x([1-9a-f][0-9a-f]{0,63}|0)$
gasPrice
string or null
Match pattern:
^0x([1-9a-f][0-9a-f]{0,63}|0)$
maxFeePerGas
string or null
Match pattern:
^0x([1-9a-f][0-9a-f]{0,63}|0)$
maxPriorityFeePerGas
string or null
Match pattern:
^0x([1-9a-f][0-9a-f]{0,63}|0)$
nonce
string or null
Match pattern:
^0x([1-9a-f][0-9a-f]{0,63}|0)$
to
string or null
Match pattern:
^0x[0-9,a-f,A-F]{40}$
transactionType
string or null
Match pattern:
^0x([1-9a-f][0-9a-f]{0,15}|0)$
value
string or null
Match pattern:
^0x([1-9a-f][0-9a-f]{0,63}|0)$

2. block (required)

(one of)
string or null
Match pattern:
^0x([1-9a-f][0-9a-f]{0,15}|0)$

Result

(gasUsed)
string
Match pattern:
^0x([1-9a-f][0-9a-f]{0,63}|0)$

Endpoint

Params

transaction

accessList

block


Request

curl -X POST --data \
'{
"method": "eth_estimateGas",
"params": [
null,
null
],
"jsonrpc": "2.0",
"id": 1
}' \
-H "Content-Type: application/json" \
https://evmtestnet.confluxrpc.com