Avalanche
هل أنت مستعد لاستدعاء هذا في الإنتاج؟
الخطة المجانية تغطي المشاريع الشخصية. الدفع حسب الاستخدام يتوسع دون بطاقة.
Avalanche
الخطة المجانية تغطي المشاريع الشخصية. الدفع حسب الاستخدام يتوسع دون بطاقة.
eth_estimateGas simulates a transaction against current Avalanche C-Chain state and returns the estimated amount of gas it would consume on-chain. Because C-Chain gas is paid in AVAX, this estimate is what you multiply by the gas price to forecast the AVAX cost of a swap, deposit, or contract deployment before you ever sign it. Send the call to https://avalanche.therpc.io/YOUR_API_KEY (chain ID 43114); the node runs the transaction in a sandbox, discards the result, and reports the gas figure as a hex string.
to) and convert the gas figure into an AVAX budget.| # | الاسم | النوع | مطلوب | الوصف |
|---|---|---|---|---|
| 1 | transaction | object | نعم | Transaction object. `to` is required for calls; omit `to` for contract deployments. Optional: `from`, `gas`, `gasPrice`/`maxFeePerGas`/`maxPriorityFeePerGas`, `value`, `data`. |
| 2 | blockTag | string | لا | Block state to simulate against. Defaults to `latest`.الافتراضي: latest |
| النوع | الوصف |
|---|---|
| string | Hex-encoded gas estimate. The node typically adds a small safety buffer above the raw simulation result. |
Try it live in the Avalanche playground.
| الكود | الرسالة | السبب |
|---|---|---|
3 | execution reverted | The simulated transaction reverted; the estimate cannot be produced. |
-32000 | gas required exceeds allowance | Estimated gas exceeded the block gas limit or the supplied gas cap. |
-32602 | invalid argument | Malformed transaction object. |
3 or -32000), not a gas number — handle that path instead of expecting a value.المعاملات
Transaction object. `to` is required for calls; omit `to` for contract deployments. Optional: `from`, `gas`, `gasPrice`/`maxFeePerGas`/`maxPriorityFeePerGas`, `value`, `data`.
"latest" | "pending" | hex block number