@cyberdrk/onchain 0.1.0 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/SKILL.md +160 -0
- package/package.json +5 -3
package/SKILL.md
ADDED
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: onchain
|
|
3
|
+
description: CLI for crypto portfolio tracking, market data, and CEX history. Use when the user asks about crypto prices, wallet balances, portfolio values, Coinbase/Binance holdings, or Polymarket predictions.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Onchain CLI
|
|
7
|
+
|
|
8
|
+
CLI for crypto portfolio tracking, market data, and CEX history.
|
|
9
|
+
|
|
10
|
+
## First-Time Setup (Required)
|
|
11
|
+
|
|
12
|
+
Before using most features, users must configure their API keys:
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
onchain setup
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
This interactive wizard helps configure:
|
|
19
|
+
- **Coinbase/Binance** - For CEX balances and trade history
|
|
20
|
+
- **DeBank** - For EVM wallet data (Ethereum, Polygon, Arbitrum, etc.)
|
|
21
|
+
- **Helius** - For Solana wallet data
|
|
22
|
+
|
|
23
|
+
**Without setup**: Only `onchain price` and `onchain markets` work (using free CoinGecko tier).
|
|
24
|
+
|
|
25
|
+
**Verify setup**: Run `onchain test` to check which providers are configured and working.
|
|
26
|
+
|
|
27
|
+
**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.
|
|
28
|
+
|
|
29
|
+
## Invocation
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
onchain <command>
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Commands
|
|
36
|
+
|
|
37
|
+
### Market Data
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
onchain price <token> # Token price (btc, eth, sol, etc.)
|
|
41
|
+
onchain markets # Market overview with trending
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Wallet Data
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
onchain balance [address] # Token balances (auto-detects EVM/Solana)
|
|
48
|
+
onchain balance --chain polygon # Filter by chain
|
|
49
|
+
onchain history [address] # Transaction history
|
|
50
|
+
onchain portfolio [address] # Full portfolio with DeFi positions
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### CEX Data
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
onchain coinbase balance # Coinbase balances
|
|
57
|
+
onchain coinbase history # Coinbase trade history
|
|
58
|
+
onchain binance balance # Binance balances
|
|
59
|
+
onchain binance history # Binance trade history
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Prediction Markets
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
onchain polymarket trending # Trending markets
|
|
66
|
+
onchain polymarket search <query> # Search markets
|
|
67
|
+
onchain polymarket view <slug> # View market details
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Configuration
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
onchain setup # Interactive setup wizard
|
|
74
|
+
onchain config # View current config
|
|
75
|
+
onchain config wallet add <name> <address>
|
|
76
|
+
onchain config wallet set-default <name>
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Global Options
|
|
80
|
+
|
|
81
|
+
- `--json` - Output as JSON (agent-friendly)
|
|
82
|
+
- `--plain` - Disable colors and emoji
|
|
83
|
+
- `--timeout <ms>` - Request timeout
|
|
84
|
+
|
|
85
|
+
## Configuration
|
|
86
|
+
|
|
87
|
+
Config file: `~/.config/onchain/config.json5`
|
|
88
|
+
|
|
89
|
+
### Required API Keys
|
|
90
|
+
|
|
91
|
+
| Feature | API Key | Get Key |
|
|
92
|
+
|---------|---------|---------|
|
|
93
|
+
| EVM wallets | `DEBANK_API_KEY` | [DeBank](https://cloud.debank.com/) |
|
|
94
|
+
| Solana wallets | `HELIUS_API_KEY` | [Helius](https://helius.xyz/) |
|
|
95
|
+
| Coinbase CEX | `COINBASE_API_KEY` + `COINBASE_API_SECRET` | [Coinbase](https://www.coinbase.com/settings/api) |
|
|
96
|
+
| Binance CEX | `BINANCE_API_KEY` + `BINANCE_API_SECRET` | [Binance](https://www.binance.com/en/my/settings/api-management) |
|
|
97
|
+
|
|
98
|
+
### Optional API Keys
|
|
99
|
+
|
|
100
|
+
| Feature | API Key | Notes |
|
|
101
|
+
|---------|---------|-------|
|
|
102
|
+
| Market data | `COINGECKO_API_KEY` | Free tier works, Pro for higher limits |
|
|
103
|
+
| Market fallback | `COINMARKETCAP_API_KEY` | Alternative market data source |
|
|
104
|
+
|
|
105
|
+
## Examples
|
|
106
|
+
|
|
107
|
+
### Get Bitcoin price
|
|
108
|
+
```bash
|
|
109
|
+
onchain price btc
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Check wallet balance
|
|
113
|
+
```bash
|
|
114
|
+
onchain balance 0x1234...5678
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### View portfolio with DeFi positions
|
|
118
|
+
```bash
|
|
119
|
+
onchain portfolio main # Uses saved wallet named "main"
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### Get trending prediction markets
|
|
123
|
+
```bash
|
|
124
|
+
onchain polymarket trending -n 5
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### JSON output for scripts
|
|
128
|
+
```bash
|
|
129
|
+
onchain --json price eth | jq '.priceUsd'
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
## Supported Chains
|
|
133
|
+
|
|
134
|
+
### EVM (via DeBank)
|
|
135
|
+
Ethereum, BNB Chain, Polygon, Arbitrum, Optimism, Avalanche, Base, zkSync Era, Linea, Scroll, Blast, Mantle, Gnosis, Fantom, Celo, and more.
|
|
136
|
+
|
|
137
|
+
### Solana (via Helius)
|
|
138
|
+
Full Solana mainnet support including SPL tokens and NFTs.
|
|
139
|
+
|
|
140
|
+
## Agent Integration
|
|
141
|
+
|
|
142
|
+
This CLI is designed for agent use. Key patterns:
|
|
143
|
+
|
|
144
|
+
1. **Always use `--json`** for programmatic access
|
|
145
|
+
2. **Check exit codes** - 0 for success, 1 for error
|
|
146
|
+
3. **Use saved wallets** - Configure once with `onchain setup`, reference by name
|
|
147
|
+
4. **Rate limiting** - APIs have rate limits, add delays between rapid calls
|
|
148
|
+
|
|
149
|
+
### Example Agent Usage
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
# Get portfolio value
|
|
153
|
+
VALUE=$(onchain --json portfolio main | jq -r '.totalValueUsd')
|
|
154
|
+
|
|
155
|
+
# Get price with change
|
|
156
|
+
onchain --json price btc | jq '{price: .priceUsd, change24h: .priceChange24h}'
|
|
157
|
+
|
|
158
|
+
# Check if market is bullish
|
|
159
|
+
CHANGE=$(onchain --json markets | jq '.marketCapChange24h')
|
|
160
|
+
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cyberdrk/onchain",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"description": "CLI tool for crypto portfolio tracking, market data, and CEX history",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -12,7 +12,8 @@
|
|
|
12
12
|
"dist",
|
|
13
13
|
"README.md",
|
|
14
14
|
"CHANGELOG.md",
|
|
15
|
-
"LICENSE"
|
|
15
|
+
"LICENSE",
|
|
16
|
+
"SKILL.md"
|
|
16
17
|
],
|
|
17
18
|
"repository": {
|
|
18
19
|
"type": "git",
|
|
@@ -73,5 +74,6 @@
|
|
|
73
74
|
},
|
|
74
75
|
"engines": {
|
|
75
76
|
"node": ">=22"
|
|
76
|
-
}
|
|
77
|
+
},
|
|
78
|
+
"packageManager": "pnpm@10.25.0+sha512.5e82639027af37cf832061bcc6d639c219634488e0f2baebe785028a793de7b525ffcd3f7ff574f5e9860654e098fe852ba8ac5dd5cefe1767d23a020a92f501"
|
|
77
79
|
}
|