chain

Estimate Gas

Estimates the gas required for a proposed transaction on EVM-compatible chains by simulating its execution. The response provides an approximate gas limit, helping developers set optimal fees and avoid underfunding errors.

💡 Compute Unit Value: 30 (Fixed)

post/defi/v1/chain/estimategas

Request

  • Base URL
    https://svc.blockdaemon.com
  • URL
    https://svc.blockdaemon.com/defi/v1/chain/estimategas
  • Auth
    API key in header X-API-Key

Request body

chainId'1' | '11155111' | '56' | '25' | '97' | '43114' | '338' | '43113' | '42161' | '421614' | '17000' | '10' | '11155420' | '4002' | '324' | '300' | '137' | '80002' | '250' | '8453' | '84532' | '5000' | '5003' | '8217' | '1001'

The unique ID to direct queries or transactions to the correct blockchain. Find more here.

chainSymbolstring

The abbreviated chain name for queries or transactions.

datastring required

Encoded function call data for the transaction.

fromstring required

Public blockchain address of the sender initiating the transaction. Format depends on the chain (e.g., 0xABCDEF... for EVM, G... for Stellar).

tostring required

Public blockchain address of the recipient. Format depends on the chain (e.g., 0xABCDEF... for EVM, G... for Stellar).

valuestring

Amount of native currency to send with the transaction, specified in wei (integer string). Example: '1000000000000000000' = 1 ETH.

Example request

{
  "chainId": "1",
  "chainSymbol": "ETH",
  "data": "0x40e53eb7000000000000000000000000000000000000000000000000000000000016e360",
  "from": "0xdAe2F6EdDdA6fb4fb60cc02633DE27e2b431B402",
  "to": "0xdAe2F6EdDdA6fb4fb60cc02633DE27e2b431B402",
  "value": "10"
}

Response

Successful response

statusinteger
msgstring
dataobject

Example response

{
  "status": 200,
  "msg": "success",
  "data": {
    "estimatedGas": "153222"
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.