@surf-ai/sdk 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.
@@ -0,0 +1,3342 @@
1
+ import express from 'express';
2
+
3
+ /**
4
+ * Express server runtime — replaces scaffold server.js + routes/proxy.js.
5
+ *
6
+ * Handles:
7
+ * - /proxy/* passthrough (env-aware: sandbox → OutboundProxy, deployed → hermod)
8
+ * - Auto-loading routes from routes/*.js → /api/{name}
9
+ * - Cron job system from cron.json
10
+ * - DB schema sync on startup
11
+ * - Health check at /api/health
12
+ */
13
+
14
+ interface ServerOptions {
15
+ /** Port to listen on (default: PORT env or 3001) */
16
+ port?: number;
17
+ /** Directory containing route files (default: ./routes) */
18
+ routesDir?: string;
19
+ /** Directory containing cron.json (default: .) */
20
+ cronDir?: string;
21
+ /** Enable /proxy/* passthrough (default: true) */
22
+ proxy?: boolean;
23
+ }
24
+ declare function createServer(options?: ServerOptions): {
25
+ app: express.Express;
26
+ port: number;
27
+ start(): Promise<void>;
28
+ };
29
+
30
+ interface ResponseMeta {
31
+ cached?: boolean;
32
+ credits_used?: number;
33
+ total?: number;
34
+ limit?: number;
35
+ offset?: number;
36
+ }
37
+ interface CursorMeta {
38
+ cached?: boolean;
39
+ credits_used?: number;
40
+ has_more?: boolean;
41
+ next_cursor?: string;
42
+ limit?: number;
43
+ }
44
+ interface ApiResponse<T> {
45
+ data: T[];
46
+ meta?: ResponseMeta;
47
+ }
48
+ interface ApiObjectResponse<T> {
49
+ data: T;
50
+ meta?: ResponseMeta;
51
+ }
52
+ interface ApiCursorResponse<T> {
53
+ data: T[];
54
+ meta?: CursorMeta;
55
+ }
56
+ interface ExchangeDepthItem {
57
+ /** Total ask-side depth in base currency units */
58
+ ask_depth: unknown;
59
+ asks: ExchangeDepthItemAsksItem[];
60
+ /** Total bid-side depth in base currency units */
61
+ bid_depth: unknown;
62
+ bids: ExchangeDepthItemBidsItem[];
63
+ /** Exchange identifier */
64
+ exchange: string;
65
+ /** (best_bid + best_ask) / 2 */
66
+ mid_price: unknown;
67
+ /** Trading pair like BTC/USDT */
68
+ pair: string;
69
+ /** Best ask - best bid */
70
+ spread: unknown;
71
+ /** Spread as percent of mid price */
72
+ spread_pct: unknown;
73
+ }
74
+ interface ExchangeDepthItemAsksItem {
75
+ /** Amount at this level */
76
+ amount: number;
77
+ /** Price level */
78
+ price: number;
79
+ }
80
+ interface ExchangeDepthItemBidsItem {
81
+ /** Amount at this level */
82
+ amount: number;
83
+ /** Price level */
84
+ price: number;
85
+ }
86
+ interface ExchangeDepthParams {
87
+ /** Trading pair (e.g. BTC/USDT) */
88
+ pair?: string;
89
+ /** Market type: spot for spot trading, swap for perpetual contracts — @default 'spot' */
90
+ type?: 'spot' | 'swap';
91
+ /** Number of price levels (1-100) — @default '20' */
92
+ limit?: number;
93
+ /** Exchange identifier — @default 'binance' */
94
+ exchange?: 'binance' | 'okx' | 'bybit' | 'bitget' | 'coinbase' | 'kraken' | 'gate' | 'mexc' | 'upbit' | 'bitstamp' | 'deribit' | 'bitmex' | 'bithumb';
95
+ }
96
+ interface ExchangeFundingHistoryItem {
97
+ /** Exchange identifier */
98
+ exchange: string;
99
+ /** Funding rate at this settlement */
100
+ funding_rate: unknown;
101
+ /** Perpetual contract pair like BTC/USDT */
102
+ pair: string;
103
+ /** Unix timestamp in seconds */
104
+ timestamp: unknown;
105
+ }
106
+ interface ExchangeFundingHistoryParams {
107
+ /** Trading pair (e.g. BTC/USDT) */
108
+ pair?: string;
109
+ /** Start of time range. Accepts Unix seconds or date string (YYYY-MM-DD, ISO8601). Not all exchanges support historical queries; some only return recent data regardless of this value. */
110
+ from?: string;
111
+ /** Max number of records. For longer history, paginate using the last returned timestamp as the next from value. — @default '100' */
112
+ limit?: number;
113
+ /** Exchange identifier — @default 'binance' */
114
+ exchange?: 'binance' | 'okx' | 'bybit' | 'bitget' | 'gate' | 'htx' | 'mexc' | 'bitfinex' | 'bitmex';
115
+ }
116
+ interface ExchangeKlinesItem {
117
+ candles: ExchangeKlinesItemCandlesItem[];
118
+ /** Number of candles */
119
+ count: number;
120
+ /** Exchange identifier */
121
+ exchange: string;
122
+ /** Candle interval */
123
+ interval: string;
124
+ /** Trading pair */
125
+ pair: string;
126
+ /** Last candle datetime */
127
+ period_end: unknown;
128
+ /** Highest price in period */
129
+ period_high: unknown;
130
+ /** Lowest price in period */
131
+ period_low: unknown;
132
+ /** First candle datetime */
133
+ period_start: unknown;
134
+ /** Total volume in period */
135
+ period_volume: unknown;
136
+ }
137
+ interface ExchangeKlinesItemCandlesItem {
138
+ /** Closing price */
139
+ close: number;
140
+ /** Highest price during the interval */
141
+ high: number;
142
+ /** Lowest price during the interval */
143
+ low: number;
144
+ /** Opening price */
145
+ open: number;
146
+ /** Candle open time in Unix seconds */
147
+ timestamp: unknown;
148
+ /** Trading volume in base currency units */
149
+ volume: number;
150
+ }
151
+ interface ExchangeKlinesParams {
152
+ /** Trading pair (e.g. BTC/USDT) */
153
+ pair?: string;
154
+ /** Market type: spot for spot trading, swap for perpetual contracts — @default 'spot' */
155
+ type?: 'spot' | 'swap';
156
+ /** Candle interval — @default '1h' */
157
+ interval?: '1m' | '3m' | '5m' | '15m' | '30m' | '1h' | '2h' | '4h' | '6h' | '8h' | '12h' | '1d' | '3d' | '1w' | '1M';
158
+ /** Start of time range. Accepts Unix seconds or date string (YYYY-MM-DD, ISO8601) */
159
+ from?: string;
160
+ /** Max number of candles to return. Exchange may cap lower (e.g. 200-1000). For longer ranges, paginate using the last returned timestamp as the next from value. — @default '100' */
161
+ limit?: number;
162
+ /** Exchange identifier — @default 'binance' */
163
+ exchange?: 'binance' | 'okx' | 'bybit' | 'bitget' | 'coinbase' | 'kraken' | 'gate' | 'htx' | 'kucoin' | 'mexc' | 'upbit' | 'bitfinex' | 'bitstamp' | 'deribit' | 'bitmex' | 'bithumb';
164
+ }
165
+ interface ExchangeLongShortRatioItem {
166
+ /** Exchange identifier */
167
+ exchange: string;
168
+ /** Ratio of longs to shorts (e.g. 1.5 means 60% long / 40% short). To get percentages: long% = ratio/(ratio+1)*100, short% = 100/(ratio+1) */
169
+ long_short_ratio: unknown;
170
+ /** Perpetual contract pair like BTC/USDT */
171
+ pair: string;
172
+ /** Unix timestamp in seconds */
173
+ timestamp: unknown;
174
+ }
175
+ interface ExchangeLongShortRatioParams {
176
+ /** Trading pair (e.g. BTC/USDT) */
177
+ pair?: string;
178
+ /** Data interval — @default '1h' */
179
+ interval?: '1h' | '4h' | '1d';
180
+ /** Start of time range. Accepts Unix seconds or date string (YYYY-MM-DD, ISO8601). Not all exchanges support historical queries; some only return recent data regardless of this value. */
181
+ from?: string;
182
+ /** Max number of records. For longer history, paginate using the last returned timestamp as the next from value. — @default '50' */
183
+ limit?: number;
184
+ /** Exchange identifier — @default 'binance' */
185
+ exchange?: 'binance' | 'okx' | 'bybit' | 'bitget';
186
+ }
187
+ interface ExchangeMarketsItem {
188
+ /** Whether the market is active */
189
+ active: unknown;
190
+ /** Base currency */
191
+ base: unknown;
192
+ /** Exchange identifier */
193
+ exchange: string;
194
+ /** Default maker fee rate */
195
+ maker_fee: unknown;
196
+ /** Trading pair like BTC/USDT */
197
+ pair: string;
198
+ /** Quote currency */
199
+ quote: unknown;
200
+ /** Default taker fee rate */
201
+ taker_fee: unknown;
202
+ /** Market type: spot, swap, future, option */
203
+ type: unknown;
204
+ }
205
+ interface ExchangeMarketsParams {
206
+ /** Exchange identifier. When omitted, searches across all supported exchanges. */
207
+ exchange?: 'binance' | 'okx' | 'bybit' | 'bitget' | 'coinbase' | 'kraken' | 'gate' | 'htx' | 'kucoin' | 'mexc' | 'upbit' | 'bitfinex' | 'bitstamp' | 'deribit' | 'bitmex' | 'bithumb';
208
+ /** Filter: spot, swap, future, option */
209
+ type?: 'spot' | 'swap' | 'future' | 'option';
210
+ /** Filter by base currency */
211
+ base?: string;
212
+ /** Filter by quote currency */
213
+ quote?: string;
214
+ /** Fuzzy search in pair/base/quote */
215
+ search?: string;
216
+ /** Max results — @default '100' */
217
+ limit?: number;
218
+ }
219
+ interface ExchangePerpData {
220
+ /** Exchange identifier */
221
+ exchange: string;
222
+ funding: ExchangePerpDataFunding;
223
+ open_interest: ExchangePerpDataOpenInterest;
224
+ /** Perpetual contract pair like BTC/USDT */
225
+ pair: string;
226
+ }
227
+ interface ExchangePerpDataFunding {
228
+ /** Exchange identifier */
229
+ exchange: string;
230
+ /** Current funding rate (0.0001 = 0.01%) */
231
+ funding_rate: unknown;
232
+ /** Index price derived from the weighted average of spot prices across multiple exchanges */
233
+ index_price: unknown;
234
+ /** Funding interval like 8h */
235
+ interval: unknown;
236
+ /** Mark price calculated by the exchange from the index price and funding rate, used as the reference for liquidations */
237
+ mark_price: unknown;
238
+ /** Next settlement time ISO8601 */
239
+ next_funding: unknown;
240
+ /** Perpetual contract pair like BTC/USDT */
241
+ pair: string;
242
+ }
243
+ interface ExchangePerpDataOpenInterest {
244
+ /** Exchange identifier */
245
+ exchange: string;
246
+ /** Open interest in contracts */
247
+ open_interest_amount: unknown;
248
+ /** Open interest in USD */
249
+ open_interest_usd: unknown;
250
+ /** Trading pair like BTC/USDT */
251
+ pair: string;
252
+ /** Unix timestamp in seconds */
253
+ timestamp: unknown;
254
+ }
255
+ interface ExchangePerpParams {
256
+ /** Trading pair (e.g. BTC/USDT). The swap suffix ':USDT' is added automatically. */
257
+ pair?: string;
258
+ /** Comma-separated fields to include: 'funding' (current funding rate), 'oi' (open interest). Defaults to all fields. — @default 'funding' */
259
+ fields?: string;
260
+ /** Exchange identifier — @default 'binance' */
261
+ exchange?: 'binance' | 'okx' | 'bybit' | 'bitget' | 'htx' | 'bitfinex' | 'bitmex';
262
+ }
263
+ interface ExchangePriceItem {
264
+ /** Best ask price */
265
+ ask: unknown;
266
+ /** Best bid price */
267
+ bid: unknown;
268
+ /** Price change percentage in 24h */
269
+ change_24h_pct: unknown;
270
+ /** Exchange identifier like binance, okx */
271
+ exchange: string;
272
+ /** 24h high price */
273
+ high_24h: unknown;
274
+ /** Last traded price */
275
+ last: unknown;
276
+ /** 24h low price */
277
+ low_24h: unknown;
278
+ /** Trading pair like BTC/USDT */
279
+ pair: string;
280
+ /** Unix timestamp in seconds */
281
+ timestamp: unknown;
282
+ /** 24h trading volume in base currency units */
283
+ volume_24h_base: unknown;
284
+ }
285
+ interface ExchangePriceParams {
286
+ /** Trading pair (e.g. BTC/USDT) */
287
+ pair?: string;
288
+ /** Market type: spot for spot trading, swap for perpetual contracts — @default 'spot' */
289
+ type?: 'spot' | 'swap';
290
+ /** Exchange identifier — @default 'binance' */
291
+ exchange?: 'binance' | 'okx' | 'bybit' | 'bitget' | 'coinbase' | 'kraken' | 'gate' | 'htx' | 'kucoin' | 'mexc' | 'upbit' | 'bitfinex' | 'bitstamp' | 'deribit' | 'bitmex' | 'bithumb';
292
+ }
293
+ interface FundDetailData {
294
+ /** Fund description */
295
+ description?: string;
296
+ /** Surf fund UUID — pass as 'id' parameter to /fund/detail or /fund/portfolio for exact lookup */
297
+ id: string;
298
+ /** Fund logo URL */
299
+ image?: string;
300
+ /** Total number of unique invested projects (a project with multiple funding rounds counts once) */
301
+ invested_projects_count: number;
302
+ /** Fund jurisdiction */
303
+ jurisdiction?: string;
304
+ links: FundDetailDataLinksItem[];
305
+ members: FundDetailDataMembersItem[];
306
+ /** Fund name */
307
+ name: string;
308
+ recent_researches: FundDetailDataRecentResearchesItem[];
309
+ /** Fund tier ranking (lower is better) */
310
+ tier: number;
311
+ /** Fund type like `VC` or `Accelerator` */
312
+ type?: string;
313
+ x_accounts: FundDetailDataXAccountsItem[];
314
+ }
315
+ interface FundDetailDataLinksItem {
316
+ /** Link type like `web`, `twitter`, or `linkedin` */
317
+ type: string;
318
+ /** Link URL */
319
+ value: string;
320
+ }
321
+ interface FundDetailDataMembersItem {
322
+ /** Avatar URL */
323
+ avatar?: string;
324
+ /** Member name */
325
+ name: string;
326
+ roles: unknown;
327
+ }
328
+ interface FundDetailDataRecentResearchesItem {
329
+ /** Research ID */
330
+ id: string;
331
+ /** Publication date (Unix seconds) */
332
+ published_at: number;
333
+ /** Research title */
334
+ title: string;
335
+ /** Research URL */
336
+ url: string;
337
+ }
338
+ interface FundDetailDataXAccountsItem {
339
+ /** Display name */
340
+ display_name?: string;
341
+ /** Follower count */
342
+ followers_count: number;
343
+ /** X (Twitter) handle without the @ prefix */
344
+ handle: string;
345
+ /** Numeric X (Twitter) user ID */
346
+ id: string;
347
+ /** Profile image URL */
348
+ profile_image?: string;
349
+ }
350
+ interface FundDetailParams {
351
+ /** Surf fund UUID. PREFERRED — always use this when available from a previous response (e.g. id from /search/fund). Takes priority over q. */
352
+ id?: string;
353
+ /** Fuzzy fund name search. Only use when 'id' is not available. May return unexpected results for ambiguous names. */
354
+ q?: string;
355
+ }
356
+ interface FundPortfolioItem {
357
+ /** Investment date (Unix seconds) */
358
+ invested_at?: number;
359
+ /** Whether this fund was the lead investor */
360
+ is_lead: boolean;
361
+ /** Surf project UUID — pass as 'id' parameter to /project/detail, /project/events, or /project/defi/metrics for exact lookup. Prefer over 'q' (fuzzy name search). */
362
+ project_id: string;
363
+ /** Project logo URL */
364
+ project_logo?: string;
365
+ /** Project name */
366
+ project_name: string;
367
+ /** Project slug */
368
+ project_slug?: string;
369
+ /** Most recent funding round amount in USD */
370
+ recent_raise?: number;
371
+ /** Total amount raised by the project in USD */
372
+ total_raise?: number;
373
+ }
374
+ interface FundPortfolioParams {
375
+ /** Surf fund UUID. PREFERRED — always use this when available from a previous response (e.g. id from /search/fund). Takes priority over q. */
376
+ id?: string;
377
+ /** Fuzzy fund name search. Only use when 'id' is not available. May return unexpected results for ambiguous names. */
378
+ q?: string;
379
+ /** Results per page — @default '20' */
380
+ limit?: number;
381
+ /** Pagination offset — @default '0' */
382
+ offset?: number;
383
+ /** Filter by lead investor status. Omit or leave empty for all investments. */
384
+ is_lead?: 'true' | 'false' | '';
385
+ /** Only include investments at or after this Unix timestamp (seconds) */
386
+ invested_after?: number;
387
+ /** Only include investments before this Unix timestamp (seconds) */
388
+ invested_before?: number;
389
+ /** Field to sort results by — @default 'invested_at' */
390
+ sort_by?: 'invested_at' | 'recent_raise' | 'total_raise';
391
+ /** Sort order — @default 'desc' */
392
+ order?: 'asc' | 'desc';
393
+ }
394
+ interface FundRankingItem {
395
+ /** Surf fund UUID — pass as 'id' parameter to /fund/detail or /fund/portfolio for exact lookup */
396
+ id: string;
397
+ /** Fund logo URL */
398
+ image?: string;
399
+ /** Total number of unique invested projects (a project with multiple funding rounds counts once) */
400
+ invested_projects_count: number;
401
+ /** Fund name */
402
+ name: string;
403
+ /** Fund tier ranking (lower is better) */
404
+ tier: number;
405
+ top_projects: FundRankingItemTopProjectsItem[];
406
+ /** Fund type */
407
+ type?: string;
408
+ }
409
+ interface FundRankingItemTopProjectsItem {
410
+ /** Investment date (Unix seconds) */
411
+ invested_at?: number;
412
+ /** Whether this fund was the lead investor */
413
+ is_lead: boolean;
414
+ /** Surf project UUID — pass as 'id' parameter to /project/detail, /project/events, or /project/defi/metrics for exact lookup. Prefer over 'q' (fuzzy name search). */
415
+ project_id: string;
416
+ /** Project logo URL */
417
+ project_logo?: string;
418
+ /** Project name */
419
+ project_name: string;
420
+ /** Project slug */
421
+ project_slug?: string;
422
+ /** Most recent funding round amount in USD */
423
+ recent_raise?: number;
424
+ /** Total amount raised by the project in USD */
425
+ total_raise?: number;
426
+ }
427
+ interface FundRankingParams {
428
+ /** Ranking metric. Can be `tier` (lower is better) or `portfolio_count` (number of invested projects). */
429
+ metric?: 'tier' | 'portfolio_count';
430
+ /** Results per page — @default '20' */
431
+ limit?: number;
432
+ /** Pagination offset — @default '0' */
433
+ offset?: number;
434
+ }
435
+ interface MarketEtfItem {
436
+ etfs?: MarketEtfItemEtfsItem[];
437
+ /** Daily net flow in USD (positive=inflow, negative=outflow) */
438
+ flow_usd: number;
439
+ /** Token price in USD at close of day */
440
+ price_usd: number;
441
+ /** Unix timestamp in seconds (midnight UTC for the trading day) */
442
+ timestamp: number;
443
+ }
444
+ interface MarketEtfItemEtfsItem {
445
+ /** Daily net flow in USD for this ticker */
446
+ flow_usd: number;
447
+ /** ETF ticker symbol like `IBIT`, `GBTC`, or `ETHA` */
448
+ ticker: string;
449
+ }
450
+ interface MarketEtfParams {
451
+ /** Token symbol. Can be `BTC` or `ETH`. */
452
+ symbol?: 'BTC' | 'ETH';
453
+ /** Field to sort results by — @default 'timestamp' */
454
+ sort_by?: 'flow_usd' | 'timestamp';
455
+ /** Sort order — @default 'desc' */
456
+ order?: 'asc' | 'desc';
457
+ /** Start of time range. Accepts Unix seconds or date string (YYYY-MM-DD) */
458
+ from?: string;
459
+ /** End of time range. Accepts Unix seconds or date string (YYYY-MM-DD) */
460
+ to?: string;
461
+ }
462
+ interface MarketFearGreedItem {
463
+ /** Human-readable classification (Extreme Fear, Fear, Neutral, Greed, Extreme Greed) */
464
+ classification: string;
465
+ /** BTC price in USD at this point in time */
466
+ price: number;
467
+ /** Unix timestamp in seconds for this data point */
468
+ timestamp: number;
469
+ /** Fear and Greed Index score from 0 (extreme fear) to 100 (extreme greed) */
470
+ value: number;
471
+ }
472
+ interface MarketFearGreedParams {
473
+ /** Start of time range. Accepts Unix seconds or date string (YYYY-MM-DD) */
474
+ from?: string;
475
+ /** End of time range. Accepts Unix seconds or date string (YYYY-MM-DD) */
476
+ to?: string;
477
+ }
478
+ interface MarketFuturesItem {
479
+ /** Current funding rate as a decimal (`0.0001` = 0.01%) */
480
+ funding_rate: number;
481
+ /** Ratio of long to short positions */
482
+ long_short_ratio: number;
483
+ /** Total open interest in USD */
484
+ open_interest: number;
485
+ /** Trading symbol like `BTC` or `ETH` */
486
+ symbol: string;
487
+ /** Unix timestamp (seconds) of last update */
488
+ updated_at: number;
489
+ /** 24-hour trading volume in USD */
490
+ volume_24h: number;
491
+ /** 24-hour volume change in USD (positive=increase, negative=decrease) */
492
+ volume_change_24h: number;
493
+ }
494
+ interface MarketFuturesParams {
495
+ /** Field to sort results by — @default 'volume_24h' */
496
+ sort_by?: 'open_interest' | 'funding_rate' | 'volume_24h' | 'long_short_ratio';
497
+ /** Sort order — @default 'desc' */
498
+ order?: 'asc' | 'desc';
499
+ }
500
+ interface MarketLiquidationChartItem {
501
+ /** Long-side aggregated liquidation volume (USD) */
502
+ long_liquidation_usd: number;
503
+ /** Short-side aggregated liquidation volume (USD) */
504
+ short_liquidation_usd: number;
505
+ /** Unix timestamp in seconds */
506
+ timestamp: number;
507
+ }
508
+ interface MarketLiquidationChartParams {
509
+ /** Token ticker symbol like `BTC` or `ETH` */
510
+ symbol?: string;
511
+ /** Candlestick interval. Can be `1m`, `3m`, `5m`, `15m`, `30m`, `1h`, `4h`, `6h`, `8h`, `12h`, `1d`, or `1w`. — @default '1h' */
512
+ interval?: '1m' | '3m' | '5m' | '15m' | '30m' | '1h' | '4h' | '6h' | '8h' | '12h' | '1d' | '1w';
513
+ /** Exchange name. Can be `Binance`, `OKX`, `Bybit`, `Bitget`, `Hyperliquid`, `Gate`, `HTX`, `Bitmex`, `Bitfinex`, `CoinEx`, `Aster`, or `Lighter`. — @default 'Binance' */
514
+ exchange?: 'Binance' | 'OKX' | 'Bybit' | 'Bitget' | 'Hyperliquid' | 'Gate' | 'HTX' | 'Bitmex' | 'Bitfinex' | 'CoinEx' | 'Aster' | 'Lighter';
515
+ /** Results per page — @default '500' */
516
+ limit?: number;
517
+ /** Start of time range. Accepts Unix seconds (`1704067200`) or date string (`2024-01-01`) */
518
+ from?: string;
519
+ /** End of time range. Accepts Unix seconds (`1706745600`) or date string (`2024-02-01`) */
520
+ to?: string;
521
+ }
522
+ interface MarketLiquidationExchangeListItem {
523
+ /** Exchange name like `Binance` or `OKX`. `All` = aggregate across all exchanges */
524
+ exchange: string;
525
+ /** Total liquidation volume (USD) */
526
+ liquidation_usd: number;
527
+ /** Long-side liquidation volume (USD) */
528
+ long_liquidation_usd: number;
529
+ /** Short-side liquidation volume (USD) */
530
+ short_liquidation_usd: number;
531
+ }
532
+ interface MarketLiquidationExchangeListParams {
533
+ /** Token ticker symbol like `BTC` or `ETH` — @default 'BTC' */
534
+ symbol?: string;
535
+ /** Aggregation time range. Can be `1h`, `4h`, `12h`, or `24h`. — @default '24h' */
536
+ time_range?: '1h' | '4h' | '12h' | '24h';
537
+ /** Field to sort results by — @default 'liquidation_usd' */
538
+ sort_by?: 'liquidation_usd' | 'long_liquidation_usd' | 'short_liquidation_usd';
539
+ /** Sort order — @default 'desc' */
540
+ order?: 'asc' | 'desc';
541
+ }
542
+ interface MarketLiquidationOrderItem {
543
+ /** Base token symbol like `BTC` */
544
+ base_asset: string;
545
+ /** Exchange name like `Binance` or `OKX` */
546
+ exchange: string;
547
+ /** Liquidation execution price (USD) */
548
+ price: number;
549
+ /** Liquidation side: `long` or `short` */
550
+ side: string;
551
+ /** Full trading pair like `BTCUSDT` */
552
+ symbol: string;
553
+ /** Unix timestamp in seconds */
554
+ timestamp: number;
555
+ /** Liquidated position size (USD) */
556
+ usd_value: number;
557
+ }
558
+ interface MarketLiquidationOrderParams {
559
+ /** Exchange name. Can be `Binance`, `OKX`, `Bybit`, `Bitget`, `Hyperliquid`, `Gate`, `HTX`, `Bitmex`, `Bitfinex`, `CoinEx`, `Aster`, or `Lighter`. — @default 'Binance' */
560
+ exchange?: 'Binance' | 'OKX' | 'Bybit' | 'Bitget' | 'Hyperliquid' | 'Gate' | 'HTX' | 'Bitmex' | 'Bitfinex' | 'CoinEx' | 'Aster' | 'Lighter';
561
+ /** Token ticker symbol like `BTC` or `ETH` — @default 'BTC' */
562
+ symbol?: string;
563
+ /** Minimum liquidation amount in USD — @default '10000' */
564
+ min_amount?: string;
565
+ /** Filter by liquidation side. Omit to return both. */
566
+ side?: 'long' | 'short';
567
+ /** Field to sort results by — @default 'timestamp' */
568
+ sort_by?: 'usd_value' | 'timestamp' | 'price';
569
+ /** Sort order — @default 'desc' */
570
+ order?: 'asc' | 'desc';
571
+ /** Start of time range. Accepts Unix seconds (`1704067200`) or date string (`2024-01-01`) */
572
+ from?: string;
573
+ /** End of time range. Accepts Unix seconds (`1706745600`) or date string (`2024-02-01`) */
574
+ to?: string;
575
+ }
576
+ interface MarketOnchainIndicatorItem {
577
+ /** Metric name like `nupl`, `sopr`, or `price` */
578
+ metric?: string;
579
+ /** Token symbol this data point belongs to */
580
+ symbol?: string;
581
+ /** Unix timestamp in seconds for this data point */
582
+ timestamp: number;
583
+ /** Metric value at this timestamp */
584
+ value: number;
585
+ }
586
+ interface MarketOnchainIndicatorParams {
587
+ /** Token ticker symbol. Can be `BTC` or `ETH`. */
588
+ symbol?: 'BTC' | 'ETH';
589
+ /** On-chain metric name. Can be `nupl`, `sopr`, `mvrv`, `puell-multiple`, `nvm`, `nvt`, `nvt-golden-cross`, or `exchange-flows/{inflow,outflow,netflow,reserve}`. */
590
+ metric?: 'nupl' | 'sopr' | 'mvrv' | 'puell-multiple' | 'nvm' | 'nvt' | 'nvt-golden-cross' | 'exchange-flows/inflow' | 'exchange-flows/outflow' | 'exchange-flows/netflow' | 'exchange-flows/reserve';
591
+ /** Aggregation granularity. — @default 'day' */
592
+ granularity?: 'day';
593
+ /** Start of time range. Accepts Unix seconds or date string (YYYY-MM-DD). Defaults to 90 days ago when omitted. Maximum range is 365 days. */
594
+ from?: string;
595
+ /** End of time range. Accepts Unix seconds or date string (YYYY-MM-DD). Defaults to today when omitted. Maximum range is 365 days. */
596
+ to?: string;
597
+ /** Exchange filter (only applies to exchange-flow metrics). Can be `all_exchange`, `spot_exchange`, `derivative_exchange`, `binance`, `bybit`, `kraken`, or `okx`. — @default 'all_exchange' */
598
+ exchange?: 'all_exchange' | 'spot_exchange' | 'derivative_exchange' | 'binance' | 'bybit' | 'kraken' | 'okx';
599
+ }
600
+ interface MarketOptionsItem {
601
+ /** Options exchange name */
602
+ exchange: string;
603
+ /** Max pain price for the nearest expiry in USD. Only available for individual exchanges (Deribit, OKX, Binance, Bybit), not present on the `All` aggregate row. */
604
+ max_pain_price?: number;
605
+ /** Total options open interest in USD */
606
+ open_interest: number;
607
+ /** Put/call open interest ratio (put OI / call OI). Values above 1 indicate bearish sentiment. Only available for individual exchanges (Deribit, OKX, Binance, Bybit), not present on the `All` aggregate row. */
608
+ put_call_ratio?: number;
609
+ /** Underlying token symbol like `BTC` or `ETH` */
610
+ symbol: string;
611
+ /** Unix timestamp (seconds) of last update */
612
+ updated_at: number;
613
+ /** 24-hour options trading volume in USD */
614
+ volume_24h: number;
615
+ }
616
+ interface MarketOptionsParams {
617
+ /** Token symbol. Can be `BTC`, `ETH`, `SOL`, `XRP`, `BNB`, `DOGE`, `ADA`, or `AVAX`. */
618
+ symbol?: 'BTC' | 'ETH' | 'SOL' | 'XRP' | 'BNB' | 'DOGE' | 'ADA' | 'AVAX';
619
+ /** Field to sort results by — @default 'volume_24h' */
620
+ sort_by?: 'open_interest' | 'volume_24h';
621
+ /** Sort order — @default 'desc' */
622
+ order?: 'asc' | 'desc';
623
+ }
624
+ interface MarketPriceItem {
625
+ /** Metric name like `nupl`, `sopr`, or `price` */
626
+ metric?: string;
627
+ /** Token symbol this data point belongs to */
628
+ symbol?: string;
629
+ /** Unix timestamp in seconds for this data point */
630
+ timestamp: number;
631
+ /** Metric value at this timestamp */
632
+ value: number;
633
+ }
634
+ interface MarketPriceParams {
635
+ /** Single token ticker symbol like `BTC`, `ETH`, or `SOL` (multi-symbol not supported) */
636
+ symbol?: string;
637
+ /** Predefined time range for historical data. Ignored when `from`/`to` are set. Can be `1d`, `7d`, `14d`, `30d`, `90d`, `180d`, `365d`, or `max`. — @default '30d' */
638
+ time_range?: '1d' | '7d' | '14d' | '30d' | '90d' | '180d' | '365d' | 'max';
639
+ /** Start of custom date range (Unix timestamp or YYYY-MM-DD). Must be used together with `to`. Overrides `time_range` when set. */
640
+ from?: string;
641
+ /** End of custom date range (Unix timestamp or YYYY-MM-DD). Must be used together with `from`. Overrides `time_range` when set. */
642
+ to?: string;
643
+ /** Quote currency like `usd`, `eur`, or `btc` — @default 'usd' */
644
+ currency?: string;
645
+ }
646
+ interface MarketPriceIndicatorItem {
647
+ /** Time interval used to compute the indicator like `1h`, `4h`, or `1d` */
648
+ interval: string;
649
+ /** Indicator name like `rsi`, `macd`, or `bbands` */
650
+ name: string;
651
+ /** Token symbol this indicator is computed for */
652
+ symbol: string;
653
+ /** Candle open timestamp in Unix seconds (present in time-series responses) */
654
+ timestamp?: number;
655
+ /** Unix timestamp in seconds when the indicator was last computed */
656
+ updated_at?: number;
657
+ /** Primary indicator value */
658
+ value: number;
659
+ values?: MarketPriceIndicatorItemValues;
660
+ }
661
+ interface MarketPriceIndicatorItemValues {
662
+ /** Bollinger lower band */
663
+ bbands_lower?: number;
664
+ /** Bollinger middle band (SMA) */
665
+ bbands_middle?: number;
666
+ /** Bollinger upper band */
667
+ bbands_upper?: number;
668
+ /** Average Directional Index value */
669
+ dmi_adx?: number;
670
+ /** Negative Directional Indicator (-DI) */
671
+ dmi_mdi?: number;
672
+ /** Positive Directional Indicator (+DI) */
673
+ dmi_pdi?: number;
674
+ /** Ichimoku baseline (Kijun-sen) */
675
+ ichimoku_base?: number;
676
+ /** Ichimoku conversion line (Tenkan-sen) */
677
+ ichimoku_conversion?: number;
678
+ /** Ichimoku current span A */
679
+ ichimoku_current_span_a?: number;
680
+ /** Ichimoku current span B */
681
+ ichimoku_current_span_b?: number;
682
+ /** Ichimoku lagging span A */
683
+ ichimoku_lagging_span_a?: number;
684
+ /** Ichimoku lagging span B */
685
+ ichimoku_lagging_span_b?: number;
686
+ /** Ichimoku leading span A (Senkou A) */
687
+ ichimoku_span_a?: number;
688
+ /** Ichimoku leading span B (Senkou B) */
689
+ ichimoku_span_b?: number;
690
+ /** MACD histogram (MACD minus signal) */
691
+ macd_hist?: number;
692
+ /** MACD signal line */
693
+ macd_signal?: number;
694
+ /** MACD line value */
695
+ macd_value?: number;
696
+ /** Stochastic %D (slow line) */
697
+ stoch_d?: number;
698
+ /** Stochastic %K (fast line) */
699
+ stoch_k?: number;
700
+ /** Supertrend direction: `buy` (price above supertrend, bullish) or `sell` (price below supertrend, bearish) */
701
+ supertrend_advice?: string;
702
+ /** Supertrend line value */
703
+ supertrend_value?: number;
704
+ }
705
+ interface MarketPriceIndicatorParams {
706
+ /** Technical indicator name. Can be `rsi`, `macd`, `ema`, `sma`, `bbands`, `stoch`, `adx`, `atr`, `cci`, `obv`, `vwap`, `dmi`, `ichimoku`, or `supertrend`. */
707
+ indicator?: 'rsi' | 'macd' | 'ema' | 'sma' | 'bbands' | 'stoch' | 'adx' | 'atr' | 'cci' | 'obv' | 'vwap' | 'dmi' | 'ichimoku' | 'supertrend';
708
+ /** Trading pair as `BTC/USDT` or bare symbol like `BTC` */
709
+ symbol?: string;
710
+ /** Candlestick interval. Can be `1m`, `5m`, `15m`, `30m`, `1h`, `2h`, `4h`, `12h`, `1d`, or `1w`. — @default '1d' */
711
+ interval?: '1m' | '5m' | '15m' | '30m' | '1h' | '2h' | '4h' | '12h' | '1d' | '1w';
712
+ /** Exchange for price data. Can be `binance`, `bybit`, `coinbase`, or `kraken`. — @default 'binance' */
713
+ exchange?: 'binance' | 'bybit' | 'coinbase' | 'kraken';
714
+ /** Start of time range. When set, returns time-series instead of latest value. Accepts Unix seconds (`1704067200`) or date string (`2024-01-01`) */
715
+ from?: string;
716
+ /** End of time range. Defaults to now when from is set. Accepts Unix seconds (`1706745600`) or date string (`2024-02-01`) */
717
+ to?: string;
718
+ /** Indicator-specific options as comma-separated key:value pairs. Available options by indicator: `period` — lookback period for rsi (default 14), sma (default 20), ema (default 20), bbands (default 20), adx (default 14), atr (default 14), cci (default 20), dmi (default 14), stoch (default 14), supertrend (default 10). `stddev` — standard deviation for bbands (default 2). `multiplier` — multiplier for supertrend (default 3). `fast_period` — MACD fast EMA (default 12). `slow_period` — MACD slow EMA (default 26). `signal_period` — MACD signal smoothing (default 9). Examples: `period:7`, `period:200`, `fast_period:8,slow_period:21,signal_period:5`, `period:10,stddev:1.5`. */
719
+ options?: string;
720
+ }
721
+ interface MarketRankingItem {
722
+ /** All-time high price in USD */
723
+ ath?: number;
724
+ /** All-time low price in USD */
725
+ atl?: number;
726
+ /** Price change percentage over the last 24 hours */
727
+ change_24h_pct: number;
728
+ /** Circulating token supply */
729
+ circulating_supply?: number;
730
+ /** Fully diluted valuation in USD */
731
+ fdv?: number;
732
+ /** Highest price in the last 24 hours in USD */
733
+ high_24h: number;
734
+ /** Token logo image URL */
735
+ image?: string;
736
+ /** Lowest price in the last 24 hours in USD */
737
+ low_24h: number;
738
+ /** Total market capitalization in USD */
739
+ market_cap_usd: number;
740
+ /** Maximum token supply (e.g. 21M for BTC). Not available for all tokens. */
741
+ max_supply?: number;
742
+ /** Full token name */
743
+ name: string;
744
+ /** Current price in USD */
745
+ price_usd: number;
746
+ /** Rank position in the list (1 = highest) */
747
+ rank: number;
748
+ /** Token ticker symbol like `BTC` or `ETH` */
749
+ symbol: string;
750
+ /** Total token supply */
751
+ total_supply?: number;
752
+ /** 24-hour trading volume in USD */
753
+ volume_24h_usd: number;
754
+ }
755
+ interface MarketRankingParams {
756
+ /** Field to sort by. `market_cap` sorts by total market capitalisation, `change_24h` sorts by 24-hour price change percentage (fetches top 250 by market cap then sorts client-side), `volume_24h` sorts by 24-hour trading volume. — @default 'market_cap' */
757
+ sort_by?: 'market_cap' | 'change_24h' | 'volume_24h';
758
+ /** Sort order: `desc` (default, highest first) or `asc` (lowest first). — @default 'desc' */
759
+ order?: 'asc' | 'desc';
760
+ /** Optional token category filter. When provided, results are limited to coins in that category. Supported values: MEME, AI, AI_AGENTS, L1, L2, DEFI, GAMING, STABLECOIN, RWA, DEPIN, SOL_ECO, BASE_ECO, LST. */
761
+ category?: 'MEME' | 'AI' | 'AI_AGENTS' | 'L1' | 'L2' | 'DEFI' | 'GAMING' | 'STABLECOIN' | 'RWA' | 'DEPIN' | 'SOL_ECO' | 'BASE_ECO' | 'LST';
762
+ /** Results per page — @default '20' */
763
+ limit?: number;
764
+ /** Pagination offset — @default '0' */
765
+ offset?: number;
766
+ }
767
+ interface NewsDetailData {
768
+ /** Full article body text */
769
+ content: string;
770
+ /** Article ID */
771
+ id: string;
772
+ /** Surf project UUID */
773
+ project_id?: string;
774
+ /** Primary crypto project referenced in the article */
775
+ project_name?: string;
776
+ /** Unix timestamp in seconds when the article was published */
777
+ published_at: number;
778
+ /** Publisher name */
779
+ source?: string;
780
+ /** Short summary of the article */
781
+ summary?: string;
782
+ /** Article headline */
783
+ title: string;
784
+ /** Direct URL to the original article */
785
+ url?: string;
786
+ }
787
+ interface NewsDetailParams {
788
+ /** Article ID (returned as id in feed/search results) */
789
+ id?: string;
790
+ }
791
+ interface NewsFeedItem {
792
+ highlights?: NewsFeedItemHighlights;
793
+ /** Article ID. Use with the detail endpoint to fetch full content. */
794
+ id: string;
795
+ /** Surf project UUID — pass as 'id' parameter to /project/detail, /project/events, or /project/defi/metrics for exact lookup */
796
+ project_id?: string;
797
+ /** Primary crypto project referenced in the article */
798
+ project_name?: string;
799
+ /** Unix timestamp in seconds when the article was published */
800
+ published_at: number;
801
+ /** Publisher name (e.g. COINDESK, COINTELEGRAPH) */
802
+ source?: string;
803
+ /** Short summary of the article */
804
+ summary?: string;
805
+ /** Article headline */
806
+ title: string;
807
+ /** Direct URL to the original article */
808
+ url?: string;
809
+ }
810
+ interface NewsFeedItemHighlights {
811
+ [key: string]: unknown;
812
+ }
813
+ interface NewsFeedParams {
814
+ /** Filter by news source */
815
+ source?: 'coindesk' | 'cointelegraph' | 'theblock' | 'decrypt' | 'dlnews' | 'blockbeats' | 'bitcoincom' | 'coinpedia' | 'ambcrypto' | 'cryptodaily' | 'cryptopotato' | 'phemex' | 'panews' | 'odaily' | 'tradingview' | 'chaincatcher' | 'techflow';
816
+ /** Comma-separated project names to filter by */
817
+ project?: string;
818
+ /** Filter articles published on or after this time. Accepts Unix seconds or date string (2024-01-01) */
819
+ from?: string;
820
+ /** Filter articles published on or before this time. Accepts Unix seconds or date string (2024-02-01) */
821
+ to?: string;
822
+ /** Sort order: recency (newest first) or trending (hot right now) — @default 'recency' */
823
+ sort_by?: 'recency' | 'trending';
824
+ /** Results per page (max 50) — @default '20' */
825
+ limit?: number;
826
+ /** Pagination offset — @default '0' */
827
+ offset?: number;
828
+ }
829
+ interface OnchainBridgeRankingItem {
830
+ /** Bridge protocol name */
831
+ project: string;
832
+ /** Total number of bridge transfers */
833
+ tx_count: number;
834
+ /** Total USD volume in the time range */
835
+ volume_usd: number;
836
+ }
837
+ interface OnchainBridgeRankingParams {
838
+ /** Aggregation window — @default '30d' */
839
+ time_range?: '7d' | '30d' | '90d' | '180d' | '1y' | 'all';
840
+ /** Results per page — @default '20' */
841
+ limit?: number;
842
+ /** Pagination offset — @default '0' */
843
+ offset?: number;
844
+ }
845
+ interface OnchainGasPriceData {
846
+ /** Canonical chain name */
847
+ chain: string;
848
+ /** Gas price in wei */
849
+ gas_price: string;
850
+ /** Gas price in Gwei */
851
+ gas_price_gwei: number;
852
+ }
853
+ interface OnchainGasPriceParams {
854
+ /** Chain. Can be `ethereum`, `polygon`, `bsc`, `arbitrum`, `optimism`, `base`, `avalanche`, `fantom`, `linea`, or `cyber`. */
855
+ chain?: 'ethereum' | 'polygon' | 'bsc' | 'arbitrum' | 'optimism' | 'base' | 'avalanche' | 'fantom' | 'linea' | 'cyber';
856
+ }
857
+ interface OnchainStructuredQueryItem {
858
+ [key: string]: unknown;
859
+ }
860
+ interface OnchainStructuredQueryParams {
861
+ fields?: unknown;
862
+ filters?: OnchainStructuredQueryParamsFiltersItem[];
863
+ /** Max rows to return. Default 20, max 10000 */
864
+ limit?: number;
865
+ /** Rows to skip for pagination. Default 0 */
866
+ offset?: number;
867
+ sort?: OnchainStructuredQueryParamsSortItem[];
868
+ /** Fully-qualified table name like `agent.my_table` */
869
+ source: string;
870
+ }
871
+ interface OnchainStructuredQueryParamsFiltersItem {
872
+ /** Column name to filter on like `block_number` or `from_address` */
873
+ field: string;
874
+ /** Comparison operator: eq, neq, gt, gte, lt, lte, like, in, not_in. For `in`/`not_in`, value must be a JSON array */
875
+ op: string;
876
+ /** <any> */
877
+ value: unknown;
878
+ }
879
+ interface OnchainStructuredQueryParamsSortItem {
880
+ /** Column name to sort by like `gas`, `block_number`, or `amount_usd` */
881
+ field: string;
882
+ /** Sort direction: asc (default) or desc */
883
+ order?: string;
884
+ }
885
+ interface OnchainSchemaItem {
886
+ columns: OnchainSchemaItemColumnsItem[];
887
+ /** Database name (always `agent`) */
888
+ database: string;
889
+ /** Table name */
890
+ table: string;
891
+ }
892
+ interface OnchainSchemaItemColumnsItem {
893
+ /** Column comment or description */
894
+ comment?: string;
895
+ /** Column name */
896
+ name: string;
897
+ /** Column data type like `UInt64`, `String`, or `DateTime` */
898
+ type: string;
899
+ }
900
+ interface OnchainSqlItem {
901
+ [key: string]: unknown;
902
+ }
903
+ interface OnchainSqlParams {
904
+ /** Maximum number of rows to return — @default '1000' */
905
+ max_rows?: number;
906
+ /** SQL query to execute against the blockchain data warehouse */
907
+ sql: string;
908
+ }
909
+ interface OnchainTxItem {
910
+ accessList: OnchainTxItemAccesslistItem[];
911
+ blobVersionedHashes?: unknown;
912
+ /** Block hash, null if pending */
913
+ blockHash: unknown;
914
+ /** Block number (hex), null if pending */
915
+ blockNumber: unknown;
916
+ /** Chain ID (hex) */
917
+ chainId?: string;
918
+ /** Sender address (0x-prefixed) */
919
+ from: string;
920
+ /** Gas limit (hex) */
921
+ gas: string;
922
+ /** Gas price in wei (hex). Present in all types; for EIP-1559 this is the effective gas price */
923
+ gasPrice?: string;
924
+ /** Transaction hash (0x-prefixed) */
925
+ hash: string;
926
+ /** Call data (hex) */
927
+ input: string;
928
+ /** Max fee per blob gas in wei (hex). EIP-4844 only */
929
+ maxFeePerBlobGas?: string;
930
+ /** Max fee per gas in wei (hex). EIP-1559/EIP-4844 only */
931
+ maxFeePerGas?: string;
932
+ /** Max priority fee per gas in wei (hex). EIP-1559/EIP-4844 only */
933
+ maxPriorityFeePerGas?: string;
934
+ /** Sender nonce (hex) */
935
+ nonce: string;
936
+ /** Signature R (hex) */
937
+ r: string;
938
+ /** Signature S (hex) */
939
+ s: string;
940
+ /** Recipient address, null for contract creation */
941
+ to: unknown;
942
+ /** Index in block (hex), null if pending */
943
+ transactionIndex: unknown;
944
+ /** Transaction type: 0x0=legacy, 0x1=EIP-2930, 0x2=EIP-1559, 0x3=EIP-4844 */
945
+ type: string;
946
+ /** Signature V (hex). Legacy: recovery ID (0x1b/0x1c); EIP-2930+: parity (0x0/0x1) */
947
+ v: string;
948
+ /** ETH value in wei (hex) */
949
+ value: string;
950
+ /** Signature Y parity (hex). Present in EIP-2930+ transactions */
951
+ yParity?: string;
952
+ }
953
+ interface OnchainTxItemAccesslistItem {
954
+ /** Account address (0x-prefixed) */
955
+ address: string;
956
+ storageKeys: unknown;
957
+ }
958
+ interface OnchainTxParams {
959
+ /** Transaction hash (0x-prefixed hex) */
960
+ hash?: string;
961
+ /** Chain. Can be `ethereum`, `polygon`, `bsc`, `arbitrum`, `optimism`, `base`, `avalanche`, `fantom`, `linea`, or `cyber`. */
962
+ chain?: 'ethereum' | 'polygon' | 'bsc' | 'arbitrum' | 'optimism' | 'base' | 'avalanche' | 'fantom' | 'linea' | 'cyber';
963
+ }
964
+ interface OnchainYieldRankingItem {
965
+ /** Total APY (base + reward) */
966
+ apy: number;
967
+ /** Base APY from pool fees or interest */
968
+ apy_base: number;
969
+ /** Reward token APY */
970
+ apy_reward: number;
971
+ /** Pool or vault contract address */
972
+ pool_address: string;
973
+ /** Protocol name */
974
+ project: string;
975
+ /** Token symbol */
976
+ symbol: string;
977
+ /** Underlying token address */
978
+ token_address: string;
979
+ /** Pool TVL in USD */
980
+ tvl_usd: number;
981
+ /** Protocol version */
982
+ version: string;
983
+ }
984
+ interface OnchainYieldRankingParams {
985
+ /** Filter by protocol name like `lido`, `aave`, or `uniswap` */
986
+ project?: string;
987
+ /** Ranking metric: `apy` or `tvl_usd`. When sorted by `apy`, only pools with TVL >= $100k are included — @default 'apy' */
988
+ sort_by?: 'apy' | 'tvl_usd';
989
+ /** Sort direction — @default 'desc' */
990
+ order?: 'asc' | 'desc';
991
+ /** Results per page — @default '20' */
992
+ limit?: number;
993
+ /** Pagination offset — @default '0' */
994
+ offset?: number;
995
+ }
996
+ interface PredictionMarketCategoryMetricsItem {
997
+ /** Top-level category */
998
+ category: string;
999
+ /** Notional trading volume in USD */
1000
+ notional_volume_usd: number;
1001
+ /** Open interest in USD */
1002
+ open_interest_usd: number;
1003
+ /** Prediction market platform: Kalshi or Polymarket */
1004
+ source: string;
1005
+ /** Subcategory within the category */
1006
+ subcategory: string;
1007
+ /** Unix timestamp in seconds (midnight UTC for the trading day) */
1008
+ timestamp: number;
1009
+ }
1010
+ interface PredictionMarketCategoryMetricsParams {
1011
+ /** Filter by prediction market platform: `Kalshi` or `Polymarket` */
1012
+ source?: 'Kalshi' | 'Polymarket';
1013
+ /** Filter by top-level category */
1014
+ category?: 'crypto' | 'culture' | 'economics' | 'financials' | 'politics' | 'stem' | 'sports';
1015
+ /** Predefined time range: `7d`, `30d`, `90d`, `180d`, `1y`, or `all` — @default '30d' */
1016
+ time_range?: '7d' | '30d' | '90d' | '180d' | '1y' | 'all';
1017
+ /** Results per page — @default '20' */
1018
+ limit?: number;
1019
+ /** Pagination offset — @default '0' */
1020
+ offset?: number;
1021
+ }
1022
+ interface KalshiEventsItem {
1023
+ /** Event subtitle */
1024
+ event_subtitle?: string;
1025
+ /** Unique event ticker identifier */
1026
+ event_ticker: string;
1027
+ /** Event title */
1028
+ event_title: string;
1029
+ /** Number of markets in this event */
1030
+ market_count: number;
1031
+ markets: KalshiEventsItemMarketsItem[];
1032
+ }
1033
+ interface KalshiEventsItemMarketsItem {
1034
+ /** Surf curated market category */
1035
+ category?: string;
1036
+ /** Market close time (Unix seconds) */
1037
+ close_time?: number;
1038
+ /** Market end time (Unix seconds) */
1039
+ end_time?: number;
1040
+ /** Parent event ticker */
1041
+ event_ticker: string;
1042
+ /** Event title */
1043
+ event_title?: string;
1044
+ /** Previous day open interest from daily report */
1045
+ last_day_open_interest: number;
1046
+ /** Unique market ticker identifier */
1047
+ market_ticker: string;
1048
+ /** Last day notional trading volume in USD (each contract = $1) */
1049
+ notional_volume_usd: number;
1050
+ /** Open interest (contracts) */
1051
+ open_interest: number;
1052
+ /** Payout type */
1053
+ payout_type: string;
1054
+ /** Market result if resolved */
1055
+ result?: string;
1056
+ /** Market start time (Unix seconds) */
1057
+ start_time?: number;
1058
+ /** Market status */
1059
+ status: string;
1060
+ /** Surf curated market subcategory */
1061
+ subcategory?: string;
1062
+ /** Market title */
1063
+ title: string;
1064
+ /** Total trading volume (contracts) */
1065
+ total_volume: number;
1066
+ }
1067
+ interface KalshiEventsParams {
1068
+ /** Event ticker identifier */
1069
+ event_ticker?: string;
1070
+ /** Results per page — @default '20' */
1071
+ limit?: number;
1072
+ /** Pagination offset — @default '0' */
1073
+ offset?: number;
1074
+ }
1075
+ interface KalshiMarketsItem {
1076
+ /** Surf curated market category */
1077
+ category?: string;
1078
+ /** Market close time (Unix seconds) */
1079
+ close_time?: number;
1080
+ /** Market end time (Unix seconds) */
1081
+ end_time?: number;
1082
+ /** Parent event ticker */
1083
+ event_ticker: string;
1084
+ /** Event title */
1085
+ event_title?: string;
1086
+ /** Previous day open interest from daily report */
1087
+ last_day_open_interest: number;
1088
+ /** Unique market ticker identifier */
1089
+ market_ticker: string;
1090
+ /** Last day notional trading volume in USD (each contract = $1) */
1091
+ notional_volume_usd: number;
1092
+ /** Open interest (contracts) */
1093
+ open_interest: number;
1094
+ /** Payout type */
1095
+ payout_type: string;
1096
+ /** Market result if resolved */
1097
+ result?: string;
1098
+ /** Market start time (Unix seconds) */
1099
+ start_time?: number;
1100
+ /** Market status */
1101
+ status: string;
1102
+ /** Surf curated market subcategory */
1103
+ subcategory?: string;
1104
+ /** Market title */
1105
+ title: string;
1106
+ /** Total trading volume (contracts) */
1107
+ total_volume: number;
1108
+ }
1109
+ interface KalshiMarketsParams {
1110
+ /** Market ticker identifier */
1111
+ market_ticker?: string;
1112
+ /** Results per page — @default '20' */
1113
+ limit?: number;
1114
+ /** Pagination offset — @default '0' */
1115
+ offset?: number;
1116
+ }
1117
+ interface KalshiOpenInterestItem {
1118
+ /** Open interest on this date (contracts) */
1119
+ open_interest: number;
1120
+ /** Unix timestamp in seconds (midnight UTC for the trading day) */
1121
+ timestamp: number;
1122
+ }
1123
+ interface KalshiOpenInterestParams {
1124
+ /** Market ticker identifier */
1125
+ ticker?: string;
1126
+ /** Predefined time range: `7d`, `30d`, `90d`, `180d`, or `1y` — @default '30d' */
1127
+ time_range?: '7d' | '30d' | '90d' | '180d' | '1y';
1128
+ }
1129
+ interface KalshiPricesItem {
1130
+ /** Highest price as probability (0-1) */
1131
+ high: number;
1132
+ /** Lowest price as probability (0-1) */
1133
+ low: number;
1134
+ /** Opening price as probability (0-1). Present for daily interval only. */
1135
+ open?: number;
1136
+ side_a: KalshiPricesItemSideA;
1137
+ side_b: KalshiPricesItemSideB;
1138
+ /** Unix timestamp in seconds (midnight UTC for daily, hour start for hourly, trade time for latest) */
1139
+ timestamp: number;
1140
+ }
1141
+ interface KalshiPricesItemSideA {
1142
+ /** Outcome label: `Yes` or `No` */
1143
+ label: string;
1144
+ /** Price as probability (0-1) */
1145
+ price: number;
1146
+ }
1147
+ interface KalshiPricesItemSideB {
1148
+ /** Outcome label: `Yes` or `No` */
1149
+ label: string;
1150
+ /** Price as probability (0-1) */
1151
+ price: number;
1152
+ }
1153
+ interface KalshiPricesParams {
1154
+ /** Market ticker identifier */
1155
+ ticker?: string;
1156
+ /** Predefined time range: `7d`, `30d`, `90d`, `180d`, or `1y`. Ignored when `interval=latest`. — @default '30d' */
1157
+ time_range?: '7d' | '30d' | '90d' | '180d' | '1y';
1158
+ /** Data interval: `1h` for hourly, `1d` for daily OHLC, `latest` for real-time price from trades — @default '1d' */
1159
+ interval?: '1h' | '1d' | 'latest';
1160
+ }
1161
+ interface KalshiRankingItem {
1162
+ /** Surf curated market category */
1163
+ category?: string;
1164
+ /** Market close time (Unix seconds) */
1165
+ close_time?: number;
1166
+ /** Market end time (Unix seconds) */
1167
+ end_time?: number;
1168
+ /** Parent event ticker */
1169
+ event_ticker: string;
1170
+ /** Event title */
1171
+ event_title?: string;
1172
+ /** Previous day open interest from daily report */
1173
+ last_day_open_interest: number;
1174
+ /** Unique market ticker identifier */
1175
+ market_ticker: string;
1176
+ /** Last day notional trading volume in USD (each contract = $1) */
1177
+ notional_volume_usd: number;
1178
+ /** Open interest (contracts) */
1179
+ open_interest: number;
1180
+ /** Payout type */
1181
+ payout_type: string;
1182
+ /** Market result if resolved */
1183
+ result?: string;
1184
+ /** Market start time (Unix seconds) */
1185
+ start_time?: number;
1186
+ /** Market status */
1187
+ status: string;
1188
+ /** Surf curated market subcategory */
1189
+ subcategory?: string;
1190
+ /** Market title */
1191
+ title: string;
1192
+ /** Total trading volume (contracts) */
1193
+ total_volume: number;
1194
+ }
1195
+ interface KalshiRankingParams {
1196
+ /** Field to sort results by — @default 'notional_volume_usd' */
1197
+ sort_by?: 'notional_volume_usd' | 'open_interest';
1198
+ /** Sort order — @default 'desc' */
1199
+ order?: 'asc' | 'desc';
1200
+ /** Market status filter: `active`, `closed`, `determined`, `disputed`, `finalized`, `inactive`, or `initialized` — @default 'active' */
1201
+ status?: 'active' | 'closed' | 'determined' | 'disputed' | 'finalized' | 'inactive' | 'initialized';
1202
+ /** Filter by category */
1203
+ category?: 'crypto' | 'culture' | 'economics' | 'financials' | 'politics' | 'stem' | 'sports' | 'unknown';
1204
+ /** Results per page — @default '20' */
1205
+ limit?: number;
1206
+ /** Pagination offset — @default '0' */
1207
+ offset?: number;
1208
+ }
1209
+ interface KalshiTradesItem {
1210
+ /** Unique market ticker identifier */
1211
+ market_ticker: string;
1212
+ /** No outcome price as probability (0-1) */
1213
+ no_price: number;
1214
+ /** Notional volume in USD (each contract = $1) */
1215
+ notional_volume_usd: number;
1216
+ /** Taker side: `yes` or `no` */
1217
+ taker_side: string;
1218
+ /** Unix timestamp in seconds */
1219
+ timestamp: number;
1220
+ /** Unique trade identifier */
1221
+ trade_id: string;
1222
+ /** Yes outcome price as probability (0-1) */
1223
+ yes_price: number;
1224
+ }
1225
+ interface KalshiTradesParams {
1226
+ /** Market ticker identifier */
1227
+ ticker?: string;
1228
+ /** Filter by taker side: `yes` or `no` */
1229
+ taker_side?: 'yes' | 'no';
1230
+ /** Minimum notional volume in USD (each contract = $1) */
1231
+ min_amount?: number;
1232
+ /** Start of time range. Accepts Unix seconds (`1704067200`) or date string (`2024-01-01`) */
1233
+ from?: string;
1234
+ /** End of time range. Accepts Unix seconds (`1706745600`) or date string (`2024-02-01`) */
1235
+ to?: string;
1236
+ /** Field to sort results by — @default 'timestamp' */
1237
+ sort_by?: 'timestamp' | 'notional_volume_usd';
1238
+ /** Sort order — @default 'desc' */
1239
+ order?: 'asc' | 'desc';
1240
+ /** Results per page — @default '50' */
1241
+ limit?: number;
1242
+ /** Pagination offset — @default '0' */
1243
+ offset?: number;
1244
+ }
1245
+ interface KalshiVolumesItem {
1246
+ /** Notional volume in USD (each contract counted as $1) */
1247
+ notional_volume_usd: number;
1248
+ /** Unix timestamp in seconds (midnight UTC for the trading day) */
1249
+ timestamp: number;
1250
+ }
1251
+ interface KalshiVolumesParams {
1252
+ /** Market ticker identifier */
1253
+ ticker?: string;
1254
+ /** Predefined time range: `7d`, `30d`, `90d`, `180d`, or `1y` — @default '30d' */
1255
+ time_range?: '7d' | '30d' | '90d' | '180d' | '1y';
1256
+ }
1257
+ interface PolymarketActivityItem {
1258
+ /** Market condition identifier */
1259
+ condition_id: string;
1260
+ /** Outcome label */
1261
+ outcome: string;
1262
+ /** Trade price (0-1) */
1263
+ price: number;
1264
+ /** Trade side */
1265
+ side: string;
1266
+ /** Trade size in shares */
1267
+ size: number;
1268
+ /** Activity Unix timestamp in seconds */
1269
+ timestamp: number;
1270
+ /** Market title */
1271
+ title: string;
1272
+ /** Transaction hash */
1273
+ transaction_hash: string;
1274
+ /** Activity type such as `buy`, `sell`, or `redeem` */
1275
+ type: string;
1276
+ /** Trade size in USDC */
1277
+ usdc_size: number;
1278
+ }
1279
+ interface PolymarketActivityParams {
1280
+ /** Polymarket proxy wallet address */
1281
+ address?: string;
1282
+ /** Results per page — @default '50' */
1283
+ limit?: number;
1284
+ /** Pagination offset — @default '0' */
1285
+ offset?: number;
1286
+ }
1287
+ interface PolymarketEventsItem {
1288
+ /** Surf curated event category */
1289
+ category?: string;
1290
+ /** Event description */
1291
+ description?: string;
1292
+ /** Event end time (Unix seconds) */
1293
+ end_time?: number;
1294
+ /** Event identifier slug */
1295
+ event_slug: string;
1296
+ /** Event image URL */
1297
+ image?: string;
1298
+ /** Number of markets in this event */
1299
+ market_count: number;
1300
+ markets: PolymarketEventsItemMarketsItem[];
1301
+ /** Resolution source URL */
1302
+ settlement_sources?: string;
1303
+ /** Event start time (Unix seconds) */
1304
+ start_time?: number;
1305
+ /** Event status: `open` if any market is open, `closed` if all markets are closed */
1306
+ status: string;
1307
+ /** Surf curated event subcategory */
1308
+ subcategory?: string;
1309
+ tags?: unknown;
1310
+ /** Event title */
1311
+ title: string;
1312
+ /** Total event volume across all markets (USD) */
1313
+ volume_total: number;
1314
+ }
1315
+ interface PolymarketEventsItemMarketsItem {
1316
+ /** Surf curated market category */
1317
+ category?: string;
1318
+ /** Market close time (Unix seconds) */
1319
+ close_time?: number;
1320
+ /** Resolution time (Unix seconds) */
1321
+ completed_time?: number;
1322
+ /** Unique condition identifier */
1323
+ condition_id: string;
1324
+ /** Market description */
1325
+ description?: string;
1326
+ /** Market end time (Unix seconds) */
1327
+ end_time?: number;
1328
+ /** Event identifier slug */
1329
+ event_slug?: string;
1330
+ /** Game start time for sports markets (Unix seconds) */
1331
+ game_start_time?: number;
1332
+ /** Market image URL */
1333
+ image?: string;
1334
+ /** Market identifier slug */
1335
+ market_slug: string;
1336
+ /** Negative risk market identifier */
1337
+ negative_risk_id?: string;
1338
+ /** Link to Polymarket page */
1339
+ polymarket_link?: string;
1340
+ /** URL to resolution data source */
1341
+ resolution_source?: string;
1342
+ side_a?: PolymarketEventsItemMarketsItemSideA;
1343
+ side_b?: PolymarketEventsItemMarketsItemSideB;
1344
+ /** Market start time (Unix seconds) */
1345
+ start_time?: number;
1346
+ /** Market status: `open` or `closed` */
1347
+ status: string;
1348
+ /** Surf curated market subcategory */
1349
+ subcategory?: string;
1350
+ tags?: unknown;
1351
+ /** Market title */
1352
+ title: string;
1353
+ /** Trading volume in the past month (USD) */
1354
+ volume_1_month: number;
1355
+ /** Trading volume in the past week (USD) */
1356
+ volume_1_week: number;
1357
+ /** Trading volume in the past year (USD) */
1358
+ volume_1_year: number;
1359
+ /** Total trading volume (USD) */
1360
+ volume_total: number;
1361
+ /** Winning outcome label, if resolved */
1362
+ winning_side?: string;
1363
+ }
1364
+ interface PolymarketEventsItemMarketsItemSideA {
1365
+ /** Token identifier for this outcome */
1366
+ id: string;
1367
+ /** Outcome label */
1368
+ label: string;
1369
+ }
1370
+ interface PolymarketEventsItemMarketsItemSideB {
1371
+ /** Token identifier for this outcome */
1372
+ id: string;
1373
+ /** Outcome label */
1374
+ label: string;
1375
+ }
1376
+ interface PolymarketEventsParams {
1377
+ /** Event slug identifier */
1378
+ event_slug?: string;
1379
+ /** Results per page — @default '20' */
1380
+ limit?: number;
1381
+ /** Pagination offset — @default '0' */
1382
+ offset?: number;
1383
+ }
1384
+ interface PolymarketMarketsItem {
1385
+ /** Surf curated market category */
1386
+ category?: string;
1387
+ /** Market close time (Unix seconds) */
1388
+ close_time?: number;
1389
+ /** Resolution time (Unix seconds) */
1390
+ completed_time?: number;
1391
+ /** Unique condition identifier */
1392
+ condition_id: string;
1393
+ /** Market description */
1394
+ description?: string;
1395
+ /** Market end time (Unix seconds) */
1396
+ end_time?: number;
1397
+ /** Event identifier slug */
1398
+ event_slug?: string;
1399
+ /** Game start time for sports markets (Unix seconds) */
1400
+ game_start_time?: number;
1401
+ /** Market image URL */
1402
+ image?: string;
1403
+ /** Market identifier slug */
1404
+ market_slug: string;
1405
+ /** Negative risk market identifier */
1406
+ negative_risk_id?: string;
1407
+ /** Link to Polymarket page */
1408
+ polymarket_link?: string;
1409
+ /** URL to resolution data source */
1410
+ resolution_source?: string;
1411
+ side_a?: PolymarketMarketsItemSideA;
1412
+ side_b?: PolymarketMarketsItemSideB;
1413
+ /** Market start time (Unix seconds) */
1414
+ start_time?: number;
1415
+ /** Market status: `open` or `closed` */
1416
+ status: string;
1417
+ /** Surf curated market subcategory */
1418
+ subcategory?: string;
1419
+ tags?: unknown;
1420
+ /** Market title */
1421
+ title: string;
1422
+ /** Trading volume in the past month (USD) */
1423
+ volume_1_month: number;
1424
+ /** Trading volume in the past week (USD) */
1425
+ volume_1_week: number;
1426
+ /** Trading volume in the past year (USD) */
1427
+ volume_1_year: number;
1428
+ /** Total trading volume (USD) */
1429
+ volume_total: number;
1430
+ /** Winning outcome label, if resolved */
1431
+ winning_side?: string;
1432
+ }
1433
+ interface PolymarketMarketsItemSideA {
1434
+ /** Token identifier for this outcome */
1435
+ id: string;
1436
+ /** Outcome label */
1437
+ label: string;
1438
+ }
1439
+ interface PolymarketMarketsItemSideB {
1440
+ /** Token identifier for this outcome */
1441
+ id: string;
1442
+ /** Outcome label */
1443
+ label: string;
1444
+ }
1445
+ interface PolymarketMarketsParams {
1446
+ /** Market slug identifier */
1447
+ market_slug?: string;
1448
+ /** Results per page — @default '20' */
1449
+ limit?: number;
1450
+ /** Pagination offset — @default '0' */
1451
+ offset?: number;
1452
+ }
1453
+ interface PolymarketOpenInterestItem {
1454
+ /** Daily net change in USD */
1455
+ daily_net_change_usd: number;
1456
+ /** Open interest in USD */
1457
+ open_interest_usd: number;
1458
+ /** Unix timestamp in seconds (midnight UTC) */
1459
+ timestamp: number;
1460
+ }
1461
+ interface PolymarketOpenInterestParams {
1462
+ /** Market condition identifier */
1463
+ condition_id?: string;
1464
+ /** Predefined time range — @default '30d' */
1465
+ time_range?: '7d' | '30d' | '90d' | '180d' | '1y';
1466
+ }
1467
+ interface PolymarketPositionsItem {
1468
+ /** Average entry price (0-1) */
1469
+ avg_price: number;
1470
+ /** Unrealized profit and loss in USD */
1471
+ cash_pnl: number;
1472
+ /** Market condition identifier */
1473
+ condition_id: string;
1474
+ /** Current market price (0-1) */
1475
+ cur_price: number;
1476
+ /** Current position value in USD */
1477
+ current_value: number;
1478
+ /** Outcome label */
1479
+ outcome_label: string;
1480
+ /** Market question */
1481
+ question: string;
1482
+ /** Realized profit and loss in USD */
1483
+ realized_pnl: number;
1484
+ /** Whether the position is redeemable */
1485
+ redeemable: boolean;
1486
+ /** Position size in shares */
1487
+ size: number;
1488
+ }
1489
+ interface PolymarketPositionsParams {
1490
+ /** Polymarket proxy wallet address */
1491
+ address?: string;
1492
+ /** Results per page — @default '50' */
1493
+ limit?: number;
1494
+ /** Pagination offset — @default '0' */
1495
+ offset?: number;
1496
+ }
1497
+ interface PolymarketPricesItem {
1498
+ side_a?: PolymarketPricesItemSideA;
1499
+ side_b?: PolymarketPricesItemSideB;
1500
+ /** Interval start Unix timestamp in seconds */
1501
+ timestamp: number;
1502
+ }
1503
+ interface PolymarketPricesItemSideA {
1504
+ /** Outcome label such as `Yes` or `No` */
1505
+ label: string;
1506
+ /** Average price over the interval (0-1) */
1507
+ price: number;
1508
+ /** Outcome token identifier */
1509
+ token_id: string;
1510
+ }
1511
+ interface PolymarketPricesItemSideB {
1512
+ /** Outcome label such as `Yes` or `No` */
1513
+ label: string;
1514
+ /** Average price over the interval (0-1) */
1515
+ price: number;
1516
+ /** Outcome token identifier */
1517
+ token_id: string;
1518
+ }
1519
+ interface PolymarketPricesParams {
1520
+ /** Market condition identifier */
1521
+ condition_id?: string;
1522
+ /** Predefined time range. Ignored when `interval` is `latest`. — @default '30d' */
1523
+ time_range?: '7d' | '30d' | '90d' | '180d' | '1y';
1524
+ /** Aggregation interval: `1h` (hourly), `1d` (daily), or `latest` (most recent snapshot) — @default '1d' */
1525
+ interval?: '1h' | '1d' | 'latest';
1526
+ }
1527
+ interface PolymarketRankingItem {
1528
+ /** Surf curated market category */
1529
+ category?: string;
1530
+ /** Unique condition identifier */
1531
+ condition_id: string;
1532
+ /** Market end time (Unix seconds) */
1533
+ end_time?: number;
1534
+ /** Notional trading volume (USD) */
1535
+ notional_volume_usd: number;
1536
+ /** Current open interest (USD) */
1537
+ open_interest_usd: number;
1538
+ /** Link to Polymarket page */
1539
+ polymarket_link?: string;
1540
+ /** Market question text */
1541
+ question: string;
1542
+ /** Market status */
1543
+ status: string;
1544
+ /** Surf curated market subcategory */
1545
+ subcategory?: string;
1546
+ tags?: unknown;
1547
+ }
1548
+ interface PolymarketRankingParams {
1549
+ /** Sort by last day's `notional_volume_usd` or `open_interest` — @default 'notional_volume_usd' */
1550
+ sort_by?: 'notional_volume_usd' | 'open_interest';
1551
+ /** Sort order — @default 'desc' */
1552
+ order?: 'asc' | 'desc';
1553
+ /** Market status filter: `active`, `finalized`, `ended`, `initialized`, or `closed` — @default 'active' */
1554
+ status?: 'active' | 'finalized' | 'ended' | 'initialized' | 'closed';
1555
+ /** Filter by Surf-curated category */
1556
+ category?: 'crypto' | 'culture' | 'early_polymarket_trades' | 'economics' | 'financials' | 'politics' | 'stem' | 'sports' | 'unknown';
1557
+ /** Filter markets ending within this window from now: `24h`, `3d`, `7d`, `14d`, or `30d` */
1558
+ end_before?: '24h' | '3d' | '7d' | '14d' | '30d';
1559
+ /** Results per page — @default '20' */
1560
+ limit?: number;
1561
+ /** Pagination offset — @default '0' */
1562
+ offset?: number;
1563
+ }
1564
+ interface PolymarketTradesItem {
1565
+ /** Trade amount in USD */
1566
+ amount_usd: number;
1567
+ /** Block number */
1568
+ block_number: number;
1569
+ /** Trade Unix timestamp in seconds */
1570
+ block_time: number;
1571
+ /** Market condition identifier */
1572
+ condition_id: string;
1573
+ /** Event log index */
1574
+ evt_index: number;
1575
+ /** Exchange contract address */
1576
+ exchange_address: string;
1577
+ /** Fee amount in USD */
1578
+ fee_usd: number;
1579
+ /** Maker wallet address */
1580
+ maker_address: string;
1581
+ /** Whether this is a negative risk trade */
1582
+ neg_risk: boolean;
1583
+ /** Outcome label such as `Yes` or `No` */
1584
+ outcome_label: string;
1585
+ /** Outcome token identifier */
1586
+ outcome_token_id: string;
1587
+ /** Trade price (0-1) */
1588
+ price: number;
1589
+ /** Market question text */
1590
+ question: string;
1591
+ /** Number of shares traded */
1592
+ shares: number;
1593
+ /** Taker wallet address */
1594
+ taker_address: string;
1595
+ /** Transaction hash */
1596
+ tx_hash: string;
1597
+ }
1598
+ interface PolymarketTradesParams {
1599
+ /** Market condition identifier */
1600
+ condition_id?: string;
1601
+ /** Wallet address — returns trades where the address is maker or taker */
1602
+ address?: string;
1603
+ /** Filter by outcome label: `Yes` or `No` */
1604
+ outcome_label?: 'Yes' | 'No';
1605
+ /** Minimum trade amount in USD */
1606
+ min_amount?: number;
1607
+ /** Start of time range. Accepts Unix seconds (`1704067200`) or date string (`2024-01-01`) */
1608
+ from?: string;
1609
+ /** End of time range. Accepts Unix seconds (`1706745600`) or date string (`2024-02-01`) */
1610
+ to?: string;
1611
+ /** Field to sort results by — @default 'timestamp' */
1612
+ sort_by?: 'timestamp' | 'notional_volume_usd';
1613
+ /** Results per page — @default '50' */
1614
+ limit?: number;
1615
+ /** Pagination offset — @default '0' */
1616
+ offset?: number;
1617
+ }
1618
+ interface PolymarketVolumesItem {
1619
+ /** Notional trading volume in USD */
1620
+ notional_volume_usd: number;
1621
+ /** Interval start Unix timestamp in seconds */
1622
+ timestamp: number;
1623
+ /** Number of trades */
1624
+ trade_count: number;
1625
+ }
1626
+ interface PolymarketVolumesParams {
1627
+ /** Market condition identifier */
1628
+ condition_id?: string;
1629
+ /** Predefined time range — @default '30d' */
1630
+ time_range?: '7d' | '30d' | '90d' | '180d' | '1y';
1631
+ /** Aggregation interval: `1h` (hourly) or `1d` (daily) — @default '1d' */
1632
+ interval?: '1h' | '1d';
1633
+ }
1634
+ interface ProjectDefiMetricsItem {
1635
+ /** Unix timestamp in seconds for this data point */
1636
+ timestamp: number;
1637
+ /** Metric value at this timestamp */
1638
+ value: number;
1639
+ }
1640
+ interface ProjectDefiMetricsParams {
1641
+ /** Surf project UUID. PREFERRED — always use this when available from a previous response (e.g. project_id from /fund/portfolio or id from /search/project). Takes priority over q. */
1642
+ id?: string;
1643
+ /** Fuzzy entity name search. Only use when 'id' is not available. May return unexpected results for ambiguous names. */
1644
+ q?: string;
1645
+ /** Metric to query. Can be `volume`, `fees` (or `fee` alias), `revenue`, `tvl`, or `users`. */
1646
+ metric?: 'volume' | 'fee' | 'fees' | 'revenue' | 'tvl' | 'users';
1647
+ /** Start of time range. Accepts Unix seconds (`1704067200`) or date string (`2024-01-01`) */
1648
+ from?: string;
1649
+ /** End of time range. Accepts Unix seconds (`1706745600`) or date string (`2024-02-01`) */
1650
+ to?: string;
1651
+ /** Filter by chain. Can be `ethereum`, `polygon`, `bsc`, `arbitrum`, `optimism`, `base`, `avalanche`, `fantom`, or `solana`. */
1652
+ chain?: 'ethereum' | 'polygon' | 'bsc' | 'arbitrum' | 'optimism' | 'base' | 'avalanche' | 'fantom' | 'solana';
1653
+ /** Results per page — @default '20' */
1654
+ limit?: number;
1655
+ /** Pagination offset — @default '0' */
1656
+ offset?: number;
1657
+ }
1658
+ interface ProjectDefiRankingItem {
1659
+ fees?: number;
1660
+ /** Project logo image URL */
1661
+ logo_url?: string;
1662
+ name: string;
1663
+ revenue?: number;
1664
+ symbol?: string;
1665
+ tvl?: number;
1666
+ users?: number;
1667
+ volume?: number;
1668
+ }
1669
+ interface ProjectDefiRankingParams {
1670
+ /** Ranking metric. Can be `tvl`, `revenue`, `fees`, `volume`, or `users`. */
1671
+ metric?: 'tvl' | 'revenue' | 'fees' | 'volume' | 'users';
1672
+ /** Results per page — @default '20' */
1673
+ limit?: number;
1674
+ /** Pagination offset — @default '0' */
1675
+ offset?: number;
1676
+ }
1677
+ interface ProjectDetailData {
1678
+ contracts?: ProjectDetailDataContracts;
1679
+ funding?: ProjectDetailDataFunding;
1680
+ overview?: ProjectDetailDataOverview;
1681
+ social?: ProjectDetailDataSocial;
1682
+ team?: ProjectDetailDataTeam;
1683
+ tge_status?: ProjectDetailDataTgeStatus;
1684
+ token_info?: ProjectDetailDataTokenInfo;
1685
+ tokenomics?: ProjectDetailDataTokenomics;
1686
+ }
1687
+ interface ProjectDetailDataContracts {
1688
+ contracts?: ProjectDetailDataContractsContractsItem[];
1689
+ }
1690
+ interface ProjectDetailDataFunding {
1691
+ rounds?: ProjectDetailDataFundingRoundsItem[];
1692
+ /** Total capital raised across all rounds in USD */
1693
+ total_raise?: number;
1694
+ }
1695
+ interface ProjectDetailDataOverview {
1696
+ chains?: unknown;
1697
+ /** Short description of the project */
1698
+ description?: string;
1699
+ exchanges?: unknown;
1700
+ /** Surf project UUID — pass as 'id' parameter to /project/detail, /project/events, or /project/defi/metrics for exact lookup. Prefer over 'q' (fuzzy name search). */
1701
+ id: string;
1702
+ /** Project logo image URL */
1703
+ logo_url?: string;
1704
+ /** Project name */
1705
+ name: string;
1706
+ /** URL-friendly project slug */
1707
+ slug?: string;
1708
+ tags?: unknown;
1709
+ /** TGE status: pre, upcoming, or post */
1710
+ tge_status?: string;
1711
+ /** Primary token ticker symbol */
1712
+ token_symbol?: string;
1713
+ /** Project official website URL */
1714
+ website?: string;
1715
+ /** Number of X (Twitter) followers */
1716
+ x_followers: number;
1717
+ /** X (Twitter) handle without the @ prefix */
1718
+ x_handle?: string;
1719
+ }
1720
+ interface ProjectDetailDataSocial {
1721
+ discord?: ProjectDetailDataSocialDiscord;
1722
+ github?: ProjectDetailDataSocialGithub;
1723
+ telegram?: ProjectDetailDataSocialTelegram;
1724
+ twitter?: ProjectDetailDataSocialTwitter;
1725
+ }
1726
+ interface ProjectDetailDataTeam {
1727
+ members?: ProjectDetailDataTeamMembersItem[];
1728
+ }
1729
+ interface ProjectDetailDataTgeStatus {
1730
+ /** TGE status: `pre`, `upcoming`, or `post`. Omitted when unknown. */
1731
+ current_status?: string;
1732
+ exchanges?: unknown;
1733
+ /** Unix timestamp of the last TGE event */
1734
+ last_event_time?: number;
1735
+ }
1736
+ interface ProjectDetailDataTokenInfo {
1737
+ /** All-time high price in USD */
1738
+ all_time_high?: number;
1739
+ /** All-time low price in USD */
1740
+ all_time_low?: number;
1741
+ /** Circulating token supply */
1742
+ circulating_supply?: number;
1743
+ /** Fully diluted valuation in USD */
1744
+ fdv?: number;
1745
+ /** 24-hour high price in USD */
1746
+ high_24h?: number;
1747
+ /** Token logo image URL */
1748
+ image?: string;
1749
+ /** 24-hour low price in USD */
1750
+ low_24h?: number;
1751
+ /** Market capitalization in USD */
1752
+ market_cap_usd?: number;
1753
+ /** Full token name */
1754
+ name: string;
1755
+ /** 24-hour price change percentage */
1756
+ price_change_24h?: number;
1757
+ /** 30-day price change percentage */
1758
+ price_change_30d?: number;
1759
+ /** 7-day price change percentage */
1760
+ price_change_7d?: number;
1761
+ /** Current price in USD */
1762
+ price_usd?: number;
1763
+ /** Token ticker symbol */
1764
+ symbol: string;
1765
+ /** Total token supply */
1766
+ total_supply?: number;
1767
+ /** 24-hour trading volume in USD */
1768
+ volume_24h?: number;
1769
+ }
1770
+ interface ProjectDetailDataTokenomics {
1771
+ /** Number of tokens currently in public circulation */
1772
+ circulating_supply?: number;
1773
+ /** Fully diluted valuation in USD */
1774
+ fdv?: number;
1775
+ /** Total market capitalization in USD */
1776
+ market_cap_usd?: number;
1777
+ /** Total token supply */
1778
+ total_supply?: number;
1779
+ }
1780
+ interface ProjectDetailDataContractsContractsItem {
1781
+ /** Contract address on the specified chain */
1782
+ address: string;
1783
+ /** Chain name like `ethereum`, `bsc`, or `solana` */
1784
+ chain: string;
1785
+ /** Human-readable label for this contract like `Token` or `Staking` */
1786
+ label?: string;
1787
+ }
1788
+ interface ProjectDetailDataFundingRoundsItem {
1789
+ /** Amount raised in USD */
1790
+ amount?: number;
1791
+ /** Date when the round closed in ISO 8601 format */
1792
+ date?: string;
1793
+ investors?: ProjectDetailDataFundingRoundsItemInvestorsItem[];
1794
+ /** Funding round name like `Seed`, `Series A`, or `Private` */
1795
+ round_name: string;
1796
+ /** Project valuation at round close in USD */
1797
+ valuation?: number;
1798
+ }
1799
+ interface ProjectDetailDataSocialDiscord {
1800
+ /** Number of followers on this platform */
1801
+ followers_count?: number;
1802
+ /** Username or handle on the social platform */
1803
+ handle?: string;
1804
+ /** Profile URL on the social platform */
1805
+ url?: string;
1806
+ }
1807
+ interface ProjectDetailDataSocialGithub {
1808
+ /** Number of followers on this platform */
1809
+ followers_count?: number;
1810
+ /** Username or handle on the social platform */
1811
+ handle?: string;
1812
+ /** Profile URL on the social platform */
1813
+ url?: string;
1814
+ }
1815
+ interface ProjectDetailDataSocialTelegram {
1816
+ /** Number of followers on this platform */
1817
+ followers_count?: number;
1818
+ /** Username or handle on the social platform */
1819
+ handle?: string;
1820
+ /** Profile URL on the social platform */
1821
+ url?: string;
1822
+ }
1823
+ interface ProjectDetailDataSocialTwitter {
1824
+ /** Number of followers on this platform */
1825
+ followers_count?: number;
1826
+ /** Username or handle on the social platform */
1827
+ handle?: string;
1828
+ /** Profile URL on the social platform */
1829
+ url?: string;
1830
+ }
1831
+ interface ProjectDetailDataTeamMembersItem {
1832
+ /** Team member profile image URL */
1833
+ image?: string;
1834
+ /** Team member's full name */
1835
+ name: string;
1836
+ /** Team member's role or title */
1837
+ role?: string;
1838
+ social_links?: ProjectDetailDataTeamMembersItemSocialLinks;
1839
+ }
1840
+ interface ProjectDetailDataFundingRoundsItemInvestorsItem {
1841
+ /** Whether this investor led the round */
1842
+ is_lead: boolean;
1843
+ /** Investor logo URL */
1844
+ logo?: string;
1845
+ /** Investor name */
1846
+ name: string;
1847
+ /** Investor type (FUND or PERSON) */
1848
+ type?: string;
1849
+ }
1850
+ interface ProjectDetailDataTeamMembersItemSocialLinks {
1851
+ [key: string]: unknown;
1852
+ }
1853
+ interface ProjectDetailParams {
1854
+ /** Surf project UUID. PREFERRED — always use this when available from a previous response (e.g. project_id from /fund/portfolio or id from /search/project). Takes priority over q. */
1855
+ id?: string;
1856
+ /** Fuzzy entity name search. Only use when 'id' is not available. May return unexpected results for ambiguous names. */
1857
+ q?: string;
1858
+ /** Comma-separated sub-resources to include. Can be `overview`, `token_info`, `tokenomics`, `funding`, `team`, `contracts`, `social`, or `tge_status`. — @default 'overview' */
1859
+ fields?: string;
1860
+ }
1861
+ interface SearchAirdropItem {
1862
+ /** Token ticker symbol */
1863
+ coin_symbol?: string;
1864
+ /** X/Twitter follower count (0 if unknown) */
1865
+ followers_count: number;
1866
+ /** Last status change as Unix seconds */
1867
+ last_status_update: number;
1868
+ /** Project logo image URL */
1869
+ logo_url?: string;
1870
+ /** Surf project UUID if linked */
1871
+ project_id?: string;
1872
+ /** Project/coin name */
1873
+ project_name: string;
1874
+ /** Expected reward date as Unix seconds (0 if unknown) */
1875
+ reward_date: number;
1876
+ /** Reward type: airdrop, points, whitelist, nft, role, ambassador */
1877
+ reward_type?: string;
1878
+ /** Airdrop lifecycle stage: `POTENTIAL` (speculated, tasks open), `CONFIRMED` (announced, tasks open), `SNAPSHOT` (eligibility snapshot taken), `VERIFICATION` (claim window open), `REWARD_AVAILABLE` (ready to claim), `DISTRIBUTED` (sent, historical) */
1879
+ status: string;
1880
+ task_summary?: SearchAirdropItemTaskSummary;
1881
+ tasks?: SearchAirdropItemTasksItem[];
1882
+ /** Total project fundraise in USD (0 if unknown) */
1883
+ total_raise: number;
1884
+ /** CryptoRank social score (0 if unknown) */
1885
+ xscore: number;
1886
+ }
1887
+ interface SearchAirdropItemTaskSummary {
1888
+ /** Number of currently open tasks */
1889
+ open: number;
1890
+ /** Total number of tasks */
1891
+ total: number;
1892
+ types: unknown;
1893
+ }
1894
+ interface SearchAirdropItemTasksItem {
1895
+ blockchains?: unknown;
1896
+ /** Task close date as Unix seconds (0 if unknown) */
1897
+ close_date: number;
1898
+ /** Participation cost in USD (0 = free) */
1899
+ cost: number;
1900
+ /** Public participation URL */
1901
+ external_link?: string;
1902
+ /** Whether task is exclusive */
1903
+ is_exclusive: boolean;
1904
+ /** Task open date as Unix seconds (0 if unknown) */
1905
+ open_date: number;
1906
+ /** Task status: OPEN, CLOSED, UPCOMING */
1907
+ status: string;
1908
+ /** Estimated time in minutes */
1909
+ time_minutes: number;
1910
+ /** Task title */
1911
+ title: string;
1912
+ /** Task type: social, testnet, mainnet, staking, trading, etc. */
1913
+ type: string;
1914
+ }
1915
+ interface SearchAirdropParams {
1916
+ /** Search keyword for coin name */
1917
+ q?: string;
1918
+ /** Comma-separated lifecycle phases. `active` = tasks open, can participate (POTENTIAL + CONFIRMED). `claimable` = eligible, can claim (SNAPSHOT + VERIFICATION + REWARD_AVAILABLE). `completed` = done (DISTRIBUTED). Defaults to `active,claimable` to show actionable airdrops. — @default 'active' */
1919
+ phase?: string;
1920
+ /** Filter by reward type */
1921
+ reward_type?: 'airdrop' | 'points' | 'whitelist' | 'nft' | 'role' | 'ambassador';
1922
+ /** Filter activities containing tasks of this type */
1923
+ task_type?: 'social' | 'bounty-platforms' | 'testnet' | 'mainnet' | 'role' | 'form' | 'liquidity' | 'mint-nft' | 'game' | 'trading' | 'staking' | 'depin' | 'node' | 'ambassador' | 'hold' | 'check-wallet' | 'mint-domain' | 'predictions' | 'deploy';
1924
+ /** Only return activities with currently OPEN tasks — @default 'false' */
1925
+ has_open?: boolean;
1926
+ /** Field to sort results by — @default 'last_status_update' */
1927
+ sort_by?: 'total_raise' | 'xscore' | 'last_status_update';
1928
+ /** Sort order — @default 'desc' */
1929
+ order?: 'asc' | 'desc';
1930
+ /** Results per page — @default '20' */
1931
+ limit?: number;
1932
+ /** Pagination offset — @default '0' */
1933
+ offset?: number;
1934
+ /** Include full task list per activity — @default 'false' */
1935
+ include_tasks?: boolean;
1936
+ }
1937
+ interface SearchEventsItem {
1938
+ /** Event date in ISO 8601 format */
1939
+ date?: string;
1940
+ /** Detailed event description */
1941
+ description?: string;
1942
+ /** Project logo image URL */
1943
+ logo_url?: string;
1944
+ /** Short event title */
1945
+ title: string;
1946
+ /** Event type — one of: launch, upgrade, partnership, news, airdrop, listing, twitter */
1947
+ type: string;
1948
+ }
1949
+ interface SearchEventsParams {
1950
+ /** Surf project UUID. PREFERRED — always use this when available from a previous response (e.g. project_id from /fund/portfolio or id from /search/project). Takes priority over q. */
1951
+ id?: string;
1952
+ /** Fuzzy entity name search. Only use when 'id' is not available. May return unexpected results for ambiguous names. */
1953
+ q?: string;
1954
+ /** Filter by event type. Can be `launch`, `upgrade`, `partnership`, `news`, `airdrop`, `listing`, or `twitter`. */
1955
+ type?: 'launch' | 'upgrade' | 'partnership' | 'news' | 'airdrop' | 'listing' | 'twitter';
1956
+ /** Results per page — @default '20' */
1957
+ limit?: number;
1958
+ /** Pagination offset — @default '0' */
1959
+ offset?: number;
1960
+ }
1961
+ interface SearchFundItem {
1962
+ /** Surf fund UUID — pass as 'id' parameter to /fund/detail or /fund/portfolio for exact lookup */
1963
+ id: string;
1964
+ /** Fund logo URL */
1965
+ image?: string;
1966
+ /** Total number of unique invested projects (a project with multiple funding rounds counts once) */
1967
+ invested_projects_count: number;
1968
+ /** Fund name */
1969
+ name: string;
1970
+ /** Fund tier ranking (lower is better) */
1971
+ tier: number;
1972
+ top_projects: SearchFundItemTopProjectsItem[];
1973
+ /** Fund type */
1974
+ type?: string;
1975
+ }
1976
+ interface SearchFundItemTopProjectsItem {
1977
+ /** Investment date (Unix seconds) */
1978
+ invested_at?: number;
1979
+ /** Whether this fund was the lead investor */
1980
+ is_lead: boolean;
1981
+ /** Surf project UUID — pass as 'id' parameter to /project/detail, /project/events, or /project/defi/metrics for exact lookup. Prefer over 'q' (fuzzy name search). */
1982
+ project_id: string;
1983
+ /** Project logo URL */
1984
+ project_logo?: string;
1985
+ /** Project name */
1986
+ project_name: string;
1987
+ /** Project slug */
1988
+ project_slug?: string;
1989
+ /** Most recent funding round amount in USD */
1990
+ recent_raise?: number;
1991
+ /** Total amount raised by the project in USD */
1992
+ total_raise?: number;
1993
+ }
1994
+ interface SearchFundParams {
1995
+ /** Search keyword — fund name like `a16z`, `paradigm`, or `coinbase ventures` */
1996
+ q?: string;
1997
+ /** Results per page — @default '20' */
1998
+ limit?: number;
1999
+ /** Pagination offset — @default '0' */
2000
+ offset?: number;
2001
+ }
2002
+ interface SearchKalshiItem {
2003
+ /** Event subtitle */
2004
+ event_subtitle?: string;
2005
+ /** Unique event ticker identifier */
2006
+ event_ticker: string;
2007
+ /** Event title */
2008
+ event_title: string;
2009
+ /** Number of markets in this event */
2010
+ market_count: number;
2011
+ markets: SearchKalshiItemMarketsItem[];
2012
+ }
2013
+ interface SearchKalshiItemMarketsItem {
2014
+ /** Surf curated market category */
2015
+ category?: string;
2016
+ /** Market close time (Unix seconds) */
2017
+ close_time?: number;
2018
+ /** Market end time (Unix seconds) */
2019
+ end_time?: number;
2020
+ /** Parent event ticker */
2021
+ event_ticker: string;
2022
+ /** Event title */
2023
+ event_title?: string;
2024
+ /** Previous day open interest from daily report */
2025
+ last_day_open_interest: number;
2026
+ /** Unique market ticker identifier */
2027
+ market_ticker: string;
2028
+ /** Last day notional trading volume in USD (each contract = $1) */
2029
+ notional_volume_usd: number;
2030
+ /** Open interest (contracts) */
2031
+ open_interest: number;
2032
+ /** Payout type */
2033
+ payout_type: string;
2034
+ /** Market result if resolved */
2035
+ result?: string;
2036
+ /** Market start time (Unix seconds) */
2037
+ start_time?: number;
2038
+ /** Market status */
2039
+ status: string;
2040
+ /** Surf curated market subcategory */
2041
+ subcategory?: string;
2042
+ /** Market title */
2043
+ title: string;
2044
+ /** Total trading volume (contracts) */
2045
+ total_volume: number;
2046
+ }
2047
+ interface SearchKalshiParams {
2048
+ /** Search keyword matching event title, subtitle, or market title */
2049
+ q?: string;
2050
+ /** Filter by category */
2051
+ category?: 'crypto' | 'culture' | 'economics' | 'financials' | 'politics' | 'stem' | 'sports' | 'unknown';
2052
+ /** Market status filter: `active`, `closed`, `determined`, `disputed`, `finalized`, `inactive`, or `initialized` */
2053
+ status?: 'active' | 'closed' | 'determined' | 'disputed' | 'finalized' | 'inactive' | 'initialized';
2054
+ /** Results per page — @default '20' */
2055
+ limit?: number;
2056
+ /** Pagination offset — @default '0' */
2057
+ offset?: number;
2058
+ }
2059
+ interface SearchNewsItem {
2060
+ highlights?: SearchNewsItemHighlights;
2061
+ /** Article ID. Use with the detail endpoint to fetch full content. */
2062
+ id: string;
2063
+ /** Surf project UUID — pass as 'id' parameter to /project/detail, /project/events, or /project/defi/metrics for exact lookup */
2064
+ project_id?: string;
2065
+ /** Primary crypto project referenced in the article */
2066
+ project_name?: string;
2067
+ /** Unix timestamp in seconds when the article was published */
2068
+ published_at: number;
2069
+ /** Publisher name (e.g. COINDESK, COINTELEGRAPH) */
2070
+ source?: string;
2071
+ /** Short summary of the article */
2072
+ summary?: string;
2073
+ /** Article headline */
2074
+ title: string;
2075
+ /** Direct URL to the original article */
2076
+ url?: string;
2077
+ }
2078
+ interface SearchNewsItemHighlights {
2079
+ [key: string]: unknown;
2080
+ }
2081
+ interface SearchNewsParams {
2082
+ /** Search keyword or phrase */
2083
+ q?: string;
2084
+ }
2085
+ interface SearchPolymarketItem {
2086
+ /** Surf curated event category */
2087
+ category?: string;
2088
+ /** Event description */
2089
+ description?: string;
2090
+ /** Event end time (Unix seconds) */
2091
+ end_time?: number;
2092
+ /** Event identifier slug */
2093
+ event_slug: string;
2094
+ /** Event image URL */
2095
+ image?: string;
2096
+ /** Number of markets in this event */
2097
+ market_count: number;
2098
+ markets: SearchPolymarketItemMarketsItem[];
2099
+ /** Resolution source URL */
2100
+ settlement_sources?: string;
2101
+ /** Event start time (Unix seconds) */
2102
+ start_time?: number;
2103
+ /** Event status: `open` if any market is open, `closed` if all markets are closed */
2104
+ status: string;
2105
+ /** Surf curated event subcategory */
2106
+ subcategory?: string;
2107
+ tags?: unknown;
2108
+ /** Event title */
2109
+ title: string;
2110
+ /** Total event volume across all markets (USD) */
2111
+ volume_total: number;
2112
+ }
2113
+ interface SearchPolymarketItemMarketsItem {
2114
+ /** Surf curated market category */
2115
+ category?: string;
2116
+ /** Market close time (Unix seconds) */
2117
+ close_time?: number;
2118
+ /** Resolution time (Unix seconds) */
2119
+ completed_time?: number;
2120
+ /** Unique condition identifier */
2121
+ condition_id: string;
2122
+ /** Market description */
2123
+ description?: string;
2124
+ /** Market end time (Unix seconds) */
2125
+ end_time?: number;
2126
+ /** Event identifier slug */
2127
+ event_slug?: string;
2128
+ /** Game start time for sports markets (Unix seconds) */
2129
+ game_start_time?: number;
2130
+ /** Market image URL */
2131
+ image?: string;
2132
+ /** Market identifier slug */
2133
+ market_slug: string;
2134
+ /** Negative risk market identifier */
2135
+ negative_risk_id?: string;
2136
+ /** Link to Polymarket page */
2137
+ polymarket_link?: string;
2138
+ /** URL to resolution data source */
2139
+ resolution_source?: string;
2140
+ side_a?: SearchPolymarketItemMarketsItemSideA;
2141
+ side_b?: SearchPolymarketItemMarketsItemSideB;
2142
+ /** Market start time (Unix seconds) */
2143
+ start_time?: number;
2144
+ /** Market status: `open` or `closed` */
2145
+ status: string;
2146
+ /** Surf curated market subcategory */
2147
+ subcategory?: string;
2148
+ tags?: unknown;
2149
+ /** Market title */
2150
+ title: string;
2151
+ /** Trading volume in the past month (USD) */
2152
+ volume_1_month: number;
2153
+ /** Trading volume in the past week (USD) */
2154
+ volume_1_week: number;
2155
+ /** Trading volume in the past year (USD) */
2156
+ volume_1_year: number;
2157
+ /** Total trading volume (USD) */
2158
+ volume_total: number;
2159
+ /** Winning outcome label, if resolved */
2160
+ winning_side?: string;
2161
+ }
2162
+ interface SearchPolymarketItemMarketsItemSideA {
2163
+ /** Token identifier for this outcome */
2164
+ id: string;
2165
+ /** Outcome label */
2166
+ label: string;
2167
+ }
2168
+ interface SearchPolymarketItemMarketsItemSideB {
2169
+ /** Token identifier for this outcome */
2170
+ id: string;
2171
+ /** Outcome label */
2172
+ label: string;
2173
+ }
2174
+ interface SearchPolymarketParams {
2175
+ /** Search keyword matching market question, event title, or description */
2176
+ q?: string;
2177
+ /** Comma-separated tag labels to filter by (matches any). Commonly used tags: `Crypto`, `Politics`, `Sports`, `Science`, `Pop Culture` */
2178
+ tags?: string;
2179
+ /** Filter by Surf-curated category */
2180
+ category?: 'crypto' | 'culture' | 'early_polymarket_trades' | 'economics' | 'financials' | 'politics' | 'stem' | 'sports' | 'unknown';
2181
+ /** Market status filter: `active`, `finalized`, `ended`, `initialized`, or `closed` — @default 'active' */
2182
+ status?: 'active' | 'finalized' | 'ended' | 'initialized' | 'closed';
2183
+ /** Results per page — @default '20' */
2184
+ limit?: number;
2185
+ /** Pagination offset — @default '0' */
2186
+ offset?: number;
2187
+ }
2188
+ interface SearchProjectItem {
2189
+ chains?: unknown;
2190
+ /** Short description of the project */
2191
+ description?: string;
2192
+ /** Surf project UUID — pass as 'id' parameter to /project/detail, /project/events, or /project/defi/metrics for exact lookup. Prefer over 'q' (fuzzy name search). */
2193
+ id: string;
2194
+ /** Project logo image URL */
2195
+ logo_url?: string;
2196
+ /** Project name */
2197
+ name: string;
2198
+ /** Project slug for URL construction */
2199
+ slug?: string;
2200
+ /** Primary token symbol like `BTC` or `ETH` */
2201
+ symbol?: string;
2202
+ tags?: unknown;
2203
+ tokens?: SearchProjectItemTokensItem[];
2204
+ }
2205
+ interface SearchProjectItemTokensItem {
2206
+ /** Token identifier */
2207
+ id: string;
2208
+ /** Token logo image URL */
2209
+ image?: string;
2210
+ /** Token name */
2211
+ name: string;
2212
+ /** Token symbol */
2213
+ symbol: string;
2214
+ }
2215
+ interface SearchProjectParams {
2216
+ /** Search keyword — project name or ticker like `uniswap`, `bitcoin`, or `ETH` */
2217
+ q?: string;
2218
+ /** Results per page — @default '20' */
2219
+ limit?: number;
2220
+ /** Pagination offset — @default '0' */
2221
+ offset?: number;
2222
+ }
2223
+ interface SearchSocialPeopleItem {
2224
+ /** Profile picture URL */
2225
+ avatar?: string;
2226
+ /** Profile biography text */
2227
+ bio?: string;
2228
+ /** Number of followers */
2229
+ followers_count: number;
2230
+ /** Number of accounts this user follows */
2231
+ following_count: number;
2232
+ /** X/Twitter handle without the @ prefix */
2233
+ handle: string;
2234
+ /** Display name on X/Twitter */
2235
+ name: string;
2236
+ /** Numeric X/Twitter user ID as a string */
2237
+ user_id: string;
2238
+ }
2239
+ interface SearchSocialPeopleParams {
2240
+ /** Search keyword or `@handle` for exact handle lookup. Use a keyword like `vitalik` for fuzzy matching across names and bios, or `@VitalikButerin` to find a specific account by handle */
2241
+ q?: string;
2242
+ /** Results per page — @default '20' */
2243
+ limit?: number;
2244
+ /** Opaque cursor token from a previous response's next_cursor field for fetching the next page */
2245
+ cursor?: string;
2246
+ }
2247
+ interface SearchSocialPostsItem {
2248
+ author: SearchSocialPostsItemAuthor;
2249
+ /** Unix timestamp (seconds) when the tweet was posted */
2250
+ created_at: number;
2251
+ media?: SearchSocialPostsItemMediaItem[];
2252
+ stats: SearchSocialPostsItemStats;
2253
+ /** Full text content of the tweet */
2254
+ text: string;
2255
+ /** Numeric tweet ID as a string (e.g. '1234567890123456789') */
2256
+ tweet_id: string;
2257
+ /** Permanent link to the tweet on X/Twitter */
2258
+ url: string;
2259
+ }
2260
+ interface SearchSocialPostsItemAuthor {
2261
+ /** Profile picture URL */
2262
+ avatar?: string;
2263
+ /** X/Twitter handle without the @ prefix (e.g. 'cz_binance') */
2264
+ handle: string;
2265
+ /** Display name on X/Twitter */
2266
+ name: string;
2267
+ /** Numeric X/Twitter user ID as a string */
2268
+ user_id: string;
2269
+ }
2270
+ interface SearchSocialPostsItemMediaItem {
2271
+ /** Media type: photo, video, or animated_gif */
2272
+ type: string;
2273
+ /** Direct URL to the media asset */
2274
+ url: string;
2275
+ }
2276
+ interface SearchSocialPostsItemStats {
2277
+ /** Number of likes (hearts) */
2278
+ likes: number;
2279
+ /** Number of replies */
2280
+ replies: number;
2281
+ /** Number of retweets/reposts */
2282
+ reposts: number;
2283
+ /** Total view count */
2284
+ views: number;
2285
+ }
2286
+ interface SearchSocialPostsParams {
2287
+ /** Search keyword or `from:handle` syntax like `ethereum` or `from:cz_binance` */
2288
+ q?: string;
2289
+ /** Results per page — @default '20' */
2290
+ limit?: number;
2291
+ /** Opaque cursor token from a previous response's next_cursor field for fetching the next page */
2292
+ cursor?: string;
2293
+ }
2294
+ interface SearchWalletItem {
2295
+ /** Primary wallet address for this entity */
2296
+ address?: string;
2297
+ addresses?: SearchWalletItemAddressesItem[];
2298
+ /** Chain of the primary address */
2299
+ chain?: string;
2300
+ /** Name of the associated entity like `Binance` or `Aave` */
2301
+ entity_name?: string;
2302
+ /** Type of entity like `exchange`, `fund`, or `whale` */
2303
+ entity_type?: string;
2304
+ /** Human-readable label for the wallet entity */
2305
+ label?: string;
2306
+ /** Total number of wallet addresses associated with this entity */
2307
+ num_addresses?: number;
2308
+ /** Associated X (Twitter) handle */
2309
+ twitter?: string;
2310
+ }
2311
+ interface SearchWalletItemAddressesItem {
2312
+ /** Wallet address */
2313
+ address: string;
2314
+ /** Chain name like ethereum, arbitrum_one */
2315
+ chain: string;
2316
+ }
2317
+ interface SearchWalletParams {
2318
+ /** Search keyword like `binance`, `vitalik.eth`, or `0xd8dA...` */
2319
+ q?: string;
2320
+ /** Results per page — @default '20' */
2321
+ limit?: number;
2322
+ /** Pagination offset — @default '0' */
2323
+ offset?: number;
2324
+ }
2325
+ interface SearchWebItem {
2326
+ /** Relevant content snippet from the page */
2327
+ content: string;
2328
+ /** Short description or meta description of the page */
2329
+ description: string;
2330
+ /** Page title from the search result */
2331
+ title: string;
2332
+ /** Full URL of the search result page */
2333
+ url: string;
2334
+ }
2335
+ interface SearchWebParams {
2336
+ /** Search query like `bitcoin price prediction 2026` */
2337
+ q?: string;
2338
+ /** Results per page — @default '20' */
2339
+ limit?: number;
2340
+ /** Pagination offset — @default '0' */
2341
+ offset?: number;
2342
+ /** Comma-separated domain filter like `coindesk.com` or `cointelegraph.com` */
2343
+ site?: string;
2344
+ }
2345
+ interface SocialDetailData {
2346
+ follower_geo?: SocialDetailDataFollowerGeo;
2347
+ /** Surf project UUID — pass as 'id' parameter to /project/detail, /project/events, or /project/defi/metrics. Omitted for direct x_id lookups. */
2348
+ project_id?: string;
2349
+ /** Project name (omitted for direct x_id lookups) */
2350
+ project_name?: string;
2351
+ sentiment?: SocialDetailDataSentiment;
2352
+ smart_followers?: SocialDetailDataSmartFollowers;
2353
+ /** Numeric X (Twitter) account ID */
2354
+ twitter_id: string;
2355
+ }
2356
+ interface SocialDetailDataFollowerGeo {
2357
+ locations: SocialDetailDataFollowerGeoLocationsItem[];
2358
+ /** Total number of followers across all locations */
2359
+ total_follower_count: number;
2360
+ }
2361
+ interface SocialDetailDataSentiment {
2362
+ /** Sentiment score from -1 (very negative) to 1 (very positive) */
2363
+ score: unknown;
2364
+ /** Time range for the sentiment analysis like 7d or 30d */
2365
+ time_range: string;
2366
+ }
2367
+ interface SocialDetailDataSmartFollowers {
2368
+ /** Total number of smart followers */
2369
+ count: number;
2370
+ followers: SocialDetailDataSmartFollowersFollowersItem[];
2371
+ }
2372
+ interface SocialDetailDataFollowerGeoLocationsItem {
2373
+ /** Number of followers in this location */
2374
+ follower_count: number;
2375
+ /** Geographic location name like a country or region */
2376
+ location: string;
2377
+ /** Percentage of total followers in this location (0-100) */
2378
+ percentage: number;
2379
+ }
2380
+ interface SocialDetailDataSmartFollowersFollowersItem {
2381
+ /** Profile image URL */
2382
+ avatar: string;
2383
+ /** Human-readable description of the follower's role */
2384
+ description?: string;
2385
+ /** Number of followers this account has */
2386
+ followers_count: number;
2387
+ /** X (Twitter) handle without the @ prefix */
2388
+ handle: string;
2389
+ /** Display name of the follower */
2390
+ name: string;
2391
+ /** Rank position among smart followers (1 = highest) */
2392
+ rank: number;
2393
+ /** Smart follower influence score */
2394
+ score: number;
2395
+ /** Smart follower category tag like VC, KOL, or Developer */
2396
+ tag: string;
2397
+ /** Numeric X (Twitter) user ID */
2398
+ twitter_id: string;
2399
+ }
2400
+ interface SocialDetailParams {
2401
+ /** Numeric X (Twitter) account ID (takes priority over `q`) */
2402
+ x_id?: string;
2403
+ /** Entity name to resolve like `uniswap`, `ethereum`, or `aave` */
2404
+ q?: string;
2405
+ /** Comma-separated sub-resources to include. Can be `sentiment`, `follower_geo`, or `smart_followers`. — @default 'sentiment' */
2406
+ fields?: string;
2407
+ /** Timeframe for sentiment data. Can be `24h`, `48h`, `7d`, `30d`, `3m`, `6m`, or `1y`. — @default '7d' */
2408
+ time_range?: '24h' | '48h' | '7d' | '30d' | '3m' | '6m' | '1y';
2409
+ /** Max geo locations to return — @default '20' */
2410
+ geo_limit?: number;
2411
+ }
2412
+ interface SocialMindshareItem {
2413
+ /** Unix timestamp in seconds */
2414
+ timestamp: number;
2415
+ /** Mindshare view count at this timestamp */
2416
+ value: number;
2417
+ }
2418
+ interface SocialMindshareParams {
2419
+ /** Entity name to resolve like `uniswap`, `ethereum`, or `aave` */
2420
+ q?: string;
2421
+ /** Time aggregation interval. Can be `5m`, `1h`, `1d`, or `7d`. */
2422
+ interval?: '5m' | '1h' | '1d' | '7d';
2423
+ /** Start timestamp. Accepts Unix seconds (1704067200) or date string (2024-01-01) */
2424
+ from?: string;
2425
+ /** End timestamp. Accepts Unix seconds (1706745600) or date string (2024-02-01) */
2426
+ to?: string;
2427
+ }
2428
+ interface SocialRankingItem {
2429
+ project?: SocialRankingItemProject;
2430
+ /** Rank position in the mindshare leaderboard */
2431
+ rank: number;
2432
+ /** Sentiment polarity: positive or negative */
2433
+ sentiment?: string;
2434
+ /** Weighted sentiment score from -1 (very negative) to 1 (very positive) */
2435
+ sentiment_score?: number;
2436
+ tags?: unknown;
2437
+ token?: SocialRankingItemToken;
2438
+ /** Deprecated: no longer populated. */
2439
+ trending_short_reason?: string;
2440
+ /** Deprecated: no longer populated. */
2441
+ trending_summary?: string;
2442
+ twitter?: SocialRankingItemTwitter;
2443
+ }
2444
+ interface SocialRankingItemProject {
2445
+ /** Surf project UUID — pass as 'id' parameter to /project/detail, /project/events, or /project/defi/metrics for exact lookup */
2446
+ id: string;
2447
+ /** Project name */
2448
+ name: string;
2449
+ /** URL-friendly project slug */
2450
+ slug?: string;
2451
+ }
2452
+ interface SocialRankingItemToken {
2453
+ /** Surf token UUID */
2454
+ id?: string;
2455
+ /** Token image URL */
2456
+ image?: string;
2457
+ /** Token name */
2458
+ name: string;
2459
+ /** Token ticker symbol */
2460
+ symbol?: string;
2461
+ }
2462
+ interface SocialRankingItemTwitter {
2463
+ /** Profile image URL */
2464
+ avatar_url?: string;
2465
+ /** X (Twitter) display name */
2466
+ display_name: string;
2467
+ /** Numeric X (Twitter) user ID */
2468
+ twitter_id: string;
2469
+ /** X (Twitter) handle without the @ prefix */
2470
+ x_handle: string;
2471
+ }
2472
+ interface SocialRankingParams {
2473
+ /** Pagination offset — @default '0' */
2474
+ offset?: number;
2475
+ /** Results per page — @default '20' */
2476
+ limit?: number;
2477
+ /** Filter by project category. `l1` = Layer 1, `l2` = Layer 2/scaling, `dex` = DEX/AMM, `derivatives` = perps/options, `cex` = centralized exchange, `gamefi` = gaming, `nft` = NFT collections, `oracle` = oracle, `prediction` = prediction market, `rwa` = real-world assets, `yield` = yield/asset management, `data` = data/analytics, `devtool` = developer tooling, `compliance` = compliance/regtech, `meme` = meme/token launchpad. */
2478
+ tag?: 'l1' | 'l2' | 'dex' | 'derivatives' | 'cex' | 'gamefi' | 'nft' | 'oracle' | 'prediction' | 'rwa' | 'yield' | 'data' | 'devtool' | 'compliance' | 'meme' | '';
2479
+ /** Mindshare ranking timeframe window — @default '7d' */
2480
+ time_range?: '24h' | '48h' | '7d' | '30d';
2481
+ /** Filter by sentiment polarity. Only projects with sufficient tweet data are classified. */
2482
+ sentiment?: 'positive' | 'negative' | '';
2483
+ }
2484
+ interface SocialSmartFollowersHistoryItem {
2485
+ /** Number of smart followers on this date */
2486
+ count: number;
2487
+ /** Date in YYYY-MM-DD format */
2488
+ date: string;
2489
+ }
2490
+ interface SocialSmartFollowersHistoryParams {
2491
+ /** Numeric X (Twitter) account ID (takes priority over `q`) */
2492
+ x_id?: string;
2493
+ /** Project name to resolve (e.g. `uniswap`, `ethereum`). Must be a project with a linked X account — personal handles like `VitalikButerin` return 404. Use `x_id` for individual accounts. */
2494
+ q?: string;
2495
+ /** Max data points to return (upstream typically provides ~36 daily points) — @default '36' */
2496
+ limit?: number;
2497
+ }
2498
+ interface SocialTweetRepliesItem {
2499
+ author: SocialTweetRepliesItemAuthor;
2500
+ /** Unix timestamp (seconds) when the tweet was posted */
2501
+ created_at: number;
2502
+ media?: SocialTweetRepliesItemMediaItem[];
2503
+ stats: SocialTweetRepliesItemStats;
2504
+ /** Full text content of the tweet */
2505
+ text: string;
2506
+ /** Numeric tweet ID as a string (e.g. '1234567890123456789') */
2507
+ tweet_id: string;
2508
+ /** Permanent link to the tweet on X/Twitter */
2509
+ url: string;
2510
+ }
2511
+ interface SocialTweetRepliesItemAuthor {
2512
+ /** Profile picture URL */
2513
+ avatar?: string;
2514
+ /** X/Twitter handle without the @ prefix (e.g. 'cz_binance') */
2515
+ handle: string;
2516
+ /** Display name on X/Twitter */
2517
+ name: string;
2518
+ /** Numeric X/Twitter user ID as a string */
2519
+ user_id: string;
2520
+ }
2521
+ interface SocialTweetRepliesItemMediaItem {
2522
+ /** Media type: photo, video, or animated_gif */
2523
+ type: string;
2524
+ /** Direct URL to the media asset */
2525
+ url: string;
2526
+ }
2527
+ interface SocialTweetRepliesItemStats {
2528
+ /** Number of likes (hearts) */
2529
+ likes: number;
2530
+ /** Number of replies */
2531
+ replies: number;
2532
+ /** Number of retweets/reposts */
2533
+ reposts: number;
2534
+ /** Total view count */
2535
+ views: number;
2536
+ }
2537
+ interface SocialTweetRepliesParams {
2538
+ /** Tweet ID to get replies for */
2539
+ tweet_id?: string;
2540
+ /** Max results to return — @default '20' */
2541
+ limit?: number;
2542
+ /** Opaque cursor token from a previous response's next_cursor field for fetching the next page */
2543
+ cursor?: string;
2544
+ }
2545
+ interface SocialTweetsItem {
2546
+ author: SocialTweetsItemAuthor;
2547
+ /** Unix timestamp (seconds) when the tweet was posted */
2548
+ created_at: number;
2549
+ media?: SocialTweetsItemMediaItem[];
2550
+ stats: SocialTweetsItemStats;
2551
+ /** Full text content of the tweet */
2552
+ text: string;
2553
+ /** Numeric tweet ID as a string (e.g. '1234567890123456789') */
2554
+ tweet_id: string;
2555
+ /** Permanent link to the tweet on X/Twitter */
2556
+ url: string;
2557
+ }
2558
+ interface SocialTweetsItemAuthor {
2559
+ /** Profile picture URL */
2560
+ avatar?: string;
2561
+ /** X/Twitter handle without the @ prefix (e.g. 'cz_binance') */
2562
+ handle: string;
2563
+ /** Display name on X/Twitter */
2564
+ name: string;
2565
+ /** Numeric X/Twitter user ID as a string */
2566
+ user_id: string;
2567
+ }
2568
+ interface SocialTweetsItemMediaItem {
2569
+ /** Media type: photo, video, or animated_gif */
2570
+ type: string;
2571
+ /** Direct URL to the media asset */
2572
+ url: string;
2573
+ }
2574
+ interface SocialTweetsItemStats {
2575
+ /** Number of likes (hearts) */
2576
+ likes: number;
2577
+ /** Number of replies */
2578
+ replies: number;
2579
+ /** Number of retweets/reposts */
2580
+ reposts: number;
2581
+ /** Total view count */
2582
+ views: number;
2583
+ }
2584
+ interface SocialTweetsParams {
2585
+ /** Comma-separated numeric post ID strings, max 100 */
2586
+ ids?: string;
2587
+ }
2588
+ interface SocialUserData {
2589
+ /** Profile picture URL */
2590
+ avatar?: string;
2591
+ /** Profile biography text */
2592
+ bio?: string;
2593
+ /** Number of followers */
2594
+ followers_count: number;
2595
+ /** Number of accounts this user follows */
2596
+ following_count: number;
2597
+ /** X/Twitter handle without the @ prefix */
2598
+ handle: string;
2599
+ /** Display name on X/Twitter */
2600
+ name: string;
2601
+ /** Numeric X/Twitter user ID as a string */
2602
+ user_id: string;
2603
+ }
2604
+ interface SocialUserParams {
2605
+ /** X (Twitter) username without @ like `cz_binance` or `vitalikbuterin` */
2606
+ handle?: string;
2607
+ }
2608
+ interface SocialUserFollowersItem {
2609
+ /** Profile picture URL */
2610
+ avatar?: string;
2611
+ /** Profile biography text */
2612
+ bio?: string;
2613
+ /** Number of followers */
2614
+ followers_count: number;
2615
+ /** Number of accounts this user follows */
2616
+ following_count: number;
2617
+ /** X/Twitter handle without the @ prefix */
2618
+ handle: string;
2619
+ /** Display name on X/Twitter */
2620
+ name: string;
2621
+ /** Numeric X/Twitter user ID as a string */
2622
+ user_id: string;
2623
+ }
2624
+ interface SocialUserFollowersParams {
2625
+ /** X (Twitter) username without @ like `vitalikbuterin` or `cz_binance` */
2626
+ handle?: string;
2627
+ /** Max results to return — @default '20' */
2628
+ limit?: number;
2629
+ /** Opaque cursor token from a previous response's next_cursor field for fetching the next page */
2630
+ cursor?: string;
2631
+ }
2632
+ interface SocialUserFollowingItem {
2633
+ /** Profile picture URL */
2634
+ avatar?: string;
2635
+ /** Profile biography text */
2636
+ bio?: string;
2637
+ /** Number of followers */
2638
+ followers_count: number;
2639
+ /** Number of accounts this user follows */
2640
+ following_count: number;
2641
+ /** X/Twitter handle without the @ prefix */
2642
+ handle: string;
2643
+ /** Display name on X/Twitter */
2644
+ name: string;
2645
+ /** Numeric X/Twitter user ID as a string */
2646
+ user_id: string;
2647
+ }
2648
+ interface SocialUserFollowingParams {
2649
+ /** X (Twitter) username without @ like `vitalikbuterin` or `cz_binance` */
2650
+ handle?: string;
2651
+ /** Max results to return — @default '20' */
2652
+ limit?: number;
2653
+ /** Opaque cursor token from a previous response's next_cursor field for fetching the next page */
2654
+ cursor?: string;
2655
+ }
2656
+ interface SocialUserPostsItem {
2657
+ author: SocialUserPostsItemAuthor;
2658
+ /** Unix timestamp (seconds) when the tweet was posted */
2659
+ created_at: number;
2660
+ media?: SocialUserPostsItemMediaItem[];
2661
+ stats: SocialUserPostsItemStats;
2662
+ /** Full text content of the tweet */
2663
+ text: string;
2664
+ /** Numeric tweet ID as a string (e.g. '1234567890123456789') */
2665
+ tweet_id: string;
2666
+ /** Permanent link to the tweet on X/Twitter */
2667
+ url: string;
2668
+ }
2669
+ interface SocialUserPostsItemAuthor {
2670
+ /** Profile picture URL */
2671
+ avatar?: string;
2672
+ /** X/Twitter handle without the @ prefix (e.g. 'cz_binance') */
2673
+ handle: string;
2674
+ /** Display name on X/Twitter */
2675
+ name: string;
2676
+ /** Numeric X/Twitter user ID as a string */
2677
+ user_id: string;
2678
+ }
2679
+ interface SocialUserPostsItemMediaItem {
2680
+ /** Media type: photo, video, or animated_gif */
2681
+ type: string;
2682
+ /** Direct URL to the media asset */
2683
+ url: string;
2684
+ }
2685
+ interface SocialUserPostsItemStats {
2686
+ /** Number of likes (hearts) */
2687
+ likes: number;
2688
+ /** Number of replies */
2689
+ replies: number;
2690
+ /** Number of retweets/reposts */
2691
+ reposts: number;
2692
+ /** Total view count */
2693
+ views: number;
2694
+ }
2695
+ interface SocialUserPostsParams {
2696
+ /** X (Twitter) username without @ like `vitalikbuterin` or `cz_binance` */
2697
+ handle?: string;
2698
+ /** Results per page — @default '20' */
2699
+ limit?: number;
2700
+ /** Opaque cursor token from a previous response's next_cursor field for fetching the next page */
2701
+ cursor?: string;
2702
+ /** Filter tweets: `all` returns everything, `original` excludes retweets — @default 'all' */
2703
+ filter?: 'all' | 'original';
2704
+ }
2705
+ interface SocialUserRepliesItem {
2706
+ author: SocialUserRepliesItemAuthor;
2707
+ /** Unix timestamp (seconds) when the tweet was posted */
2708
+ created_at: number;
2709
+ media?: SocialUserRepliesItemMediaItem[];
2710
+ stats: SocialUserRepliesItemStats;
2711
+ /** Full text content of the tweet */
2712
+ text: string;
2713
+ /** Numeric tweet ID as a string (e.g. '1234567890123456789') */
2714
+ tweet_id: string;
2715
+ /** Permanent link to the tweet on X/Twitter */
2716
+ url: string;
2717
+ }
2718
+ interface SocialUserRepliesItemAuthor {
2719
+ /** Profile picture URL */
2720
+ avatar?: string;
2721
+ /** X/Twitter handle without the @ prefix (e.g. 'cz_binance') */
2722
+ handle: string;
2723
+ /** Display name on X/Twitter */
2724
+ name: string;
2725
+ /** Numeric X/Twitter user ID as a string */
2726
+ user_id: string;
2727
+ }
2728
+ interface SocialUserRepliesItemMediaItem {
2729
+ /** Media type: photo, video, or animated_gif */
2730
+ type: string;
2731
+ /** Direct URL to the media asset */
2732
+ url: string;
2733
+ }
2734
+ interface SocialUserRepliesItemStats {
2735
+ /** Number of likes (hearts) */
2736
+ likes: number;
2737
+ /** Number of replies */
2738
+ replies: number;
2739
+ /** Number of retweets/reposts */
2740
+ reposts: number;
2741
+ /** Total view count */
2742
+ views: number;
2743
+ }
2744
+ interface SocialUserRepliesParams {
2745
+ /** X (Twitter) username without @ like `vitalikbuterin` or `cz_binance` */
2746
+ handle?: string;
2747
+ /** Max results to return — @default '20' */
2748
+ limit?: number;
2749
+ /** Opaque cursor token from a previous response's next_cursor field for fetching the next page */
2750
+ cursor?: string;
2751
+ }
2752
+ interface TokenDexTradesItem {
2753
+ /** Trade value in USD at execution time */
2754
+ amount_usd: number;
2755
+ /** Unix timestamp in seconds when the trade was executed */
2756
+ block_time: number;
2757
+ /** DEX project name like `uniswap`, `sushiswap`, or `curve` */
2758
+ project: string;
2759
+ /** Wallet address that initiated the swap */
2760
+ taker: string;
2761
+ /** Contract address of the token bought */
2762
+ token_bought_address?: string;
2763
+ /** Amount of tokens bought (decimal-adjusted) */
2764
+ token_bought_amount: number;
2765
+ /** Symbol of the token bought in this trade */
2766
+ token_bought_symbol: string;
2767
+ /** Trading pair symbol like `WETH-USDC` */
2768
+ token_pair: string;
2769
+ /** Contract address of the token sold */
2770
+ token_sold_address?: string;
2771
+ /** Amount of tokens sold (decimal-adjusted) */
2772
+ token_sold_amount: number;
2773
+ /** Symbol of the token sold in this trade */
2774
+ token_sold_symbol: string;
2775
+ /** Transaction hash */
2776
+ tx_hash: string;
2777
+ /** DEX version like `v2` or `v3` */
2778
+ version: string;
2779
+ }
2780
+ interface TokenDexTradesParams {
2781
+ /** Token contract address (0x-prefixed hex) */
2782
+ address?: string;
2783
+ /** Chain. Can be `ethereum` or `base`. — @default 'ethereum' */
2784
+ chain?: 'ethereum' | 'base';
2785
+ /** Results per page — @default '20' */
2786
+ limit?: number;
2787
+ /** Pagination offset — @default '0' */
2788
+ offset?: number;
2789
+ }
2790
+ interface TokenHoldersItem {
2791
+ /** Wallet address of the token holder */
2792
+ address: string;
2793
+ /** Token balance (decimal-adjusted, human-readable) */
2794
+ balance: string;
2795
+ /** Name of the associated entity like `Binance` or `Aave` */
2796
+ entity_name?: string;
2797
+ /** Type of entity like `exchange`, `fund`, or `whale` */
2798
+ entity_type?: string;
2799
+ /** Share of total supply held as a percentage (5.2 means 5.2%) */
2800
+ percentage?: number;
2801
+ }
2802
+ interface TokenHoldersParams {
2803
+ /** Token contract address (0x-prefixed hex or Solana base58) */
2804
+ address?: string;
2805
+ /** Chain. Can be `ethereum`, `polygon`, `bsc`, `solana`, `avalanche`, `arbitrum`, `optimism`, or `base`. */
2806
+ chain?: 'ethereum' | 'polygon' | 'bsc' | 'solana' | 'avalanche' | 'arbitrum' | 'optimism' | 'base';
2807
+ /** Results per page — @default '20' */
2808
+ limit?: number;
2809
+ /** Pagination offset (accepted for API consistency but currently ignored) — @default '0' */
2810
+ offset?: number;
2811
+ }
2812
+ interface TokenTokenomicsItem {
2813
+ allocations?: TokenTokenomicsItemAllocationsItem[];
2814
+ /** Unix timestamp in seconds */
2815
+ timestamp: number;
2816
+ /** Cumulative total tokens unlocked up to this timestamp (decimal-adjusted) */
2817
+ unlock_amount: number;
2818
+ }
2819
+ interface TokenTokenomicsItemAllocationsItem {
2820
+ /** Decimal-adjusted allocation amount */
2821
+ amount: number;
2822
+ /** Allocation name */
2823
+ name: string;
2824
+ }
2825
+ interface TokenTokenomicsParams {
2826
+ /** Surf project UUID. PREFERRED — always use this when available from a previous response. Takes priority over symbol. */
2827
+ id?: string;
2828
+ /** Token symbol like `ARB`, `OP`, or `APT` */
2829
+ symbol?: string;
2830
+ /** Start of time range. Accepts Unix seconds (`1704067200`) or date string (`2024-01-01`) */
2831
+ from?: string;
2832
+ /** End of time range. Accepts Unix seconds (`1735689600`) or date string (`2025-01-01`) */
2833
+ to?: string;
2834
+ }
2835
+ interface TokenTransfersItem {
2836
+ /** Transfer amount (decimal-adjusted, human-readable) */
2837
+ amount: string;
2838
+ /** Transfer value in USD at the time of the transaction. Not available for all transfers. */
2839
+ amount_usd?: number;
2840
+ /** Block number in which this transfer was included */
2841
+ block_number: number;
2842
+ /** Sender wallet address */
2843
+ from_address: string;
2844
+ /** Token symbol like ETH, USDC, or WETH */
2845
+ symbol?: string;
2846
+ /** Unix timestamp in seconds when the transfer occurred */
2847
+ timestamp: number;
2848
+ /** Recipient wallet address */
2849
+ to_address: string;
2850
+ /** Transaction hash */
2851
+ tx_hash: string;
2852
+ }
2853
+ interface TokenTransfersParams {
2854
+ /** Token contract address (0x-prefixed hex or Solana base58) */
2855
+ address?: string;
2856
+ /** Chain. Can be `ethereum`, `base`, `solana`, or `tron`. */
2857
+ chain?: 'ethereum' | 'base' | 'solana' | 'tron';
2858
+ /** Start of date range. Accepts Unix seconds or YYYY-MM-DD. Defaults to 30 days ago. */
2859
+ from?: string;
2860
+ /** End of date range. Accepts Unix seconds or YYYY-MM-DD. Defaults to today. */
2861
+ to?: string;
2862
+ /** Results per page — @default '20' */
2863
+ limit?: number;
2864
+ /** Pagination offset — @default '0' */
2865
+ offset?: number;
2866
+ }
2867
+ interface WalletDetailData {
2868
+ active_chains?: WalletDetailDataActiveChainsItem[];
2869
+ approvals?: WalletDetailDataApprovalsItem[];
2870
+ errors?: WalletDetailDataErrorsItem[];
2871
+ evm_balance?: WalletDetailDataEvmBalance;
2872
+ evm_tokens?: WalletDetailDataEvmTokensItem[];
2873
+ labels?: WalletDetailDataLabels;
2874
+ nft?: WalletDetailDataNftItem[];
2875
+ sol_balance?: WalletDetailDataSolBalance;
2876
+ sol_tokens?: WalletDetailDataSolTokensItem[];
2877
+ }
2878
+ interface WalletDetailDataActiveChainsItem {
2879
+ /** Canonical chain name like `ethereum` or `polygon` */
2880
+ chain: string;
2881
+ /** EVM chain ID like `1` for Ethereum or `137` for Polygon */
2882
+ chain_id?: number;
2883
+ /** Total USD value of assets on this chain */
2884
+ usd_value: number;
2885
+ }
2886
+ interface WalletDetailDataApprovalsItem {
2887
+ /** Current token balance */
2888
+ balance: number;
2889
+ /** Canonical chain name */
2890
+ chain: string;
2891
+ /** Full token name */
2892
+ name?: string;
2893
+ spenders: WalletDetailDataApprovalsItemSpendersItem[];
2894
+ /** Token ticker symbol */
2895
+ symbol: string;
2896
+ /** Token contract address */
2897
+ token_address: string;
2898
+ }
2899
+ interface WalletDetailDataErrorsItem {
2900
+ /** Field name that failed to load like `evm_balance`, `sol_balance`, `evm_tokens`, `sol_tokens`, `labels`, `nft`, `active_chains`, or `approvals` */
2901
+ field: string;
2902
+ /** Error message describing why the field could not be loaded */
2903
+ message: string;
2904
+ }
2905
+ interface WalletDetailDataEvmBalance {
2906
+ /** Wallet address */
2907
+ address: string;
2908
+ chain_balances?: WalletDetailDataEvmBalanceChainBalancesItem[];
2909
+ /** Total portfolio value in USD (EVM only) */
2910
+ total_usd: number;
2911
+ }
2912
+ interface WalletDetailDataEvmTokensItem {
2913
+ /** Decimal-adjusted token balance as a string */
2914
+ balance: string;
2915
+ /** Chain name like ethereum, polygon (EVM only) */
2916
+ chain?: string;
2917
+ /** Whether the token is verified (EVM only) */
2918
+ is_verified: boolean;
2919
+ /** Token logo image URL */
2920
+ logo_url?: string;
2921
+ /** Full token name */
2922
+ name?: string;
2923
+ /** Current USD price per token (EVM only) */
2924
+ price: number;
2925
+ /** Token ticker symbol */
2926
+ symbol: string;
2927
+ /** Token contract address (EVM only) */
2928
+ token_address: string;
2929
+ /** Total USD value (balance * price) (EVM only) */
2930
+ usd_value: number;
2931
+ }
2932
+ interface WalletDetailDataLabels {
2933
+ /** Wallet address */
2934
+ address: string;
2935
+ /** Name of the associated entity like `Binance` or `Aave` */
2936
+ entity_name?: string;
2937
+ /** Type of entity like `exchange`, `fund`, or `whale` */
2938
+ entity_type?: string;
2939
+ labels: WalletDetailDataLabelsLabelsItem[];
2940
+ }
2941
+ interface WalletDetailDataNftItem {
2942
+ /** Canonical chain name like `ethereum` or `polygon` */
2943
+ chain?: string;
2944
+ /** NFT collection name */
2945
+ collection_name?: string;
2946
+ /** NFT contract address */
2947
+ contract_address: string;
2948
+ /** NFT image or thumbnail URL */
2949
+ image_url?: string;
2950
+ /** NFT item name or title */
2951
+ name?: string;
2952
+ /** NFT token ID within the collection */
2953
+ token_id: string;
2954
+ /** Latest trading price in USD */
2955
+ usd_price?: number;
2956
+ }
2957
+ interface WalletDetailDataSolBalance {
2958
+ /** Wallet address */
2959
+ address: string;
2960
+ /** Decimal-adjusted native SOL balance as a string (Solana only) */
2961
+ sol_balance: string;
2962
+ }
2963
+ interface WalletDetailDataSolTokensItem {
2964
+ /** Decimal-adjusted token balance as a string */
2965
+ balance: string;
2966
+ /** Token decimal places (Solana only) */
2967
+ decimals: number;
2968
+ /** Full token name */
2969
+ name?: string;
2970
+ /** Token ticker symbol */
2971
+ symbol: string;
2972
+ /** SPL token mint address (Solana only) */
2973
+ token_address: string;
2974
+ }
2975
+ interface WalletDetailDataApprovalsItemSpendersItem {
2976
+ /** Approved token amount (use -1 for unlimited) */
2977
+ allowance: number;
2978
+ /** Address of the approved spender contract */
2979
+ spender_address: string;
2980
+ /** Human-readable name of the spender, absent for unrecognized contracts */
2981
+ spender_name?: string;
2982
+ }
2983
+ interface WalletDetailDataEvmBalanceChainBalancesItem {
2984
+ /** Canonical chain name like `ethereum` or `polygon` */
2985
+ chain: string;
2986
+ /** EVM chain ID like `1` for Ethereum or `137` for Polygon */
2987
+ chain_id?: number;
2988
+ /** Total USD value of assets on this chain */
2989
+ usd_value: number;
2990
+ }
2991
+ interface WalletDetailDataLabelsLabelsItem {
2992
+ /** Confidence score 0.0-1.0 */
2993
+ confidence?: number;
2994
+ /** Human-readable label for this address like `Binance Hot Wallet` */
2995
+ label: string;
2996
+ }
2997
+ interface WalletDetailParams {
2998
+ /** Wallet address (0x hex for EVM, base58 for Solana) */
2999
+ address?: string;
3000
+ /** Chain filter for `tokens`, `nft`, and `approvals`. When omitted, inferred from address format: 0x addresses query all EVM chains, base58 addresses query Solana. */
3001
+ chain?: 'ethereum' | 'polygon' | 'bsc' | 'avalanche' | 'arbitrum' | 'optimism' | 'fantom' | 'base' | 'solana';
3002
+ /** Comma-separated sub-resources to include. Valid: `balance`, `tokens`, `labels`, `nft`, `approvals`. The `active_chains` field is always returned. `approvals` is opt-in (not in default) as it triggers additional upstream calls. — @default 'balance' */
3003
+ fields?: string;
3004
+ }
3005
+ interface WalletHistoryItem {
3006
+ /** Sender wallet address */
3007
+ from_address: string;
3008
+ /** Unix timestamp in seconds when the transaction was confirmed */
3009
+ timestamp: number;
3010
+ /** Recipient wallet address */
3011
+ to_address: string;
3012
+ /** Transaction hash */
3013
+ tx_hash: string;
3014
+ /** Transaction type: `send`, `receive`, `swap`, `approve`, etc. */
3015
+ tx_type?: string;
3016
+ /** Decimal-adjusted transaction value in native token as a string */
3017
+ value: string;
3018
+ }
3019
+ interface WalletHistoryParams {
3020
+ /** Wallet address — must be a raw 0x-prefixed hex address, not an ENS name */
3021
+ address?: string;
3022
+ /** Chain filter. Can be `ethereum`, `polygon`, `bsc`, `avalanche`, `arbitrum`, `optimism`, `fantom`, or `base`. — @default 'ethereum' */
3023
+ chain?: 'ethereum' | 'polygon' | 'bsc' | 'avalanche' | 'arbitrum' | 'optimism' | 'fantom' | 'base';
3024
+ /** Results per page — @default '20' */
3025
+ limit?: number;
3026
+ /** Pagination offset — @default '0' */
3027
+ offset?: number;
3028
+ /** Field to sort results by — @default 'timestamp' */
3029
+ sort_by?: 'timestamp' | 'value';
3030
+ /** Sort order — @default 'desc' */
3031
+ order?: 'asc' | 'desc';
3032
+ }
3033
+ interface WalletLabelsBatchItem {
3034
+ /** Wallet address */
3035
+ address: string;
3036
+ /** Name of the associated entity like `Binance` or `Aave` */
3037
+ entity_name?: string;
3038
+ /** Type of entity like `exchange`, `fund`, or `whale` */
3039
+ entity_type?: string;
3040
+ labels: WalletLabelsBatchItemLabelsItem[];
3041
+ }
3042
+ interface WalletLabelsBatchItemLabelsItem {
3043
+ /** Confidence score 0.0-1.0 */
3044
+ confidence?: number;
3045
+ /** Human-readable label for this address like `Binance Hot Wallet` */
3046
+ label: string;
3047
+ }
3048
+ interface WalletLabelsBatchParams {
3049
+ /** Comma-separated wallet addresses to look up, max 100 */
3050
+ addresses?: string;
3051
+ }
3052
+ interface WalletNetWorthItem {
3053
+ /** Unix timestamp in seconds */
3054
+ timestamp: number;
3055
+ /** Total portfolio value in USD at this point in time */
3056
+ usd_value: number;
3057
+ }
3058
+ interface WalletNetWorthParams {
3059
+ /** Wallet address (0x hex, base58, or ENS name like `vitalik.eth`) */
3060
+ address?: string;
3061
+ }
3062
+ interface WalletProtocolsItem {
3063
+ /** Canonical chain name where the protocol operates */
3064
+ chain: string;
3065
+ /** Protocol logo image URL */
3066
+ logo_url?: string;
3067
+ positions: WalletProtocolsItemPositionsItem[];
3068
+ /** Human-readable protocol name */
3069
+ protocol_name: string;
3070
+ /** Protocol website URL */
3071
+ site_url?: string;
3072
+ /** Total USD value across all positions in this protocol */
3073
+ total_usd: number;
3074
+ }
3075
+ interface WalletProtocolsItemPositionsItem {
3076
+ /** Total USD value of this position */
3077
+ balance_usd: number;
3078
+ borrow_tokens?: WalletProtocolsItemPositionsItemBorrowTokensItem[];
3079
+ lp_tokens?: WalletProtocolsItemPositionsItemLpTokensItem[];
3080
+ /** Position name or type like `Lending` or `Staking` */
3081
+ name: string;
3082
+ reward_tokens?: WalletProtocolsItemPositionsItemRewardTokensItem[];
3083
+ supply_tokens?: WalletProtocolsItemPositionsItemSupplyTokensItem[];
3084
+ }
3085
+ interface WalletProtocolsItemPositionsItemBorrowTokensItem {
3086
+ /** Token amount held in this position */
3087
+ amount: number;
3088
+ /** Canonical chain name like `ethereum` or `polygon` */
3089
+ chain: string;
3090
+ /** Full token name */
3091
+ name?: string;
3092
+ /** Current token price in USD */
3093
+ price: number;
3094
+ /** Token ticker symbol */
3095
+ symbol: string;
3096
+ /** Token contract address */
3097
+ token_address?: string;
3098
+ }
3099
+ interface WalletProtocolsItemPositionsItemLpTokensItem {
3100
+ /** Token amount held in this position */
3101
+ amount: number;
3102
+ /** Canonical chain name like `ethereum` or `polygon` */
3103
+ chain: string;
3104
+ /** Full token name */
3105
+ name?: string;
3106
+ /** Current token price in USD */
3107
+ price: number;
3108
+ /** Token ticker symbol */
3109
+ symbol: string;
3110
+ /** Token contract address */
3111
+ token_address?: string;
3112
+ }
3113
+ interface WalletProtocolsItemPositionsItemRewardTokensItem {
3114
+ /** Token amount held in this position */
3115
+ amount: number;
3116
+ /** Canonical chain name like `ethereum` or `polygon` */
3117
+ chain: string;
3118
+ /** Full token name */
3119
+ name?: string;
3120
+ /** Current token price in USD */
3121
+ price: number;
3122
+ /** Token ticker symbol */
3123
+ symbol: string;
3124
+ /** Token contract address */
3125
+ token_address?: string;
3126
+ }
3127
+ interface WalletProtocolsItemPositionsItemSupplyTokensItem {
3128
+ /** Token amount held in this position */
3129
+ amount: number;
3130
+ /** Canonical chain name like `ethereum` or `polygon` */
3131
+ chain: string;
3132
+ /** Full token name */
3133
+ name?: string;
3134
+ /** Current token price in USD */
3135
+ price: number;
3136
+ /** Token ticker symbol */
3137
+ symbol: string;
3138
+ /** Token contract address */
3139
+ token_address?: string;
3140
+ }
3141
+ interface WalletProtocolsParams {
3142
+ /** Wallet address — must be a raw 0x-prefixed hex address, not an ENS name */
3143
+ address?: string;
3144
+ /** Results per page — @default '20' */
3145
+ limit?: number;
3146
+ /** Pagination offset — @default '0' */
3147
+ offset?: number;
3148
+ }
3149
+ interface WalletTransfersItem {
3150
+ /** Transfer activity type (Solana only, e.g. ACTIVITY_SPL_TRANSFER) */
3151
+ activity_type?: string;
3152
+ /** Decimal-adjusted transfer amount as a string */
3153
+ amount: string;
3154
+ /** Transfer value in USD at the time of the transaction */
3155
+ amount_usd?: number;
3156
+ /** Transfer direction relative to the queried wallet: `in` or `out` */
3157
+ flow?: string;
3158
+ /** Sender wallet address */
3159
+ from_address: string;
3160
+ /** Unix timestamp in seconds when the transfer occurred */
3161
+ timestamp: number;
3162
+ /** Recipient wallet address */
3163
+ to_address: string;
3164
+ /** Token contract address (EVM) or SPL mint address (Solana) */
3165
+ token_address?: string;
3166
+ /** Token ticker symbol (available for EVM chains from on-chain data) */
3167
+ token_symbol?: string;
3168
+ /** Transaction hash (EVM) or transaction signature (Solana) */
3169
+ tx_hash: string;
3170
+ }
3171
+ interface WalletTransfersParams {
3172
+ /** Wallet address — must be a raw address (0x-prefixed hex for EVM, base58 for Solana). ENS names like `vitalik.eth` are not supported; resolve to a 0x address first. */
3173
+ address?: string;
3174
+ /** Chain. Can be `ethereum`, `base`, or `solana`. — @default 'ethereum' */
3175
+ chain?: 'ethereum' | 'base' | 'solana';
3176
+ /** Filter by transfer direction relative to the queried wallet. `in` for incoming, `out` for outgoing. Omit for both directions. */
3177
+ flow?: 'in' | 'out';
3178
+ /** Filter by token contract address. Use `0x0000000000000000000000000000000000000000` for native token transfers. Omit for all tokens. */
3179
+ token?: string;
3180
+ /** Results per page — @default '20' */
3181
+ limit?: number;
3182
+ /** Pagination offset — @default '0' */
3183
+ offset?: number;
3184
+ }
3185
+ interface WebFetchData {
3186
+ /** Full page content converted to clean markdown text */
3187
+ content: string;
3188
+ /** Page title extracted from the HTML */
3189
+ title?: string;
3190
+ /** The URL that was fetched */
3191
+ url: string;
3192
+ }
3193
+ interface WebFetchParams {
3194
+ /** URL to fetch and parse */
3195
+ url?: string;
3196
+ /** CSS selector to extract specific content */
3197
+ target_selector?: string;
3198
+ /** CSS selector to remove unwanted elements */
3199
+ remove_selector?: string;
3200
+ /** CSS selector to wait for before extracting */
3201
+ wait_for_selector?: string;
3202
+ /** Request timeout in milliseconds — @default '30000' */
3203
+ timeout?: number;
3204
+ }
3205
+
3206
+ /**
3207
+ * Environment-aware data API client.
3208
+ *
3209
+ * Reads env vars to determine routing (prefixed vars take priority):
3210
+ * - SURF_SANDBOX_PROXY_BASE → sandbox (OutboundProxy handles auth)
3211
+ * - SURF_DEPLOYED_GATEWAY_URL + SURF_DEPLOYED_APP_TOKEN → deployed (hermod with Bearer)
3212
+ * - Neither → public (api.ask.surf, caller provides own auth)
3213
+ *
3214
+ * Backward-compatible aliases:
3215
+ * DATA_PROXY_BASE → SURF_SANDBOX_PROXY_BASE
3216
+ * GATEWAY_URL → SURF_DEPLOYED_GATEWAY_URL
3217
+ * APP_TOKEN → SURF_DEPLOYED_APP_TOKEN
3218
+ */
3219
+ /** Low-level GET — escape hatch for endpoints not yet in the SDK. */
3220
+ declare function get<T = any>(path: string, params?: Record<string, any>): Promise<T>;
3221
+ /** Low-level POST — escape hatch for endpoints not yet in the SDK. */
3222
+ declare function post<T = any>(path: string, body?: any): Promise<T>;
3223
+
3224
+ declare const dataApi: {
3225
+ /** Escape hatch: raw GET to any endpoint path. */
3226
+ get: typeof get;
3227
+ /** Escape hatch: raw POST to any endpoint path. */
3228
+ post: typeof post;
3229
+ exchange: {
3230
+ depth: (params?: ExchangeDepthParams) => Promise<ApiResponse<ExchangeDepthItem>>;
3231
+ funding_history: (params?: ExchangeFundingHistoryParams) => Promise<ApiResponse<ExchangeFundingHistoryItem>>;
3232
+ klines: (params?: ExchangeKlinesParams) => Promise<ApiResponse<ExchangeKlinesItem>>;
3233
+ long_short_ratio: (params?: ExchangeLongShortRatioParams) => Promise<ApiResponse<ExchangeLongShortRatioItem>>;
3234
+ markets: (params?: ExchangeMarketsParams) => Promise<ApiResponse<ExchangeMarketsItem>>;
3235
+ perp: (params?: ExchangePerpParams) => Promise<ApiObjectResponse<ExchangePerpData>>;
3236
+ price: (params?: ExchangePriceParams) => Promise<ApiResponse<ExchangePriceItem>>;
3237
+ };
3238
+ fund: {
3239
+ detail: (params?: FundDetailParams) => Promise<ApiObjectResponse<FundDetailData>>;
3240
+ portfolio: (params?: FundPortfolioParams) => Promise<ApiResponse<FundPortfolioItem>>;
3241
+ ranking: (params?: FundRankingParams) => Promise<ApiResponse<FundRankingItem>>;
3242
+ };
3243
+ kalshi: {
3244
+ events: (params?: KalshiEventsParams) => Promise<ApiResponse<KalshiEventsItem>>;
3245
+ markets: (params?: KalshiMarketsParams) => Promise<ApiResponse<KalshiMarketsItem>>;
3246
+ open_interest: (params?: KalshiOpenInterestParams) => Promise<ApiResponse<KalshiOpenInterestItem>>;
3247
+ prices: (params?: KalshiPricesParams) => Promise<ApiResponse<KalshiPricesItem>>;
3248
+ ranking: (params?: KalshiRankingParams) => Promise<ApiResponse<KalshiRankingItem>>;
3249
+ trades: (params?: KalshiTradesParams) => Promise<ApiResponse<KalshiTradesItem>>;
3250
+ volumes: (params?: KalshiVolumesParams) => Promise<ApiResponse<KalshiVolumesItem>>;
3251
+ };
3252
+ market: {
3253
+ etf: (params?: MarketEtfParams) => Promise<ApiResponse<MarketEtfItem>>;
3254
+ fear_greed: (params?: MarketFearGreedParams) => Promise<ApiResponse<MarketFearGreedItem>>;
3255
+ futures: (params?: MarketFuturesParams) => Promise<ApiResponse<MarketFuturesItem>>;
3256
+ liquidation_chart: (params?: MarketLiquidationChartParams) => Promise<ApiResponse<MarketLiquidationChartItem>>;
3257
+ liquidation_exchange_list: (params?: MarketLiquidationExchangeListParams) => Promise<ApiResponse<MarketLiquidationExchangeListItem>>;
3258
+ liquidation_order: (params?: MarketLiquidationOrderParams) => Promise<ApiResponse<MarketLiquidationOrderItem>>;
3259
+ onchain_indicator: (params?: MarketOnchainIndicatorParams) => Promise<ApiResponse<MarketOnchainIndicatorItem>>;
3260
+ options: (params?: MarketOptionsParams) => Promise<ApiResponse<MarketOptionsItem>>;
3261
+ price: (params?: MarketPriceParams) => Promise<ApiResponse<MarketPriceItem>>;
3262
+ price_indicator: (params?: MarketPriceIndicatorParams) => Promise<ApiResponse<MarketPriceIndicatorItem>>;
3263
+ ranking: (params?: MarketRankingParams) => Promise<ApiResponse<MarketRankingItem>>;
3264
+ };
3265
+ news: {
3266
+ detail: (params?: NewsDetailParams) => Promise<ApiObjectResponse<NewsDetailData>>;
3267
+ feed: (params?: NewsFeedParams) => Promise<ApiResponse<NewsFeedItem>>;
3268
+ };
3269
+ onchain: {
3270
+ bridge_ranking: (params?: OnchainBridgeRankingParams) => Promise<ApiResponse<OnchainBridgeRankingItem>>;
3271
+ gas_price: (params?: OnchainGasPriceParams) => Promise<ApiObjectResponse<OnchainGasPriceData>>;
3272
+ structured_query: (body: OnchainStructuredQueryParams) => Promise<ApiResponse<OnchainStructuredQueryItem>>;
3273
+ schema: () => Promise<ApiResponse<OnchainSchemaItem>>;
3274
+ sql: (body: OnchainSqlParams) => Promise<ApiResponse<OnchainSqlItem>>;
3275
+ tx: (params?: OnchainTxParams) => Promise<ApiResponse<OnchainTxItem>>;
3276
+ yield_ranking: (params?: OnchainYieldRankingParams) => Promise<ApiResponse<OnchainYieldRankingItem>>;
3277
+ };
3278
+ polymarket: {
3279
+ activity: (params?: PolymarketActivityParams) => Promise<ApiResponse<PolymarketActivityItem>>;
3280
+ events: (params?: PolymarketEventsParams) => Promise<ApiResponse<PolymarketEventsItem>>;
3281
+ markets: (params?: PolymarketMarketsParams) => Promise<ApiResponse<PolymarketMarketsItem>>;
3282
+ open_interest: (params?: PolymarketOpenInterestParams) => Promise<ApiResponse<PolymarketOpenInterestItem>>;
3283
+ positions: (params?: PolymarketPositionsParams) => Promise<ApiResponse<PolymarketPositionsItem>>;
3284
+ prices: (params?: PolymarketPricesParams) => Promise<ApiResponse<PolymarketPricesItem>>;
3285
+ ranking: (params?: PolymarketRankingParams) => Promise<ApiResponse<PolymarketRankingItem>>;
3286
+ trades: (params?: PolymarketTradesParams) => Promise<ApiResponse<PolymarketTradesItem>>;
3287
+ volumes: (params?: PolymarketVolumesParams) => Promise<ApiResponse<PolymarketVolumesItem>>;
3288
+ };
3289
+ prediction_market: {
3290
+ category_metrics: (params?: PredictionMarketCategoryMetricsParams) => Promise<ApiResponse<PredictionMarketCategoryMetricsItem>>;
3291
+ };
3292
+ project: {
3293
+ defi_metrics: (params?: ProjectDefiMetricsParams) => Promise<ApiResponse<ProjectDefiMetricsItem>>;
3294
+ defi_ranking: (params?: ProjectDefiRankingParams) => Promise<ApiResponse<ProjectDefiRankingItem>>;
3295
+ detail: (params?: ProjectDetailParams) => Promise<ApiObjectResponse<ProjectDetailData>>;
3296
+ };
3297
+ search: {
3298
+ airdrop: (params?: SearchAirdropParams) => Promise<ApiResponse<SearchAirdropItem>>;
3299
+ events: (params?: SearchEventsParams) => Promise<ApiResponse<SearchEventsItem>>;
3300
+ fund: (params?: SearchFundParams) => Promise<ApiResponse<SearchFundItem>>;
3301
+ kalshi: (params?: SearchKalshiParams) => Promise<ApiResponse<SearchKalshiItem>>;
3302
+ news: (params?: SearchNewsParams) => Promise<ApiResponse<SearchNewsItem>>;
3303
+ polymarket: (params?: SearchPolymarketParams) => Promise<ApiResponse<SearchPolymarketItem>>;
3304
+ project: (params?: SearchProjectParams) => Promise<ApiResponse<SearchProjectItem>>;
3305
+ social_people: (params?: SearchSocialPeopleParams) => Promise<ApiCursorResponse<SearchSocialPeopleItem>>;
3306
+ social_posts: (params?: SearchSocialPostsParams) => Promise<ApiCursorResponse<SearchSocialPostsItem>>;
3307
+ wallet: (params?: SearchWalletParams) => Promise<ApiResponse<SearchWalletItem>>;
3308
+ web: (params?: SearchWebParams) => Promise<ApiResponse<SearchWebItem>>;
3309
+ };
3310
+ social: {
3311
+ detail: (params?: SocialDetailParams) => Promise<ApiObjectResponse<SocialDetailData>>;
3312
+ mindshare: (params?: SocialMindshareParams) => Promise<ApiResponse<SocialMindshareItem>>;
3313
+ ranking: (params?: SocialRankingParams) => Promise<ApiResponse<SocialRankingItem>>;
3314
+ smart_followers_history: (params?: SocialSmartFollowersHistoryParams) => Promise<ApiResponse<SocialSmartFollowersHistoryItem>>;
3315
+ tweet_replies: (params?: SocialTweetRepliesParams) => Promise<ApiCursorResponse<SocialTweetRepliesItem>>;
3316
+ tweets: (params?: SocialTweetsParams) => Promise<ApiResponse<SocialTweetsItem>>;
3317
+ user: (params?: SocialUserParams) => Promise<ApiObjectResponse<SocialUserData>>;
3318
+ user_followers: (params?: SocialUserFollowersParams) => Promise<ApiCursorResponse<SocialUserFollowersItem>>;
3319
+ user_following: (params?: SocialUserFollowingParams) => Promise<ApiCursorResponse<SocialUserFollowingItem>>;
3320
+ user_posts: (params?: SocialUserPostsParams) => Promise<ApiCursorResponse<SocialUserPostsItem>>;
3321
+ user_replies: (params?: SocialUserRepliesParams) => Promise<ApiCursorResponse<SocialUserRepliesItem>>;
3322
+ };
3323
+ token: {
3324
+ dex_trades: (params?: TokenDexTradesParams) => Promise<ApiResponse<TokenDexTradesItem>>;
3325
+ holders: (params?: TokenHoldersParams) => Promise<ApiResponse<TokenHoldersItem>>;
3326
+ tokenomics: (params?: TokenTokenomicsParams) => Promise<ApiResponse<TokenTokenomicsItem>>;
3327
+ transfers: (params?: TokenTransfersParams) => Promise<ApiResponse<TokenTransfersItem>>;
3328
+ };
3329
+ wallet: {
3330
+ detail: (params?: WalletDetailParams) => Promise<ApiObjectResponse<WalletDetailData>>;
3331
+ history: (params?: WalletHistoryParams) => Promise<ApiResponse<WalletHistoryItem>>;
3332
+ labels_batch: (params?: WalletLabelsBatchParams) => Promise<ApiResponse<WalletLabelsBatchItem>>;
3333
+ net_worth: (params?: WalletNetWorthParams) => Promise<ApiResponse<WalletNetWorthItem>>;
3334
+ protocols: (params?: WalletProtocolsParams) => Promise<ApiResponse<WalletProtocolsItem>>;
3335
+ transfers: (params?: WalletTransfersParams) => Promise<ApiResponse<WalletTransfersItem>>;
3336
+ };
3337
+ web: {
3338
+ fetch: (params?: WebFetchParams) => Promise<ApiObjectResponse<WebFetchData>>;
3339
+ };
3340
+ };
3341
+
3342
+ export { type ServerOptions, createServer, dataApi };