# Send Onchain CLI to your agent
Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.
## Fast path
- Download the package from Yavira.
- Extract it into a folder your agent can access.
- Paste one of the prompts below and point your agent at the extracted folder.
## Suggested prompts
### New install

```text
I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Then review README.md for any prerequisites, environment setup, or post-install checks. Tell me what you changed and call out any manual steps you could not complete.
```
### Upgrade existing

```text
I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Then review README.md for any prerequisites, environment setup, or post-install checks. Summarize what changed and any follow-up checks I should run.
```
## Machine-readable fields
```json
{
  "schemaVersion": "1.0",
  "item": {
    "slug": "onchain",
    "name": "Onchain CLI",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/arein/onchain",
    "canonicalUrl": "https://clawhub.ai/arein/onchain",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadUrl": "/downloads/onchain",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=onchain",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "packageFormat": "ZIP package",
    "primaryDoc": "SKILL.md",
    "includedAssets": [
      "README.md",
      "SKILL.md"
    ],
    "downloadMode": "redirect",
    "sourceHealth": {
      "source": "tencent",
      "slug": "onchain",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-05-06T09:43:46.191Z",
      "expiresAt": "2026-05-13T09:43:46.191Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=onchain",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=onchain",
        "contentDisposition": "attachment; filename=\"onchain-0.3.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null,
        "slug": "onchain"
      },
      "scope": "item",
      "summary": "Item download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this item.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/onchain"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    }
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/onchain",
    "downloadUrl": "https://openagent3.xyz/downloads/onchain",
    "agentUrl": "https://openagent3.xyz/skills/onchain/agent",
    "manifestUrl": "https://openagent3.xyz/skills/onchain/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/onchain/agent.md"
  }
}
```
## Documentation

### Onchain CLI

CLI for crypto portfolio tracking, market data, and CEX history.

### First-Time Setup (Required)

Before using most features, users must configure their API keys:

onchain setup

This interactive wizard helps configure:

Coinbase/Binance - For CEX balances and trade history
DeBank - For EVM wallet data (Ethereum, Polygon, Arbitrum, etc.)
Helius - For Solana wallet data

Without setup: Only onchain price and onchain markets work (using free CoinGecko tier).

Verify setup: Run onchain test to check which providers are configured and working.

Agent note: If a command fails with "not configured" or "API key required", guide the user to run onchain setup first, then onchain test to verify.

### Invocation

onchain <command>

### Market Data

onchain price <token>         # Token price (btc, eth, sol, etc.)
onchain markets               # Market overview with trending
onchain search <query>        # Search tokens by name or symbol
onchain gas                   # Current gas prices (Ethereum default)
onchain gas --chain polygon   # Gas prices for other EVM chains

### Wallet Data

onchain balance [address]           # Token balances (auto-detects EVM/Solana)
onchain balance --chain polygon     # Filter by chain
onchain history [address]           # Transaction history
onchain portfolio [address]         # Full portfolio with DeFi positions

### Transaction Lookup

onchain tx <hash>                   # Lookup transaction details (auto-detects chain)
onchain tx <hash> --chain base      # Specify chain explicitly
onchain tx <explorer-url>           # Paste block explorer URL directly

Supports EVM chains (Ethereum, Polygon, Base, Arbitrum, Optimism, BSC, Avalanche, Fantom) and Solana. Accepts raw hashes or explorer URLs (etherscan.io, basescan.org, solscan.io, etc.).

Example Output

Transaction Details

✓ Status: SUCCESS
  Hash:  0xd757...5f31
  Chain: Base
  Block: 41,310,593
  Time:  Jan 26, 2026, 01:55 PM (4h ago)

Addresses
  From: 0xc4e7263dd870a29f1cfe438d1a7db48547b16888
  To:   0xab98b760e5ad88521a97c0f87a3f6eef8c42641d

Value & Fee
  Value: 0 ETH
  Fee:   3.62e-7 ETH
  Gas:   96,893 / 249,604 (39%)

Method
  ID: 0x6a761202

🔗 https://basescan.org/tx/0xd757...

This output contains all available transaction data. The CLI queries Etherscan/Solscan APIs directly - there is no additional data available from other sources.

### CEX Data

onchain coinbase balance      # Coinbase balances
onchain coinbase history      # Coinbase trade history
onchain binance balance       # Binance balances
onchain binance history       # Binance trade history

### Prediction Markets

onchain polymarket tags              # List all available tags/categories
onchain polymarket tags --popular    # Show popular tags by market count
onchain polymarket trending          # Trending markets (respects config filters)
onchain polymarket trending --all    # Show all markets (ignore config filters)
onchain polymarket trending --exclude sports,nfl   # Exclude specific tags
onchain polymarket trending --include crypto,ai    # Only show specific tags
onchain polymarket search <query>    # Search markets (respects config filters)
onchain polymarket view <slug>       # View market details
onchain polymarket sentiment <topic> # Analyze market sentiment for a topic

Sentiment analysis: Analyzes prediction markets to determine bullish/bearish expectations:

onchain polymarket sentiment fed        # Fed rate expectations
onchain polymarket sentiment bitcoin    # Bitcoin market sentiment
onchain polymarket sentiment ai         # AI-related predictions
onchain polymarket sentiment trump      # Political sentiment
onchain polymarket sentiment fed --json # JSON output for agents

