{"openapi":"3.0.3","info":{"title":"x402 on-chain audits — pay-per-call crypto API","version":"1.0.0","description":"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.","x-x402":{"version":2,"scheme":"exact","network":"eip155:8453","asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","payTo":"0x8e8d53a67b59E6f2A28e0d6d52012A2b0e3E1886","maxTimeoutSeconds":300,"docs":"https://docs.x402.org"},"contact":{"name":"hermes-ops","email":"ni@web-library.net","url":"https://x402-audit.tatschluizguilherme.workers.dev"},"x-guidance":"Pay-per-call: request any paid endpoint, receive HTTP 402 with paymentRequirements (x402 exact scheme, USDC on Base eip155:8453, payTo 0x8e8d53a67b59E6f2A28e0d6d52012A2b0e3E1886). Pay with any x402 client (EIP-3009 transferWithAuthorization) and re-send with PAYMENT-SIGNATURE header. $0.25/audit, $0.10/other calls. No API key, no signup, no subscription."},"servers":[{"url":"https://x402-audit.tatschluizguilherme.workers.dev"}],"paths":{"/":{"get":{"summary":"Landing + machine-readable API description","description":"HTML landing page; with Accept: application/json returns a JSON description of the API (endpoints, pricing, payTo). Free — no payment required.","responses":{"200":{"description":"Landing page (HTML) or API description (JSON)"}},"security":[]}},"/llms.txt":{"get":{"summary":"llms.txt description for LLM crawlers","description":"Plain-text, machine-readable description of the API for LLM agents. Free.","responses":{"200":{"description":"text/plain llms.txt"}},"security":[]}},"/openapi.json":{"get":{"summary":"OpenAPI 3.0 specification of this API","description":"This document. Free.","responses":{"200":{"description":"OpenAPI 3.0.3 JSON"}},"security":[]}},"/discovery/resources":{"get":{"summary":"Bazaar discovery layer","description":"Lists the 15 paid resources of this API in the open discovery format (x402 bazaar extension) so facilitators and clients can auto-discover pay-per-call services. Free.","parameters":[{"name":"type","in":"query","required":false,"schema":{"type":"string","enum":["http"]},"description":"Resource type filter (default http)."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":50}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0}}],"responses":{"200":{"description":"JSON list of paid resources with route templates and examples","content":{"application/json":{"schema":{"type":"object"}}}}},"security":[]}},"/sample":{"get":{"summary":"Free sample wallet audit","description":"Real wallet audit of vitalik.eth across 3 chains — free, no payment required. Use it to evaluate output quality before paying.","responses":{"200":{"description":"Sample audit JSON"}},"security":[]}},"/sample-token":{"get":{"summary":"Free sample token audit","description":"Real token safety audit (honeypot caught on Base) — free, no payment required.","responses":{"200":{"description":"Sample token audit JSON"}},"security":[]}},"/audit":{"get":{"summary":"Wallet audit (balances + gas + recent txs)","description":"Full wallet audit for any 0x address across Optimism, Base and Ethereum Mainnet: ETH/USDC/sUSDC balances, total gas spent (USD) and recent transactions per chain. $0.25 USDC.","parameters":[{"name":"address","in":"query","required":true,"schema":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$"},"example":"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045","description":"Wallet address to audit."}],"responses":{"200":{"description":"Audit JSON (balances, gasSpentUsd, recentTxs per chain)"},"400":{"$ref":"#/components/responses/BadRequest"},"402":{"$ref":"#/components/responses/PaymentRequired"}},"x-payment-info":{"protocols":[{"x402":{"version":2,"scheme":"exact"}}],"price":{"mode":"fixed","currency":"USD","amount":"0.25"}}}},"/token":{"get":{"summary":"Token safety audit (honeypot detection)","description":"Token safety audit on Base: honeypot simulation (buy/sell/transfer), taxes, liquidity USD, holders, source verification, proxy and owner renouncement — 0-100 safety score and verdict (safe/caution/danger). $0.25 USDC.","parameters":[{"name":"address","in":"query","required":true,"schema":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$"},"example":"0x3e12b9d6a4d12cd9b4a6d613872d0eb32f68b380","description":"Token address to audit (Base)."}],"responses":{"200":{"description":"Token audit JSON (score, verdict, reasons, raw checks)"},"400":{"$ref":"#/components/responses/BadRequest"},"402":{"$ref":"#/components/responses/PaymentRequired"}},"x-payment-info":{"protocols":[{"x402":{"version":2,"scheme":"exact"}}],"price":{"mode":"fixed","currency":"USD","amount":"0.25"}}}},"/gas":{"get":{"summary":"Live gas prices","description":"gasPrice, maxPriorityFee (EIP-1559) and latest block for Base, Optimism and Ethereum Mainnet — from public RPCs, no API key. $0.10 USDC.","parameters":[{"name":"chain","in":"query","required":false,"schema":{"type":"string","enum":["base","op","mainnet","all"],"default":"all"},"description":"Chain to query (default all)."}],"responses":{"200":{"description":"Gas prices per chain (gasPriceGwei, maxPriorityFeeGwei, blockNumber)"},"400":{"$ref":"#/components/responses/BadRequest"},"402":{"$ref":"#/components/responses/PaymentRequired"}},"x-payment-info":{"protocols":[{"x402":{"version":2,"scheme":"exact"}}],"price":{"mode":"fixed","currency":"USD","amount":"0.10"}}}},"/price":{"get":{"summary":"Token prices on Base, Optimism or Ethereum Mainnet","description":"Spot USD price, supply and market cap for up to 30 tokens at once on base/op/mainnet, computed on-chain from the most liquid DEX pool (Uniswap V3 + Uniswap V2, quotes USDC/WETH/USDT). No external market API. $0.10 USDC.","parameters":[{"name":"address","in":"query","required":true,"schema":{"type":"string"},"example":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","description":"Token address(es), comma-separated, up to 30."},{"name":"chain","in":"query","required":false,"schema":{"type":"string","enum":["base","op","mainnet"],"default":"base"}}],"responses":{"200":{"description":"Per-token priceUsd, supply, marketCapUsd and pool source"},"400":{"$ref":"#/components/responses/BadRequest"},"402":{"$ref":"#/components/responses/PaymentRequired"}},"x-payment-info":{"protocols":[{"x402":{"version":2,"scheme":"exact"}}],"price":{"mode":"fixed","currency":"USD","amount":"0.10"}}}},"/tx":{"get":{"summary":"Transaction status (receipt) on Base","description":"On-chain receipt for any Base tx hash: success/reverted, block number, gas used, from/to, value and log count — no explorer API. $0.10 USDC.","parameters":[{"name":"hash","in":"query","required":true,"schema":{"type":"string","pattern":"^0x[a-fA-F0-9]{64}$"},"description":"Transaction hash."}],"responses":{"200":{"description":"Receipt JSON (status, block, gasUsed, from, to, value, logCount)"},"400":{"$ref":"#/components/responses/BadRequest"},"402":{"$ref":"#/components/responses/PaymentRequired"}},"x-payment-info":{"protocols":[{"x402":{"version":2,"scheme":"exact"}}],"price":{"mode":"fixed","currency":"USD","amount":"0.10"}}}},"/tx-full":{"get":{"summary":"Full transaction intel (raw tx + receipt + decoded function + events)","description":"Complete on-chain picture of any transaction on Base, Optimism or Ethereum Mainnet: receipt (success/reverted, gas used, log count) + raw tx (from/to, value, nonce, type, EIP-1559 fees, full input calldata with size) + block timestamp (unix + ISO) + confirmations + decoded function call (4-byte selector resolved against ~40 known functions — transfer/approve/transferFrom/swapExact*Tokens*/exactInput/deposit/withdraw/mint/burn/supply/borrow/repay/multicall/addLiquidity/removeLiquidity/safeTransferFrom/setApprovalForAll/execute — with typed arguments when the ABI is known) + event summary (Transfer/Approval/Swap/Deposit/Withdrawal/Sync/PairCreated/OwnershipTransferred). The \"what did this tx do and what did it cost?\" call after every settlement, swap or payment — no explorer, no API key. $0.10 USDC.","parameters":[{"name":"hash","in":"query","required":true,"schema":{"type":"string","pattern":"^0x[a-fA-F0-9]{64}$"},"description":"Transaction hash."},{"name":"chain","in":"query","required":false,"schema":{"type":"string","enum":["base","op","mainnet"],"default":"base"}}],"responses":{"200":{"description":"Full tx JSON (status, blockNumber, timestamp, confirmations, from, to, valueEth, type, gasUsed, fees, input, function, logCount, logSummary)"},"400":{"$ref":"#/components/responses/BadRequest"},"402":{"$ref":"#/components/responses/PaymentRequired"}},"x-payment-info":{"protocols":[{"x402":{"version":2,"scheme":"exact"}}],"price":{"mode":"fixed","currency":"USD","amount":"0.10"}}}},"/decode":{"get":{"summary":"Offline calldata decoder (no RPC, chain-agnostic)","description":"Raw transaction calldata in, decoded function call out: 4-byte selector resolved against ~40 known functions (transfer/approve/transferFrom/swapExact*Tokens*/deposit/withdraw/mint/burn/supply/borrow/repay/multicall/addLiquidity/removeLiquidity/safeTransferFrom/setApprovalForAll/execute/execTransaction) with TYPED, NAMED arguments (args array + argsNamed object), plus NESTED decoding of inner sub-calls when the calldata wraps them (multicall bytes[] up to 32 entries, Gnosis Safe execute/execTransaction data). Unknown selectors return known:false honestly. Pure ABI decoding — no RPC, no explorer, no API key, instant response. The \"what will this calldata execute?\" answer before signing or relaying a transaction received from third parties (multisig, relayer, mempool). $0.10 USDC.","parameters":[{"name":"data","in":"query","required":true,"schema":{"type":"string","pattern":"^0x[a-fA-F0-9]*$"},"description":"Raw transaction calldata as hex (0x..., up to 64KB; may be 0x for native ETH transfers)."}],"responses":{"200":{"description":"Decoded JSON (network, data, inputSize, selector, function {known, name, signature, args, argsNamed, decodeError, nested}, requestedAt)"},"400":{"$ref":"#/components/responses/BadRequest"},"402":{"$ref":"#/components/responses/PaymentRequired"}},"x-payment-info":{"protocols":[{"x402":{"version":2,"scheme":"exact"}}],"price":{"mode":"fixed","currency":"USD","amount":"0.10"}}}},"/encode":{"get":{"summary":"Offline calldata encoder (no RPC, chain-agnostic)","description":"Function name or 4-byte selector + arguments as JSON in, raw calldata hex ready to sign out. The mirror of /decode: transfer/approve/transferFrom/swapExact*Tokens*/deposit/withdraw/mint/burn/supply/borrow/repay/multicall/addLiquidity/removeLiquidity/safeTransferFrom/setApprovalForAll/execute/execTransaction (same ~40-function dictionary) with NAMED or positional arguments, resolved against the exact ABI (ambiguous overloads disambiguate by arg count/keys; use the selector for full control). Returns calldata + inputSize plus an embedded ROUND-TRIP verification (verify: the generated calldata decoded by the same /decode dictionary — what this calldata will execute, confirmed before you sign). Pure ABI encoding — no RPC, no explorer, no API key, instant response. Build the calldata you want for multisig/relayer/bot calls and check what it does in the same call. $0.10 USDC.","parameters":[{"name":"fn","in":"query","required":true,"schema":{"type":"string"},"description":"Function name (transfer, approve, swapExactTokensForTokens, multicall, execTransaction, ...) or 4-byte selector (0xa9059cbb)."},{"name":"args","in":"query","required":false,"schema":{"type":"string"},"description":"JSON arguments: named object ({\"to\":\"0x...\",\"value\":\"1000000\"}) or positional array. uintN as decimal string or 0x hex; address as 0x+40hex; bool true/false; bytes as 0x hex. Omit for functions without arguments."}],"responses":{"200":{"description":"Encoded JSON (network, fn, selector, signature, calldata, inputSize, args, verify {known, name, signature, args, argsNamed, decodeError, nested}, requestedAt)"},"400":{"$ref":"#/components/responses/BadRequest"},"402":{"$ref":"#/components/responses/PaymentRequired"}},"x-payment-info":{"protocols":[{"x402":{"version":2,"scheme":"exact"}}],"price":{"mode":"fixed","currency":"USD","amount":"0.10"}}}},"/eip712":{"get":{"summary":"Offline EIP-712 typed data (no RPC, chain-agnostic)","description":"EIP-712 typed data JSON (domain + types + primaryType + message) in, the normalized typed data plus domainSeparator, hashStruct and the final digest (the 32-byte value the wallet signs — keccak256(0x1901 || domainSeparator || hashStruct)) out. Optional signature (0x + 65 bytes): recovers the signer address (ecrecover), confirmed against an optional expectedAddress (recover.ok). Structs nest (arrays of structs, custom domain types like Permit2), uintN as decimal string or 0x hex, addresses 0x+40hex, bool true/false, bytes as 0x hex. Build/check the typed data your wallet signs (Permit/Permit2/relayer/off-chain votes) and verify who signed it, in one call. Pure cryptography — no RPC, no explorer, no API key, instant response. $0.10 USDC.","parameters":[{"name":"data","in":"query","required":true,"schema":{"type":"string"},"description":"URL-encoded JSON of EIP-712 typed data: {\"domain\":{\"name\":\"USDC\",\"version\":\"2\",\"chainId\":8453,\"verifyingContract\":\"0x...\"},\"types\":{\"Permit\":[...]},\"primaryType\":\"Permit\",\"message\":{...}, optional \"signature\":\"0x+65bytes\", optional \"expectedAddress\":\"0x...\"}."}],"responses":{"200":{"description":"Typed data JSON (network, domain, domainSeparator, types, primaryType, message, hashStruct, digest, signature?, recover {address, expectedAddress?, ok?}, requestedAt)"},"400":{"$ref":"#/components/responses/BadRequest"},"402":{"$ref":"#/components/responses/PaymentRequired"}},"x-payment-info":{"protocols":[{"x402":{"version":2,"scheme":"exact"}}],"price":{"mode":"fixed","currency":"USD","amount":"0.10"}}}},"/selector":{"get":{"summary":"Offline ABI selector generator (no RPC, chain-agnostic)","description":"Human function signature in (transfer(address,uint256); parameter names optional — transfer(address to, uint256 value); arrays address[]; tuples (bytes,address,uint256,uint256)) and the 4-byte selector out (0xa9059cbb), with the full keccak256 and the parsed inputs (type + name). kind=event switches to the 32-byte topic0 for log filtering (Transfer/Approval/Swap/Sync/Paused...). Every result carries a round-trip verification (verify.known — is this function/event in the /decode dictionary? e.g. transfer → known:true with its ABI args). The signature calculator for calldata builders and log filters. Pure cryptography — no RPC, no explorer, no API key, instant response. $0.10 USDC.","parameters":[{"name":"sig","in":"query","required":true,"schema":{"type":"string"},"description":"Human ABI signature: transfer(address,uint256) or transfer(address to, uint256 value) (names optional); arrays address[]; tuples (bytes,address,uint256,uint256); up to 2KB."},{"name":"kind","in":"query","required":false,"schema":{"type":"string","enum":["function","event"],"default":"function"},"description":"function (default) → 4-byte selector; event → 32-byte topic0."}],"responses":{"200":{"description":"Selector JSON (network, kind, name, signature, inputs[], keccak, selector? or topic0?, verify {known, name?, args?}, requestedAt)"},"400":{"$ref":"#/components/responses/BadRequest"},"402":{"$ref":"#/components/responses/PaymentRequired"}},"x-payment-info":{"protocols":[{"x402":{"version":2,"scheme":"exact"}}],"price":{"mode":"fixed","currency":"USD","amount":"0.10"}}}},"/abi":{"get":{"summary":"Offline ABI map generator (no RPC, chain-agnostic)","description":"Contract ABI (JSON array of entries) in, full selector map out: per function the 4-byte selector + canonical signature + typed inputs/outputs + stateMutability, per event the 32-byte topic0 + indexed/anonymous flags, per error the 4-byte selector. Tuples (type 'tuple' + components), dynamic (uint256[]) and fixed (uint256[3]) arrays, up to 300 entries and 64KB. Every selector carries a round-trip verification (verify.known — is this function/event in the /decode dictionary? e.g. transfer → known:true with its ABI args). The one-call contract interface map for calldata builders, indexers and log filters. Pure cryptography — no RPC, no explorer, no API key, instant response. $0.10 USDC.","parameters":[{"name":"abi","in":"query","required":true,"schema":{"type":"string"},"description":"URL-encoded contract ABI as a JSON array of entries (function/event/error/constructor/fallback/receive; tuples as type 'tuple' + components; up to 300 entries, 64KB)."}],"responses":{"200":{"description":"ABI map JSON (network, count {functions,events,errors,other}, functions[] {name, signature, selector, inputs[], outputs[], stateMutability, verify}, events[] {name, signature, topic0, inputs[], anonymous, verify}, errors[] {name, signature, selector, inputs[]}, other[], requestedAt)"},"400":{"$ref":"#/components/responses/BadRequest"},"402":{"$ref":"#/components/responses/PaymentRequired"}},"x-payment-info":{"protocols":[{"x402":{"version":2,"scheme":"exact"}}],"price":{"mode":"fixed","currency":"USD","amount":"0.10"}}}},"/balance":{"get":{"summary":"Wallet balance (native ETH or ERC-20)","description":"Native ETH or any ERC-20 balance for any address on Base, Optimism or Ethereum Mainnet, with decimals, symbol, formatted value and block number. $0.10 USDC.","parameters":[{"name":"address","in":"query","required":true,"schema":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$"},"description":"Wallet address."},{"name":"token","in":"query","required":false,"schema":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$"},"description":"Optional ERC-20 token address (default: native ETH)."},{"name":"chain","in":"query","required":false,"schema":{"type":"string","enum":["base","op","mainnet"],"default":"base"}}],"responses":{"200":{"description":"Balance JSON (wei, formatted, decimals, symbol, blockNumber)"},"400":{"$ref":"#/components/responses/BadRequest"},"402":{"$ref":"#/components/responses/PaymentRequired"}},"x-payment-info":{"protocols":[{"x402":{"version":2,"scheme":"exact"}}],"price":{"mode":"fixed","currency":"USD","amount":"0.10"}}}},"/wallet":{"get":{"summary":"Wallet snapshot (multi-token balances + USD values + total)","description":"One-call portfolio snapshot for any address on Base, Optimism or Ethereum Mainnet: native ETH plus curated tokens (WETH/USDC/USDT/DAI + chain majors: cbBTC/AERO on Base, OP/WBTC on Optimism, WBTC on Mainnet) or your own list via tokens= (1-20 addresses). Per asset: decimals, balanceWei, balanceFormatted, priceUsd (on-chain DEX pools) and valueUsd; plus totalUsd for the whole wallet. Replaces 5+ /balance + /price calls. $0.10 USDC.","parameters":[{"name":"address","in":"query","required":true,"schema":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$"},"description":"Wallet address."},{"name":"chain","in":"query","required":false,"schema":{"type":"string","enum":["base","op","mainnet"],"default":"base"}},{"name":"tokens","in":"query","required":false,"schema":{"type":"string"},"description":"Optional comma-separated ERC-20 addresses (1-20) added to the curated list."}],"responses":{"200":{"description":"Wallet JSON (network, address, count, totalUsd, assets[])"},"400":{"$ref":"#/components/responses/BadRequest"},"402":{"$ref":"#/components/responses/PaymentRequired"}},"x-payment-info":{"protocols":[{"x402":{"version":2,"scheme":"exact"}}],"price":{"mode":"fixed","currency":"USD","amount":"0.10"}}}},"/ens":{"get":{"summary":"ENS name resolution","description":"Forward (name → address) and reverse (address → ENS name) resolution via the ENS registry on Ethereum Mainnet, Base or Optimism. $0.10 USDC.","parameters":[{"name":"name","in":"query","required":false,"schema":{"type":"string"},"example":"vitalik.eth","description":"ENS name to resolve forward (exactly one of name/address required)."},{"name":"address","in":"query","required":false,"schema":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$"},"description":"Address for reverse resolution."},{"name":"chain","in":"query","required":false,"schema":{"type":"string","enum":["mainnet","base","op"],"default":"mainnet"}}],"responses":{"200":{"description":"Resolution JSON (found, address or name, resolver)"},"400":{"$ref":"#/components/responses/BadRequest"},"402":{"$ref":"#/components/responses/PaymentRequired"}},"x-payment-info":{"protocols":[{"x402":{"version":2,"scheme":"exact"}}],"price":{"mode":"fixed","currency":"USD","amount":"0.10"}}}},"/block":{"get":{"summary":"Block data","description":"Number, hash, parentHash, timestamp (unix + ISO), baseFee (wei + gwei), gasUsed/gasLimit, transactionCount, proposer and size for any block on Base, Optimism or Ethereum Mainnet — or found:false when the block doesn't exist yet. $0.10 USDC.","parameters":[{"name":"block","in":"query","required":false,"schema":{"type":"string"},"example":"latest","description":"latest | earliest | decimal block number | 0x-hex (default latest)."},{"name":"chain","in":"query","required":false,"schema":{"type":"string","enum":["base","op","mainnet"],"default":"base"}}],"responses":{"200":{"description":"Block JSON or found:false"},"400":{"$ref":"#/components/responses/BadRequest"},"402":{"$ref":"#/components/responses/PaymentRequired"}},"x-payment-info":{"protocols":[{"x402":{"version":2,"scheme":"exact"}}],"price":{"mode":"fixed","currency":"USD","amount":"0.10"}}}},"/allowance":{"get":{"summary":"ERC-20 allowance","description":"How much a spender contract can spend from an owner wallet for any ERC-20 token on Base, Optimism or Ethereum Mainnet: allowanceWei + allowanceFormatted, decimals, symbol, tokenExists and block number — the pre-flight check before approving a spender. $0.10 USDC.","parameters":[{"name":"token","in":"query","required":true,"schema":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$"},"description":"ERC-20 token address."},{"name":"owner","in":"query","required":true,"schema":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$"},"description":"Wallet that owns the tokens."},{"name":"spender","in":"query","required":true,"schema":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$"},"description":"Contract/address allowed to spend."},{"name":"chain","in":"query","required":false,"schema":{"type":"string","enum":["base","op","mainnet"],"default":"base"}}],"responses":{"200":{"description":"Allowance JSON (wei, formatted, decimals, symbol, tokenExists)"},"400":{"$ref":"#/components/responses/BadRequest"},"402":{"$ref":"#/components/responses/PaymentRequired"}},"x-payment-info":{"protocols":[{"x402":{"version":2,"scheme":"exact"}}],"price":{"mode":"fixed","currency":"USD","amount":"0.10"}}}},"/simulate":{"get":{"summary":"Transaction simulation (pre-flight)","description":"eth_call pre-flight of from/to/data/value on Base, Optimism or Ethereum Mainnet: success flag, returnData + decoded, decoded revertReason (Error(string)), gasEstimate and blockNumber — the 'will this tx work?' call before signing. Runs on the current block state; the real result may differ between simulation and send (noted in the JSON). $0.10 USDC.","parameters":[{"name":"from","in":"query","required":true,"schema":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$"},"description":"Sender address."},{"name":"to","in":"query","required":true,"schema":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$"},"description":"Recipient/contract address."},{"name":"data","in":"query","required":false,"schema":{"type":"string","pattern":"^0x[a-fA-F0-9]*$"},"description":"Hex calldata (optional for plain transfers)."},{"name":"value","in":"query","required":false,"schema":{"type":"string"},"description":"Value in wei (decimal or 0x hex)."},{"name":"gas","in":"query","required":false,"schema":{"type":"string"},"description":"Gas limit override (decimal or 0x hex)."},{"name":"chain","in":"query","required":false,"schema":{"type":"string","enum":["base","op","mainnet"],"default":"base"}}],"responses":{"200":{"description":"Simulation JSON (success, returnData, revertReason, gasEstimate)"},"400":{"$ref":"#/components/responses/BadRequest"},"402":{"$ref":"#/components/responses/PaymentRequired"}},"x-payment-info":{"protocols":[{"x402":{"version":2,"scheme":"exact"}}],"price":{"mode":"fixed","currency":"USD","amount":"0.10"}}}},"/swap":{"get":{"summary":"Swap quote (on-chain, Base)","description":"AmountOut for an amountIn of any ERC-20 pair with DEX liquidity on Base — direct pool (Uniswap V3 best liquidity / Aerodrome V2) or WETH route when no direct pair. Returns amountOut (wei + formatted), executionPrice, spotPrice, priceImpactPct (includes fees, Uniswap-UI concept), slippagePct (price movement only), feePct, minOut slippage guards (0.5%/1%) and the route used — or routeFound:false when the pair has no pool. All from pool reserves; no market API. $0.10 USDC.","parameters":[{"name":"in","in":"query","required":true,"schema":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$"},"description":"Input ERC-20 address."},{"name":"out","in":"query","required":true,"schema":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$"},"description":"Output ERC-20 address (must differ from in)."},{"name":"amountIn","in":"query","required":true,"schema":{"type":"string"},"example":"1000000","description":"Input amount in wei (decimal or 0x hex, > 0)."}],"responses":{"200":{"description":"Quote JSON (amountOut, prices, impact, minOut, route)"},"400":{"$ref":"#/components/responses/BadRequest"},"402":{"$ref":"#/components/responses/PaymentRequired"}},"x-payment-info":{"protocols":[{"x402":{"version":2,"scheme":"exact"}}],"price":{"mode":"fixed","currency":"USD","amount":"0.10"}}}},"/multicall":{"get":{"summary":"MultiCall batch (up to 20 read-only calls)","description":"Batch of up to 20 read-only on-chain calls (balances, allowances, any eth_call) via the canonical Multicall3 aggregate3 on Base, Optimism or Ethereum Mainnet. Per-call success flag (allowFailure=true — a reverting call returns success:false without failing the batch), returnData hex, blockNumber and gasEstimate of the equivalent transaction. $0.10 USDC.","parameters":[{"name":"calls","in":"query","required":true,"schema":{"type":"string"},"description":"URL-encoded JSON array of {to, data?} — 1 to 20 calls. Example: [{\"to\":\"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913\",\"data\":\"0x70a082310000000000000000000000008e8d53a67b59E6f2A28e0d6d52012A2b0e3E1886\"}]"},{"name":"chain","in":"query","required":false,"schema":{"type":"string","enum":["base","op","mainnet"],"default":"base"}}],"responses":{"200":{"description":"Batch JSON (calls[].success/returnData, blockNumber, gasEstimate)"},"400":{"$ref":"#/components/responses/BadRequest"},"402":{"$ref":"#/components/responses/PaymentRequired"}},"x-payment-info":{"protocols":[{"x402":{"version":2,"scheme":"exact"}}],"price":{"mode":"fixed","currency":"USD","amount":"0.10"}}}},"/events":{"get":{"summary":"On-chain events (eth_getLogs) with decoded Transfer/Approval/Swap","description":"Raw event logs of any contract or wallet on Base, Optimism or Ethereum Mainnet — the monitoring primitive: deposits, payouts, approvals, swaps, mints, burns. Filters: ?address (required, 0x + 40 hex), ?topics (up to 4 comma-separated topic hashes, empty item = wildcard), ?fromBlock/?toBlock (latest | earliest | decimal | 0x-hex; default: last 5000 blocks, max window 10000), ?limit (1-50, default 20), ?order (asc|desc, default desc), ?chain (base|op|mainnet, default base). Per event: blockNumber, timestamp (unix + ISO), txHash, logIndex, topics, data. Best-effort decoding: Transfer (from/to/value formatted with the contract decimals), Approval (owner/spender/value), Uniswap V3 Swap (sender/recipient/amount0/amount1/sqrtPriceX96/liquidity/tick); other topic0 values returned raw. Busy contracts auto-shrink the range to what the RPC accepts (rangeHint). $0.10 USDC.","parameters":[{"name":"address","in":"query","required":true,"schema":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$"},"description":"Contract or wallet to watch."},{"name":"topics","in":"query","required":false,"schema":{"type":"string"},"description":"Up to 4 comma-separated topic hashes (0x + 64 hex); empty item = wildcard. Example: 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef (Transfer only)."},{"name":"fromBlock","in":"query","required":false,"schema":{"type":"string"},"description":"Start block: latest | earliest | decimal | 0x-hex (default: 5000 blocks before toBlock)."},{"name":"toBlock","in":"query","required":false,"schema":{"type":"string"},"description":"End block: latest | earliest | decimal | 0x-hex (default latest)."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":50,"default":20},"description":"Max events to return."},{"name":"order","in":"query","required":false,"schema":{"type":"string","enum":["asc","desc"],"default":"desc"},"description":"Sort order (desc = newest first)."},{"name":"chain","in":"query","required":false,"schema":{"type":"string","enum":["base","op","mainnet"],"default":"base"}}],"responses":{"200":{"description":"Events JSON (events[].blockNumber/timestamp/topics/data/decoded, count, truncated, rangeHint)"},"400":{"$ref":"#/components/responses/BadRequest"},"402":{"$ref":"#/components/responses/PaymentRequired"}},"x-payment-info":{"protocols":[{"x402":{"version":2,"scheme":"exact"}}],"price":{"mode":"fixed","currency":"USD","amount":"0.10"}}}},"/pairs":{"get":{"summary":"DEX pair discovery — every Uniswap V2 + V3 pool of a token (liquidity, reserves, prices)","description":"Locates every Uniswap V2 + Uniswap V3 pool (fees 100/500/3000/10000) of an ERC-20 token on Base, Optimism or Ethereum Mainnet against curated base tokens (WETH/USDC/USDT/DAI + chain majors) or a custom list via bases=. Per pool: venue, address, feeTier, feePct, token0/token1 (address + symbol + decimals), tokenIsToken0, quote, spot priceInQuote (token per quote), priceUsd (stablecoins 1:1; other quotes priced against USDC on the same chain), liquidityUsd (V2: 2 x quote reserve x price; V3: virtual TVL approximation 2 x L x sqrt(P)), reserves (V2) or sqrtPriceX96 + liquidity (V3). Pairs with zero reserves are filtered; sorted by liquidity desc; truncated:true when more pools exist than maxPairs. All computed on-chain from the DEX factories (no indexer, no market API). $0.10 USDC.","parameters":[{"name":"token","in":"query","required":true,"schema":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$"},"description":"ERC-20 token to locate."},{"name":"chain","in":"query","required":false,"schema":{"type":"string","enum":["base","op","mainnet"],"default":"base"}},{"name":"maxPairs","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":20,"default":10},"description":"Max pools to return (sorted by liquidity desc)."},{"name":"bases","in":"query","required":false,"schema":{"type":"string"},"description":"Optional comma-separated quote tokens (1-8) — replaces the curated base list."}],"responses":{"200":{"description":"Pairs JSON (token, bases, pairs[].venue/address/feeTier/token0/token1/quote/priceInQuote/priceUsd/liquidityUsd/reserves|sqrtPriceX96+liquidity, count, truncated)"},"400":{"$ref":"#/components/responses/BadRequest"},"402":{"$ref":"#/components/responses/PaymentRequired"}},"x-payment-info":{"protocols":[{"x402":{"version":2,"scheme":"exact"}}],"price":{"mode":"fixed","currency":"USD","amount":"0.10"}}}},"/history":{"get":{"summary":"Wallet activity — ERC-20 Transfer history of any address (no token address needed)","description":"ERC-20 Transfer history involving a wallet on Base, Optimism or Ethereum Mainnet — the did-my-payment-land check for payouts, bounties and airdrops. Unlike /balance (needs the token address) and /events (needs the contract address), this endpoint only needs the wallet address: every token that moved in or out is returned. Filters: ?address (required, 0x + 40 hex), ?direction (in|out|both, default both), ?fromBlock/?toBlock (latest | earliest | decimal | 0x-hex; default: last 1000 blocks, max window 10000), ?limit (1-50, default 20), ?order (asc|desc, default desc), ?chain (base|op|mainnet, default base). Per transfer: direction, blockNumber, timestamp (unix + ISO), txHash, logIndex, token address and decoded Transfer (from/to/value formatted with the token's own decimals). Plus the native ETH balance delta over the window (before/after when the RPC supports historical balances). Busy wallets auto-shrink the range to what the RPC accepts (rangeHint). $0.10 USDC.","parameters":[{"name":"address","in":"query","required":true,"schema":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$"},"description":"Wallet to inspect (no token address needed)."},{"name":"direction","in":"query","required":false,"schema":{"type":"string","enum":["in","out","both"],"default":"both"},"description":"Filter transfers: incoming only, outgoing only, or both."},{"name":"fromBlock","in":"query","required":false,"schema":{"type":"string"},"description":"Start block: latest | earliest | decimal | 0x-hex (default: 1000 blocks before toBlock)."},{"name":"toBlock","in":"query","required":false,"schema":{"type":"string"},"description":"End block: latest | earliest | decimal | 0x-hex (default latest)."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":50,"default":20},"description":"Max transfers to return."},{"name":"order","in":"query","required":false,"schema":{"type":"string","enum":["asc","desc"],"default":"desc"},"description":"Sort order (desc = newest first)."},{"name":"chain","in":"query","required":false,"schema":{"type":"string","enum":["base","op","mainnet"],"default":"base"}}],"responses":{"200":{"description":"History JSON (transfers[].direction/blockNumber/timestamp/token/decoded, native delta, count, truncated, rangeHint)"},"400":{"$ref":"#/components/responses/BadRequest"},"402":{"$ref":"#/components/responses/PaymentRequired"}},"x-payment-info":{"protocols":[{"x402":{"version":2,"scheme":"exact"}}],"price":{"mode":"fixed","currency":"USD","amount":"0.10"}}}}},"components":{"responses":{"PaymentRequired":{"description":"Payment required — the x402 exact scheme. The response body is the paymentRequirements object: the client pays `amount` of `asset` on `network` to `payTo` (EIP-3009 transferWithAuthorization), then re-sends the original request with the PAYMENT-SIGNATURE header to receive the resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentRequirements"}}}},"BadRequest":{"description":"Validation failed — invalid/missing parameters. Nothing is charged (validation happens before payment).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"schemas":{"PaymentRequirements":{"type":"object","properties":{"scheme":{"type":"string","enum":["exact"],"description":"x402 exact payment scheme."},"network":{"type":"string","example":"eip155:8453","description":"Chain (CAIP-2) where the payment settles."},"asset":{"type":"string","example":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","description":"Token address (USDC on Base)."},"amount":{"type":"string","example":"100000","description":"Price in asset base units (100000 = $0.10 USDC; 250000 = $0.25)."},"payTo":{"type":"string","example":"0x8e8d53a67b59E6f2A28e0d6d52012A2b0e3E1886","description":"Recipient wallet of the payment."},"maxTimeoutSeconds":{"type":"integer","example":300}},"required":["scheme","network","asset","amount","payTo","maxTimeoutSeconds"]},"Error":{"type":"object","properties":{"error":{"type":"string","description":"Human-readable validation error."}}}},"headers":{"PaymentSignature":{"description":"EIP-712 signature of the payment authorization (transferWithAuthorization) — sent on the re-request after paying.","schema":{"type":"string"}}}}}