Estimate and Set EVM Gas Fees
Under-priced EVM transactions stall; over-priced ones waste money. This guide reads a fee estimate, sets EIP-1559 fields, and simulates before broadcast so a fee shortfall never strands your transaction. Applies to eth and other EVM chains.
- The unsigned EVM transaction you intend to send.
- An API key with C2 access for build and simulate.
1Get a fee estimate from build
Build the transaction; the response carries a fee estimate you use to set maxFeePerGas and maxPriorityFeePerGas.
curl -X POST https://api.1st-node.com/v1/tx/eth/build \
-H "Authorization: Bearer sk_live_..." \
-d '{"from":"0x8f2c...","to":"0x7a1d...","amount":"50000000000000000"}'
> {"raw":"0x02f8...","max_fee_per_gas":"32000000000",
> "max_priority_fee_per_gas":"1500000000","gas_limit":"21000"}2Simulate at the chosen fee
Simulate the raw transaction. A fee-shortfall or revert surfaces here before you sign, so raise maxFeePerGas or fix inputs.
curl -X POST https://api.1st-node.com/v1/tx/eth/simulate \
-H "Authorization: Bearer sk_live_..." \
-d '{"raw":"0x02f8..."}'
> {"success":true,"gas_used":"21000","revert_reason":null}3Sign and broadcast
Sign where you keep keys, then broadcast. The response returns the transaction hash to track for inclusion.
Perguntas frequentes
How do I avoid a stuck EVM transaction?
Set maxFeePerGas from the build estimate with headroom, then simulate. If the simulation flags a fee shortfall, raise the fee before signing.
Do you sign the transaction for me?
No by default. Build and simulate are non-custodial — you sign where you keep keys. Custodial signing is a separate opt-in primitive.
Continue lendo
Recarregue, pegue a chave e publique.
Autoatendimento. Pague em cripto ou cartão. Medido por créditos: primitivas pesadas custam mais, as simples são baratas.
Obter chave de API