80trust / 100

Chain Estimate Gas

by Tanod chainpeek in Onchain & crypto

x402 APIPassing, checked 3 h ago

chainpeek (Tanod) gas estimate (eth_estimateGas) for a transaction on Ethereum or Base. Use when an agent must know how much gas a transaction needs before signing and sending it.

POST https://tanod.dev/v1/chain/estimate-gas

Last 30 days

All checks passedSome failedAll failedNot checked
Uptime
100%
Response time
276 ms typical, 777 ms slowest 5%
Last check
3 h ago
Next check
any minute now

How to call it

# bash or zsh: see the payment challenge (nothing is charged)
curl -g -i -X POST 'https://tanod.dev/v1/chain/estimate-gas' \
  -H 'content-type: application/json' \
  --data-raw '{"chain":"base","data":"0x18160ddd","from":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045","to":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"}'
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%2Ftanod.dev%2Fv1%2Fchain%2Festimate-gas
const res = await pay("https://tanod.dev/v1/chain/estimate-gas", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: "{\"chain\":\"base\",\"data\":\"0x18160ddd\",\"from\":\"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\"to\":\"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913\"}",
});
console.log(await res.json());

Example input

{
  "chain": "base",
  "data": "0x18160ddd",
  "from": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
  "to": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
}

Example output

{
  "chain": "base",
  "contract_creation": false,
  "from": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
  "gas": 30989,
  "gas_with_20pct_buffer": 37186,
  "note": "estimated at the latest block against current state; the real cost can differ if state changes",
  "to": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
}

Security scan

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

Recent checks

WhenResultHTTPTimePrice
3 h agoPassed402258 ms$0.002
7 h agoPassed402265 ms$0.002
10 h agoPassed402777 ms$0.002
14 h agoPassed402284 ms$0.002
18 h agoPassed402276 ms$0.002
22 h agoPassed402593 ms$0.002
25 h agoPassed402286 ms$0.002
29 h agoPassed402262 ms$0.002
33 h agoPassed402270 ms$0.002
36 h agoPassed402270 ms$0.002
40 h agoPassed402278 ms$0.002
43 h agoPassed402864 ms$0.002
2 days agoPassed402267 ms$0.002
2 days agoPassed402276 ms$0.002
2 days agoPassed402462 ms$0.002