81trust / 100

Base Block

by base-block in Onchain & crypto

x402 APIPassing, checked 4 h ago

Fetch a Base mainnet block header and transaction hashes by number, tag (latest/earliest/safe/finalized), or hash via eth_getBlockByNumber/eth_getBlockByHash.

POST https://x402.agentindex.world/base/block

Last 30 days

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

How to call it

# See the payment challenge (nothing is charged)
curl -i -X POST "https://x402.agentindex.world/base/block" \
  -H "content-type: application/json" \
  -d '{"number":0}'
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%2Fx402.agentindex.world%2Fbase%2Fblock
const res = await pay("https://x402.agentindex.world/base/block", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({"number":0}),
});
console.log(await res.json());

Example input

{
  "number": 0
}

Example output

{
  "base_fee_per_gas": 1000000000,
  "gas_limit": 30000000,
  "gas_used": 0,
  "hash": "0xf712aa9241cc24369b143cf6dce85f0902a9731e70d66818a3a5845b296c73dd",
  "miner": "0x4200000000000000000000000000000000000011",
  "number": 0,
  "parent_hash": "0x0000000000000000000000000000000000000000000000000000000000000000",
  "timestamp": 1686789347,
  "transaction_count": 0,
  "transaction_hashes": []
}

Security scan

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

Recent checks

WhenResultHTTPTimePrice
4 h agoPassed40264 ms$0.003