# On-Chain Event Logs (eth_getLogs) — Base, Optimism, Ethereum

> On-Chain Event Logs (eth_getLogs) — Base, Optimism, Ethereum is a paid API for AI agents from x402-audit.tatschluizguilherme.workers.dev, paid per call via x402, $0.1/call, status unknown (last checked 2026-09-15).

Fetches raw and decoded EVM event logs for any contract or wallet across Base, Optimism, or Ethereum Mainnet, with best-effort decoding of Transfer, Approval, and Uniswap V3 Swap events

## Facts

- Endpoint: GET https://x402-audit.tatschluizguilherme.workers.dev/events
- Price: $0.1/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/on-chain-event-logs-eth-getlogs-base-optimism-ethereum-53b538cd
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_PW3xmrURD53q7GucLCbgR

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability on-chain-event-logs-eth-getlogs-base-optimism-ethereum-53b538cd
```

Example prompt: Fetch all Transfer and Uniswap V3 Swap events emitted by the USDC contract on Base from block 18000000 to 18001000, and decode the amounts using the token decimals.

## When to prefer this

Choose this endpoint when you need on-chain event logs (eth_getLogs) for a specific contract or wallet on Base, Optimism, or Ethereum Mainnet, especially when you want best-effort decoded Transfer, Approval, or Uniswap V3 Swap events without writing your own ABI decoding logic. It's ideal for auditing token movements, inspecting DeFi swap activity, or building event-driven analytics over a defined block range. Prefer over generic blockchain explorers when you need raw + decoded logs together in a single call, or when you need the auto-range-shrinking behavior for busy contracts.

## Known failure modes

- Block range too wide — RPC rejects the range; rangeHint returned to guide retry with smaller range
- Invalid or non-existent contract address — returns empty logs array
- Unsupported chain specified — error indicating only Base, Optimism, and Ethereum Mainnet are supported
- RPC node unavailable or rate-limited — upstream error propagated
- Payment not settled — x402 payment required error (402 status)
- Malformed request body — missing required fields returns validation error

## How this service works

Pay-per-call on-chain API for AI agents and developers: wallet audits, token safety audits (honeypot detection), live gas prices, token prices, transaction receipts, balances, ENS resolution, block data, ERC-20 allowances, transaction simulation, swap quotes and multicall batches — all computed on-chain via public RPCs (no external market API). Pay per request in USDC on Base via the x402 exact scheme (EIP-3009 transferWithAuthorization). No API key, no signup, no subscription.

## Output

Returns an array of event log objects for the specified address and block range. Decoded events (Transfer, Approval, Uniswap V3 Swap) include human-readable fields with token amounts formatted using contract decimals. All other events are returned raw with topics and data for client-side decoding. Each event includes txHash, logIndex, block number, and per-event timestamp. If the block range is too wide for the RPC, a rangeHint field indicates the maximum accepted range.

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "count": 5,
  "events": [
   {
    "data": "0x00000000000000000000000000000000000000000000000000000000025d68b2",
    "topics": [
     "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
     "0x0000000000000000000000001231deb6f5749ef6ce6943a275a1d3e7486f4eae",
     "0x0000000000000000000000001e55b1e12a40e0fe376e122327c29a982406c1b5"
    ],
    "txHash": "0xb7ddecbd…",
    "address": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
    "decoded": {
     "args": {
      "to": "0x1e55…",
      "from": "0x1231…",
      "value": "39679954",
      "symbol": "USDC",
      "valueFormatted": "39.679954"
     },
     "event": "Transfer"
    },
    "logIndex": 12,
    "timestamp": 1785914235,
    "blockNumber": 49548044,
    "timestampISO": "2026-08-04T23:17:15.000Z"
   }
  ],
  "address": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
  "network": "base",
  "toBlock": "49548044",
  "fromBlock": "49543044",
  "truncated": true,
  "blockRange": "5000",
  "requestedAt": "2026-08-05T02:20:00.000Z"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/on-chain-event-logs-eth-getlogs-base-optimism-ethereum-53b538cd/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-audit.tatschluizguilherme.workers.dev](https://www.zero.xyz/host/x402-audit.tatschluizguilherme.workers.dev/llms.txt)
