POSTklay_estimateGas

Estimates the gas required to execute a transaction. Estimates gas without actually submitting the transaction.

Request Body
idintegerrequired
jsonrpcstringrequired
methodstringrequired
paramsoneOf[]required

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

  1. call object - Enter the contract address to call and the function data.
params[0]object
fromstring

Enter the transaction's from address as a string.

tostring

Enter the transaction's to address as a string.

gasstring

Enter the gas limit for the transaction as a hexadecimal string. For smart contract calls, you can enter 0x0 since no gas is consumed.

gasPricestring

Enter the gas price per unit as a hexadecimal string.

valuestring

The value field of the transaction.

datastring

The method signature hash of the transaction to execute. Can be referenced from the ABI.

Responses

응답 본문이 없습니다.

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