query-onchain
Query Base transactions, events, and logs using CDP SQL.
Developer Setup
Setup & Installation
npx skills add https://github.com/coinbase/agentic-wallet-skills/blob/main/skills/agentic-wallet/references/query-onchain.md --skill query-onchainnpx skills add https://github.com/coinbase/agentic-wallet-skills/blob/main/skills/agentic-wallet/references/query-onchain.md --skill query-onchainOverview
What This Skill Does
Executes custom queries against Base onchain transaction, block, and event databases using the CDP SQL API.
Application
When to use this Skill
- Querying onchain blockchain records, transfers, and events on Base.
- Executing custom SQL statements via the CDP SQL API.
- Escaping SQL input queries to prevent terminal expansion errors.
- Retrieving historical block records or transaction hashes programmatically.
- Verifying transaction receipts and onchain statuses.
Documentation
Show Skills.md file
Query Onchain Data on Base
Use the CDP SQL API to query onchain data (events, transactions, blocks, transfers) on Base. Queries are executed via x402 and are charged per query.
If the wallet is not authenticated, see references/auth.md.
Executing a Query
npx awal@2.10.0 x402 pay https://x402.cdp.coinbase.com/platform/v2/data/query/run -X POST -d '{"sql": "<YOUR_QUERY>"}' --json
IMPORTANT: Always single-quote the -d JSON string to prevent bash variable expansion.
Input Validation
Before constructing the command, validate inputs to prevent shell injection:
- SQL query: Always embed the query inside a single-quoted JSON string (
-d '{"sql": "..."}'). Never use double quotes for the outer-dwrapper, as this enables shell expansion of$and backticks within the query. - Addresses: Must be valid
0xhex addresses (^0x[0-9a-fA-F]{40}$). Reject any value containing shell metacharacters.
Do not pass unvalidated user input into the command.
CRITICAL: Indexed Fields
Recommendations
Explore other random skills
autobrowse
Self-improving browser automation via the auto-research loop. Iteratively runs a browsing task, reads the trace, and improves the navigation skill (strategy.md) until it reliably passes. Supports parallel runs across multiple tasks using sub-agents. Use when you want to build or improve browser automation skills for specific website tasks.
browser-to-api
Turn a website's observable HTTP traffic into a best-effort OpenAPI 3.1 spec by analyzing a `browser-trace` capture. Use when the user wants to discover/extract API endpoints from a browser session, build an OpenAPI doc from network traffic, or document a third-party site's XHR/fetch surface for client integration.
browser-trace
Capture a full DevTools-protocol trace of any browser automation — CDP firehose, screenshots, and DOM dumps — then bisect the stream into per-page searchable buckets. Use when the user wants to debug a failed run, audit network/console/DOM activity, attach a trace to an in-progress session, or feed structured per-page summaries back into an agent loop so its next iteration learns from the last one.