@surf-ai/sdk 0.1.5-beta → 1.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +93 -159
- package/dist/chunk-4NA3GKVD.js +100 -0
- package/dist/{client-3YMIRPDV.js → client-Z45B2GYT.js} +1 -1
- package/dist/db/index.cjs +63 -37
- package/dist/db/index.d.cts +5 -2
- package/dist/db/index.d.ts +5 -2
- package/dist/db/index.js +63 -37
- package/dist/server/index.cjs +211 -190
- package/dist/server/index.d.cts +204 -16
- package/dist/server/index.d.ts +204 -16
- package/dist/server/index.js +131 -153
- package/package.json +6 -29
- package/dist/chunk-J4OMYO3F.js +0 -70
- package/dist/react/index.d.ts +0 -3450
- package/dist/react/index.js +0 -1092
- package/src/theme/index.css +0 -314
package/dist/server/index.d.cts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import express from 'express';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* Express server runtime — replaces scaffold server.js
|
|
4
|
+
* Express server runtime — replaces scaffold server.js.
|
|
5
5
|
*
|
|
6
6
|
* Handles:
|
|
7
|
-
* - /proxy/* passthrough (env-aware: sandbox → OutboundProxy, deployed → hermod)
|
|
8
7
|
* - Auto-loading routes from routes/*.js → /api/{name}
|
|
9
8
|
* - Cron job system from cron.json
|
|
10
9
|
* - DB schema sync on startup
|
|
@@ -12,18 +11,16 @@ import express from 'express';
|
|
|
12
11
|
*/
|
|
13
12
|
|
|
14
13
|
interface ServerOptions {
|
|
15
|
-
/** Port to listen on
|
|
14
|
+
/** Port to listen on. Falls back to the PORT env var when omitted. */
|
|
16
15
|
port?: number;
|
|
17
16
|
/** Directory containing route files (default: ./routes) */
|
|
18
17
|
routesDir?: string;
|
|
19
18
|
/** Directory containing cron.json (default: .) */
|
|
20
19
|
cronDir?: string;
|
|
21
|
-
/** Enable /proxy/* passthrough (default: true) */
|
|
22
|
-
proxy?: boolean;
|
|
23
20
|
}
|
|
24
21
|
declare function createServer(options?: ServerOptions): {
|
|
25
22
|
app: express.Express;
|
|
26
|
-
port: number;
|
|
23
|
+
port: number | undefined;
|
|
27
24
|
start(): Promise<void>;
|
|
28
25
|
};
|
|
29
26
|
|
|
@@ -184,7 +181,7 @@ interface ExchangeLongShortRatioParams {
|
|
|
184
181
|
from?: string;
|
|
185
182
|
/** Max number of records. For longer history, paginate using the last returned timestamp as the next from value. — @default '50' */
|
|
186
183
|
limit?: number;
|
|
187
|
-
/** Exchange identifier — @default '
|
|
184
|
+
/** Exchange identifier — @default 'bitget' */
|
|
188
185
|
exchange?: 'binance' | 'okx' | 'bybit' | 'bitget';
|
|
189
186
|
}
|
|
190
187
|
interface ExchangeMarketsItem {
|
|
@@ -1271,6 +1268,130 @@ interface KalshiVolumesParams {
|
|
|
1271
1268
|
/** Predefined time range: `7d`, `30d`, `90d`, `180d`, or `1y` — @default '30d' */
|
|
1272
1269
|
time_range?: '7d' | '30d' | '90d' | '180d' | '1y';
|
|
1273
1270
|
}
|
|
1271
|
+
interface MatchingMarketDailyItem {
|
|
1272
|
+
/** Kalshi open interest (contracts) */
|
|
1273
|
+
kalshi_oi_contracts: number;
|
|
1274
|
+
/** Kalshi daily volume (contracts) */
|
|
1275
|
+
kalshi_volume_contracts: number;
|
|
1276
|
+
/** Polymarket open interest (USD) */
|
|
1277
|
+
polymarket_oi_usd: number;
|
|
1278
|
+
/** Polymarket daily volume (USD) */
|
|
1279
|
+
polymarket_volume_usd: number;
|
|
1280
|
+
/** Unix timestamp (midnight UTC) */
|
|
1281
|
+
timestamp: number;
|
|
1282
|
+
}
|
|
1283
|
+
interface MatchingMarketDailyParams {
|
|
1284
|
+
/** Polymarket condition ID */
|
|
1285
|
+
polymarket_condition_id: string;
|
|
1286
|
+
/** Kalshi market ticker */
|
|
1287
|
+
kalshi_market_ticker: string;
|
|
1288
|
+
/** Time range — @default '30d' */
|
|
1289
|
+
time_range?: '1d' | '7d' | '30d' | '90d' | '180d' | '1y' | 'all';
|
|
1290
|
+
/** Maximum rows — @default '200' */
|
|
1291
|
+
limit?: number;
|
|
1292
|
+
/** Pagination offset — @default '0' */
|
|
1293
|
+
offset?: number;
|
|
1294
|
+
}
|
|
1295
|
+
interface MatchingMarketFindItem {
|
|
1296
|
+
/** Market category */
|
|
1297
|
+
category: string;
|
|
1298
|
+
/** Match confidence score (75-100) */
|
|
1299
|
+
confidence: number;
|
|
1300
|
+
kalshi: MatchingMarketFindItemKalshi;
|
|
1301
|
+
/** Match type: exact or related */
|
|
1302
|
+
match_type: string;
|
|
1303
|
+
polymarket: MatchingMarketFindItemPolymarket;
|
|
1304
|
+
}
|
|
1305
|
+
interface MatchingMarketFindItemKalshi {
|
|
1306
|
+
/** Kalshi event ticker */
|
|
1307
|
+
event_ticker: string;
|
|
1308
|
+
/** Kalshi market ticker */
|
|
1309
|
+
market_ticker: string;
|
|
1310
|
+
/** Open interest in contracts */
|
|
1311
|
+
open_interest: number;
|
|
1312
|
+
/** Market status */
|
|
1313
|
+
status: string;
|
|
1314
|
+
/** Market title */
|
|
1315
|
+
title: string;
|
|
1316
|
+
/** Total volume in contracts */
|
|
1317
|
+
volume_contracts: number;
|
|
1318
|
+
}
|
|
1319
|
+
interface MatchingMarketFindItemPolymarket {
|
|
1320
|
+
/** Polymarket condition identifier */
|
|
1321
|
+
condition_id: string;
|
|
1322
|
+
/** Event slug identifier */
|
|
1323
|
+
event_slug: string;
|
|
1324
|
+
/** Whether the market is currently active */
|
|
1325
|
+
is_active: boolean;
|
|
1326
|
+
/** Market question text */
|
|
1327
|
+
question: string;
|
|
1328
|
+
/** Total trading volume (USD) */
|
|
1329
|
+
volume_usd: number;
|
|
1330
|
+
}
|
|
1331
|
+
interface MatchingMarketFindParams {
|
|
1332
|
+
/** Polymarket condition ID to find match for */
|
|
1333
|
+
polymarket_condition_id?: string;
|
|
1334
|
+
/** Kalshi market ticker to find match for */
|
|
1335
|
+
kalshi_market_ticker?: string;
|
|
1336
|
+
/** Maximum rows to return — @default '20' */
|
|
1337
|
+
limit?: number;
|
|
1338
|
+
/** Pagination offset — @default '0' */
|
|
1339
|
+
offset?: number;
|
|
1340
|
+
}
|
|
1341
|
+
interface MatchingMarketPairsItem {
|
|
1342
|
+
/** Market category */
|
|
1343
|
+
category: string;
|
|
1344
|
+
/** Match confidence score (75-100) */
|
|
1345
|
+
confidence: number;
|
|
1346
|
+
kalshi: MatchingMarketPairsItemKalshi;
|
|
1347
|
+
/** Match type: exact or related */
|
|
1348
|
+
match_type: string;
|
|
1349
|
+
polymarket: MatchingMarketPairsItemPolymarket;
|
|
1350
|
+
}
|
|
1351
|
+
interface MatchingMarketPairsItemKalshi {
|
|
1352
|
+
/** Kalshi event ticker */
|
|
1353
|
+
event_ticker: string;
|
|
1354
|
+
/** Kalshi market ticker */
|
|
1355
|
+
market_ticker: string;
|
|
1356
|
+
/** Open interest in contracts */
|
|
1357
|
+
open_interest: number;
|
|
1358
|
+
/** Market status */
|
|
1359
|
+
status: string;
|
|
1360
|
+
/** Market title */
|
|
1361
|
+
title: string;
|
|
1362
|
+
/** Total volume in contracts */
|
|
1363
|
+
volume_contracts: number;
|
|
1364
|
+
}
|
|
1365
|
+
interface MatchingMarketPairsItemPolymarket {
|
|
1366
|
+
/** Polymarket condition identifier */
|
|
1367
|
+
condition_id: string;
|
|
1368
|
+
/** Event slug identifier */
|
|
1369
|
+
event_slug: string;
|
|
1370
|
+
/** Whether the market is currently active */
|
|
1371
|
+
is_active: boolean;
|
|
1372
|
+
/** Market question text */
|
|
1373
|
+
question: string;
|
|
1374
|
+
/** Total trading volume (USD) */
|
|
1375
|
+
volume_usd: number;
|
|
1376
|
+
}
|
|
1377
|
+
interface MatchingMarketPairsParams {
|
|
1378
|
+
/** Filter by category */
|
|
1379
|
+
category?: 'crypto' | 'culture' | 'economics' | 'financials' | 'politics' | 'stem' | 'sports';
|
|
1380
|
+
/** Filter by match type */
|
|
1381
|
+
match_type?: 'exact' | 'related';
|
|
1382
|
+
/** Only return pairs where both markets are currently active — @default 'False' */
|
|
1383
|
+
active_only?: boolean;
|
|
1384
|
+
/** Minimum confidence score (0-100) — @default '0' */
|
|
1385
|
+
min_confidence?: number;
|
|
1386
|
+
/** Sort field — @default 'confidence' */
|
|
1387
|
+
sort_by?: 'confidence' | 'polymarket_volume' | 'kalshi_volume';
|
|
1388
|
+
/** Sort order — @default 'desc' */
|
|
1389
|
+
order?: 'asc' | 'desc';
|
|
1390
|
+
/** Maximum rows to return — @default '20' */
|
|
1391
|
+
limit?: number;
|
|
1392
|
+
/** Pagination offset — @default '0' */
|
|
1393
|
+
offset?: number;
|
|
1394
|
+
}
|
|
1274
1395
|
interface PolymarketActivityItem {
|
|
1275
1396
|
/** Market condition identifier */
|
|
1276
1397
|
condition_id: string;
|
|
@@ -3270,19 +3391,74 @@ interface WebFetchParams {
|
|
|
3270
3391
|
/** Request timeout in milliseconds — @default '30000' */
|
|
3271
3392
|
timeout?: number;
|
|
3272
3393
|
}
|
|
3394
|
+
interface V2KalshiOrderbooksItem {
|
|
3395
|
+
}
|
|
3396
|
+
interface V2KalshiOrderbooksParams {
|
|
3397
|
+
/** Kalshi market ticker */
|
|
3398
|
+
ticker: string;
|
|
3399
|
+
/** Start time in Unix milliseconds. 0 means 7 days ago. */
|
|
3400
|
+
start_time?: number;
|
|
3401
|
+
/** End time in Unix milliseconds. 0 means current time. */
|
|
3402
|
+
end_time?: number;
|
|
3403
|
+
/** Maximum number of snapshots to return — @default '100' */
|
|
3404
|
+
limit?: number;
|
|
3405
|
+
/** Base64 cursor for pagination */
|
|
3406
|
+
pagination_key?: string;
|
|
3407
|
+
}
|
|
3408
|
+
interface V2PolymarketCandlesticksItem {
|
|
3409
|
+
}
|
|
3410
|
+
interface V2PolymarketCandlesticksParams {
|
|
3411
|
+
/** Start time (Unix seconds). 0 means no lower bound. */
|
|
3412
|
+
start_time?: number;
|
|
3413
|
+
/** End time (Unix seconds). 0 means current time. */
|
|
3414
|
+
end_time?: number;
|
|
3415
|
+
/** Candle interval in minutes: 1=1min, 60=1hour, 1440=1day — @default '60' */
|
|
3416
|
+
interval?: number;
|
|
3417
|
+
}
|
|
3418
|
+
interface V2PolymarketVolumeTimeseriesItem {
|
|
3419
|
+
}
|
|
3420
|
+
interface V2PolymarketVolumeTimeseriesParams {
|
|
3421
|
+
/** Time granularity for aggregation — @default 'day' */
|
|
3422
|
+
granularity?: 'day' | 'week' | 'month' | 'year' | 'all';
|
|
3423
|
+
/** Start time (Unix seconds). 0 means no lower bound. */
|
|
3424
|
+
start_time?: number;
|
|
3425
|
+
/** End time (Unix seconds). 0 means current time. */
|
|
3426
|
+
end_time?: number;
|
|
3427
|
+
}
|
|
3428
|
+
interface V2PolymarketOrderbooksItem {
|
|
3429
|
+
}
|
|
3430
|
+
interface V2PolymarketOrderbooksParams {
|
|
3431
|
+
/** Token identifier */
|
|
3432
|
+
token_id: string;
|
|
3433
|
+
/** Start time in Unix milliseconds. 0 means 7 days ago. */
|
|
3434
|
+
start_time?: number;
|
|
3435
|
+
/** End time in Unix milliseconds. 0 means current time. */
|
|
3436
|
+
end_time?: number;
|
|
3437
|
+
/** Maximum number of snapshots to return — @default '100' */
|
|
3438
|
+
limit?: number;
|
|
3439
|
+
/** Base64 cursor for pagination */
|
|
3440
|
+
pagination_key?: string;
|
|
3441
|
+
}
|
|
3442
|
+
interface V2PolymarketVolumeChartItem {
|
|
3443
|
+
}
|
|
3444
|
+
interface V2PolymarketVolumeChartParams {
|
|
3445
|
+
/** Time granularity for volume aggregation — @default 'hour' */
|
|
3446
|
+
granularity?: 'hour' | 'day' | 'week';
|
|
3447
|
+
/** Start time (Unix seconds). 0 means no lower bound. */
|
|
3448
|
+
start_time?: number;
|
|
3449
|
+
/** End time (Unix seconds). 0 means current time. */
|
|
3450
|
+
end_time?: number;
|
|
3451
|
+
}
|
|
3273
3452
|
|
|
3274
3453
|
/**
|
|
3275
|
-
*
|
|
3454
|
+
* 1.0 data API client.
|
|
3276
3455
|
*
|
|
3277
|
-
* Reads
|
|
3278
|
-
* -
|
|
3279
|
-
* -
|
|
3280
|
-
* - Neither → public (api.ask.surf, caller provides own auth)
|
|
3456
|
+
* Reads:
|
|
3457
|
+
* - SURF_API_BASE_URL (default: https://api.asksurf.ai/gateway/v1)
|
|
3458
|
+
* - SURF_API_KEY (required)
|
|
3281
3459
|
*
|
|
3282
|
-
*
|
|
3283
|
-
*
|
|
3284
|
-
* GATEWAY_URL → SURF_DEPLOYED_GATEWAY_URL
|
|
3285
|
-
* APP_TOKEN → SURF_DEPLOYED_APP_TOKEN
|
|
3460
|
+
* All requests are sent directly to the configured API base URL using
|
|
3461
|
+
* Authorization: Bearer <SURF_API_KEY>.
|
|
3286
3462
|
*/
|
|
3287
3463
|
/** Low-level GET — escape hatch for endpoints not yet in the SDK. */
|
|
3288
3464
|
declare function get<T = any>(path: string, params?: Record<string, any>): Promise<T>;
|
|
@@ -3330,6 +3506,11 @@ declare const dataApi: {
|
|
|
3330
3506
|
price_indicator: (params: MarketPriceIndicatorParams) => Promise<ApiResponse<MarketPriceIndicatorItem>>;
|
|
3331
3507
|
ranking: (params?: MarketRankingParams) => Promise<ApiResponse<MarketRankingItem>>;
|
|
3332
3508
|
};
|
|
3509
|
+
matching: {
|
|
3510
|
+
market_daily: (params: MatchingMarketDailyParams) => Promise<ApiResponse<MatchingMarketDailyItem>>;
|
|
3511
|
+
market_find: (params?: MatchingMarketFindParams) => Promise<ApiResponse<MatchingMarketFindItem>>;
|
|
3512
|
+
market_pairs: (params?: MatchingMarketPairsParams) => Promise<ApiResponse<MatchingMarketPairsItem>>;
|
|
3513
|
+
};
|
|
3333
3514
|
news: {
|
|
3334
3515
|
detail: (params: NewsDetailParams) => Promise<ApiObjectResponse<NewsDetailData>>;
|
|
3335
3516
|
feed: (params?: NewsFeedParams) => Promise<ApiResponse<NewsFeedItem>>;
|
|
@@ -3394,6 +3575,13 @@ declare const dataApi: {
|
|
|
3394
3575
|
tokenomics: (params?: TokenTokenomicsParams) => Promise<ApiResponse<TokenTokenomicsItem>>;
|
|
3395
3576
|
transfers: (params: TokenTransfersParams) => Promise<ApiResponse<TokenTransfersItem>>;
|
|
3396
3577
|
};
|
|
3578
|
+
v2: {
|
|
3579
|
+
kalshi_orderbooks: (params: V2KalshiOrderbooksParams) => Promise<ApiResponse<V2KalshiOrderbooksItem>>;
|
|
3580
|
+
polymarket_candlesticks: (params?: V2PolymarketCandlesticksParams) => Promise<ApiResponse<V2PolymarketCandlesticksItem>>;
|
|
3581
|
+
polymarket_volume_timeseries: (params?: V2PolymarketVolumeTimeseriesParams) => Promise<ApiResponse<V2PolymarketVolumeTimeseriesItem>>;
|
|
3582
|
+
polymarket_orderbooks: (params: V2PolymarketOrderbooksParams) => Promise<ApiResponse<V2PolymarketOrderbooksItem>>;
|
|
3583
|
+
polymarket_volume_chart: (params?: V2PolymarketVolumeChartParams) => Promise<ApiResponse<V2PolymarketVolumeChartItem>>;
|
|
3584
|
+
};
|
|
3397
3585
|
wallet: {
|
|
3398
3586
|
detail: (params: WalletDetailParams) => Promise<ApiObjectResponse<WalletDetailData>>;
|
|
3399
3587
|
history: (params: WalletHistoryParams) => Promise<ApiResponse<WalletHistoryItem>>;
|
package/dist/server/index.d.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import express from 'express';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* Express server runtime — replaces scaffold server.js
|
|
4
|
+
* Express server runtime — replaces scaffold server.js.
|
|
5
5
|
*
|
|
6
6
|
* Handles:
|
|
7
|
-
* - /proxy/* passthrough (env-aware: sandbox → OutboundProxy, deployed → hermod)
|
|
8
7
|
* - Auto-loading routes from routes/*.js → /api/{name}
|
|
9
8
|
* - Cron job system from cron.json
|
|
10
9
|
* - DB schema sync on startup
|
|
@@ -12,18 +11,16 @@ import express from 'express';
|
|
|
12
11
|
*/
|
|
13
12
|
|
|
14
13
|
interface ServerOptions {
|
|
15
|
-
/** Port to listen on
|
|
14
|
+
/** Port to listen on. Falls back to the PORT env var when omitted. */
|
|
16
15
|
port?: number;
|
|
17
16
|
/** Directory containing route files (default: ./routes) */
|
|
18
17
|
routesDir?: string;
|
|
19
18
|
/** Directory containing cron.json (default: .) */
|
|
20
19
|
cronDir?: string;
|
|
21
|
-
/** Enable /proxy/* passthrough (default: true) */
|
|
22
|
-
proxy?: boolean;
|
|
23
20
|
}
|
|
24
21
|
declare function createServer(options?: ServerOptions): {
|
|
25
22
|
app: express.Express;
|
|
26
|
-
port: number;
|
|
23
|
+
port: number | undefined;
|
|
27
24
|
start(): Promise<void>;
|
|
28
25
|
};
|
|
29
26
|
|
|
@@ -184,7 +181,7 @@ interface ExchangeLongShortRatioParams {
|
|
|
184
181
|
from?: string;
|
|
185
182
|
/** Max number of records. For longer history, paginate using the last returned timestamp as the next from value. — @default '50' */
|
|
186
183
|
limit?: number;
|
|
187
|
-
/** Exchange identifier — @default '
|
|
184
|
+
/** Exchange identifier — @default 'bitget' */
|
|
188
185
|
exchange?: 'binance' | 'okx' | 'bybit' | 'bitget';
|
|
189
186
|
}
|
|
190
187
|
interface ExchangeMarketsItem {
|
|
@@ -1271,6 +1268,130 @@ interface KalshiVolumesParams {
|
|
|
1271
1268
|
/** Predefined time range: `7d`, `30d`, `90d`, `180d`, or `1y` — @default '30d' */
|
|
1272
1269
|
time_range?: '7d' | '30d' | '90d' | '180d' | '1y';
|
|
1273
1270
|
}
|
|
1271
|
+
interface MatchingMarketDailyItem {
|
|
1272
|
+
/** Kalshi open interest (contracts) */
|
|
1273
|
+
kalshi_oi_contracts: number;
|
|
1274
|
+
/** Kalshi daily volume (contracts) */
|
|
1275
|
+
kalshi_volume_contracts: number;
|
|
1276
|
+
/** Polymarket open interest (USD) */
|
|
1277
|
+
polymarket_oi_usd: number;
|
|
1278
|
+
/** Polymarket daily volume (USD) */
|
|
1279
|
+
polymarket_volume_usd: number;
|
|
1280
|
+
/** Unix timestamp (midnight UTC) */
|
|
1281
|
+
timestamp: number;
|
|
1282
|
+
}
|
|
1283
|
+
interface MatchingMarketDailyParams {
|
|
1284
|
+
/** Polymarket condition ID */
|
|
1285
|
+
polymarket_condition_id: string;
|
|
1286
|
+
/** Kalshi market ticker */
|
|
1287
|
+
kalshi_market_ticker: string;
|
|
1288
|
+
/** Time range — @default '30d' */
|
|
1289
|
+
time_range?: '1d' | '7d' | '30d' | '90d' | '180d' | '1y' | 'all';
|
|
1290
|
+
/** Maximum rows — @default '200' */
|
|
1291
|
+
limit?: number;
|
|
1292
|
+
/** Pagination offset — @default '0' */
|
|
1293
|
+
offset?: number;
|
|
1294
|
+
}
|
|
1295
|
+
interface MatchingMarketFindItem {
|
|
1296
|
+
/** Market category */
|
|
1297
|
+
category: string;
|
|
1298
|
+
/** Match confidence score (75-100) */
|
|
1299
|
+
confidence: number;
|
|
1300
|
+
kalshi: MatchingMarketFindItemKalshi;
|
|
1301
|
+
/** Match type: exact or related */
|
|
1302
|
+
match_type: string;
|
|
1303
|
+
polymarket: MatchingMarketFindItemPolymarket;
|
|
1304
|
+
}
|
|
1305
|
+
interface MatchingMarketFindItemKalshi {
|
|
1306
|
+
/** Kalshi event ticker */
|
|
1307
|
+
event_ticker: string;
|
|
1308
|
+
/** Kalshi market ticker */
|
|
1309
|
+
market_ticker: string;
|
|
1310
|
+
/** Open interest in contracts */
|
|
1311
|
+
open_interest: number;
|
|
1312
|
+
/** Market status */
|
|
1313
|
+
status: string;
|
|
1314
|
+
/** Market title */
|
|
1315
|
+
title: string;
|
|
1316
|
+
/** Total volume in contracts */
|
|
1317
|
+
volume_contracts: number;
|
|
1318
|
+
}
|
|
1319
|
+
interface MatchingMarketFindItemPolymarket {
|
|
1320
|
+
/** Polymarket condition identifier */
|
|
1321
|
+
condition_id: string;
|
|
1322
|
+
/** Event slug identifier */
|
|
1323
|
+
event_slug: string;
|
|
1324
|
+
/** Whether the market is currently active */
|
|
1325
|
+
is_active: boolean;
|
|
1326
|
+
/** Market question text */
|
|
1327
|
+
question: string;
|
|
1328
|
+
/** Total trading volume (USD) */
|
|
1329
|
+
volume_usd: number;
|
|
1330
|
+
}
|
|
1331
|
+
interface MatchingMarketFindParams {
|
|
1332
|
+
/** Polymarket condition ID to find match for */
|
|
1333
|
+
polymarket_condition_id?: string;
|
|
1334
|
+
/** Kalshi market ticker to find match for */
|
|
1335
|
+
kalshi_market_ticker?: string;
|
|
1336
|
+
/** Maximum rows to return — @default '20' */
|
|
1337
|
+
limit?: number;
|
|
1338
|
+
/** Pagination offset — @default '0' */
|
|
1339
|
+
offset?: number;
|
|
1340
|
+
}
|
|
1341
|
+
interface MatchingMarketPairsItem {
|
|
1342
|
+
/** Market category */
|
|
1343
|
+
category: string;
|
|
1344
|
+
/** Match confidence score (75-100) */
|
|
1345
|
+
confidence: number;
|
|
1346
|
+
kalshi: MatchingMarketPairsItemKalshi;
|
|
1347
|
+
/** Match type: exact or related */
|
|
1348
|
+
match_type: string;
|
|
1349
|
+
polymarket: MatchingMarketPairsItemPolymarket;
|
|
1350
|
+
}
|
|
1351
|
+
interface MatchingMarketPairsItemKalshi {
|
|
1352
|
+
/** Kalshi event ticker */
|
|
1353
|
+
event_ticker: string;
|
|
1354
|
+
/** Kalshi market ticker */
|
|
1355
|
+
market_ticker: string;
|
|
1356
|
+
/** Open interest in contracts */
|
|
1357
|
+
open_interest: number;
|
|
1358
|
+
/** Market status */
|
|
1359
|
+
status: string;
|
|
1360
|
+
/** Market title */
|
|
1361
|
+
title: string;
|
|
1362
|
+
/** Total volume in contracts */
|
|
1363
|
+
volume_contracts: number;
|
|
1364
|
+
}
|
|
1365
|
+
interface MatchingMarketPairsItemPolymarket {
|
|
1366
|
+
/** Polymarket condition identifier */
|
|
1367
|
+
condition_id: string;
|
|
1368
|
+
/** Event slug identifier */
|
|
1369
|
+
event_slug: string;
|
|
1370
|
+
/** Whether the market is currently active */
|
|
1371
|
+
is_active: boolean;
|
|
1372
|
+
/** Market question text */
|
|
1373
|
+
question: string;
|
|
1374
|
+
/** Total trading volume (USD) */
|
|
1375
|
+
volume_usd: number;
|
|
1376
|
+
}
|
|
1377
|
+
interface MatchingMarketPairsParams {
|
|
1378
|
+
/** Filter by category */
|
|
1379
|
+
category?: 'crypto' | 'culture' | 'economics' | 'financials' | 'politics' | 'stem' | 'sports';
|
|
1380
|
+
/** Filter by match type */
|
|
1381
|
+
match_type?: 'exact' | 'related';
|
|
1382
|
+
/** Only return pairs where both markets are currently active — @default 'False' */
|
|
1383
|
+
active_only?: boolean;
|
|
1384
|
+
/** Minimum confidence score (0-100) — @default '0' */
|
|
1385
|
+
min_confidence?: number;
|
|
1386
|
+
/** Sort field — @default 'confidence' */
|
|
1387
|
+
sort_by?: 'confidence' | 'polymarket_volume' | 'kalshi_volume';
|
|
1388
|
+
/** Sort order — @default 'desc' */
|
|
1389
|
+
order?: 'asc' | 'desc';
|
|
1390
|
+
/** Maximum rows to return — @default '20' */
|
|
1391
|
+
limit?: number;
|
|
1392
|
+
/** Pagination offset — @default '0' */
|
|
1393
|
+
offset?: number;
|
|
1394
|
+
}
|
|
1274
1395
|
interface PolymarketActivityItem {
|
|
1275
1396
|
/** Market condition identifier */
|
|
1276
1397
|
condition_id: string;
|
|
@@ -3270,19 +3391,74 @@ interface WebFetchParams {
|
|
|
3270
3391
|
/** Request timeout in milliseconds — @default '30000' */
|
|
3271
3392
|
timeout?: number;
|
|
3272
3393
|
}
|
|
3394
|
+
interface V2KalshiOrderbooksItem {
|
|
3395
|
+
}
|
|
3396
|
+
interface V2KalshiOrderbooksParams {
|
|
3397
|
+
/** Kalshi market ticker */
|
|
3398
|
+
ticker: string;
|
|
3399
|
+
/** Start time in Unix milliseconds. 0 means 7 days ago. */
|
|
3400
|
+
start_time?: number;
|
|
3401
|
+
/** End time in Unix milliseconds. 0 means current time. */
|
|
3402
|
+
end_time?: number;
|
|
3403
|
+
/** Maximum number of snapshots to return — @default '100' */
|
|
3404
|
+
limit?: number;
|
|
3405
|
+
/** Base64 cursor for pagination */
|
|
3406
|
+
pagination_key?: string;
|
|
3407
|
+
}
|
|
3408
|
+
interface V2PolymarketCandlesticksItem {
|
|
3409
|
+
}
|
|
3410
|
+
interface V2PolymarketCandlesticksParams {
|
|
3411
|
+
/** Start time (Unix seconds). 0 means no lower bound. */
|
|
3412
|
+
start_time?: number;
|
|
3413
|
+
/** End time (Unix seconds). 0 means current time. */
|
|
3414
|
+
end_time?: number;
|
|
3415
|
+
/** Candle interval in minutes: 1=1min, 60=1hour, 1440=1day — @default '60' */
|
|
3416
|
+
interval?: number;
|
|
3417
|
+
}
|
|
3418
|
+
interface V2PolymarketVolumeTimeseriesItem {
|
|
3419
|
+
}
|
|
3420
|
+
interface V2PolymarketVolumeTimeseriesParams {
|
|
3421
|
+
/** Time granularity for aggregation — @default 'day' */
|
|
3422
|
+
granularity?: 'day' | 'week' | 'month' | 'year' | 'all';
|
|
3423
|
+
/** Start time (Unix seconds). 0 means no lower bound. */
|
|
3424
|
+
start_time?: number;
|
|
3425
|
+
/** End time (Unix seconds). 0 means current time. */
|
|
3426
|
+
end_time?: number;
|
|
3427
|
+
}
|
|
3428
|
+
interface V2PolymarketOrderbooksItem {
|
|
3429
|
+
}
|
|
3430
|
+
interface V2PolymarketOrderbooksParams {
|
|
3431
|
+
/** Token identifier */
|
|
3432
|
+
token_id: string;
|
|
3433
|
+
/** Start time in Unix milliseconds. 0 means 7 days ago. */
|
|
3434
|
+
start_time?: number;
|
|
3435
|
+
/** End time in Unix milliseconds. 0 means current time. */
|
|
3436
|
+
end_time?: number;
|
|
3437
|
+
/** Maximum number of snapshots to return — @default '100' */
|
|
3438
|
+
limit?: number;
|
|
3439
|
+
/** Base64 cursor for pagination */
|
|
3440
|
+
pagination_key?: string;
|
|
3441
|
+
}
|
|
3442
|
+
interface V2PolymarketVolumeChartItem {
|
|
3443
|
+
}
|
|
3444
|
+
interface V2PolymarketVolumeChartParams {
|
|
3445
|
+
/** Time granularity for volume aggregation — @default 'hour' */
|
|
3446
|
+
granularity?: 'hour' | 'day' | 'week';
|
|
3447
|
+
/** Start time (Unix seconds). 0 means no lower bound. */
|
|
3448
|
+
start_time?: number;
|
|
3449
|
+
/** End time (Unix seconds). 0 means current time. */
|
|
3450
|
+
end_time?: number;
|
|
3451
|
+
}
|
|
3273
3452
|
|
|
3274
3453
|
/**
|
|
3275
|
-
*
|
|
3454
|
+
* 1.0 data API client.
|
|
3276
3455
|
*
|
|
3277
|
-
* Reads
|
|
3278
|
-
* -
|
|
3279
|
-
* -
|
|
3280
|
-
* - Neither → public (api.ask.surf, caller provides own auth)
|
|
3456
|
+
* Reads:
|
|
3457
|
+
* - SURF_API_BASE_URL (default: https://api.asksurf.ai/gateway/v1)
|
|
3458
|
+
* - SURF_API_KEY (required)
|
|
3281
3459
|
*
|
|
3282
|
-
*
|
|
3283
|
-
*
|
|
3284
|
-
* GATEWAY_URL → SURF_DEPLOYED_GATEWAY_URL
|
|
3285
|
-
* APP_TOKEN → SURF_DEPLOYED_APP_TOKEN
|
|
3460
|
+
* All requests are sent directly to the configured API base URL using
|
|
3461
|
+
* Authorization: Bearer <SURF_API_KEY>.
|
|
3286
3462
|
*/
|
|
3287
3463
|
/** Low-level GET — escape hatch for endpoints not yet in the SDK. */
|
|
3288
3464
|
declare function get<T = any>(path: string, params?: Record<string, any>): Promise<T>;
|
|
@@ -3330,6 +3506,11 @@ declare const dataApi: {
|
|
|
3330
3506
|
price_indicator: (params: MarketPriceIndicatorParams) => Promise<ApiResponse<MarketPriceIndicatorItem>>;
|
|
3331
3507
|
ranking: (params?: MarketRankingParams) => Promise<ApiResponse<MarketRankingItem>>;
|
|
3332
3508
|
};
|
|
3509
|
+
matching: {
|
|
3510
|
+
market_daily: (params: MatchingMarketDailyParams) => Promise<ApiResponse<MatchingMarketDailyItem>>;
|
|
3511
|
+
market_find: (params?: MatchingMarketFindParams) => Promise<ApiResponse<MatchingMarketFindItem>>;
|
|
3512
|
+
market_pairs: (params?: MatchingMarketPairsParams) => Promise<ApiResponse<MatchingMarketPairsItem>>;
|
|
3513
|
+
};
|
|
3333
3514
|
news: {
|
|
3334
3515
|
detail: (params: NewsDetailParams) => Promise<ApiObjectResponse<NewsDetailData>>;
|
|
3335
3516
|
feed: (params?: NewsFeedParams) => Promise<ApiResponse<NewsFeedItem>>;
|
|
@@ -3394,6 +3575,13 @@ declare const dataApi: {
|
|
|
3394
3575
|
tokenomics: (params?: TokenTokenomicsParams) => Promise<ApiResponse<TokenTokenomicsItem>>;
|
|
3395
3576
|
transfers: (params: TokenTransfersParams) => Promise<ApiResponse<TokenTransfersItem>>;
|
|
3396
3577
|
};
|
|
3578
|
+
v2: {
|
|
3579
|
+
kalshi_orderbooks: (params: V2KalshiOrderbooksParams) => Promise<ApiResponse<V2KalshiOrderbooksItem>>;
|
|
3580
|
+
polymarket_candlesticks: (params?: V2PolymarketCandlesticksParams) => Promise<ApiResponse<V2PolymarketCandlesticksItem>>;
|
|
3581
|
+
polymarket_volume_timeseries: (params?: V2PolymarketVolumeTimeseriesParams) => Promise<ApiResponse<V2PolymarketVolumeTimeseriesItem>>;
|
|
3582
|
+
polymarket_orderbooks: (params: V2PolymarketOrderbooksParams) => Promise<ApiResponse<V2PolymarketOrderbooksItem>>;
|
|
3583
|
+
polymarket_volume_chart: (params?: V2PolymarketVolumeChartParams) => Promise<ApiResponse<V2PolymarketVolumeChartItem>>;
|
|
3584
|
+
};
|
|
3397
3585
|
wallet: {
|
|
3398
3586
|
detail: (params: WalletDetailParams) => Promise<ApiObjectResponse<WalletDetailData>>;
|
|
3399
3587
|
history: (params: WalletHistoryParams) => Promise<ApiResponse<WalletHistoryItem>>;
|