estimateGasCost
Calculate transaction gas costs in both native token and USD by providing chain ID, gas units, and optional gas fees for accurate Ethereum-based transaction budgeting.
Instructions
Estimate the gas cost for a transaction in both native token and USD
Input Schema
Name | Required | Description | Default |
---|---|---|---|
chainId | Yes | Chain ID (e.g. 1 for Ethereum, 137 for Polygon) | |
gasUnits | Yes | Estimated gas units for the transaction | |
maxFeePerGas | No | Optional max fee per gas in gwei | |
maxPriorityFeePerGas | No | Optional max priority fee per gas in gwei |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"chainId": {
"description": "Chain ID (e.g. 1 for Ethereum, 137 for Polygon)",
"type": "number"
},
"gasUnits": {
"description": "Estimated gas units for the transaction",
"type": "number"
},
"maxFeePerGas": {
"description": "Optional max fee per gas in gwei",
"type": "string"
},
"maxPriorityFeePerGas": {
"description": "Optional max priority fee per gas in gwei",
"type": "string"
}
},
"required": [
"chainId",
"gasUnits"
],
"type": "object"
}