Tag filtering: Configure default excludes in ~/.config/onchain/config.json5:

{
  "polymarket": {
    "excludeTags": ["sports", "nfl", "nba", "mlb"],
    "includeTags": []  // empty = all non-excluded
  }
}

### Configuration

onchain setup                 # Interactive setup wizard
onchain config                # View current config
onchain config wallet add <name> <address>
onchain config wallet set-default <name>

### Global Options

--json - Output as JSON (agent-friendly)
--plain - Disable colors and emoji
--timeout <ms> - Request timeout

### Configuration

Config file: ~/.config/onchain/config.json5

### Required API Keys

FeatureAPI KeyGet KeyEVM walletsDEBANK_API_KEYDeBankSolana walletsHELIUS_API_KEYHeliusCoinbase CEXCOINBASE_API_KEY + COINBASE_API_SECRETCoinbaseBinance CEXBINANCE_API_KEY + BINANCE_API_SECRETBinance

### Optional API Keys

FeatureAPI KeyNotesMarket dataCOINGECKO_API_KEYFree tier works, Pro for higher limitsMarket fallbackCOINMARKETCAP_API_KEYAlternative market data sourceEVM tx lookupETHERSCAN_API_KEYFor onchain tx on EVM chainsSolana tx lookupSOLSCAN_API_KEYFor onchain tx on Solana

### Get Bitcoin price

onchain price btc

### Check wallet balance

onchain balance 0x1234...5678

### View portfolio with DeFi positions

onchain portfolio main  # Uses saved wallet named "main"

### Get trending prediction markets

onchain polymarket trending -n 5             # Top 5 (respects config filters)
onchain polymarket trending --all            # All markets, ignore config
onchain polymarket trending --exclude sports # Filter out sports on-the-fly

### Lookup a transaction

onchain tx 0xd757e7e4cdb424e22319cbf63bbcfcd4b26c93ebef31d1458ab7d5e986375f31
onchain tx https://basescan.org/tx/0x...  # Or paste explorer URL

### Search for tokens

onchain search pepe               # Find tokens matching "pepe"
onchain search "shiba inu" -l 5   # Limit to 5 results

### Check gas prices

onchain gas                   # Ethereum gas prices
onchain gas --chain polygon   # Polygon gas prices
onchain gas --json            # JSON output

### JSON output for scripts

onchain --json price eth | jq '.priceUsd'

### EVM (via DeBank)

Ethereum, BNB Chain, Polygon, Arbitrum, Optimism, Avalanche, Base, zkSync Era, Linea, Scroll, Blast, Mantle, Gnosis, Fantom, Celo, and more.

### Solana (via Helius)

Full Solana mainnet support including SPL tokens and NFTs.

### Agent Integration

This CLI is designed for agent use. Key patterns:

Always use --json for programmatic access
Check exit codes - 0 for success, 1 for error
Use saved wallets - Configure once with onchain setup, reference by name
Rate limiting - APIs have rate limits, add delays between rapid calls

### Example Agent Usage

# Get portfolio value
VALUE=$(onchain --json portfolio main | jq -r '.totalValueUsd')

# Get price with change
onchain --json price btc | jq '{price: .priceUsd, change24h: .priceChange24h}'

# Check if market is bullish
CHANGE=$(onchain --json markets | jq '.marketCapChange24h')

# Get transaction details as JSON
TX=$(onchain --json tx 0x... --chain base)
echo $TX | jq '{status: .status, from: .from, to: .to, method: .methodId}'

### Transaction Lookup Guidance

IMPORTANT: Trust the CLI output. The onchain tx command queries Etherscan (EVM) or Solscan (Solana) APIs directly and returns all available data.

DO NOT:

Use curl to hit Etherscan/Basescan APIs directly
Use cast or other CLI tools as "fallbacks"
Use WebFetch to scrape block explorer websites
Assume the CLI is missing data - it returns everything available

DO:

Use onchain tx <hash> or onchain tx <explorer-url>
Use --json for structured data parsing
Interpret the output directly to answer user questions

Example interpretation:

onchain tx 0x... --chain base

If output shows Status: SUCCESS, From: 0x..., To: 0x..., Method ID: 0x6a761202 - that's a successful contract interaction. The method ID 0x6a761202 is execTransaction (Gnosis Safe). No additional lookups needed.
## Trust
- Source: tencent
- Verification: Indexed source record
- Publisher: arein
- Version: 0.3.0
## Source health
- Status: healthy
- Item download looks usable.
- Yavira can redirect you to the upstream package for this item.
- Health scope: item
- Reason: direct_download_ok
- Checked at: 2026-05-06T09:43:46.191Z
- Expires at: 2026-05-13T09:43:46.191Z
- Recommended action: Download for OpenClaw
## Links
- [Detail page](https://openagent3.xyz/skills/onchain)
- [Send to Agent page](https://openagent3.xyz/skills/onchain/agent)
- [JSON manifest](https://openagent3.xyz/skills/onchain/agent.json)
- [Markdown brief](https://openagent3.xyz/skills/onchain/agent.md)
- [Download page](https://openagent3.xyz/downloads/onchain)