Docs
Supported ChainsZetachainJSON-RPC APITransaction Methods

eth_estimateGas - Zetachain RPC Method

Estimate gas required for transactions on Zetachain. Essential for optimizing transaction costs for omnichain DeFi, native Bitcoin smart contracts, cross-chain asset management, and unified liquidity aggregation.

Estimates the gas necessary to execute a transaction on Zetachain.

Why Zetachain? Build on the universal omnichain blockchain enabling cross-chain smart contracts across 50+ chains including Bitcoin with native Bitcoin support, 50+ chain interoperability via UNISON, no bridging required, and partnerships with Curve and SushiSwap.

Use Cases

The eth_estimateGas method is essential for:

  • Transaction preparation - Set appropriate gas limits
  • Cost estimation - Calculate transaction costs before sending
  • Error detection - Identify reverts before spending gas
  • DeFi operations - Estimate costs for omnichain DeFi, native Bitcoin smart contracts, cross-chain asset management, and unified liquidity aggregation

Request Parameters

Request
fromDATA

Sender address

toDATA

Recipient address

gasQUANTITY

Gas limit

gasPriceQUANTITY

Gas price

valueQUANTITY

Value in wei

dataDATA

Transaction data

Response Body

Response
resultQUANTITY

Estimated gas amount in hexadecimal

Code Examples

Bash
curl -X POST https://api-zetachain-mainnet.n.dwellir.com/YOUR_API_KEY \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "method": "eth_estimateGas",
    "params": [{
      "from": "0x5F0b1a82749cb4E2278EC87F8BF6B618dC71a8bf",
      "to": "0x5F0b1a82749cb4E2278EC87F8BF6B618dC71a8bf",
      "value": "0x1"
    }],
    "id": 1
  }'

Error Handling

Error CodeMessageDescription
-32000Execution revertedTransaction would fail
-32602Invalid paramsInvalid transaction parameters

Tip: If estimation fails, the transaction would likely revert if sent.