16trust / 100

Evm Estimate Gas

by Vextorium in Onchain & crypto

x402 APIFailing, checked 14 min ago

Estimate the gas a transaction will use (eth_estimateGas) and its cost at the current gas price, or the revert reason if it would fail. Nothing is sent. Works on Base, Ethereum, Arbitrum, Optimism, Polygon, BNB Chain, Avalanche, Gnosis, Linea, Scroll, Sonic and Unichain.

POST https://api.vextorium.com/v1/evm-estimate-gas

Last 30 days

All checks passedSome failedAll failedNot checked
Uptime
0.0%
Response time
- typical, - slowest 5%
Last check
14 min ago: Amount "0.003" is not in atomic token units
Next check
in 48 min

How to call it

# bash or zsh: see the payment challenge (nothing is charged)
curl -g -i -X POST 'https://api.vextorium.com/v1/evm-estimate-gas' \
  -H 'content-type: application/json' \
  --data-raw '{"a":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","data":"0x18160ddd","from":"0xb9f06D2734B7E9D7b21B64C4D8b95bd774b71aCf","network":"base"}'
import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { ExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const client = new x402Client().register(
  "eip155:8453",
  new ExactEvmScheme(privateKeyToAccount(process.env.AGENT_KEY)),
);
const pay = wrapFetchWithPayment(fetch, client);

// Not sure it's safe to pay? Preflight it first for $0.005:
// GET https://toolvet.app/api/v1/check?url=https%3A%2F%2Fapi.vextorium.com%2Fv1%2Fevm-estimate-gas
const res = await pay("https://api.vextorium.com/v1/evm-estimate-gas", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: "{\"a\":\"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913\",\"data\":\"0x18160ddd\",\"from\":\"0xb9f06D2734B7E9D7b21B64C4D8b95bd774b71aCf\",\"network\":\"base\"}",
});
console.log(await res.json());

Example input

{
  "a": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
  "data": "0x18160ddd",
  "from": "0xb9f06D2734B7E9D7b21B64C4D8b95bd774b71aCf",
  "network": "base"
}

Example output

{
  "estimated_cost": 1.859e-7,
  "estimated_gas": 30989,
  "executable": true,
  "gas_price_gwei": 0.006,
  "native": "ETH",
  "network": "base",
  "recommended_gas": 37186
}

Security scan

  • No findings. We scan names, descriptions and tool definitions for hidden instructions and other prompt-injection patterns.

Recent checks

WhenResultHTTPTimePrice
14 min agoAmount "0.003" is not in atomic token units40288 ms$0.003
5 h agoAmount "0.003" is not in atomic token units402132 ms$0.003
9 h agoAmount "0.003" is not in atomic token units40276 ms$0.003
13 h agoAmount "0.003" is not in atomic token units40280 ms$0.003
18 h agoAmount "0.003" is not in atomic token units40289 ms$0.003
22 h agoAmount "0.003" is not in atomic token units402177 ms$0.003
26 h agoAmount "0.003" is not in atomic token units40278 ms$0.003
30 h agoAmount "0.003" is not in atomic token units40297 ms$0.003
34 h agoAmount "0.003" is not in atomic token units40283 ms$0.003
38 h agoAmount "0.003" is not in atomic token units402144 ms$0.003
42 h agoAmount "0.003" is not in atomic token units40283 ms$0.003
47 h agoAmount "0.003" is not in atomic token units40292 ms$0.003
2 days agoAmount "0.003" is not in atomic token units40272 ms$0.003
2 days agoAmount "0.003" is not in atomic token units40281 ms$0.003
2 days agoAmount "0.003" is not in atomic token units40278 ms$0.003