@truenorth-ai/cli 0.1.0
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/README.md +212 -0
- package/bin/truenorth.js +2 -0
- package/dist/api/client.d.ts +4 -0
- package/dist/api/client.d.ts.map +1 -0
- package/dist/api/client.js +34 -0
- package/dist/api/client.js.map +1 -0
- package/dist/api/tools.d.ts +4 -0
- package/dist/api/tools.d.ts.map +1 -0
- package/dist/api/tools.js +25 -0
- package/dist/api/tools.js.map +1 -0
- package/dist/commands/call.d.ts +3 -0
- package/dist/commands/call.d.ts.map +1 -0
- package/dist/commands/call.js +27 -0
- package/dist/commands/call.js.map +1 -0
- package/dist/commands/defi.d.ts +3 -0
- package/dist/commands/defi.d.ts.map +1 -0
- package/dist/commands/defi.js +47 -0
- package/dist/commands/defi.js.map +1 -0
- package/dist/commands/derivatives.d.ts +3 -0
- package/dist/commands/derivatives.d.ts.map +1 -0
- package/dist/commands/derivatives.js +27 -0
- package/dist/commands/derivatives.js.map +1 -0
- package/dist/commands/events.d.ts +3 -0
- package/dist/commands/events.d.ts.map +1 -0
- package/dist/commands/events.js +28 -0
- package/dist/commands/events.js.map +1 -0
- package/dist/commands/kol.d.ts +3 -0
- package/dist/commands/kol.d.ts.map +1 -0
- package/dist/commands/kol.js +66 -0
- package/dist/commands/kol.js.map +1 -0
- package/dist/commands/market-info.d.ts +3 -0
- package/dist/commands/market-info.d.ts.map +1 -0
- package/dist/commands/market-info.js +27 -0
- package/dist/commands/market-info.js.map +1 -0
- package/dist/commands/meme.d.ts +3 -0
- package/dist/commands/meme.d.ts.map +1 -0
- package/dist/commands/meme.js +108 -0
- package/dist/commands/meme.js.map +1 -0
- package/dist/commands/perps.d.ts +3 -0
- package/dist/commands/perps.d.ts.map +1 -0
- package/dist/commands/perps.js +36 -0
- package/dist/commands/perps.js.map +1 -0
- package/dist/commands/polymarket.d.ts +3 -0
- package/dist/commands/polymarket.d.ts.map +1 -0
- package/dist/commands/polymarket.js +32 -0
- package/dist/commands/polymarket.js.map +1 -0
- package/dist/commands/scan.d.ts +3 -0
- package/dist/commands/scan.d.ts.map +1 -0
- package/dist/commands/scan.js +27 -0
- package/dist/commands/scan.js.map +1 -0
- package/dist/commands/search.d.ts +3 -0
- package/dist/commands/search.d.ts.map +1 -0
- package/dist/commands/search.js +66 -0
- package/dist/commands/search.js.map +1 -0
- package/dist/commands/technical.d.ts +3 -0
- package/dist/commands/technical.d.ts.map +1 -0
- package/dist/commands/technical.js +55 -0
- package/dist/commands/technical.js.map +1 -0
- package/dist/commands/tools.d.ts +3 -0
- package/dist/commands/tools.d.ts.map +1 -0
- package/dist/commands/tools.js +68 -0
- package/dist/commands/tools.js.map +1 -0
- package/dist/commands/trending.d.ts +3 -0
- package/dist/commands/trending.d.ts.map +1 -0
- package/dist/commands/trending.js +31 -0
- package/dist/commands/trending.js.map +1 -0
- package/dist/config.d.ts +5 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +28 -0
- package/dist/config.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +71 -0
- package/dist/index.js.map +1 -0
- package/dist/types.d.ts +55 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +6 -0
- package/dist/types.js.map +1 -0
- package/dist/utils.d.ts +20 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +221 -0
- package/dist/utils.js.map +1 -0
- package/package.json +48 -0
package/README.md
ADDED
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<h1 align="center">TrueNorth CLI</h1>
|
|
3
|
+
<p align="center">
|
|
4
|
+
Crypto analysis tools in your terminal — powered by Discovery Agents.
|
|
5
|
+
<br />
|
|
6
|
+
Technical analysis, derivatives, market data, DeFi metrics, and more at your fingertips.
|
|
7
|
+
</p>
|
|
8
|
+
</p>
|
|
9
|
+
|
|
10
|
+
<p align="center">
|
|
11
|
+
<img alt="Node.js" src="https://img.shields.io/badge/node-%3E%3D18-brightgreen">
|
|
12
|
+
<img alt="TypeScript" src="https://img.shields.io/badge/TypeScript-strict-3178c6">
|
|
13
|
+
<img alt="License: MIT" src="https://img.shields.io/badge/license-MIT-blue.svg">
|
|
14
|
+
</p>
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Features
|
|
19
|
+
|
|
20
|
+
- **Technical Analysis** — RSI, MACD, Bollinger Bands, support/resistance, candlestick patterns with configurable timeframes
|
|
21
|
+
- **Kline Charts** — Candlestick/OHLCV analysis across multiple timeframes
|
|
22
|
+
- **Market Data** — ATH, market cap, supply, price, and fundamental metrics
|
|
23
|
+
- **Derivatives** — Funding rates, open interest, liquidation heatmaps
|
|
24
|
+
- **Liquidation Risk** — Calculate liquidation risk with entry price and direction
|
|
25
|
+
- **Events & News** — Crypto news and announcements from 7 sources
|
|
26
|
+
- **DeFi Analytics** — Protocol and chain metrics from DeFiLlama (TVL, fees, revenue, growth)
|
|
27
|
+
- **Performance Scanner** — Rank tokens by relative strength vs benchmark
|
|
28
|
+
- **Token Unlocks** — Upcoming vesting and unlock schedules
|
|
29
|
+
- **NER Detection** — Extract token, chain, and protocol entities from text
|
|
30
|
+
- **Agent-Friendly** — Every command supports `--json` for raw JSON output. Self-describing tool schemas via `tn tools --json`
|
|
31
|
+
|
|
32
|
+
## Installation
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
git clone https://github.com/Advent-AI/truenorth-cli.git
|
|
36
|
+
cd truenorth-cli
|
|
37
|
+
npm install
|
|
38
|
+
npm run build
|
|
39
|
+
npm link
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
**Requires Node.js >= 18**
|
|
43
|
+
|
|
44
|
+
## Quick Start
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
# List all available tools
|
|
48
|
+
tn tools
|
|
49
|
+
|
|
50
|
+
# Technical analysis
|
|
51
|
+
tn ta bitcoin
|
|
52
|
+
tn ta ethereum --timeframe 1d
|
|
53
|
+
|
|
54
|
+
# Market fundamentals
|
|
55
|
+
tn info bitcoin
|
|
56
|
+
|
|
57
|
+
# Derivatives
|
|
58
|
+
tn deriv ethereum
|
|
59
|
+
|
|
60
|
+
# News & events
|
|
61
|
+
tn events solana --time-window 7d
|
|
62
|
+
|
|
63
|
+
# Raw JSON for scripting / AI agents
|
|
64
|
+
tn ta bitcoin --json
|
|
65
|
+
tn tools --json
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Commands
|
|
69
|
+
|
|
70
|
+
### Tool Discovery
|
|
71
|
+
|
|
72
|
+
| Command | Description |
|
|
73
|
+
|---------|-------------|
|
|
74
|
+
| `tn tools` | List all available tools |
|
|
75
|
+
| `tn tools --verbose` | Show full descriptions + input schemas |
|
|
76
|
+
| `tn tools --filter <keyword>` | Filter by keyword |
|
|
77
|
+
| `tn call <tool> [--args]` | Call any tool generically |
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
tn tools # Table view of all tools
|
|
81
|
+
tn tools --verbose --filter derivatives # Full schema for matching tools
|
|
82
|
+
tn call technical_analysis --token-address bitcoin --timeframe 4h
|
|
83
|
+
tn call events --query solana --time-window 7d # Any tool, any args
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
> **Dynamic discovery:** `tn tools --json` returns every tool's name, description, and full input schema. AI agents can use this for runtime tool discovery — no documentation needed.
|
|
87
|
+
|
|
88
|
+
### Technical Analysis
|
|
89
|
+
|
|
90
|
+
| Command | Description |
|
|
91
|
+
|---------|-------------|
|
|
92
|
+
| `tn ta <token>` | Technical indicators (RSI, MACD, support/resistance) |
|
|
93
|
+
| `tn kline <token>` | Kline/candlestick chart analysis |
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
tn ta bitcoin # Default 4h timeframe
|
|
97
|
+
tn ta ethereum --timeframe 1d # Daily timeframe
|
|
98
|
+
tn kline solana --timeframe 1h # Hourly candlesticks
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### Market Data
|
|
102
|
+
|
|
103
|
+
| Command | Description |
|
|
104
|
+
|---------|-------------|
|
|
105
|
+
| `tn info <token>` | Basic market info (ATH, market cap, supply, price) |
|
|
106
|
+
| `tn deriv <token>` | Derivatives (funding rates, OI, liquidations) |
|
|
107
|
+
| `tn risk` | Liquidation risk calculator |
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
tn info bitcoin # Market cap, ATH, supply, fundamentals
|
|
111
|
+
tn deriv bitcoin # Funding, OI, liquidation heatmap
|
|
112
|
+
tn risk --token bitcoin --dir long --price 95000 --liq 80000
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### Events & News
|
|
116
|
+
|
|
117
|
+
| Command | Description |
|
|
118
|
+
|---------|-------------|
|
|
119
|
+
| `tn events <query>` | Crypto news & events from 7 sources |
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
tn events bitcoin --time-window 7d # Last 7 days of BTC news
|
|
123
|
+
tn events solana --time-window 30d # Last 30 days
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### DeFi
|
|
127
|
+
|
|
128
|
+
| Command | Description |
|
|
129
|
+
|---------|-------------|
|
|
130
|
+
| `tn defi protocols` | Query DeFi protocols (TVL, fees, revenue) |
|
|
131
|
+
| `tn defi chains` | Query blockchain chains (TVL, fees, growth) |
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
tn defi protocols --sort tvl_growth # Fastest growing protocols
|
|
135
|
+
tn defi chains --sort fees_growth # Chains with rising fee revenue
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### Performance & Unlocks
|
|
139
|
+
|
|
140
|
+
| Command | Description |
|
|
141
|
+
|---------|-------------|
|
|
142
|
+
| `tn perf` | Token performance scanner |
|
|
143
|
+
| `tn unlock <token>` | Token unlock schedule |
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
tn perf --top 20 # Top 20 performers by relative strength
|
|
147
|
+
tn unlock arbitrum # Upcoming ARB unlocks
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
### Utility
|
|
151
|
+
|
|
152
|
+
| Command | Description |
|
|
153
|
+
|---------|-------------|
|
|
154
|
+
| `tn ner <text>` | Named entity recognition for crypto text |
|
|
155
|
+
| `tn config` | Configure CLI settings |
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
tn ner "Is SOL better than ETH?" # Extract token/chain/protocol entities
|
|
159
|
+
tn config # Interactive settings menu
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
## Output Format
|
|
163
|
+
|
|
164
|
+
By default, all commands display data using formatted tables, colored text, and human-friendly numbers (e.g. `$95,432.00`, `+3.46%`). To get raw JSON output for scripting or piping, add the `--json` flag to any command:
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
tn ta bitcoin --json # Full technical analysis as JSON
|
|
168
|
+
tn info ethereum --json | jq '.result.market_data' # Pipe to jq
|
|
169
|
+
tn tools --json | jq '.[].name' # List all tool names
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
## Configuration
|
|
173
|
+
|
|
174
|
+
```bash
|
|
175
|
+
tn config # Interactive settings menu
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
| Setting | Default | Description |
|
|
179
|
+
|---------|---------|-------------|
|
|
180
|
+
| Base URL | `https://api.adventai.io/api/agent-tools` | API endpoint |
|
|
181
|
+
| Default Timeframe | `4h` | Chart timeframe for TA commands |
|
|
182
|
+
| Default Limit | `20` | Number of results for list commands |
|
|
183
|
+
|
|
184
|
+
Settings stored in `~/.truenorth/config.json`.
|
|
185
|
+
|
|
186
|
+
## Agent Integration
|
|
187
|
+
|
|
188
|
+
TrueNorth CLI is designed to work as a tool provider for AI agents. Two commands are all an agent needs:
|
|
189
|
+
|
|
190
|
+
```bash
|
|
191
|
+
# 1. Discover available tools and their input schemas
|
|
192
|
+
tn tools --json
|
|
193
|
+
|
|
194
|
+
# 2. Call any tool with dynamic arguments
|
|
195
|
+
tn call <tool_name> --arg1 value1 --arg2 value2 --json
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
The `tn tools --json` response includes full JSON Schema for every tool's parameters — types, descriptions, required fields, defaults, and enums. No external documentation needed.
|
|
199
|
+
|
|
200
|
+
## Development
|
|
201
|
+
|
|
202
|
+
```bash
|
|
203
|
+
npm install # Install dependencies
|
|
204
|
+
npm run build # Compile TypeScript → dist/
|
|
205
|
+
npm run dev # Watch mode
|
|
206
|
+
npm link # Link globally as `tn`
|
|
207
|
+
npm test # Run tests (Vitest)
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
## License
|
|
211
|
+
|
|
212
|
+
[MIT](LICENSE)
|
package/bin/truenorth.js
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ApiResponse, ListToolsApiResponse, CallToolApiResponse } from "../types.js";
|
|
2
|
+
export declare function listTools(): Promise<ApiResponse<ListToolsApiResponse>>;
|
|
3
|
+
export declare function callTool(toolName: string, args: Record<string, unknown>): Promise<ApiResponse<CallToolApiResponse>>;
|
|
4
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/api/client.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAyB1F,wBAAsB,SAAS,IAAI,OAAO,CAAC,WAAW,CAAC,oBAAoB,CAAC,CAAC,CAG5E;AAED,wBAAsB,QAAQ,CAC5B,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,OAAO,CAAC,WAAW,CAAC,mBAAmB,CAAC,CAAC,CAM3C"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { getBaseUrl } from "../config.js";
|
|
2
|
+
async function request(url, init) {
|
|
3
|
+
try {
|
|
4
|
+
const res = await fetch(url, {
|
|
5
|
+
...init,
|
|
6
|
+
headers: {
|
|
7
|
+
"Content-Type": "application/json",
|
|
8
|
+
...init?.headers,
|
|
9
|
+
},
|
|
10
|
+
});
|
|
11
|
+
if (!res.ok) {
|
|
12
|
+
const body = await res.text().catch(() => "");
|
|
13
|
+
return { ok: false, error: `HTTP ${res.status}: ${body || res.statusText}`, status: res.status };
|
|
14
|
+
}
|
|
15
|
+
const data = (await res.json());
|
|
16
|
+
return { ok: true, data };
|
|
17
|
+
}
|
|
18
|
+
catch (err) {
|
|
19
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
20
|
+
return { ok: false, error: msg };
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
export async function listTools() {
|
|
24
|
+
const baseUrl = getBaseUrl();
|
|
25
|
+
return request(baseUrl);
|
|
26
|
+
}
|
|
27
|
+
export async function callTool(toolName, args) {
|
|
28
|
+
const baseUrl = getBaseUrl();
|
|
29
|
+
return request(`${baseUrl}/call`, {
|
|
30
|
+
method: "POST",
|
|
31
|
+
body: JSON.stringify({ toolName, arguments: args }),
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/api/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG1C,KAAK,UAAU,OAAO,CAAI,GAAW,EAAE,IAAkB;IACvD,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE;YAC3B,GAAG,IAAI;YACP,OAAO,EAAE;gBACP,cAAc,EAAE,kBAAkB;gBAClC,GAAG,IAAI,EAAE,OAAO;aACjB;SACF,CAAC,CAAC;QAEH,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;YACZ,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,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AAsB,WAAW,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC,CASvD;AAED,wBAAsB,WAAW,CAC/B,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,OAAO,CAAC,cAAc,CAAC,CAYzB"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { listTools as fetchTools, callTool as fetchCallTool } from "./client.js";
|
|
2
|
+
export async function getToolList() {
|
|
3
|
+
const res = await fetchTools();
|
|
4
|
+
if (!res.ok || !res.data) {
|
|
5
|
+
throw new Error(res.error ?? "Failed to fetch tools");
|
|
6
|
+
}
|
|
7
|
+
if (res.data.failed || !res.data.success) {
|
|
8
|
+
throw new Error(res.data.message ?? "API returned failure");
|
|
9
|
+
}
|
|
10
|
+
return res.data.data.tools;
|
|
11
|
+
}
|
|
12
|
+
export async function executeTool(toolName, args) {
|
|
13
|
+
const res = await fetchCallTool(toolName, args);
|
|
14
|
+
if (!res.ok || !res.data) {
|
|
15
|
+
throw new Error(res.error ?? "Failed to call tool");
|
|
16
|
+
}
|
|
17
|
+
if (res.data.failed || !res.data.success) {
|
|
18
|
+
throw new Error(res.data.message ?? "API returned failure");
|
|
19
|
+
}
|
|
20
|
+
if (res.data.data.isError) {
|
|
21
|
+
throw new Error(`Tool error: ${JSON.stringify(res.data.data.result)}`);
|
|
22
|
+
}
|
|
23
|
+
return res.data.data;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../../src/api/tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,IAAI,UAAU,EAAE,QAAQ,IAAI,aAAa,EAAE,MAAM,aAAa,CAAC;AAGjF,MAAM,CAAC,KAAK,UAAU,WAAW;IAC/B,MAAM,GAAG,GAAG,MAAM,UAAU,EAAE,CAAC;IAC/B,IAAI,CAAC,GAAG,C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ot":"","sources":["../../src/commands/call.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAcpC,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA6B1D"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import chalk from "chalk";
|
|
2
|
+
import { executeTool } from "../api/tools.js";
|
|
3
|
+
import { startSpinner, formatResult, formatDuration, printJson, isJsonMode, wrapAction, parseDynamicArgs, addJsonOption, } from "../utils.js";
|
|
4
|
+
export function registerCallCommand(program) {
|
|
5
|
+
const cmd = program
|
|
6
|
+
.command("call <tool>")
|
|
7
|
+
.description("Call any tool by name with dynamic arguments")
|
|
8
|
+
.allowUnknownOption(true)
|
|
9
|
+
.helpOption("-h, --help", "Show help (use `tn tools --verbose` to see tool params)");
|
|
10
|
+
addJsonOption(cmd);
|
|
11
|
+
cmd.action(wrapAction(async (toolName, _opts, command) => {
|
|
12
|
+
const opts = command.opts();
|
|
13
|
+
const rawArgs = command.args.slice(1); // skip tool name
|
|
14
|
+
const dynamicArgs = parseDynamicArgs(rawArgs);
|
|
15
|
+
const spinner = startSpinner(`Calling ${chalk.cyan(toolName)}…`);
|
|
16
|
+
const result = await executeTool(toolName, dynamicArgs);
|
|
17
|
+
spinner.stop();
|
|
18
|
+
if (isJsonMode(opts)) {
|
|
19
|
+
printJson(result);
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
console.log(chalk.bold(`\n ${chalk.cyan(result.toolName)} ${formatDuration(result.durationMs)}\n`));
|
|
23
|
+
formatResult(result.result);
|
|
24
|
+
console.log();
|
|
25
|
+
}));
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=call.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"call.js","sourceRoot":"","sources":["../../src/commands/call.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,WAAW,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AC,MAAM,CAAC,CAAC;QAC5B,OAAO,CAAC,GAAG,EAAE,CAAC;IAChB,CAAC,CAAC,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defi.d.ts","sourceRoot":"","sources":["../../src/commands/defi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA4C1D"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import chalk from "chalk";
|
|
2
|
+
import { executeTool } from "../api/tools.js";
|
|
3
|
+
import { startSpinner, formatResult, formatDuration, printJson, isJsonMode, wrapAction, addJsonOption } from "../utils.js";
|
|
4
|
+
export function registerDefiCommand(program) {
|
|
5
|
+
const defi = program
|
|
6
|
+
.command("defi")
|
|
7
|
+
.description("DeFi protocol and chain analysis");
|
|
8
|
+
// ── defi protocols ──
|
|
9
|
+
const protocols = defi.command("protocols").description("Query DeFi protocols").option("--sort <field>", "Sort by field (e.g. tvl_growth)");
|
|
10
|
+
addJsonOption(protocols);
|
|
11
|
+
protocols.action(wrapAction(async (_opts) => {
|
|
12
|
+
const opts = _opts;
|
|
13
|
+
const args = {};
|
|
14
|
+
if (opts.sort)
|
|
15
|
+
args.sort = opts.sort;
|
|
16
|
+
const spinner = startSpinner("Querying protocols…");
|
|
17
|
+
const result = await executeTool("query_protocols", args);
|
|
18
|
+
spinner.stop();
|
|
19
|
+
if (isJsonMode(opts)) {
|
|
20
|
+
printJson(result);
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
console.log(chalk.bold(`\n DeFi Protocols ${formatDuration(result.durationMs)}\n`));
|
|
24
|
+
formatResult(result.result);
|
|
25
|
+
console.log();
|
|
26
|
+
}));
|
|
27
|
+
// ── defi chains ──
|
|
28
|
+
const chains = defi.command("chains").description("Query blockchain chains").option("--sort <field>", "Sort by field (e.g. fees_growth)");
|
|
29
|
+
addJsonOption(chains);
|
|
30
|
+
chains.action(wrapAction(async (_opts) => {
|
|
31
|
+
const opts = _opts;
|
|
32
|
+
const args = {};
|
|
33
|
+
if (opts.sort)
|
|
34
|
+
args.sort = opts.sort;
|
|
35
|
+
const spinner = startSpinner("Querying chains…");
|
|
36
|
+
const result = await executeTool("query_chains", args);
|
|
37
|
+
spinner.stop();
|
|
38
|
+
if (isJsonMode(opts)) {
|
|
39
|
+
printJson(result);
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
console.log(chalk.bold(`\n Blockchain Chains ${formatDuration(result.durationMs)}\n`));
|
|
43
|
+
formatResult(result.result);
|
|
44
|
+
console.log();
|
|
45
|
+
}));
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=defi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defi.js","sourceRoot":"","sources":["../../src/commands/defi.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE3H,MAAM,UAAU,mBAAmB,CAAC,OAAgB;IAClD,MAAM,IAAI,GAAG,OAAO;SACjB,OAAO,CAAC,MAAM,CAAC;SACf,WAAW,CAAC,kCAAkC,CAAC,CAAC;IAEnD,uBAAuB;IACvB,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,WAAW,CAAC,sBAAsB,CAAC,CAAC,MAAM,CAAC,gBAAgB,EAAE,iCAAiC,CAAC,CAAC;IAC5I,aAAa,CAAC,SAAS,CAAC,CAAC;IACzB,SAAS,CAAC,MAAM,CACd,UAAU,CAAC,KAAK,EAAE,KAAc,EAAE,EAAE;QAClC,MAAM,IAAI,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IAAI,EAAE,CAAC;QAEf,IAAI,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;YAAC,SAAS,CAAC,MAAM,CAAC,CAAC;YAAC,OAAO;QAAC,CAAC;QACpD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,yBAAyB,cAAc,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC;QACxF,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QAC5B,OAAO,CAAC,GAAG,EAAE,CAAC;IAChB,CAAC,CAAC,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"derivatives.d.ts","sourceRoot":"","sources":["../../src/commands/derivatives.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA6BjE"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import chalk from "chalk";
|
|
2
|
+
import { executeTool } from "../api/tools.js";
|
|
3
|
+
import { startSpinner, formatResult, formatDuration, printJson, isJsonMode, wrapAction, addJsonOption } from "../utils.js";
|
|
4
|
+
export function registerDerivativesCommand(program) {
|
|
5
|
+
const cmd = program
|
|
6
|
+
.command("deriv <token>")
|
|
7
|
+
.description("Derivatives analysis for a token")
|
|
8
|
+
.option("--token-address <addr>", "Token address (overrides positional)");
|
|
9
|
+
addJsonOption(cmd);
|
|
10
|
+
cmd.action(wrapAction(async (token, _opts) => {
|
|
11
|
+
const opts = _opts;
|
|
12
|
+
const args = {
|
|
13
|
+
token_address: opts.tokenAddress ?? token,
|
|
14
|
+
};
|
|
15
|
+
const spinner = startSpinner(`Fetching derivatives for ${chalk.cyan(args.token_address)}…`);
|
|
16
|
+
const result = await executeTool("derivatives_analysis", args);
|
|
17
|
+
spinner.stop();
|
|
18
|
+
if (isJsonMode(opts)) {
|
|
19
|
+
printJson(result);
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
console.log(chalk.bold(`\n Derivatives Analysis: ${chalk.cyan(args.token_address)} ${formatDuration(result.durationMs)}\n`));
|
|
23
|
+
formatResult(result.result);
|
|
24
|
+
console.log();
|
|
25
|
+
}));
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=derivatives.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"derivatives.js","sourceRoot":"","sources":["../../src/commands/derivatives.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE3H,MAAM,UAAU,0BAA0B,CAAC,OAAgB;IACzD,MAAM,GAAG,GAAG,OAAO;SAChB,OAAO,CAAC,eAAe,CAAC;SACxB,WAAW,CAAC,kCAAkC,CAAC;SAC/C,MAAM,CAAC,wBAAwB,EAAE,sCAAsC,CAAC,CAAC;IAE5E,aAAa,CAAC,GAAG,CAAC,CAAC;IAEnB,GAAG,CAAC,MAAM,CACR,UAAU,CAAC,KAAK,EAAE,KAAc,EAAE,KAAc,EAAE,EAAE;QAClD,MAAM,IAAI,GAAG,KAAgC,CAAC;QAC9C,MAAM,IAAI,GAA4B;YACpC,aAAa,EAAG,IAAI,CAAC,YAAuB,IAAK,KAAgB;SAClE,CAAC;QAEF,MAAM,OAAO,GAAG,YAAY,CAAC,4BAA4B,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,aAAuB,CAAC,GAAG,CAAC,CAAC;QACtG,MAAM,MAAM,GAAG,MAAM,WAAW,CAAC,sBAAsB,EAAE,IAAI,CAAC,CAAC;QAC/D,OAAO,CAAC,IAAI,EAAE,CAAC;QAEf,IAAI,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;YACrB,SAAS,CAAC,MAAM,CAAC,CAAC;YAClB,OAAO;QACT,CAAC;QAED,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,6BAA6B,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,aAAuB,CAAC,IAAI,cAAc,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC;QACxI,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QAC5B,OAAO,CAAC,GAAG,EAAE,CAAC;IAChB,CAAC,CAAC,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/commands/events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA8B5D"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import chalk from "chalk";
|
|
2
|
+
import { executeTool } from "../api/tools.js";
|
|
3
|
+
import { startSpinner, formatResult, formatDuration, printJson, isJsonMode, wrapAction, addJsonOption } from "../utils.js";
|
|
4
|
+
export function registerEventsCommand(program) {
|
|
5
|
+
const cmd = program
|
|
6
|
+
.command("events <query>")
|
|
7
|
+
.description("Search crypto news and events")
|
|
8
|
+
.option("--time-window <window>", "Time window (e.g. 1d, 7d, 30d)", "7d");
|
|
9
|
+
addJsonOption(cmd);
|
|
10
|
+
cmd.action(wrapAction(async (query, _opts) => {
|
|
11
|
+
const opts = _opts;
|
|
12
|
+
const args = {
|
|
13
|
+
query: query,
|
|
14
|
+
time_window: opts.timeWindow,
|
|
15
|
+
};
|
|
16
|
+
const spinner = startSpinner(`Searching events for "${chalk.cyan(query)}"…`);
|
|
17
|
+
const result = await executeTool("events", args);
|
|
18
|
+
spinner.stop();
|
|
19
|
+
if (isJsonMode(opts)) {
|
|
20
|
+
printJson(result);
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
console.log(chalk.bold(`\n Events: "${chalk.cyan(query)}" ${formatDuration(result.durationMs)}\n`));
|
|
24
|
+
formatResult(result.result);
|
|
25
|
+
console.log();
|
|
26
|
+
}));
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=events.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.js","sourceRoot":"","sources":["../../src/commands/events.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE3H,MAAM,UAAU,qBAAqB,CAAC,OAAgB;IACpD,MAAM,GAAG,GAAG,OAAO;SAChB,OAAO,CAAC,gBAAgB,CAAC;SACzB,WAAW,CAAC,+BAA+B,CAAC;SAC5C,MAAM,CAAC,wBAAwB,EAAE,gCAAgC,EAAE,IAAI,CAAC,CAAC;IAE5E,aAAa,CAAC,GAAG,CAAC,CAAC;IAEnB,GAAG,CAAC,MAAM,CACR,UAAU,CAAC,KAAK,EAAE,KAAc,EAAE,KAAc,EAAE,EAAE;QAClD,MAAM,IAAI,GAAG,KAAgC,CAAC;QAC9C,MAAM,IAAI,GAA4B;YACpC,KAAK,EAAE,KAAe;YACtB,WAAW,EAAE,IAAI,CAAC,UAAoB;SACvC,CAAC;QAEF,MAAM,OAAO,GAAG,YAAY,CAAC,yBAAyB,KAAK,CAAC,IAAI,CAAC,KAAe,CAAC,IAAI,CAAC,CAAC;QACvF,MAAM,MAAM,GAAG,MAAM,WAAW,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;QACjD,OAAO,CAAC,IAAI,EAAE,CAAC;QAEf,IAAI,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;YACrB,SAAS,CAAC,MAAM,CAAC,CAAC;YAClB,OAAO;QACT,CAAC;QAED,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,gBAAgB,KAAK,CAAC,IAAI,CAAC,KAAe,CAAC,KAAK,cAAc,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC;QAC/G,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QAC5B,OAAO,CAAC,GAAG,EAAE,CAAC;IAChB,CAAC,CAAC,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kol.d.ts","sourceRoot":"","sources":["../../src/commands/kol.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMpC,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAgEzD"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import chalk from "chalk";
|
|
2
|
+
import { executeTool } from "../api/tools.js";
|
|
3
|
+
import { startSpinner, formatResult, formatDuration, printJson, isJsonMode, wrapAction, addJsonOption } from "../utils.js";
|
|
4
|
+
import { loadConfig } from "../config.js";
|
|
5
|
+
export function registerKolCommand(program) {
|
|
6
|
+
const kol = program
|
|
7
|
+
.command("kol")
|
|
8
|
+
.description("KOL (Key Opinion Leader) tracking");
|
|
9
|
+
// ── kol leaderboard ──
|
|
10
|
+
const leaderboard = kol.command("leaderboard").description("KOL leaderboard").option("--limit <n>", "Number of results");
|
|
11
|
+
addJsonOption(leaderboard);
|
|
12
|
+
leaderboard.action(wrapAction(async (_opts) => {
|
|
13
|
+
const opts = _opts;
|
|
14
|
+
const config = loadConfig();
|
|
15
|
+
const args = {};
|
|
16
|
+
if (opts.limit)
|
|
17
|
+
args.limit = parseInt(opts.limit, 10);
|
|
18
|
+
else
|
|
19
|
+
args.limit = config.defaultLimit;
|
|
20
|
+
const spinner = startSpinner("Fetching KOL leaderboard…");
|
|
21
|
+
const result = await executeTool("kol_leaderboard", args);
|
|
22
|
+
spinner.stop();
|
|
23
|
+
if (isJsonMode(opts)) {
|
|
24
|
+
printJson(result);
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
console.log(chalk.bold(`\n KOL Leaderboard ${formatDuration(result.durationMs)}\n`));
|
|
28
|
+
formatResult(result.result);
|
|
29
|
+
console.log();
|
|
30
|
+
}));
|
|
31
|
+
// ── kol performance ──
|
|
32
|
+
const performance = kol.command("performance <handle>").description("KOL performance analysis");
|
|
33
|
+
addJsonOption(performance);
|
|
34
|
+
performance.action(wrapAction(async (handle, _opts) => {
|
|
35
|
+
const opts = _opts;
|
|
36
|
+
const args = { handle: handle };
|
|
37
|
+
const spinner = startSpinner(`Analyzing ${chalk.cyan(handle)}…`);
|
|
38
|
+
const result = await executeTool("kol_performance", args);
|
|
39
|
+
spinner.stop();
|
|
40
|
+
if (isJsonMode(opts)) {
|
|
41
|
+
printJson(result);
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
console.log(chalk.bold(`\n KOL Performance: ${chalk.cyan(handle)} ${formatDuration(result.durationMs)}\n`));
|
|
45
|
+
formatResult(result.result);
|
|
46
|
+
console.log();
|
|
47
|
+
}));
|
|
48
|
+
// ── kol search ──
|
|
49
|
+
const search = kol.command("search <query>").description("Search KOL insights");
|
|
50
|
+
addJsonOption(search);
|
|
51
|
+
search.action(wrapAction(async (query, _opts) => {
|
|
52
|
+
const opts = _opts;
|
|
53
|
+
const args = { query: query };
|
|
54
|
+
const spinner = startSpinner(`Searching KOL insights for "${chalk.cyan(query)}"…`);
|
|
55
|
+
const result = await executeTool("kol_rag_search", args);
|
|
56
|
+
spinner.stop();
|
|
57
|
+
if (isJsonMode(opts)) {
|
|
58
|
+
printJson(result);
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
console.log(chalk.bold(`\n KOL Search: "${chalk.cyan(query)}" ${formatDuration(result.durationMs)}\n`));
|
|
62
|
+
formatResult(result.result);
|
|
63
|
+
console.log();
|
|
64
|
+
}));
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=kol.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kol.js","sourceRoot":"","sources":["../../src/commands/kol.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC3H,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,MAAM,UAAU,kBAAkB,CAAC,OAAgB;IACjD,MAAM,GAAG,GAAG,OAAO;SAChB,OAAO,CAAC,KAAK,CAAC;SACd,WAAW,CAAC,mCAAmC,CAAC,CAAC;IAEpD,wBAAwB;IACxB,MAAM,WAAW,GAAG,GAAG,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,WAAW,CAAC,iBAAiB,CAAC,CAAC,MAAM,CAAC,aAAa,EAAE,mBAAmB,CAAC,CAAC;IACzH,aAAa,CAAC,WAAW,CAAC,CAAC;IAC3B,WAAW,CAAC,MAAM,CAChB,UAAU,CAAC,KAAK,EAAE,KAAc,EAAE,EAAE;QAClC,MAAM,IAAI,GAAG,KAAgC,CAAC;QAC9C,MAAM,MAAM,GAAG,UAAU,EAAE,CAAC;QAC5B,MAAM,IAAI,GAA4B,EAAE,CAAC;QACzC,IAAI,IAAI,CAAC,KAAK;YAAE,IAAI,CAAC,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAe,EAAE,EAAE,CAAC,CAAC;;YAC3D,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,YAAY,CAAC;QAEtC,MAAM,OAAO,GAAG,YAAY,CAAC,2BAA2B,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AAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAyBhE"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import chalk from "chalk";
|
|
2
|
+
import { executeTool } from "../api/tools.js";
|
|
3
|
+
import { startSpinner, formatResult, formatDuration, printJson, isJsonMode, wrapAction, addJsonOption } from "../utils.js";
|
|
4
|
+
export function registerMarketInfoCommand(program) {
|
|
5
|
+
const cmd = program
|
|
6
|
+
.command("info <token>")
|
|
7
|
+
.description("Basic market info (ATH, market cap, supply, price)")
|
|
8
|
+
.option("--token-address <addr>", "Token address (overrides positional)");
|
|
9
|
+
addJsonOption(cmd);
|
|
10
|
+
cmd.action(wrapAction(async (token, _opts) => {
|
|
11
|
+
const opts = _opts;
|
|
12
|
+
const args = {
|
|
13
|
+
token_address: opts.tokenAddress ?? token,
|
|
14
|
+
};
|
|
15
|
+
const spinner = startSpinner(`Fetching market info for ${chalk.cyan(args.token_address)}…`);
|
|
16
|
+
const result = await executeTool("basic_market_info", args);
|
|
17
|
+
spinner.stop();
|
|
18
|
+
if (isJsonMode(opts)) {
|
|
19
|
+
printJson(result);
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
console.log(chalk.bold(`\n Market Info: ${chalk.cyan(args.token_address)} ${formatDuration(result.durationMs)}\n`));
|
|
23
|
+
formatResult(result.result);
|
|
24
|
+
console.log();
|
|
25
|
+
}));
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=market-info.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"market-info.js","sourceRoot":"","sources":["../../src/commands/market-info.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,SAAS,EA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