@albalink/agent 1.0.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 +91 -0
- package/bin/albacli +31 -0
- package/dist/api/ExtensionAPI.d.ts +103 -0
- package/dist/api/ExtensionAPI.js +15 -0
- package/dist/api/Registry.d.ts +54 -0
- package/dist/api/Registry.js +103 -0
- package/dist/cli.d.ts +6 -0
- package/dist/cli.js +230 -0
- package/dist/index.d.ts +41 -0
- package/dist/index.js +41 -0
- package/dist/loader.d.ts +16 -0
- package/dist/loader.js +89 -0
- package/dist/mcp/entry.d.ts +2 -0
- package/dist/mcp/entry.js +71 -0
- package/dist/mcp/server.d.ts +31 -0
- package/dist/mcp/server.js +128 -0
- package/dist/models/CostTracker.d.ts +67 -0
- package/dist/models/CostTracker.js +151 -0
- package/dist/models/ModelRegistry.d.ts +159 -0
- package/dist/models/ModelRegistry.js +500 -0
- package/dist/models/index.d.ts +5 -0
- package/dist/models/index.js +3 -0
- package/dist/runner/AgentRunner.d.ts +88 -0
- package/dist/runner/AgentRunner.js +473 -0
- package/dist/runner/ModelClient.d.ts +97 -0
- package/dist/runner/ModelClient.js +350 -0
- package/dist/runner/SwarmRouter.d.ts +64 -0
- package/dist/runner/SwarmRouter.js +216 -0
- package/dist/runner/ToolDispatcher.d.ts +29 -0
- package/dist/runner/ToolDispatcher.js +168 -0
- package/dist/scheduler/AgentScheduler.d.ts +119 -0
- package/dist/scheduler/AgentScheduler.js +263 -0
- package/dist/server-entry.d.ts +11 -0
- package/dist/server-entry.js +15 -0
- package/dist/session/ContextStore.d.ts +96 -0
- package/dist/session/ContextStore.js +207 -0
- package/dist/session/GoalManager.d.ts +101 -0
- package/dist/session/GoalManager.js +167 -0
- package/dist/session/MemoryStore.d.ts +48 -0
- package/dist/session/MemoryStore.js +167 -0
- package/dist/session/SessionManager.d.ts +64 -0
- package/dist/session/SessionManager.js +193 -0
- package/dist/telemetry/Tracer.d.ts +48 -0
- package/dist/telemetry/Tracer.js +102 -0
- package/dist/tools/MarketSentiment.d.ts +166 -0
- package/dist/tools/MarketSentiment.js +209 -0
- package/dist/tools/NewsSentiment.d.ts +67 -0
- package/dist/tools/NewsSentiment.js +226 -0
- package/dist/tools/PriceFeed.d.ts +105 -0
- package/dist/tools/PriceFeed.js +282 -0
- package/dist/tools/TechnicalAnalysis.d.ts +110 -0
- package/dist/tools/TechnicalAnalysis.js +357 -0
- package/dist/tools/index.d.ts +7 -0
- package/dist/tools/index.js +4 -0
- package/dist/tui/App.d.ts +17 -0
- package/dist/tui/App.js +225 -0
- package/dist/tui/ModelSelector.d.ts +12 -0
- package/dist/tui/ModelSelector.js +87 -0
- package/dist/tui/REPL.d.ts +24 -0
- package/dist/tui/REPL.js +51 -0
- package/dist/tui/StatusBar.d.ts +14 -0
- package/dist/tui/StatusBar.js +14 -0
- package/dist/tui/theme.d.ts +30 -0
- package/dist/tui/theme.js +41 -0
- package/dist/util/safeLog.d.ts +3 -0
- package/dist/util/safeLog.js +21 -0
- package/package.json +67 -0
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PriceFeed — real-time price aggregation from CoinGecko and Binance.
|
|
3
|
+
*
|
|
4
|
+
* Provides:
|
|
5
|
+
* - Background polling with configurable intervals
|
|
6
|
+
* - Multi-source aggregation (prioritises Binance for precision, CG for breadth)
|
|
7
|
+
* - 24h change, volume, and market cap tracking
|
|
8
|
+
* - In-memory price cache for tool lookups
|
|
9
|
+
* - Exposed as tools for the AI to query
|
|
10
|
+
*/
|
|
11
|
+
import { Type } from "@sinclair/typebox";
|
|
12
|
+
import { EventEmitter } from "node:events";
|
|
13
|
+
// ── CoinGecko ID map (common symbols) ────────────────────────────────────────
|
|
14
|
+
const SYMBOL_TO_ID = {
|
|
15
|
+
btc: "bitcoin",
|
|
16
|
+
eth: "ethereum",
|
|
17
|
+
sol: "solana",
|
|
18
|
+
bnb: "binancecoin",
|
|
19
|
+
xrp: "ripple",
|
|
20
|
+
ada: "cardano",
|
|
21
|
+
doge: "dogecoin",
|
|
22
|
+
dot: "polkadot",
|
|
23
|
+
matic: "matic-network",
|
|
24
|
+
avax: "avalanche-2",
|
|
25
|
+
link: "chainlink",
|
|
26
|
+
uni: "uniswap",
|
|
27
|
+
atom: "cosmos",
|
|
28
|
+
arb: "arbitrum",
|
|
29
|
+
op: "optimism",
|
|
30
|
+
near: "near",
|
|
31
|
+
apt: "aptos",
|
|
32
|
+
sui: "sui",
|
|
33
|
+
sei: "sei-network",
|
|
34
|
+
inj: "injective-protocol",
|
|
35
|
+
tia: "celestia",
|
|
36
|
+
wld: "worldcoin-wld",
|
|
37
|
+
pepe: "pepe",
|
|
38
|
+
wif: "dogwifcoin",
|
|
39
|
+
bonk: "bonk",
|
|
40
|
+
floki: "floki",
|
|
41
|
+
shib: "shiba-inu",
|
|
42
|
+
aave: "aave",
|
|
43
|
+
mkr: "maker",
|
|
44
|
+
ldo: "lido-dao",
|
|
45
|
+
ens: "ethereum-name-service",
|
|
46
|
+
pendle: "pendle",
|
|
47
|
+
ltc: "litecoin",
|
|
48
|
+
bch: "bitcoin-cash",
|
|
49
|
+
etc: "ethereum-classic",
|
|
50
|
+
fil: "filecoin",
|
|
51
|
+
trx: "tron",
|
|
52
|
+
usdc: "usd-coin",
|
|
53
|
+
usdt: "tether",
|
|
54
|
+
dai: "dai",
|
|
55
|
+
};
|
|
56
|
+
// ── PriceFeed class ──────────────────────────────────────────────────────────
|
|
57
|
+
export class PriceFeed extends EventEmitter {
|
|
58
|
+
prices = new Map();
|
|
59
|
+
pollInterval;
|
|
60
|
+
timer;
|
|
61
|
+
tracking = new Set(["btc", "eth", "sol", "bnb", "matic", "arb", "op", "avax"]);
|
|
62
|
+
constructor(pollIntervalMs = 60_000) {
|
|
63
|
+
super();
|
|
64
|
+
this.pollInterval = pollIntervalMs;
|
|
65
|
+
}
|
|
66
|
+
// ── Lifecycle ────────────────────────────────────────────────────────────
|
|
67
|
+
start() {
|
|
68
|
+
this.fetchAll();
|
|
69
|
+
this.timer = setInterval(() => this.fetchAll(), this.pollInterval);
|
|
70
|
+
}
|
|
71
|
+
stop() {
|
|
72
|
+
if (this.timer) {
|
|
73
|
+
clearInterval(this.timer);
|
|
74
|
+
this.timer = undefined;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
/** Add symbols to track. IDs are auto-resolved from the symbol map. */
|
|
78
|
+
track(...symbols) {
|
|
79
|
+
for (const s of symbols)
|
|
80
|
+
this.tracking.add(s.toLowerCase());
|
|
81
|
+
}
|
|
82
|
+
// ── Fetch ────────────────────────────────────────────────────────────────
|
|
83
|
+
async fetchAll() {
|
|
84
|
+
// #17: Fan-out to Binance (primary) + CoinGecko (secondary)
|
|
85
|
+
// Binance: no rate limits on public endpoints, real-time order book prices
|
|
86
|
+
// CoinGecko: covers long-tail tokens Binance doesn't list, includes market cap
|
|
87
|
+
const [binanceResult, cgResult] = await Promise.allSettled([
|
|
88
|
+
this.fetchBinance(),
|
|
89
|
+
this.fetchCoinGecko(),
|
|
90
|
+
]);
|
|
91
|
+
let updated = false;
|
|
92
|
+
// Binance wins for price precision on listed pairs
|
|
93
|
+
if (binanceResult.status === "fulfilled") {
|
|
94
|
+
for (const tick of binanceResult.value) {
|
|
95
|
+
this.prices.set(tick.symbol.toLowerCase(), tick);
|
|
96
|
+
updated = true;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
// CoinGecko fills gaps (market cap data, unlisted tokens)
|
|
100
|
+
if (cgResult.status === "fulfilled") {
|
|
101
|
+
for (const tick of cgResult.value) {
|
|
102
|
+
const key = tick.symbol.toLowerCase();
|
|
103
|
+
const existing = this.prices.get(key);
|
|
104
|
+
if (!existing) {
|
|
105
|
+
// Token not on Binance — add from CoinGecko
|
|
106
|
+
this.prices.set(key, tick);
|
|
107
|
+
updated = true;
|
|
108
|
+
}
|
|
109
|
+
else if (tick.marketCap > 0) {
|
|
110
|
+
// Enrich Binance tick with market cap from CoinGecko
|
|
111
|
+
existing.marketCap = tick.marketCap;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
if (updated)
|
|
116
|
+
this.emit("prices", [...this.prices.values()]);
|
|
117
|
+
}
|
|
118
|
+
async fetchBinance() {
|
|
119
|
+
// Build list of USDT pairs for tracked symbols
|
|
120
|
+
const pairs = [...this.tracking]
|
|
121
|
+
.map(s => s.toUpperCase() + "USDT")
|
|
122
|
+
.filter(s => !s.startsWith("USDT") && !s.startsWith("DAI")); // skip stablecoins
|
|
123
|
+
if (!pairs.length)
|
|
124
|
+
return [];
|
|
125
|
+
const url = `https://api.binance.com/api/v3/ticker/24hr?symbols=${encodeURIComponent(JSON.stringify(pairs))}`;
|
|
126
|
+
const res = await fetch(url, {
|
|
127
|
+
signal: AbortSignal.timeout(8_000),
|
|
128
|
+
headers: { "User-Agent": "MIO/1.0" },
|
|
129
|
+
});
|
|
130
|
+
if (!res.ok)
|
|
131
|
+
throw new Error(`Binance ticker HTTP ${res.status}`);
|
|
132
|
+
const data = await res.json();
|
|
133
|
+
return data.map(d => ({
|
|
134
|
+
symbol: d.symbol.replace(/USDT$/, ""),
|
|
135
|
+
price: parseFloat(d.lastPrice),
|
|
136
|
+
change24h: parseFloat(d.priceChangePercent),
|
|
137
|
+
volume24h: parseFloat(d.quoteVolume),
|
|
138
|
+
marketCap: 0, // Binance doesn't provide market cap — CoinGecko fills this
|
|
139
|
+
high24h: parseFloat(d.highPrice),
|
|
140
|
+
low24h: parseFloat(d.lowPrice),
|
|
141
|
+
source: "binance",
|
|
142
|
+
timestamp: Date.now(),
|
|
143
|
+
}));
|
|
144
|
+
}
|
|
145
|
+
async fetchCoinGecko() {
|
|
146
|
+
const ids = [...this.tracking]
|
|
147
|
+
.map(s => SYMBOL_TO_ID[s])
|
|
148
|
+
.filter((id) => Boolean(id))
|
|
149
|
+
.join(",");
|
|
150
|
+
if (!ids)
|
|
151
|
+
return [];
|
|
152
|
+
const res = await fetch(`https://api.coingecko.com/api/v3/coins/markets?vs_currency=usd&ids=${ids}&order=market_cap_desc&sparkline=false`, { signal: AbortSignal.timeout(10_000), headers: { "User-Agent": "MIO/1.0" } });
|
|
153
|
+
if (!res.ok)
|
|
154
|
+
throw new Error(`CoinGecko HTTP ${res.status}`);
|
|
155
|
+
const data = await res.json();
|
|
156
|
+
return data.map(coin => ({
|
|
157
|
+
symbol: coin.symbol.toUpperCase(),
|
|
158
|
+
price: coin.current_price,
|
|
159
|
+
change24h: coin.price_change_percentage_24h ?? 0,
|
|
160
|
+
volume24h: coin.total_volume ?? 0,
|
|
161
|
+
marketCap: coin.market_cap ?? 0,
|
|
162
|
+
high24h: coin.high_24h ?? 0,
|
|
163
|
+
low24h: coin.low_24h ?? 0,
|
|
164
|
+
source: "coingecko",
|
|
165
|
+
timestamp: Date.now(),
|
|
166
|
+
}));
|
|
167
|
+
}
|
|
168
|
+
// ── Query ─────────────────────────────────────────────────────────────────
|
|
169
|
+
get(symbol) {
|
|
170
|
+
return this.prices.get(symbol.toLowerCase());
|
|
171
|
+
}
|
|
172
|
+
getMultiple(symbols) {
|
|
173
|
+
return symbols.map(s => this.get(s)).filter(Boolean);
|
|
174
|
+
}
|
|
175
|
+
getAll() {
|
|
176
|
+
return [...this.prices.values()];
|
|
177
|
+
}
|
|
178
|
+
getTopMovers(limit = 5) {
|
|
179
|
+
return [...this.prices.values()]
|
|
180
|
+
.sort((a, b) => Math.abs(b.change24h) - Math.abs(a.change24h))
|
|
181
|
+
.slice(0, limit);
|
|
182
|
+
}
|
|
183
|
+
formatPrice(tick) {
|
|
184
|
+
const changeStr = tick.change24h >= 0
|
|
185
|
+
? `+${tick.change24h.toFixed(2)}%`
|
|
186
|
+
: `${tick.change24h.toFixed(2)}%`;
|
|
187
|
+
const priceStr = tick.price < 1
|
|
188
|
+
? `$${tick.price.toFixed(6)}`
|
|
189
|
+
: tick.price < 100
|
|
190
|
+
? `$${tick.price.toFixed(2)}`
|
|
191
|
+
: `$${tick.price.toLocaleString()}`;
|
|
192
|
+
return `${tick.symbol.padEnd(6)} ${priceStr} ${changeStr}`;
|
|
193
|
+
}
|
|
194
|
+
/** Compact ticker line for the status bar. */
|
|
195
|
+
tickerLine(maxSymbols = 5) {
|
|
196
|
+
return [...this.prices.values()]
|
|
197
|
+
.slice(0, maxSymbols)
|
|
198
|
+
.map(t => {
|
|
199
|
+
const sign = t.change24h >= 0 ? "▲" : "▼";
|
|
200
|
+
const p = t.price < 1 ? t.price.toFixed(4) : t.price.toFixed(0);
|
|
201
|
+
return `${t.symbol} $${p} ${sign}${Math.abs(t.change24h).toFixed(1)}%`;
|
|
202
|
+
})
|
|
203
|
+
.join(" · ");
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
// ── Singleton ─────────────────────────────────────────────────────────────────
|
|
207
|
+
export const priceFeed = new PriceFeed();
|
|
208
|
+
// ── Tool: get_prices ─────────────────────────────────────────────────────────
|
|
209
|
+
export const getPricesParams = Type.Object({
|
|
210
|
+
symbols: Type.Array(Type.String(), { description: "Symbols to fetch (e.g. btc, eth, sol)" }),
|
|
211
|
+
});
|
|
212
|
+
export async function getPricesTool(_id, params) {
|
|
213
|
+
const ticks = priceFeed.getAll();
|
|
214
|
+
if (ticks.length === 0) {
|
|
215
|
+
return {
|
|
216
|
+
content: [{ type: "text", text: "No price data available yet. Please wait for the first price update." }],
|
|
217
|
+
details: {},
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
const requested = params.symbols.map(s => s.toLowerCase());
|
|
221
|
+
const results = ticks.filter(t => requested.includes(t.symbol.toLowerCase()));
|
|
222
|
+
if (results.length === 0) {
|
|
223
|
+
return {
|
|
224
|
+
content: [{ type: "text", text: `No data for: ${params.symbols.join(", ")}. Available: ${ticks.map(t => t.symbol).join(", ")}` }],
|
|
225
|
+
details: {},
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
const text = results.map(t => priceFeed.formatPrice(t)).join("\n");
|
|
229
|
+
return {
|
|
230
|
+
content: [{ type: "text", text }],
|
|
231
|
+
details: results.reduce((acc, t) => {
|
|
232
|
+
acc[t.symbol] = { price: t.price, change24h: t.change24h, volume24h: t.volume24h, marketCap: t.marketCap, source: t.source };
|
|
233
|
+
return acc;
|
|
234
|
+
}, {}),
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
// ── Tool: get_top_movers ─────────────────────────────────────────────────────
|
|
238
|
+
export const topMoversParams = Type.Object({
|
|
239
|
+
limit: Type.Optional(Type.Number({ default: 5, description: "Number of top movers to show" })),
|
|
240
|
+
});
|
|
241
|
+
export async function topMoversTool(_id, params) {
|
|
242
|
+
const movers = priceFeed.getTopMovers(params.limit ?? 5);
|
|
243
|
+
const text = movers.map(t => priceFeed.formatPrice(t)).join("\n");
|
|
244
|
+
return {
|
|
245
|
+
content: [{ type: "text", text: text || "No data available" }],
|
|
246
|
+
details: { count: movers.length },
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
// ── Tool: get_market_overview ────────────────────────────────────────────────
|
|
250
|
+
export const marketOverviewParams = Type.Object({});
|
|
251
|
+
export async function marketOverviewTool() {
|
|
252
|
+
const ticks = priceFeed.getAll();
|
|
253
|
+
if (ticks.length === 0) {
|
|
254
|
+
return {
|
|
255
|
+
content: [{ type: "text", text: "No market data available yet." }],
|
|
256
|
+
details: {},
|
|
257
|
+
};
|
|
258
|
+
}
|
|
259
|
+
const totalCap = ticks.reduce((s, t) => s + t.marketCap, 0);
|
|
260
|
+
const avgChange = ticks.reduce((s, t) => s + t.change24h, 0) / ticks.length;
|
|
261
|
+
const gainers = ticks.filter(t => t.change24h > 0).length;
|
|
262
|
+
const losers = ticks.filter(t => t.change24h < 0).length;
|
|
263
|
+
const text = [
|
|
264
|
+
`Market Overview (${ticks.length} assets tracked)`,
|
|
265
|
+
`Total Market Cap: $${(totalCap / 1e9).toFixed(1)}B`,
|
|
266
|
+
`Avg 24h Change: ${avgChange >= 0 ? "+" : ""}${avgChange.toFixed(2)}%`,
|
|
267
|
+
`Gainers: ${gainers} | Losers: ${losers}`,
|
|
268
|
+
`---`,
|
|
269
|
+
...ticks.slice(0, 10).map(t => priceFeed.formatPrice(t)),
|
|
270
|
+
].join("\n");
|
|
271
|
+
return {
|
|
272
|
+
content: [{ type: "text", text }],
|
|
273
|
+
details: {
|
|
274
|
+
totalMarketCap: totalCap,
|
|
275
|
+
avgChange24h: avgChange,
|
|
276
|
+
gainers,
|
|
277
|
+
losers,
|
|
278
|
+
assets: ticks.length,
|
|
279
|
+
},
|
|
280
|
+
};
|
|
281
|
+
}
|
|
282
|
+
//# sourceMappingURL=PriceFeed.js.map
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Technical Analysis Toolkit — RSI, MACD, EMA, Bollinger Bands,
|
|
3
|
+
* moving averages, volume profile, and signal detection.
|
|
4
|
+
*
|
|
5
|
+
* All calculations are pure math on price arrays — no external API needed.
|
|
6
|
+
* Designed to be exposed as tools the AI can call autonomously.
|
|
7
|
+
*/
|
|
8
|
+
import { type Static } from "@sinclair/typebox";
|
|
9
|
+
export interface OHLCV {
|
|
10
|
+
timestamp: number;
|
|
11
|
+
open: number;
|
|
12
|
+
high: number;
|
|
13
|
+
low: number;
|
|
14
|
+
close: number;
|
|
15
|
+
volume: number;
|
|
16
|
+
}
|
|
17
|
+
export interface AnalysisResult {
|
|
18
|
+
indicator: string;
|
|
19
|
+
value: number | number[];
|
|
20
|
+
signal?: "bullish" | "bearish" | "neutral";
|
|
21
|
+
metadata?: Record<string, unknown>;
|
|
22
|
+
}
|
|
23
|
+
export declare function sma(prices: number[], period: number): number[];
|
|
24
|
+
export declare function ema(prices: number[], period: number): number[];
|
|
25
|
+
export declare function rsi(prices: number[], period?: number): number[];
|
|
26
|
+
export declare function macd(prices: number[], fast?: number, slow?: number, signal?: number): {
|
|
27
|
+
macd: number[];
|
|
28
|
+
signal: number[];
|
|
29
|
+
histogram: number[];
|
|
30
|
+
};
|
|
31
|
+
export declare function bollingerBands(prices: number[], period?: number, deviations?: number): {
|
|
32
|
+
upper: number[];
|
|
33
|
+
middle: number[];
|
|
34
|
+
lower: number[];
|
|
35
|
+
width: number[];
|
|
36
|
+
};
|
|
37
|
+
export declare function atr(highs: number[], lows: number[], closes: number[], period?: number): number[];
|
|
38
|
+
export declare function volumeProfile(volumes: number[], prices: number[], levels?: number): {
|
|
39
|
+
priceRange: string;
|
|
40
|
+
volume: number;
|
|
41
|
+
pct: number;
|
|
42
|
+
}[];
|
|
43
|
+
export declare function detectCrossovers(fast: number[], slow: number[]): {
|
|
44
|
+
type: "golden_cross" | "death_cross" | null;
|
|
45
|
+
index: number;
|
|
46
|
+
};
|
|
47
|
+
export declare function rsiSignal(rsiValues: number[]): AnalysisResult;
|
|
48
|
+
export declare function bollingerSignal(price: number, bands: {
|
|
49
|
+
upper: number[];
|
|
50
|
+
lower: number[];
|
|
51
|
+
}): AnalysisResult;
|
|
52
|
+
export declare function macdSignal(macdData: {
|
|
53
|
+
macd: number[];
|
|
54
|
+
signal: number[];
|
|
55
|
+
histogram: number[];
|
|
56
|
+
}): AnalysisResult;
|
|
57
|
+
export declare function fullAnalysis(ohlcv: OHLCV[]): AnalysisResult[];
|
|
58
|
+
export declare const analyzeTAParams: import("@sinclair/typebox").TObject<{
|
|
59
|
+
prices: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TNumber>;
|
|
60
|
+
highs: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TNumber>>;
|
|
61
|
+
lows: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TNumber>>;
|
|
62
|
+
volumes: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TNumber>>;
|
|
63
|
+
}>;
|
|
64
|
+
export declare const rsiParams: import("@sinclair/typebox").TObject<{
|
|
65
|
+
prices: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TNumber>;
|
|
66
|
+
period: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
|
|
67
|
+
}>;
|
|
68
|
+
export declare const macdParams: import("@sinclair/typebox").TObject<{
|
|
69
|
+
prices: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TNumber>;
|
|
70
|
+
fast: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
|
|
71
|
+
slow: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
|
|
72
|
+
signal: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
|
|
73
|
+
}>;
|
|
74
|
+
export declare const getCandlesParams: import("@sinclair/typebox").TObject<{
|
|
75
|
+
symbol: import("@sinclair/typebox").TString;
|
|
76
|
+
interval: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
77
|
+
limit: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
|
|
78
|
+
analyze: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
79
|
+
}>;
|
|
80
|
+
export declare function getCandlesTool(_id: string, params: Static<typeof getCandlesParams>): Promise<{
|
|
81
|
+
content: {
|
|
82
|
+
type: "text";
|
|
83
|
+
text: string;
|
|
84
|
+
}[];
|
|
85
|
+
details: {
|
|
86
|
+
symbol?: undefined;
|
|
87
|
+
interval?: undefined;
|
|
88
|
+
candleCount?: undefined;
|
|
89
|
+
latest?: undefined;
|
|
90
|
+
priceChangePercent?: undefined;
|
|
91
|
+
};
|
|
92
|
+
} | {
|
|
93
|
+
content: {
|
|
94
|
+
type: "text";
|
|
95
|
+
text: string;
|
|
96
|
+
}[];
|
|
97
|
+
details: {
|
|
98
|
+
symbol: string;
|
|
99
|
+
interval: string;
|
|
100
|
+
candleCount: number;
|
|
101
|
+
latest: {
|
|
102
|
+
close: number;
|
|
103
|
+
high: number;
|
|
104
|
+
low: number;
|
|
105
|
+
volume: number;
|
|
106
|
+
};
|
|
107
|
+
priceChangePercent: number;
|
|
108
|
+
};
|
|
109
|
+
}>;
|
|
110
|
+
//# sourceMappingURL=TechnicalAnalysis.d.ts.map
|