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
Sender address
Recipient address
Gas limit
Gas price
Value in wei
Transaction data
Response Body
Estimated gas amount in hexadecimal
Code Examples
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 Code | Message | Description |
|---|---|---|
| -32000 | Execution reverted | Transaction would fail |
| -32602 | Invalid params | Invalid transaction parameters |
Tip: If estimation fails, the transaction would likely revert if sent.
Related Methods
eth_gasPrice- Get current gas priceeth_sendRawTransaction- Send transaction
eth_getTransactionReceipt
Get transaction receipt with status and logs on Zetachain. Essential for verifying transaction execution for omnichain DeFi, native Bitcoin smart contracts, cross-chain asset management, and unified liquidity aggregation.
eth_gasPrice
Get current gas price on Zetachain. Essential for transaction cost estimation for omnichain DeFi, native Bitcoin smart contracts, cross-chain asset management, and unified liquidity aggregation.