@chainstream-io/cli
ChainStream CLI — on-chain data and DeFi execution for AI agents.
Query tokens, analyze wallets, track markets, and execute swaps across Solana, BSC, and Ethereum.
Quick Start
npx @chainstream-io/cli token search --keyword PUMP --chain sol
npx @chainstream-io/cli token security --chain sol --address <token_address>
npx @chainstream-io/cli market trending --chain sol --duration 1h
npx @chainstream-io/cli wallet pnl --chain sol --address <wallet_address>
Authentication
API Key (recommended — works with all agent wallets)
chainstream config set --key apiKey --value <your_api_key>
Get an API key at app.chainstream.io, or via x402 purchase (see below).
ChainStream Wallet (recommended for DeFi)
chainstream login
chainstream login user@example.com
chainstream login --key
x402 Auto-Payment → API Key
When CLI encounters a 402 (no subscription), it auto-purchases via x402 and saves the returned API Key to config. After purchase, all subsequent calls use the API Key — no wallet signature needed.
npx @chainstream-io/cli token search --keyword PUMP --chain sol
Raw Private Key (dev/testing only)
chainstream wallet set-raw --chain evm
Commands
Token
token search | Search tokens by keyword |
token info | Get full token detail |
token security | Check honeypot, mint auth, freeze auth |
token holders | Get top token holders |
token candles | Get OHLCV candlestick data |
token pools | Get liquidity pools |
Market
market trending | Hot/trending tokens |
market new | Newly created tokens |
market trades | Recent trades |
Wallet
wallet profile | PnL + net worth + top holdings |
wallet pnl | PnL details |
wallet holdings | Token balances |
wallet activity | Transfer history |
wallet address | Show wallet addresses |
wallet balance | Current wallet balance |
GraphQL
graphql schema | Discover cubes, fields, and query rules |
graphql query | Execute GraphQL queries (supports x402 auto-payment) |
DeFi (requires wallet)
dex quote | Get swap quote |
dex swap | Execute token swap (irreversible) |
dex create | Create token on launchpad |
job status | Check job status |
Auth
login [email] | Email OTP login (default) |
login --key | P-256 key login (returning users) |
verify | Complete OTP verification |
logout | Clear session |
Supported Chains
| Solana | sol | Yes | Yes |
| BSC | bsc | Yes | Yes |
| Ethereum | eth | Yes | Yes |
Output
Default: formatted JSON. Use --raw for single-line JSON:
chainstream token info --chain sol --address <addr> --raw | jq '.price'
Architecture
@chainstream-io/cli → @chainstream-io/sdk → ChainStream v2 API
→ TEE (wallet signing)
- SDK-based: All API calls via
@chainstream-io/sdk (typed, auto-retry, waitForJob)
- Non-custodial: Wallet keys in TEE, never on local disk
- API Key first: x402 purchase auto-saves API Key; wallet signature as fallback for DeFi
License
MIT