finance-sentiment 1.0.0 → 1.2.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 +18 -9
- package/dist/index.cjs +49 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +191 -14
- package/dist/index.d.ts +191 -14
- package/dist/index.js +49 -9
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# finance-sentiment
|
|
2
2
|
|
|
3
|
-
`finance-sentiment` is the public TypeScript SDK for the [Adanos
|
|
3
|
+
`finance-sentiment` is the public TypeScript SDK for the [Adanos Market Sentiment API](https://api.adanos.org/docs).
|
|
4
4
|
|
|
5
5
|
It gives you typed access to:
|
|
6
6
|
- Reddit stock sentiment
|
|
@@ -44,6 +44,7 @@ console.log(explanation.explanation);
|
|
|
44
44
|
## What You Can Do
|
|
45
45
|
|
|
46
46
|
- Rank trending stocks across Reddit, News, X, and Polymarket
|
|
47
|
+
- Pull service-level market sentiment snapshots across every stock namespace
|
|
47
48
|
- Pull detailed ticker reports for a configurable lookback window
|
|
48
49
|
- Search and compare tickers across datasets
|
|
49
50
|
- Generate AI-written explanations for Reddit and News stock trends
|
|
@@ -70,8 +71,9 @@ const sectors = await client.reddit.trendingSectors({ days: 7, limit: 10 });
|
|
|
70
71
|
const countries = await client.reddit.trendingCountries({ days: 7, limit: 10 });
|
|
71
72
|
const tsla = await client.reddit.stock("TSLA", { days: 14 });
|
|
72
73
|
const explanation = await client.reddit.explain("TSLA");
|
|
73
|
-
const results = await client.reddit.search("Tesla");
|
|
74
|
+
const results = await client.reddit.search("Tesla", { days: 7, limit: 10 });
|
|
74
75
|
const comparison = await client.reddit.compare(["TSLA", "AAPL", "MSFT"], { days: 7 });
|
|
76
|
+
const market = await client.reddit.marketSentiment({ days: 7 });
|
|
75
77
|
```
|
|
76
78
|
|
|
77
79
|
### News
|
|
@@ -86,8 +88,9 @@ const sectors = await client.news.trendingSectors({ days: 7, source: "reuters" }
|
|
|
86
88
|
const countries = await client.news.trendingCountries({ days: 7, source: "reuters" });
|
|
87
89
|
const nvda = await client.news.stock("NVDA", { days: 7 });
|
|
88
90
|
const explanation = await client.news.explain("NVDA");
|
|
89
|
-
const results = await client.news.search("Nvidia");
|
|
91
|
+
const results = await client.news.search("Nvidia", { days: 7, limit: 10 });
|
|
90
92
|
const comparison = await client.news.compare(["NVDA", "AAPL"], { days: 7 });
|
|
93
|
+
const market = await client.news.marketSentiment({ days: 7 });
|
|
91
94
|
const stats = await client.news.stats();
|
|
92
95
|
const health = await client.news.health();
|
|
93
96
|
```
|
|
@@ -103,8 +106,9 @@ const trending = await client.x.trending({ days: 1, limit: 20 });
|
|
|
103
106
|
const sectors = await client.x.trendingSectors({ days: 1, limit: 10 });
|
|
104
107
|
const countries = await client.x.trendingCountries({ days: 1, limit: 10 });
|
|
105
108
|
const nvda = await client.x.stock("NVDA");
|
|
106
|
-
const results = await client.x.search("Nvidia");
|
|
109
|
+
const results = await client.x.search("Nvidia", { days: 7, limit: 10 });
|
|
107
110
|
const comparison = await client.x.compare(["NVDA", "AMD"], { days: 7 });
|
|
111
|
+
const market = await client.x.marketSentiment({ days: 7 });
|
|
108
112
|
```
|
|
109
113
|
|
|
110
114
|
### Polymarket
|
|
@@ -118,8 +122,9 @@ const trending = await client.polymarket.trending({ days: 7, limit: 20, type: "s
|
|
|
118
122
|
const sectors = await client.polymarket.trendingSectors({ days: 7, limit: 10 });
|
|
119
123
|
const countries = await client.polymarket.trendingCountries({ days: 7, limit: 10 });
|
|
120
124
|
const aapl = await client.polymarket.stock("AAPL");
|
|
121
|
-
const results = await client.polymarket.search("Apple");
|
|
125
|
+
const results = await client.polymarket.search("Apple", { days: 7, limit: 10 });
|
|
122
126
|
const comparison = await client.polymarket.compare(["AAPL", "TSLA"], { days: 7 });
|
|
127
|
+
const market = await client.polymarket.marketSentiment({ days: 7 });
|
|
123
128
|
```
|
|
124
129
|
|
|
125
130
|
Polymarket semantics:
|
|
@@ -138,8 +143,9 @@ Polymarket semantics:
|
|
|
138
143
|
| `trendingCountries({ days, limit, offset })` | Trending countries |
|
|
139
144
|
| `stock(ticker, { days })` | Detailed sentiment for a ticker |
|
|
140
145
|
| `explain(ticker)` | AI-generated trend explanation |
|
|
141
|
-
| `search(query)` | Search stocks by name or ticker |
|
|
146
|
+
| `search(query, { days, limit })` | Search stocks by name or ticker with recent-period summaries |
|
|
142
147
|
| `compare(tickers, { days })` | Compare up to 10 stocks |
|
|
148
|
+
| `marketSentiment({ days })` | Service-level Reddit market sentiment snapshot |
|
|
143
149
|
| `stats()` | Dataset statistics |
|
|
144
150
|
| `health()` | Public service health |
|
|
145
151
|
|
|
@@ -152,8 +158,9 @@ Polymarket semantics:
|
|
|
152
158
|
| `trendingCountries({ days, limit, offset, source })` | Trending countries from news |
|
|
153
159
|
| `stock(ticker, { days })` | Detailed news sentiment for a ticker |
|
|
154
160
|
| `explain(ticker)` | AI-generated explanation from news context |
|
|
155
|
-
| `search(query)` | Search stocks in the news dataset |
|
|
161
|
+
| `search(query, { days, limit })` | Search stocks in the news dataset with recent-period summaries |
|
|
156
162
|
| `compare(tickers, { days })` | Compare up to 10 stocks in news |
|
|
163
|
+
| `marketSentiment({ days })` | Service-level News market sentiment snapshot |
|
|
157
164
|
| `stats()` | News dataset statistics |
|
|
158
165
|
| `health()` | Public news service health |
|
|
159
166
|
|
|
@@ -165,8 +172,9 @@ Polymarket semantics:
|
|
|
165
172
|
| `trendingSectors({ days, limit, offset })` | Trending sectors |
|
|
166
173
|
| `trendingCountries({ days, limit, offset })` | Trending countries |
|
|
167
174
|
| `stock(ticker, { days })` | Detailed X/Twitter sentiment |
|
|
168
|
-
| `search(query)` | Search stocks |
|
|
175
|
+
| `search(query, { days, limit })` | Search stocks with recent-period summaries |
|
|
169
176
|
| `compare(tickers, { days })` | Compare stocks |
|
|
177
|
+
| `marketSentiment({ days })` | Service-level X/Twitter market sentiment snapshot |
|
|
170
178
|
| `stats()` | Dataset statistics |
|
|
171
179
|
| `health()` | Public service health |
|
|
172
180
|
|
|
@@ -178,8 +186,9 @@ Polymarket semantics:
|
|
|
178
186
|
| `trendingSectors({ days, limit, offset })` | Trending sectors |
|
|
179
187
|
| `trendingCountries({ days, limit, offset })` | Trending countries |
|
|
180
188
|
| `stock(ticker, { days })` | Detailed Polymarket activity, sentiment, and relevance-sorted market questions |
|
|
181
|
-
| `search(query)` | Search stocks |
|
|
189
|
+
| `search(query, { days, limit })` | Search stocks with recent-period summaries |
|
|
182
190
|
| `compare(tickers, { days })` | Compare stocks with windowed Polymarket activity signals |
|
|
191
|
+
| `marketSentiment({ days })` | Service-level Polymarket market sentiment snapshot |
|
|
183
192
|
| `stats()` | Dataset statistics |
|
|
184
193
|
| `health()` | Public service health |
|
|
185
194
|
|
package/dist/index.cjs
CHANGED
|
@@ -137,8 +137,12 @@ var RedditNamespace = class extends PlatformNamespace {
|
|
|
137
137
|
return this.request(`/stock/${encodeURIComponent(ticker)}/explain`);
|
|
138
138
|
}
|
|
139
139
|
/** Search for stocks by name or ticker. */
|
|
140
|
-
async search(query) {
|
|
141
|
-
return this.request("/search", {
|
|
140
|
+
async search(query, options = {}) {
|
|
141
|
+
return this.request("/search", {
|
|
142
|
+
q: query,
|
|
143
|
+
days: options.days,
|
|
144
|
+
limit: options.limit
|
|
145
|
+
});
|
|
142
146
|
}
|
|
143
147
|
/** Compare multiple stocks side-by-side. */
|
|
144
148
|
async compare(tickers, options = {}) {
|
|
@@ -147,6 +151,12 @@ var RedditNamespace = class extends PlatformNamespace {
|
|
|
147
151
|
days: options.days
|
|
148
152
|
});
|
|
149
153
|
}
|
|
154
|
+
/** Get the service-level Reddit market sentiment snapshot. */
|
|
155
|
+
async marketSentiment(options = {}) {
|
|
156
|
+
return this.request("/market-sentiment", {
|
|
157
|
+
days: options.days
|
|
158
|
+
});
|
|
159
|
+
}
|
|
150
160
|
};
|
|
151
161
|
var NewsNamespace = class extends PlatformNamespace {
|
|
152
162
|
/** @internal */
|
|
@@ -192,8 +202,12 @@ var NewsNamespace = class extends PlatformNamespace {
|
|
|
192
202
|
return this.request(`/stock/${encodeURIComponent(ticker)}/explain`);
|
|
193
203
|
}
|
|
194
204
|
/** Search for stocks by name or ticker in news. */
|
|
195
|
-
async search(query) {
|
|
196
|
-
return this.request("/search", {
|
|
205
|
+
async search(query, options = {}) {
|
|
206
|
+
return this.request("/search", {
|
|
207
|
+
q: query,
|
|
208
|
+
days: options.days,
|
|
209
|
+
limit: options.limit
|
|
210
|
+
});
|
|
197
211
|
}
|
|
198
212
|
/** Compare multiple stocks side-by-side using news sentiment. */
|
|
199
213
|
async compare(tickers, options = {}) {
|
|
@@ -202,6 +216,12 @@ var NewsNamespace = class extends PlatformNamespace {
|
|
|
202
216
|
days: options.days
|
|
203
217
|
});
|
|
204
218
|
}
|
|
219
|
+
/** Get the service-level News market sentiment snapshot. */
|
|
220
|
+
async marketSentiment(options = {}) {
|
|
221
|
+
return this.request("/market-sentiment", {
|
|
222
|
+
days: options.days
|
|
223
|
+
});
|
|
224
|
+
}
|
|
205
225
|
/** Get news data statistics. */
|
|
206
226
|
async stats() {
|
|
207
227
|
return this.request("/stats");
|
|
@@ -248,8 +268,12 @@ var XNamespace = class extends PlatformNamespace {
|
|
|
248
268
|
});
|
|
249
269
|
}
|
|
250
270
|
/** Search for stocks by name or ticker on X/Twitter. */
|
|
251
|
-
async search(query) {
|
|
252
|
-
return this.request("/search", {
|
|
271
|
+
async search(query, options = {}) {
|
|
272
|
+
return this.request("/search", {
|
|
273
|
+
q: query,
|
|
274
|
+
days: options.days,
|
|
275
|
+
limit: options.limit
|
|
276
|
+
});
|
|
253
277
|
}
|
|
254
278
|
/** Compare multiple stocks side-by-side on X/Twitter. */
|
|
255
279
|
async compare(tickers, options = {}) {
|
|
@@ -258,6 +282,12 @@ var XNamespace = class extends PlatformNamespace {
|
|
|
258
282
|
days: options.days
|
|
259
283
|
});
|
|
260
284
|
}
|
|
285
|
+
/** Get the service-level X/Twitter market sentiment snapshot. */
|
|
286
|
+
async marketSentiment(options = {}) {
|
|
287
|
+
return this.request("/market-sentiment", {
|
|
288
|
+
days: options.days
|
|
289
|
+
});
|
|
290
|
+
}
|
|
261
291
|
};
|
|
262
292
|
var PolymarketNamespace = class extends PlatformNamespace {
|
|
263
293
|
/** @internal */
|
|
@@ -296,8 +326,12 @@ var PolymarketNamespace = class extends PlatformNamespace {
|
|
|
296
326
|
});
|
|
297
327
|
}
|
|
298
328
|
/** Search for stocks by name or ticker on Polymarket. */
|
|
299
|
-
async search(query) {
|
|
300
|
-
return this.request("/search", {
|
|
329
|
+
async search(query, options = {}) {
|
|
330
|
+
return this.request("/search", {
|
|
331
|
+
q: query,
|
|
332
|
+
days: options.days,
|
|
333
|
+
limit: options.limit
|
|
334
|
+
});
|
|
301
335
|
}
|
|
302
336
|
/** Compare multiple stocks side-by-side on Polymarket. */
|
|
303
337
|
async compare(tickers, options = {}) {
|
|
@@ -306,6 +340,12 @@ var PolymarketNamespace = class extends PlatformNamespace {
|
|
|
306
340
|
days: options.days
|
|
307
341
|
});
|
|
308
342
|
}
|
|
343
|
+
/** Get the service-level Polymarket market sentiment snapshot. */
|
|
344
|
+
async marketSentiment(options = {}) {
|
|
345
|
+
return this.request("/market-sentiment", {
|
|
346
|
+
days: options.days
|
|
347
|
+
});
|
|
348
|
+
}
|
|
309
349
|
};
|
|
310
350
|
var AdanosClient = class {
|
|
311
351
|
news;
|
|
@@ -313,7 +353,7 @@ var AdanosClient = class {
|
|
|
313
353
|
x;
|
|
314
354
|
polymarket;
|
|
315
355
|
/**
|
|
316
|
-
* Create a new
|
|
356
|
+
* Create a new Adanos Market Sentiment API client.
|
|
317
357
|
*
|
|
318
358
|
* @param options.apiKey - Your API key (`adanos_api_key_here`).
|
|
319
359
|
* @param options.baseUrl - API base URL. Default: `https://api.adanos.org`.
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["/**\n * Adanos Finance Sentiment API — TypeScript SDK\n *\n * Analyze stock sentiment across News, Reddit, X/Twitter, and Polymarket.\n *\n * @example\n * ```ts\n * import { AdanosClient } from 'finance-sentiment';\n *\n * const client = new AdanosClient({ apiKey: 'adanos_api_key_here' });\n * const trending = await client.reddit.trending({ days: 7 });\n * ```\n */\n\n// ── Errors ──────────────────────────────────────────────────────────\n\nexport class StockSentimentError extends Error {\n constructor(message: string) {\n super(message);\n this.name = 'StockSentimentError';\n }\n}\n\nexport class ApiError extends StockSentimentError {\n status: number;\n detail: string;\n\n constructor(status: number, detail: string) {\n super(`${status}: ${detail}`);\n this.name = 'ApiError';\n this.status = status;\n this.detail = detail;\n }\n}\n\n// ── Option types ────────────────────────────────────────────────────\n\nexport interface ClientOptions {\n apiKey: string;\n baseUrl?: string;\n /** Request timeout in milliseconds. Default: 30000 */\n timeout?: number;\n}\n\nexport interface TrendingOptions {\n /** Time period in days (1-90). Free tier limited to 30. */\n days?: number;\n /** Max results (1-100). Default: 20. */\n limit?: number;\n /** Pagination offset. Default: 0. */\n offset?: number;\n /** Filter by \"stock\", \"etf\", \"all\", or undefined for all. */\n type?: string;\n}\n\nexport interface TrendingGroupOptions {\n days?: number;\n limit?: number;\n offset?: number;\n}\n\nexport interface StockOptions {\n /** Time period in days (1-90). Default: 7. */\n days?: number;\n}\n\n/** Alias — compare accepts the same options as a single-stock lookup. */\nexport type CompareOptions = StockOptions;\n\nexport interface NewsSourceOptions {\n /** Optional strict source filter (canonical source id or known alias). */\n source?: string;\n}\n\nexport interface NewsTrendingOptions extends TrendingOptions, NewsSourceOptions {}\nexport interface NewsTrendingGroupOptions extends TrendingGroupOptions, NewsSourceOptions {}\nexport type NewsStockOptions = StockOptions;\nexport type NewsCompareOptions = CompareOptions;\n\n// ── Response types (snake_case — matches API JSON exactly) ──────────\n\n// Reddit response types\n\nexport interface TrendingStock {\n ticker: string;\n buzz_score: number;\n trend: 'rising' | 'falling' | 'stable';\n mentions: number;\n unique_posts: number;\n subreddit_count: number;\n sentiment_score: number;\n bullish_pct: number;\n bearish_pct: number;\n total_upvotes: number;\n company_name?: string | null;\n trend_history?: number[];\n}\n\nexport interface StockSentiment {\n ticker: string;\n found: boolean;\n company_name?: string | null;\n buzz_score?: number | null;\n total_mentions?: number | null;\n sentiment_score?: number | null;\n positive_count?: number | null;\n negative_count?: number | null;\n neutral_count?: number | null;\n total_upvotes?: number | null;\n unique_posts?: number | null;\n subreddit_count?: number | null;\n trend?: 'rising' | 'falling' | 'stable' | null;\n bullish_pct?: number | null;\n bearish_pct?: number | null;\n period_days?: number | null;\n top_subreddits?: SubredditCount[] | null;\n daily_trend?: DailyTrendItem[] | null;\n top_mentions?: TopMention[] | null;\n}\n\nexport interface SubredditCount {\n subreddit: string;\n count: number;\n}\n\nexport interface DailyTrendItem {\n date: string;\n mentions: number;\n sentiment?: number | null;\n buzz_score?: number | null;\n}\n\nexport interface TopMention {\n text_snippet: string;\n sentiment_score: number;\n sentiment_label: string;\n upvotes: number;\n subreddit: string;\n created_utc: string;\n}\n\nexport interface StockExplanationResponse {\n ticker: string;\n company_name?: string | null;\n explanation: string;\n cached: boolean;\n generated_at: string;\n model?: string | null;\n}\n\nexport interface SchedulerStatus {\n running: boolean;\n last_scrape?: string | null;\n scrape_count?: number;\n error_count?: number;\n success_rate?: number | null;\n note?: string | null;\n}\n\nexport interface HealthResponse {\n status: string;\n service?: string | null;\n version?: string | null;\n total_mentions?: number;\n tickers_tracked?: number;\n scheduler?: SchedulerStatus | null;\n error?: string | null;\n}\n\nexport interface StatsResponse {\n total_mentions: number;\n unique_tickers: number;\n tickers: string[];\n supported_tickers: number;\n}\n\nexport interface SearchResponse {\n query: string;\n count: number;\n results: SearchResultItem[];\n}\n\nexport interface SearchResultItem {\n ticker: string;\n name: string;\n type?: string | null;\n exchange?: string | null;\n sector?: string | null;\n country?: string | null;\n aliases?: string[] | null;\n mention_count?: number | null;\n}\n\nexport interface CompareResponse {\n period_days: number;\n stocks: CompareStockItem[];\n}\n\nexport interface CompareStockItem {\n ticker: string;\n company_name?: string | null;\n buzz_score: number;\n mentions: number;\n sentiment?: number | null;\n upvotes: number;\n}\n\ninterface TrendingGroupBase {\n buzz_score: number;\n trend: 'rising' | 'falling' | 'stable';\n mentions: number;\n unique_tickers: number;\n sentiment_score: number;\n bullish_pct: number;\n bearish_pct: number;\n total_upvotes: number;\n top_tickers: string[];\n}\n\nexport interface TrendingSector extends TrendingGroupBase {\n sector: string;\n subreddit_count: number;\n}\n\nexport interface TrendingCountry extends TrendingGroupBase {\n country: string;\n subreddit_count: number;\n}\n\n// News response types\n\nexport interface NewsTrendingStock {\n ticker: string;\n buzz_score: number;\n trend: 'rising' | 'falling' | 'stable';\n mentions: number;\n source_count: number;\n sentiment_score: number;\n bullish_pct: number;\n bearish_pct: number;\n company_name?: string | null;\n trend_history?: number[];\n}\n\nexport interface NewsSourceCount {\n source: string;\n count: number;\n}\n\nexport interface NewsTopMention {\n text_snippet: string;\n sentiment_score: number;\n sentiment_label: string;\n source: string;\n created_utc: string;\n}\n\nexport interface NewsStockSentiment {\n ticker: string;\n found: boolean;\n company_name?: string | null;\n buzz_score?: number | null;\n total_mentions?: number | null;\n sentiment_score?: number | null;\n positive_count?: number | null;\n negative_count?: number | null;\n neutral_count?: number | null;\n source_count?: number | null;\n trend?: 'rising' | 'falling' | 'stable' | null;\n bullish_pct?: number | null;\n bearish_pct?: number | null;\n period_days?: number | null;\n top_sources?: NewsSourceCount[] | null;\n daily_trend?: DailyTrendItem[] | null;\n top_mentions?: NewsTopMention[] | null;\n}\n\ninterface NewsTrendingGroupBase {\n buzz_score: number;\n trend: 'rising' | 'falling' | 'stable';\n mentions: number;\n unique_tickers: number;\n source_count: number;\n sentiment_score: number;\n bullish_pct: number;\n bearish_pct: number;\n top_tickers: string[];\n}\n\nexport interface NewsTrendingSector extends NewsTrendingGroupBase {\n sector: string;\n}\n\nexport interface NewsTrendingCountry extends NewsTrendingGroupBase {\n country: string;\n}\n\nexport interface NewsCompareStockItem {\n ticker: string;\n company_name?: string | null;\n buzz_score: number;\n mentions: number;\n source_count: number;\n sentiment?: number | null;\n}\n\nexport interface NewsCompareResponse {\n period_days: number;\n stocks: NewsCompareStockItem[];\n}\n\n// X/Twitter response types\n\nexport interface XTrendingStock {\n ticker: string;\n buzz_score: number;\n trend: string;\n mentions: number;\n company_name?: string | null;\n sentiment_score?: number | null;\n bullish_pct?: number | null;\n bearish_pct?: number | null;\n total_upvotes?: number | null;\n unique_tweets?: number | null;\n is_validated: boolean;\n trend_history?: number[];\n}\n\nexport interface XStockDetail {\n ticker: string;\n found: boolean;\n company_name?: string | null;\n buzz_score?: number | null;\n total_mentions?: number | null;\n sentiment_score?: number | null;\n positive_count?: number | null;\n negative_count?: number | null;\n neutral_count?: number | null;\n total_upvotes?: number | null;\n unique_tweets?: number | null;\n trend?: 'rising' | 'falling' | 'stable' | null;\n bullish_pct?: number | null;\n bearish_pct?: number | null;\n period_days?: number | null;\n daily_trend?: XDailyTrendItem[] | null;\n top_tweets?: XTopTweet[] | null;\n is_validated: boolean;\n}\n\nexport interface XDailyTrendItem {\n date: string;\n mentions: number;\n sentiment?: number | null;\n avg_rank?: number | null;\n buzz_score?: number | null;\n}\n\nexport interface XTopTweet {\n text_snippet: string;\n sentiment_score?: number | null;\n sentiment_label?: string | null;\n likes: number;\n retweets: number;\n views?: number | null;\n author?: string | null;\n created_at?: string | null;\n}\n\ninterface XTrendingGroupBase {\n buzz_score: number;\n trend: 'rising' | 'falling' | 'stable';\n mentions: number;\n unique_tickers: number;\n unique_authors: number;\n sentiment_score?: number | null;\n bullish_pct?: number | null;\n bearish_pct?: number | null;\n total_upvotes?: number | null;\n top_tickers: string[];\n}\n\nexport interface XTrendingSector extends XTrendingGroupBase {\n sector: string;\n}\n\nexport interface XTrendingCountry extends XTrendingGroupBase {\n country: string;\n}\n\n// Polymarket response types\n\nexport interface PolymarketTrendingStock {\n ticker: string;\n buzz_score: number;\n trend: 'rising' | 'falling' | 'stable';\n trade_count: number;\n market_count: number;\n unique_traders?: number | null;\n bullish_pct: number;\n bearish_pct: number;\n total_liquidity: number;\n company_name?: string | null;\n sentiment_score?: number | null;\n trend_history?: number[];\n}\n\nexport interface PolymarketDailyTrendItem {\n date: string;\n trade_count: number;\n sentiment?: number | null;\n buzz_score?: number | null;\n}\n\nexport interface PolymarketTopMention {\n condition_id: string;\n question: string;\n market_type: string;\n trade_count?: number | null;\n sentiment_score?: number | null;\n yes_price?: number | null;\n no_price?: number | null;\n liquidity: number;\n volume_24h: number;\n end_date?: string | null;\n active: boolean;\n}\n\nexport interface PolymarketStockDetail {\n ticker: string;\n found: boolean;\n company_name?: string | null;\n buzz_score?: number | null;\n trend?: 'rising' | 'falling' | 'stable' | null;\n period_days?: number | null;\n trade_count?: number | null;\n market_count?: number | null;\n unique_traders?: number | null;\n sentiment_score?: number | null;\n positive_count?: number | null;\n negative_count?: number | null;\n neutral_count?: number | null;\n bullish_pct?: number | null;\n bearish_pct?: number | null;\n total_liquidity?: number | null;\n daily_trend?: PolymarketDailyTrendItem[] | null;\n top_mentions?: PolymarketTopMention[] | null;\n}\n\ninterface PolymarketTrendingGroupBase {\n buzz_score: number;\n trend: 'rising' | 'falling' | 'stable';\n trade_count: number;\n market_count: number;\n unique_tickers: number;\n unique_traders?: number | null;\n sentiment_score?: number | null;\n bullish_pct: number;\n bearish_pct: number;\n total_liquidity: number;\n top_tickers: string[];\n}\n\nexport interface PolymarketTrendingSector extends PolymarketTrendingGroupBase {\n sector: string;\n}\n\nexport interface PolymarketTrendingCountry extends PolymarketTrendingGroupBase {\n country: string;\n}\n\nexport interface PolymarketCompareStockItem {\n ticker: string;\n company_name?: string | null;\n buzz_score: number;\n trade_count: number;\n market_count: number;\n unique_traders?: number | null;\n sentiment?: number | null;\n total_liquidity: number;\n}\n\nexport interface PolymarketCompareResponse {\n period_days: number;\n stocks: PolymarketCompareStockItem[];\n}\n\nexport interface PolymarketSearchResultItem {\n ticker: string;\n name: string;\n type?: string | null;\n exchange?: string | null;\n sector?: string | null;\n country?: string | null;\n aliases: string[];\n trade_count: number;\n}\n\nexport interface PolymarketSearchResponse {\n query: string;\n count: number;\n results: PolymarketSearchResultItem[];\n}\n\n// ── Internal HTTP client ────────────────────────────────────────────\n\ntype QueryParams = Record<string, string | number | undefined>;\n\nclass HttpClient {\n private baseUrl: string;\n private apiKey: string;\n private timeout: number;\n\n constructor(baseUrl: string, apiKey: string, timeout: number) {\n this.baseUrl = baseUrl.replace(/\\/+$/, '');\n this.apiKey = apiKey;\n this.timeout = timeout;\n }\n\n async get<T>(path: string, params?: QueryParams): Promise<T> {\n const url = new URL(`${this.baseUrl}${path}`);\n\n if (params) {\n for (const [key, value] of Object.entries(params)) {\n if (value !== undefined) {\n url.searchParams.set(key, String(value));\n }\n }\n }\n\n const response = await fetch(url.toString(), {\n method: 'GET',\n headers: {\n 'X-API-Key': this.apiKey,\n 'Accept': 'application/json',\n },\n signal: AbortSignal.timeout(this.timeout),\n });\n\n if (!response.ok) {\n let detail: string;\n try {\n const body = await response.json();\n detail = body.detail ?? JSON.stringify(body);\n } catch {\n detail = response.statusText || `HTTP ${response.status}`;\n }\n throw new ApiError(response.status, detail);\n }\n\n return response.json() as Promise<T>;\n }\n}\n\n// ── Platform namespaces ─────────────────────────────────────────────\n\nclass PlatformNamespace {\n protected http: HttpClient;\n protected prefix: string;\n\n constructor(http: HttpClient, prefix: string) {\n this.http = http;\n this.prefix = prefix;\n }\n\n protected request<T>(path: string, params?: QueryParams): Promise<T> {\n return this.http.get<T>(`${this.prefix}${path}`, params);\n }\n}\n\nexport class RedditNamespace extends PlatformNamespace {\n /** @internal */\n constructor(http: HttpClient) {\n super(http, '/reddit/stocks/v1');\n }\n\n /** Get trending stocks on Reddit. */\n async trending(options: TrendingOptions = {}): Promise<TrendingStock[]> {\n return this.request('/trending', {\n days: options.days,\n limit: options.limit,\n offset: options.offset,\n type: options.type,\n });\n }\n\n /** Get trending sectors on Reddit. */\n async trendingSectors(options: TrendingGroupOptions = {}): Promise<TrendingSector[]> {\n return this.request('/trending/sectors', {\n days: options.days,\n limit: options.limit,\n offset: options.offset,\n });\n }\n\n /** Get trending countries on Reddit. */\n async trendingCountries(options: TrendingGroupOptions = {}): Promise<TrendingCountry[]> {\n return this.request('/trending/countries', {\n days: options.days,\n limit: options.limit,\n offset: options.offset,\n });\n }\n\n /** Get sentiment for a specific stock ticker. */\n async stock(ticker: string, options: StockOptions = {}): Promise<StockSentiment> {\n return this.request(`/stock/${encodeURIComponent(ticker)}`, {\n days: options.days,\n });\n }\n\n /** Get AI-generated explanation for a stock's trend. */\n async explain(ticker: string): Promise<StockExplanationResponse> {\n return this.request(`/stock/${encodeURIComponent(ticker)}/explain`);\n }\n\n /** Search for stocks by name or ticker. */\n async search(query: string): Promise<SearchResponse> {\n return this.request('/search', { q: query });\n }\n\n /** Compare multiple stocks side-by-side. */\n async compare(tickers: string[], options: CompareOptions = {}): Promise<CompareResponse> {\n return this.request('/compare', {\n tickers: tickers.join(','),\n days: options.days,\n });\n }\n}\n\nexport class NewsNamespace extends PlatformNamespace {\n /** @internal */\n constructor(http: HttpClient) {\n super(http, '/news/stocks/v1');\n }\n\n /** Get trending stocks from news. */\n async trending(options: NewsTrendingOptions = {}): Promise<NewsTrendingStock[]> {\n return this.request('/trending', {\n days: options.days,\n limit: options.limit,\n offset: options.offset,\n type: options.type,\n source: options.source,\n });\n }\n\n /** Get trending sectors from news. */\n async trendingSectors(options: NewsTrendingGroupOptions = {}): Promise<NewsTrendingSector[]> {\n return this.request('/trending/sectors', {\n days: options.days,\n limit: options.limit,\n offset: options.offset,\n source: options.source,\n });\n }\n\n /** Get trending countries from news. */\n async trendingCountries(options: NewsTrendingGroupOptions = {}): Promise<NewsTrendingCountry[]> {\n return this.request('/trending/countries', {\n days: options.days,\n limit: options.limit,\n offset: options.offset,\n source: options.source,\n });\n }\n\n /** Get sentiment for a specific stock ticker from news. */\n async stock(ticker: string, options: StockOptions = {}): Promise<NewsStockSentiment> {\n return this.request(`/stock/${encodeURIComponent(ticker)}`, {\n days: options.days,\n });\n }\n\n /** Get AI-generated explanation for a stock's news trend. */\n async explain(ticker: string): Promise<StockExplanationResponse> {\n return this.request(`/stock/${encodeURIComponent(ticker)}/explain`);\n }\n\n /** Search for stocks by name or ticker in news. */\n async search(query: string): Promise<SearchResponse> {\n return this.request('/search', { q: query });\n }\n\n /** Compare multiple stocks side-by-side using news sentiment. */\n async compare(tickers: string[], options: CompareOptions = {}): Promise<NewsCompareResponse> {\n return this.request('/compare', {\n tickers: tickers.join(','),\n days: options.days,\n });\n }\n\n /** Get news data statistics. */\n async stats(): Promise<StatsResponse> {\n return this.request('/stats');\n }\n\n /** Get public news service health (no auth required on server side). */\n async health(): Promise<HealthResponse> {\n return this.request('/health');\n }\n}\n\nexport class XNamespace extends PlatformNamespace {\n /** @internal */\n constructor(http: HttpClient) {\n super(http, '/x/stocks/v1');\n }\n\n /** Get trending stocks on X/Twitter. */\n async trending(options: TrendingOptions = {}): Promise<XTrendingStock[]> {\n return this.request('/trending', {\n days: options.days,\n limit: options.limit,\n offset: options.offset,\n type: options.type,\n });\n }\n\n /** Get trending sectors on X/Twitter. */\n async trendingSectors(options: TrendingGroupOptions = {}): Promise<XTrendingSector[]> {\n return this.request('/trending/sectors', {\n days: options.days,\n limit: options.limit,\n offset: options.offset,\n });\n }\n\n /** Get trending countries on X/Twitter. */\n async trendingCountries(options: TrendingGroupOptions = {}): Promise<XTrendingCountry[]> {\n return this.request('/trending/countries', {\n days: options.days,\n limit: options.limit,\n offset: options.offset,\n });\n }\n\n /** Get X/Twitter sentiment for a specific stock ticker. */\n async stock(ticker: string, options: StockOptions = {}): Promise<XStockDetail> {\n return this.request(`/stock/${encodeURIComponent(ticker)}`, {\n days: options.days,\n });\n }\n\n /** Search for stocks by name or ticker on X/Twitter. */\n async search(query: string): Promise<SearchResponse> {\n return this.request('/search', { q: query });\n }\n\n /** Compare multiple stocks side-by-side on X/Twitter. */\n async compare(tickers: string[], options: CompareOptions = {}): Promise<CompareResponse> {\n return this.request('/compare', {\n tickers: tickers.join(','),\n days: options.days,\n });\n }\n}\n\nexport class PolymarketNamespace extends PlatformNamespace {\n /** @internal */\n constructor(http: HttpClient) {\n super(http, '/polymarket/stocks/v1');\n }\n\n /** Get trending stocks on Polymarket. */\n async trending(options: TrendingOptions = {}): Promise<PolymarketTrendingStock[]> {\n return this.request('/trending', {\n days: options.days,\n limit: options.limit,\n offset: options.offset,\n type: options.type,\n });\n }\n\n /** Get trending sectors on Polymarket. */\n async trendingSectors(options: TrendingGroupOptions = {}): Promise<PolymarketTrendingSector[]> {\n return this.request('/trending/sectors', {\n days: options.days,\n limit: options.limit,\n offset: options.offset,\n });\n }\n\n /** Get trending countries on Polymarket. */\n async trendingCountries(options: TrendingGroupOptions = {}): Promise<PolymarketTrendingCountry[]> {\n return this.request('/trending/countries', {\n days: options.days,\n limit: options.limit,\n offset: options.offset,\n });\n }\n\n /** Get Polymarket sentiment for a specific stock ticker. */\n async stock(ticker: string, options: StockOptions = {}): Promise<PolymarketStockDetail> {\n return this.request(`/stock/${encodeURIComponent(ticker)}`, {\n days: options.days,\n });\n }\n\n /** Search for stocks by name or ticker on Polymarket. */\n async search(query: string): Promise<PolymarketSearchResponse> {\n return this.request('/search', { q: query });\n }\n\n /** Compare multiple stocks side-by-side on Polymarket. */\n async compare(tickers: string[], options: CompareOptions = {}): Promise<PolymarketCompareResponse> {\n return this.request('/compare', {\n tickers: tickers.join(','),\n days: options.days,\n });\n }\n}\n\n// ── Client ──────────────────────────────────────────────────────────\n\nexport class AdanosClient {\n readonly news: NewsNamespace;\n readonly reddit: RedditNamespace;\n readonly x: XNamespace;\n readonly polymarket: PolymarketNamespace;\n\n /**\n * Create a new Finance Sentiment API client.\n *\n * @param options.apiKey - Your API key (`adanos_api_key_here`).\n * @param options.baseUrl - API base URL. Default: `https://api.adanos.org`.\n * @param options.timeout - Request timeout in ms. Default: 30000.\n */\n constructor(options: ClientOptions) {\n const baseUrl = options.baseUrl ?? 'https://api.adanos.org';\n const timeout = options.timeout ?? 30_000;\n const http = new HttpClient(baseUrl, options.apiKey, timeout);\n\n this.news = new NewsNamespace(http);\n this.reddit = new RedditNamespace(http);\n this.x = new XNamespace(http);\n this.polymarket = new PolymarketNamespace(http);\n }\n}\n\nexport const StockSentimentClient = AdanosClient;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBO,IAAM,sBAAN,cAAkC,MAAM;AAAA,EAC7C,YAAY,SAAiB;AAC3B,UAAM,OAAO;AACb,SAAK,OAAO;AAAA,EACd;AACF;AAEO,IAAM,WAAN,cAAuB,oBAAoB;AAAA,EAChD;AAAA,EACA;AAAA,EAEA,YAAY,QAAgB,QAAgB;AAC1C,UAAM,GAAG,MAAM,KAAK,MAAM,EAAE;AAC5B,SAAK,OAAO;AACZ,SAAK,SAAS;AACd,SAAK,SAAS;AAAA,EAChB;AACF;AA0dA,IAAM,aAAN,MAAiB;AAAA,EACP;AAAA,EACA;AAAA,EACA;AAAA,EAER,YAAY,SAAiB,QAAgB,SAAiB;AAC5D,SAAK,UAAU,QAAQ,QAAQ,QAAQ,EAAE;AACzC,SAAK,SAAS;AACd,SAAK,UAAU;AAAA,EACjB;AAAA,EAEA,MAAM,IAAO,MAAc,QAAkC;AAC3D,UAAM,MAAM,IAAI,IAAI,GAAG,KAAK,OAAO,GAAG,IAAI,EAAE;AAE5C,QAAI,QAAQ;AACV,iBAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,MAAM,GAAG;AACjD,YAAI,UAAU,QAAW;AACvB,cAAI,aAAa,IAAI,KAAK,OAAO,KAAK,CAAC;AAAA,QACzC;AAAA,MACF;AAAA,IACF;AAEA,UAAM,WAAW,MAAM,MAAM,IAAI,SAAS,GAAG;AAAA,MAC3C,QAAQ;AAAA,MACR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,SAAK,aAAa,IAAI,oBAAoB,IAAI;AAAA,EAChD;AACF;AAEO,IAAM,uBAAuB;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["/**\n * Adanos Market Sentiment API — TypeScript SDK\n *\n * Analyze stock sentiment across News, Reddit, X/Twitter, and Polymarket.\n *\n * @example\n * ```ts\n * import { AdanosClient } from 'finance-sentiment';\n *\n * const client = new AdanosClient({ apiKey: 'adanos_api_key_here' });\n * const trending = await client.reddit.trending({ days: 7 });\n * ```\n */\n\n// ── Errors ──────────────────────────────────────────────────────────\n\nexport class StockSentimentError extends Error {\n constructor(message: string) {\n super(message);\n this.name = 'StockSentimentError';\n }\n}\n\nexport class ApiError extends StockSentimentError {\n status: number;\n detail: string;\n\n constructor(status: number, detail: string) {\n super(`${status}: ${detail}`);\n this.name = 'ApiError';\n this.status = status;\n this.detail = detail;\n }\n}\n\n// ── Option types ────────────────────────────────────────────────────\n\nexport interface ClientOptions {\n apiKey: string;\n baseUrl?: string;\n /** Request timeout in milliseconds. Default: 30000 */\n timeout?: number;\n}\n\nexport interface TrendingOptions {\n /** Time period in days (1-90). Free tier limited to 30. */\n days?: number;\n /** Max results (1-100). Default: 20. */\n limit?: number;\n /** Pagination offset. Default: 0. */\n offset?: number;\n /** Filter by \"stock\", \"etf\", \"all\", or undefined for all. */\n type?: string;\n}\n\nexport interface TrendingGroupOptions {\n days?: number;\n limit?: number;\n offset?: number;\n}\n\nexport interface StockOptions {\n /** Time period in days (1-90). Default: 7. */\n days?: number;\n}\n\n/** Alias — compare accepts the same options as a single-stock lookup. */\nexport type CompareOptions = StockOptions;\nexport type SearchOptions = Pick<TrendingGroupOptions, 'days' | 'limit'>;\nexport type MarketSentimentOptions = Pick<TrendingGroupOptions, 'days'>;\n\nexport interface NewsSourceOptions {\n /** Optional strict source filter (canonical source id or known alias). */\n source?: string;\n}\n\nexport interface NewsTrendingOptions extends TrendingOptions, NewsSourceOptions {}\nexport interface NewsTrendingGroupOptions extends TrendingGroupOptions, NewsSourceOptions {}\nexport type NewsStockOptions = StockOptions;\nexport type NewsCompareOptions = CompareOptions;\n\n// ── Response types (snake_case — matches API JSON exactly) ──────────\n\n// Reddit response types\n\nexport interface TrendingStock {\n ticker: string;\n buzz_score: number;\n trend: 'rising' | 'falling' | 'stable';\n mentions: number;\n unique_posts: number;\n subreddit_count: number;\n sentiment_score: number;\n bullish_pct: number;\n bearish_pct: number;\n total_upvotes: number;\n company_name?: string | null;\n trend_history?: number[];\n}\n\nexport interface StockSentiment {\n ticker: string;\n found: boolean;\n company_name?: string | null;\n buzz_score?: number | null;\n mentions?: number | null;\n total_mentions?: number | null;\n sentiment_score?: number | null;\n positive_count?: number | null;\n negative_count?: number | null;\n neutral_count?: number | null;\n total_upvotes?: number | null;\n unique_posts?: number | null;\n subreddit_count?: number | null;\n trend?: 'rising' | 'falling' | 'stable' | null;\n bullish_pct?: number | null;\n bearish_pct?: number | null;\n period_days?: number | null;\n top_subreddits?: SubredditCount[] | null;\n daily_trend?: DailyTrendItem[] | null;\n top_mentions?: TopMention[] | null;\n}\n\nexport interface SubredditCount {\n subreddit: string;\n count: number;\n}\n\nexport interface DailyTrendItem {\n date: string;\n mentions: number;\n sentiment_score?: number | null;\n sentiment?: number | null;\n buzz_score?: number | null;\n}\n\nexport interface TopMention {\n text_snippet: string;\n sentiment_score: number;\n sentiment_label: string;\n upvotes: number;\n subreddit: string;\n created_utc: string;\n}\n\nexport interface StockExplanationResponse {\n ticker: string;\n company_name?: string | null;\n explanation: string;\n cached: boolean;\n generated_at: string;\n model?: string | null;\n}\n\nexport interface SchedulerStatus {\n running: boolean;\n last_scrape?: string | null;\n scrape_count?: number;\n error_count?: number;\n success_rate?: number | null;\n note?: string | null;\n}\n\nexport interface HealthResponse {\n status: string;\n service?: string | null;\n version?: string | null;\n total_mentions?: number;\n tickers_tracked?: number;\n scheduler?: SchedulerStatus | null;\n error?: string | null;\n}\n\nexport interface StatsResponse {\n total_mentions: number;\n unique_tickers: number;\n tickers: string[];\n supported_tickers: number;\n}\n\nexport interface StockSearchSummary {\n mentions: number;\n buzz_score: number;\n trend?: 'rising' | 'falling' | 'stable' | null;\n sentiment_score?: number | null;\n bullish_pct?: number | null;\n bearish_pct?: number | null;\n unique_posts: number;\n subreddit_count: number;\n total_upvotes: number;\n}\n\nexport interface SearchResultItem {\n ticker: string;\n name: string;\n type?: string | null;\n exchange?: string | null;\n sector?: string | null;\n country?: string | null;\n aliases?: string[] | null;\n summary: StockSearchSummary;\n}\n\nexport interface SearchResponse<T = SearchResultItem> {\n query: string;\n count: number;\n period_days: number;\n results: T[];\n}\n\nexport interface CompareResponse {\n period_days: number;\n stocks: CompareStockItem[];\n}\n\nexport interface CompareStockItem {\n ticker: string;\n company_name?: string | null;\n buzz_score: number;\n trend?: 'rising' | 'falling' | 'stable' | null;\n mentions: number;\n unique_posts: number;\n subreddit_count: number;\n sentiment_score?: number | null;\n sentiment?: number | null;\n bullish_pct?: number | null;\n bearish_pct?: number | null;\n total_upvotes: number;\n upvotes?: number | null;\n trend_history: number[];\n}\n\nexport interface MarketSentimentDriver {\n ticker: string;\n buzz_score: number;\n sentiment_score?: number | null;\n mentions: number;\n}\n\nexport interface RedditMarketSentiment {\n buzz_score: number;\n trend?: 'rising' | 'falling' | 'stable' | null;\n mentions: number;\n unique_posts: number;\n subreddit_count: number;\n total_upvotes: number;\n active_tickers: number;\n sentiment_score?: number | null;\n positive_count: number;\n negative_count: number;\n neutral_count: number;\n bullish_pct: number;\n bearish_pct: number;\n trend_history: number[];\n drivers: MarketSentimentDriver[];\n}\n\ninterface TrendingGroupBase {\n buzz_score: number;\n trend: 'rising' | 'falling' | 'stable';\n mentions: number;\n unique_tickers: number;\n sentiment_score: number;\n bullish_pct: number;\n bearish_pct: number;\n total_upvotes: number;\n top_tickers: string[];\n}\n\nexport interface TrendingSector extends TrendingGroupBase {\n sector: string;\n subreddit_count: number;\n}\n\nexport interface TrendingCountry extends TrendingGroupBase {\n country: string;\n subreddit_count: number;\n}\n\n// News response types\n\nexport interface NewsTrendingStock {\n ticker: string;\n buzz_score: number;\n trend: 'rising' | 'falling' | 'stable';\n mentions: number;\n source_count: number;\n sentiment_score: number;\n bullish_pct: number;\n bearish_pct: number;\n company_name?: string | null;\n trend_history?: number[];\n}\n\nexport interface NewsSourceCount {\n source: string;\n count: number;\n}\n\nexport interface NewsTopMention {\n text_snippet: string;\n sentiment_score: number;\n sentiment_label: string;\n source: string;\n created_utc: string;\n}\n\nexport interface NewsSearchSummary {\n mentions: number;\n buzz_score: number;\n trend?: 'rising' | 'falling' | 'stable' | null;\n sentiment_score?: number | null;\n bullish_pct?: number | null;\n bearish_pct?: number | null;\n source_count: number;\n}\n\nexport interface NewsSearchResultItem {\n ticker: string;\n name: string;\n type?: string | null;\n exchange?: string | null;\n sector?: string | null;\n country?: string | null;\n aliases?: string[] | null;\n summary: NewsSearchSummary;\n}\n\nexport interface NewsStockSentiment {\n ticker: string;\n found: boolean;\n company_name?: string | null;\n buzz_score?: number | null;\n mentions?: number | null;\n total_mentions?: number | null;\n sentiment_score?: number | null;\n positive_count?: number | null;\n negative_count?: number | null;\n neutral_count?: number | null;\n source_count?: number | null;\n trend?: 'rising' | 'falling' | 'stable' | null;\n bullish_pct?: number | null;\n bearish_pct?: number | null;\n period_days?: number | null;\n top_sources?: NewsSourceCount[] | null;\n daily_trend?: DailyTrendItem[] | null;\n top_mentions?: NewsTopMention[] | null;\n}\n\ninterface NewsTrendingGroupBase {\n buzz_score: number;\n trend: 'rising' | 'falling' | 'stable';\n mentions: number;\n unique_tickers: number;\n source_count: number;\n sentiment_score: number;\n bullish_pct: number;\n bearish_pct: number;\n top_tickers: string[];\n}\n\nexport interface NewsTrendingSector extends NewsTrendingGroupBase {\n sector: string;\n}\n\nexport interface NewsTrendingCountry extends NewsTrendingGroupBase {\n country: string;\n}\n\nexport interface NewsCompareStockItem {\n ticker: string;\n company_name?: string | null;\n buzz_score: number;\n trend?: 'rising' | 'falling' | 'stable' | null;\n mentions: number;\n source_count: number;\n sentiment_score?: number | null;\n sentiment?: number | null;\n bullish_pct?: number | null;\n bearish_pct?: number | null;\n trend_history: number[];\n}\n\nexport interface NewsCompareResponse {\n period_days: number;\n stocks: NewsCompareStockItem[];\n}\n\nexport interface NewsMarketSentiment {\n buzz_score: number;\n trend?: 'rising' | 'falling' | 'stable' | null;\n mentions: number;\n unique_articles: number;\n source_count: number;\n active_tickers: number;\n sentiment_score?: number | null;\n positive_count: number;\n negative_count: number;\n neutral_count: number;\n bullish_pct: number;\n bearish_pct: number;\n trend_history: number[];\n drivers: MarketSentimentDriver[];\n}\n\n// X/Twitter response types\n\nexport interface XTrendingStock {\n ticker: string;\n buzz_score: number;\n trend: string;\n mentions: number;\n company_name?: string | null;\n sentiment_score?: number | null;\n bullish_pct?: number | null;\n bearish_pct?: number | null;\n total_upvotes?: number | null;\n unique_tweets?: number | null;\n is_validated: boolean;\n trend_history?: number[];\n}\n\nexport interface XStockDetail {\n ticker: string;\n found: boolean;\n company_name?: string | null;\n buzz_score?: number | null;\n mentions?: number | null;\n total_mentions?: number | null;\n sentiment_score?: number | null;\n positive_count?: number | null;\n negative_count?: number | null;\n neutral_count?: number | null;\n total_upvotes?: number | null;\n unique_tweets?: number | null;\n trend?: 'rising' | 'falling' | 'stable' | null;\n bullish_pct?: number | null;\n bearish_pct?: number | null;\n period_days?: number | null;\n daily_trend?: XDailyTrendItem[] | null;\n top_tweets?: XTopTweet[] | null;\n is_validated: boolean;\n}\n\nexport interface XDailyTrendItem {\n date: string;\n mentions: number;\n sentiment_score?: number | null;\n sentiment?: number | null;\n avg_rank?: number | null;\n buzz_score?: number | null;\n}\n\nexport interface XSearchSummary {\n mentions: number;\n buzz_score: number;\n trend?: 'rising' | 'falling' | 'stable' | null;\n sentiment_score?: number | null;\n bullish_pct?: number | null;\n bearish_pct?: number | null;\n unique_tweets: number;\n total_upvotes: number;\n}\n\nexport interface XSearchResultItem {\n ticker: string;\n name: string;\n type?: string | null;\n exchange?: string | null;\n sector?: string | null;\n country?: string | null;\n aliases?: string[] | null;\n summary: XSearchSummary;\n}\n\nexport type XSearchResponse = SearchResponse<XSearchResultItem>;\n\nexport interface XTopTweet {\n text_snippet: string;\n sentiment_score?: number | null;\n sentiment_label?: string | null;\n likes: number;\n retweets: number;\n views?: number | null;\n author?: string | null;\n created_at?: string | null;\n}\n\ninterface XTrendingGroupBase {\n buzz_score: number;\n trend: 'rising' | 'falling' | 'stable';\n mentions: number;\n unique_tickers: number;\n unique_authors: number;\n sentiment_score?: number | null;\n bullish_pct?: number | null;\n bearish_pct?: number | null;\n total_upvotes?: number | null;\n top_tickers: string[];\n}\n\nexport interface XTrendingSector extends XTrendingGroupBase {\n sector: string;\n}\n\nexport interface XTrendingCountry extends XTrendingGroupBase {\n country: string;\n}\n\nexport interface XMarketSentiment {\n buzz_score: number;\n trend?: 'rising' | 'falling' | 'stable' | null;\n mentions: number;\n unique_tweets: number;\n unique_authors: number;\n total_upvotes: number;\n active_tickers: number;\n sentiment_score?: number | null;\n positive_count: number;\n negative_count: number;\n neutral_count: number;\n bullish_pct: number;\n bearish_pct: number;\n trend_history: number[];\n drivers: MarketSentimentDriver[];\n}\n\n// Polymarket response types\n\nexport interface PolymarketTrendingStock {\n ticker: string;\n buzz_score: number;\n trend: 'rising' | 'falling' | 'stable';\n trade_count: number;\n market_count: number;\n unique_traders?: number | null;\n bullish_pct: number;\n bearish_pct: number;\n total_liquidity: number;\n company_name?: string | null;\n sentiment_score?: number | null;\n trend_history?: number[];\n}\n\nexport interface PolymarketDailyTrendItem {\n date: string;\n trade_count: number;\n sentiment_score?: number | null;\n sentiment?: number | null;\n buzz_score?: number | null;\n}\n\nexport interface PolymarketTopMention {\n condition_id: string;\n question: string;\n market_type: string;\n trade_count?: number | null;\n sentiment_score?: number | null;\n yes_price?: number | null;\n no_price?: number | null;\n liquidity: number;\n volume_24h: number;\n end_date?: string | null;\n active: boolean;\n}\n\nexport interface PolymarketStockDetail {\n ticker: string;\n found: boolean;\n company_name?: string | null;\n buzz_score?: number | null;\n trend?: 'rising' | 'falling' | 'stable' | null;\n period_days?: number | null;\n trade_count?: number | null;\n market_count?: number | null;\n unique_traders?: number | null;\n sentiment_score?: number | null;\n positive_count?: number | null;\n negative_count?: number | null;\n neutral_count?: number | null;\n bullish_pct?: number | null;\n bearish_pct?: number | null;\n total_liquidity?: number | null;\n daily_trend?: PolymarketDailyTrendItem[] | null;\n top_mentions?: PolymarketTopMention[] | null;\n}\n\ninterface PolymarketTrendingGroupBase {\n buzz_score: number;\n trend: 'rising' | 'falling' | 'stable';\n trade_count: number;\n market_count: number;\n unique_tickers: number;\n unique_traders?: number | null;\n sentiment_score?: number | null;\n bullish_pct: number;\n bearish_pct: number;\n total_liquidity: number;\n top_tickers: string[];\n}\n\nexport interface PolymarketTrendingSector extends PolymarketTrendingGroupBase {\n sector: string;\n}\n\nexport interface PolymarketTrendingCountry extends PolymarketTrendingGroupBase {\n country: string;\n}\n\nexport interface PolymarketCompareStockItem {\n ticker: string;\n company_name?: string | null;\n buzz_score: number;\n trend?: 'rising' | 'falling' | 'stable' | null;\n trade_count: number;\n market_count: number;\n unique_traders?: number | null;\n sentiment_score?: number | null;\n sentiment?: number | null;\n bullish_pct?: number | null;\n bearish_pct?: number | null;\n total_liquidity: number;\n trend_history: number[];\n}\n\nexport interface PolymarketCompareResponse {\n period_days: number;\n stocks: PolymarketCompareStockItem[];\n}\n\nexport interface PolymarketMarketSentimentDriver {\n ticker: string;\n trade_count: number;\n buzz_score: number;\n sentiment_score?: number | null;\n}\n\nexport interface PolymarketMarketSentiment {\n buzz_score: number;\n trend?: 'rising' | 'falling' | 'stable' | null;\n trade_count: number;\n market_count: number;\n unique_traders: number;\n total_liquidity: number;\n active_tickers: number;\n sentiment_score?: number | null;\n positive_count: number;\n negative_count: number;\n neutral_count: number;\n bullish_pct: number;\n bearish_pct: number;\n trend_history: number[];\n drivers: PolymarketMarketSentimentDriver[];\n}\n\nexport interface PolymarketSearchSummary {\n buzz_score: number;\n trend?: 'rising' | 'falling' | 'stable' | null;\n trade_count: number;\n market_count: number;\n unique_traders?: number | null;\n sentiment_score?: number | null;\n bullish_pct?: number | null;\n bearish_pct?: number | null;\n total_liquidity: number;\n}\n\nexport interface PolymarketSearchResultItem {\n ticker: string;\n name: string;\n type?: string | null;\n exchange?: string | null;\n sector?: string | null;\n country?: string | null;\n aliases: string[];\n summary: PolymarketSearchSummary;\n}\n\nexport interface PolymarketSearchResponse {\n query: string;\n count: number;\n period_days: number;\n results: PolymarketSearchResultItem[];\n}\n\n// ── Internal HTTP client ────────────────────────────────────────────\n\ntype QueryParams = Record<string, string | number | undefined>;\n\nclass HttpClient {\n private baseUrl: string;\n private apiKey: string;\n private timeout: number;\n\n constructor(baseUrl: string, apiKey: string, timeout: number) {\n this.baseUrl = baseUrl.replace(/\\/+$/, '');\n this.apiKey = apiKey;\n this.timeout = timeout;\n }\n\n async get<T>(path: string, params?: QueryParams): Promise<T> {\n const url = new URL(`${this.baseUrl}${path}`);\n\n if (params) {\n for (const [key, value] of Object.entries(params)) {\n if (value !== undefined) {\n url.searchParams.set(key, String(value));\n }\n }\n }\n\n const response = await fetch(url.toString(), {\n method: 'GET',\n headers: {\n 'X-API-Key': this.apiKey,\n 'Accept': 'application/json',\n },\n signal: AbortSignal.timeout(this.timeout),\n });\n\n if (!response.ok) {\n let detail: string;\n try {\n const body = await response.json();\n detail = body.detail ?? JSON.stringify(body);\n } catch {\n detail = response.statusText || `HTTP ${response.status}`;\n }\n throw new ApiError(response.status, detail);\n }\n\n return response.json() as Promise<T>;\n }\n}\n\n// ── Platform namespaces ─────────────────────────────────────────────\n\nclass PlatformNamespace {\n protected http: HttpClient;\n protected prefix: string;\n\n constructor(http: HttpClient, prefix: string) {\n this.http = http;\n this.prefix = prefix;\n }\n\n protected request<T>(path: string, params?: QueryParams): Promise<T> {\n return this.http.get<T>(`${this.prefix}${path}`, params);\n }\n}\n\nexport class RedditNamespace extends PlatformNamespace {\n /** @internal */\n constructor(http: HttpClient) {\n super(http, '/reddit/stocks/v1');\n }\n\n /** Get trending stocks on Reddit. */\n async trending(options: TrendingOptions = {}): Promise<TrendingStock[]> {\n return this.request('/trending', {\n days: options.days,\n limit: options.limit,\n offset: options.offset,\n type: options.type,\n });\n }\n\n /** Get trending sectors on Reddit. */\n async trendingSectors(options: TrendingGroupOptions = {}): Promise<TrendingSector[]> {\n return this.request('/trending/sectors', {\n days: options.days,\n limit: options.limit,\n offset: options.offset,\n });\n }\n\n /** Get trending countries on Reddit. */\n async trendingCountries(options: TrendingGroupOptions = {}): Promise<TrendingCountry[]> {\n return this.request('/trending/countries', {\n days: options.days,\n limit: options.limit,\n offset: options.offset,\n });\n }\n\n /** Get sentiment for a specific stock ticker. */\n async stock(ticker: string, options: StockOptions = {}): Promise<StockSentiment> {\n return this.request(`/stock/${encodeURIComponent(ticker)}`, {\n days: options.days,\n });\n }\n\n /** Get AI-generated explanation for a stock's trend. */\n async explain(ticker: string): Promise<StockExplanationResponse> {\n return this.request(`/stock/${encodeURIComponent(ticker)}/explain`);\n }\n\n /** Search for stocks by name or ticker. */\n async search(query: string, options: SearchOptions = {}): Promise<SearchResponse> {\n return this.request('/search', {\n q: query,\n days: options.days,\n limit: options.limit,\n });\n }\n\n /** Compare multiple stocks side-by-side. */\n async compare(tickers: string[], options: CompareOptions = {}): Promise<CompareResponse> {\n return this.request('/compare', {\n tickers: tickers.join(','),\n days: options.days,\n });\n }\n\n /** Get the service-level Reddit market sentiment snapshot. */\n async marketSentiment(options: MarketSentimentOptions = {}): Promise<RedditMarketSentiment> {\n return this.request('/market-sentiment', {\n days: options.days,\n });\n }\n}\n\nexport class NewsNamespace extends PlatformNamespace {\n /** @internal */\n constructor(http: HttpClient) {\n super(http, '/news/stocks/v1');\n }\n\n /** Get trending stocks from news. */\n async trending(options: NewsTrendingOptions = {}): Promise<NewsTrendingStock[]> {\n return this.request('/trending', {\n days: options.days,\n limit: options.limit,\n offset: options.offset,\n type: options.type,\n source: options.source,\n });\n }\n\n /** Get trending sectors from news. */\n async trendingSectors(options: NewsTrendingGroupOptions = {}): Promise<NewsTrendingSector[]> {\n return this.request('/trending/sectors', {\n days: options.days,\n limit: options.limit,\n offset: options.offset,\n source: options.source,\n });\n }\n\n /** Get trending countries from news. */\n async trendingCountries(options: NewsTrendingGroupOptions = {}): Promise<NewsTrendingCountry[]> {\n return this.request('/trending/countries', {\n days: options.days,\n limit: options.limit,\n offset: options.offset,\n source: options.source,\n });\n }\n\n /** Get sentiment for a specific stock ticker from news. */\n async stock(ticker: string, options: StockOptions = {}): Promise<NewsStockSentiment> {\n return this.request(`/stock/${encodeURIComponent(ticker)}`, {\n days: options.days,\n });\n }\n\n /** Get AI-generated explanation for a stock's news trend. */\n async explain(ticker: string): Promise<StockExplanationResponse> {\n return this.request(`/stock/${encodeURIComponent(ticker)}/explain`);\n }\n\n /** Search for stocks by name or ticker in news. */\n async search(query: string, options: SearchOptions = {}): Promise<SearchResponse<NewsSearchResultItem>> {\n return this.request('/search', {\n q: query,\n days: options.days,\n limit: options.limit,\n });\n }\n\n /** Compare multiple stocks side-by-side using news sentiment. */\n async compare(tickers: string[], options: CompareOptions = {}): Promise<NewsCompareResponse> {\n return this.request('/compare', {\n tickers: tickers.join(','),\n days: options.days,\n });\n }\n\n /** Get the service-level News market sentiment snapshot. */\n async marketSentiment(options: MarketSentimentOptions = {}): Promise<NewsMarketSentiment> {\n return this.request('/market-sentiment', {\n days: options.days,\n });\n }\n\n /** Get news data statistics. */\n async stats(): Promise<StatsResponse> {\n return this.request('/stats');\n }\n\n /** Get public news service health (no auth required on server side). */\n async health(): Promise<HealthResponse> {\n return this.request('/health');\n }\n}\n\nexport class XNamespace extends PlatformNamespace {\n /** @internal */\n constructor(http: HttpClient) {\n super(http, '/x/stocks/v1');\n }\n\n /** Get trending stocks on X/Twitter. */\n async trending(options: TrendingOptions = {}): Promise<XTrendingStock[]> {\n return this.request('/trending', {\n days: options.days,\n limit: options.limit,\n offset: options.offset,\n type: options.type,\n });\n }\n\n /** Get trending sectors on X/Twitter. */\n async trendingSectors(options: TrendingGroupOptions = {}): Promise<XTrendingSector[]> {\n return this.request('/trending/sectors', {\n days: options.days,\n limit: options.limit,\n offset: options.offset,\n });\n }\n\n /** Get trending countries on X/Twitter. */\n async trendingCountries(options: TrendingGroupOptions = {}): Promise<XTrendingCountry[]> {\n return this.request('/trending/countries', {\n days: options.days,\n limit: options.limit,\n offset: options.offset,\n });\n }\n\n /** Get X/Twitter sentiment for a specific stock ticker. */\n async stock(ticker: string, options: StockOptions = {}): Promise<XStockDetail> {\n return this.request(`/stock/${encodeURIComponent(ticker)}`, {\n days: options.days,\n });\n }\n\n /** Search for stocks by name or ticker on X/Twitter. */\n async search(query: string, options: SearchOptions = {}): Promise<XSearchResponse> {\n return this.request('/search', {\n q: query,\n days: options.days,\n limit: options.limit,\n });\n }\n\n /** Compare multiple stocks side-by-side on X/Twitter. */\n async compare(tickers: string[], options: CompareOptions = {}): Promise<CompareResponse> {\n return this.request('/compare', {\n tickers: tickers.join(','),\n days: options.days,\n });\n }\n\n /** Get the service-level X/Twitter market sentiment snapshot. */\n async marketSentiment(options: MarketSentimentOptions = {}): Promise<XMarketSentiment> {\n return this.request('/market-sentiment', {\n days: options.days,\n });\n }\n}\n\nexport class PolymarketNamespace extends PlatformNamespace {\n /** @internal */\n constructor(http: HttpClient) {\n super(http, '/polymarket/stocks/v1');\n }\n\n /** Get trending stocks on Polymarket. */\n async trending(options: TrendingOptions = {}): Promise<PolymarketTrendingStock[]> {\n return this.request('/trending', {\n days: options.days,\n limit: options.limit,\n offset: options.offset,\n type: options.type,\n });\n }\n\n /** Get trending sectors on Polymarket. */\n async trendingSectors(options: TrendingGroupOptions = {}): Promise<PolymarketTrendingSector[]> {\n return this.request('/trending/sectors', {\n days: options.days,\n limit: options.limit,\n offset: options.offset,\n });\n }\n\n /** Get trending countries on Polymarket. */\n async trendingCountries(options: TrendingGroupOptions = {}): Promise<PolymarketTrendingCountry[]> {\n return this.request('/trending/countries', {\n days: options.days,\n limit: options.limit,\n offset: options.offset,\n });\n }\n\n /** Get Polymarket sentiment for a specific stock ticker. */\n async stock(ticker: string, options: StockOptions = {}): Promise<PolymarketStockDetail> {\n return this.request(`/stock/${encodeURIComponent(ticker)}`, {\n days: options.days,\n });\n }\n\n /** Search for stocks by name or ticker on Polymarket. */\n async search(query: string, options: SearchOptions = {}): Promise<PolymarketSearchResponse> {\n return this.request('/search', {\n q: query,\n days: options.days,\n limit: options.limit,\n });\n }\n\n /** Compare multiple stocks side-by-side on Polymarket. */\n async compare(tickers: string[], options: CompareOptions = {}): Promise<PolymarketCompareResponse> {\n return this.request('/compare', {\n tickers: tickers.join(','),\n days: options.days,\n });\n }\n\n /** Get the service-level Polymarket market sentiment snapshot. */\n async marketSentiment(options: MarketSentimentOptions = {}): Promise<PolymarketMarketSentiment> {\n return this.request('/market-sentiment', {\n days: options.days,\n });\n }\n}\n\n// ── Client ──────────────────────────────────────────────────────────\n\nexport class AdanosClient {\n readonly news: NewsNamespace;\n readonly reddit: RedditNamespace;\n readonly x: XNamespace;\n readonly polymarket: PolymarketNamespace;\n\n /**\n * Create a new Adanos Market Sentiment API client.\n *\n * @param options.apiKey - Your API key (`adanos_api_key_here`).\n * @param options.baseUrl - API base URL. Default: `https://api.adanos.org`.\n * @param options.timeout - Request timeout in ms. Default: 30000.\n */\n constructor(options: ClientOptions) {\n const baseUrl = options.baseUrl ?? 'https://api.adanos.org';\n const timeout = options.timeout ?? 30_000;\n const http = new HttpClient(baseUrl, options.apiKey, timeout);\n\n this.news = new NewsNamespace(http);\n this.reddit = new RedditNamespace(http);\n this.x = new XNamespace(http);\n this.polymarket = new PolymarketNamespace(http);\n }\n}\n\nexport const StockSentimentClient = AdanosClient;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBO,IAAM,sBAAN,cAAkC,MAAM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