curl --request POST \
--url https://api.uniblock.dev/uni/v1/json-rpc?chainId=43114 \
--header 'content-type: application/json' \
--data '{
"id": 1,
"jsonrpc": "2.0",
"method": "eth_estimateGas",
"params": [
{},
0
]
}'
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x5208"
}
Makes a call or transaction, which won’t be added to the blockchain and returns the used gas, which can be used for estimating the used gas.
curl --request POST \
--url https://api.uniblock.dev/uni/v1/json-rpc?chainId=43114 \
--header 'content-type: application/json' \
--data '{
"id": 1,
"jsonrpc": "2.0",
"method": "eth_estimateGas",
"params": [
{},
0
]
}'
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x5208"
}
eth_estimateGas:params[0]: Legacy transaction (pre-EIP-2718).params[1]: Block identifier. Can be an integer block number or a string tag: “latest”, “earliest”, or “pending”.“0x5208”.curl --request POST \
--url https://api.uniblock.dev/uni/v1/json-rpc?chainId=43114 \
--header 'content-type: application/json' \
--data '{
"id": 1,
"jsonrpc": "2.0",
"method": "eth_estimateGas",
"params": [
{},
0
]
}'
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x5208"
}
Was this page helpful?