@surf-ai/sdk 1.0.0-alpha.9 → 1.0.1
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/dist/db/index.d.cts +5 -9
- package/dist/db/index.d.ts +5 -9
- package/dist/server/index.cjs +44 -51
- package/dist/server/index.d.cts +349 -293
- package/dist/server/index.d.ts +349 -293
- package/dist/server/index.js +44 -51
- package/package.json +3 -2
package/dist/db/index.d.cts
CHANGED
|
@@ -32,18 +32,14 @@ declare function watchSchema(schemaPath: string, options?: {
|
|
|
32
32
|
}): () => void;
|
|
33
33
|
|
|
34
34
|
/**
|
|
35
|
-
* @surf-ai/sdk/db —
|
|
35
|
+
* @surf-ai/sdk/db — Database helpers via HTTP proxy to Neon PostgreSQL.
|
|
36
36
|
*
|
|
37
|
-
*
|
|
37
|
+
* All queries go through the Surf API proxy — there is no direct database
|
|
38
|
+
* connection or Drizzle ORM query builder. Use dbQuery() for all reads/writes.
|
|
38
39
|
*
|
|
39
40
|
* Usage:
|
|
40
|
-
* const {
|
|
41
|
-
*
|
|
42
|
-
* // In a backend route:
|
|
43
|
-
* const users = await db.select().from(schema.users)
|
|
44
|
-
*
|
|
45
|
-
* // Raw SQL:
|
|
46
|
-
* const result = await dbQuery('SELECT * FROM users WHERE id = $1', [userId])
|
|
41
|
+
* const { dbQuery } = require('@surf-ai/sdk/db')
|
|
42
|
+
* const users = await dbQuery('SELECT * FROM users WHERE id = $1', [userId])
|
|
47
43
|
*/
|
|
48
44
|
|
|
49
45
|
/**
|
package/dist/db/index.d.ts
CHANGED
|
@@ -32,18 +32,14 @@ declare function watchSchema(schemaPath: string, options?: {
|
|
|
32
32
|
}): () => void;
|
|
33
33
|
|
|
34
34
|
/**
|
|
35
|
-
* @surf-ai/sdk/db —
|
|
35
|
+
* @surf-ai/sdk/db — Database helpers via HTTP proxy to Neon PostgreSQL.
|
|
36
36
|
*
|
|
37
|
-
*
|
|
37
|
+
* All queries go through the Surf API proxy — there is no direct database
|
|
38
|
+
* connection or Drizzle ORM query builder. Use dbQuery() for all reads/writes.
|
|
38
39
|
*
|
|
39
40
|
* Usage:
|
|
40
|
-
* const {
|
|
41
|
-
*
|
|
42
|
-
* // In a backend route:
|
|
43
|
-
* const users = await db.select().from(schema.users)
|
|
44
|
-
*
|
|
45
|
-
* // Raw SQL:
|
|
46
|
-
* const result = await dbQuery('SELECT * FROM users WHERE id = $1', [userId])
|
|
41
|
+
* const { dbQuery } = require('@surf-ai/sdk/db')
|
|
42
|
+
* const users = await dbQuery('SELECT * FROM users WHERE id = $1', [userId])
|
|
47
43
|
*/
|
|
48
44
|
|
|
49
45
|
/**
|
package/dist/server/index.cjs
CHANGED
|
@@ -542,7 +542,7 @@ var exchange = {
|
|
|
542
542
|
long_short_ratio: (params) => get("exchange/long-short-ratio", params),
|
|
543
543
|
/** Returns trading pairs available on an exchange. **Filters:** `type` (`spot`, `swap`, `future`, `option`) or free-text `search`. **Included fields:** pair name, base/quote currencies, market type, active status, and default fee rates. Use the returned `pair` values as the `pair` parameter in other exchange endpoints. */
|
|
544
544
|
markets: (params) => get("exchange/markets", params),
|
|
545
|
-
/** Returns a
|
|
545
|
+
/** Returns a perpetual futures snapshot for a trading pair: funding rate, open interest, mark/index price. **Available fields** (via `fields`): - `funding` — current funding rate, next settlement, mark/index price - `oi` — open interest in contracts and USD Just pass the base pair (e.g. `pair=BTC/USDT`). The `:USDT` swap suffix is added automatically. */
|
|
546
546
|
perp: (params) => get("exchange/perp", params),
|
|
547
547
|
/** Returns the real-time ticker for a trading pair. **Included fields:** last price, bid/ask, 24h high/low, 24h volume, 24h price change. Set `type=swap` to query perpetual contract prices instead of spot. For historical price trends, use `/market/price`. */
|
|
548
548
|
price: (params) => get("exchange/price", params)
|
|
@@ -550,11 +550,11 @@ var exchange = {
|
|
|
550
550
|
|
|
551
551
|
// src/data/categories/fund.ts
|
|
552
552
|
var fund = {
|
|
553
|
-
/** Returns a fund's
|
|
553
|
+
/** Returns a crypto VC fund's full profile: description, jurisdiction, portfolio count, social links, and team members with roles. **Included fields:** X accounts, team members, recent research, invested project count. This does NOT return the list of investments — use `/fund/portfolio` for that. **Lookup:** by UUID (`id`) or name (`q`). Returns 404 if not found. */
|
|
554
554
|
detail: (params) => get("fund/detail", params),
|
|
555
555
|
/** Returns investment rounds for a fund's portfolio, sorted by date (newest first). A project may appear multiple times if the fund participated in multiple rounds. **Included fields:** project name, logo, date, raise amount, lead investor status. **Lookup:** by UUID (`id`) or name (`q`). */
|
|
556
556
|
portfolio: (params) => get("fund/portfolio", params),
|
|
557
|
-
/** Returns top
|
|
557
|
+
/** Returns top crypto VC funds ranked by tier or portfolio count. **Available metrics:** `tier` (lower is better), `portfolio_count` (number of invested projects). */
|
|
558
558
|
ranking: (params) => get("fund/ranking", params)
|
|
559
559
|
};
|
|
560
560
|
|
|
@@ -564,15 +564,15 @@ var kalshi = {
|
|
|
564
564
|
events: (params) => get("prediction-market/kalshi/events", params),
|
|
565
565
|
/** Returns Kalshi markets, optionally filtered by `market_ticker`. Each market includes price, volume, and status. **Data refresh:** ~30 minutes */
|
|
566
566
|
markets: (params) => get("prediction-market/kalshi/markets", params),
|
|
567
|
-
/**
|
|
567
|
+
/** Daily open interest time series for a Kalshi market. **Data refresh:** ~30 minutes */
|
|
568
568
|
open_interest: (params) => get("prediction-market/kalshi/open-interest", params),
|
|
569
|
-
/**
|
|
569
|
+
/** Historical orderbook snapshots for a Kalshi market. Returns yes-side bid/ask levels. Timestamps in milliseconds, prices in cents. Data refresh: ~5 minutes */
|
|
570
|
+
orderbooks: (params) => get("prediction-market/kalshi/orderbooks", params),
|
|
571
|
+
/** Price time series for a Kalshi market with daily or hourly OHLC data, or latest price from recent trades. **Data refresh:** ~30 minutes */
|
|
570
572
|
prices: (params) => get("prediction-market/kalshi/prices", params),
|
|
571
|
-
/** Returns top-ranked Kalshi markets by last day's `notional_volume_usd` or `open_interest`. **Filters:** `status`. **Data refresh:** ~30 minutes */
|
|
572
|
-
ranking: (params) => get("prediction-market/kalshi/ranking", params),
|
|
573
573
|
/** Returns individual trade records for a Kalshi market. **Filters:** `taker_side`, `min_contracts`, and date range. **Sort:** `timestamp` or `num_contracts`. **Data refresh:** real-time */
|
|
574
574
|
trades: (params) => get("prediction-market/kalshi/trades", params),
|
|
575
|
-
/**
|
|
575
|
+
/** Daily trading volume time series for a Kalshi market. **Data refresh:** ~30 minutes */
|
|
576
576
|
volumes: (params) => get("prediction-market/kalshi/volumes", params)
|
|
577
577
|
};
|
|
578
578
|
|
|
@@ -598,17 +598,15 @@ var market = {
|
|
|
598
598
|
price: (params) => get("market/price", params),
|
|
599
599
|
/** Returns a technical indicator for a trading pair on a given exchange and interval. **Modes:** - Set `from`/`to` for time-series - Omit for latest value only **Indicator-specific tuning** via `options` (e.g. `period:7`, `fast_period:8,slow_period:21,signal_period:5`, `period:10,stddev:1.5`). **Available indicators:** `rsi`, `macd`, `ema`, `sma`, `bbands`, `stoch`, `adx`, `atr`, `cci`, `obv`, `vwap`, `dmi`, `ichimoku`, `supertrend`. */
|
|
600
600
|
price_indicator: (params) => get("market/price-indicator", params),
|
|
601
|
-
/** Returns
|
|
601
|
+
/** Returns a token leaderboard sorted by market cap, 24h change, or volume. Each entry includes price, market cap, FDV, supply, ATH/ATL, and 24h range. Supports category filtering (MEME, AI, L1, L2, DEFI, GAMING, etc.). **Available metrics:** `market_cap`, `top_gainers`, `top_losers`, `volume`. **Note:** `top_gainers` and `top_losers` rank by 24h price change within the top 250 coins by market cap. For circulating supply, FDV, ATH/ATL, use `/project/detail?fields=token_info`. */
|
|
602
602
|
ranking: (params) => get("market/ranking", params)
|
|
603
603
|
};
|
|
604
604
|
|
|
605
605
|
// src/data/categories/matching.ts
|
|
606
606
|
var matching = {
|
|
607
|
-
/** Returns daily volume and open interest comparison for a specific matched
|
|
607
|
+
/** Returns daily volume and open interest comparison for a specific Polymarket <> Kalshi matched pair. Both `polymarket_condition_id` and `kalshi_market_ticker` are required. Use `matching-market-pairs` to discover matched pairs first. **Volume units:** Polymarket = USD, Kalshi = contracts. */
|
|
608
608
|
market_daily: (params) => get("prediction-market/matching/daily", params),
|
|
609
|
-
/**
|
|
610
|
-
market_find: (params) => get("prediction-market/matching/find", params),
|
|
611
|
-
/** Returns one-to-one matched market pairs between Polymarket and Kalshi. Each pair maps a Polymarket condition_id to a Kalshi market_ticker with a confidence score. **Volume units differ:** Polymarket = USD, Kalshi = contracts ($1 binary options). **Data refresh:** seed-driven, updated periodically. */
|
|
609
|
+
/** Cross-platform prediction market pair matcher — finds the same event listed on both Polymarket and Kalshi, with live price spread data. This is prediction-market only (Polymarket and Kalshi). For crypto exchange markets, use `exchange-markets`. Filter by category, match type, confidence score, or look up a specific market's cross-platform counterpart via `polymarket_condition_id` or `kalshi_market_ticker`. Each pair includes current prices and spread percentage for arbitrage analysis. Sort by `spread_pct` to find the widest spreads. **Data refresh:** ~5 minutes */
|
|
612
610
|
market_pairs: (params) => get("prediction-market/matching/pairs", params)
|
|
613
611
|
};
|
|
614
612
|
|
|
@@ -628,51 +626,59 @@ var onchain = {
|
|
|
628
626
|
gas_price: (params) => get("onchain/gas-price", params),
|
|
629
627
|
/** Executes a structured JSON query on blockchain data. No raw SQL needed — specify source, fields, filters, sort, and pagination. All tables live in the **agent** database. Use `GET /v1/onchain/schema` to discover available tables and their columns. **Key rules:** - **Source format:** `agent.<table_name>` (e.g. `agent.ethereum_transactions`, `agent.ethereum_dex_trades`) - Max 10,000 rows (default 20), 30s timeout - **Always filter on block_date** — it is the partition key. Without it, queries scan billions of rows and will timeout **Data refresh:** ~24 hours. ## Example ```json { "source": "agent.ethereum_dex_trades", "fields": ["block_time", "project", "token_pair", "amount_usd", "taker"], "filters": [ {"field": "block_date", "op": "gte", "value": "2025-03-01"}, {"field": "project", "op": "eq", "value": "uniswap"}, {"field": "amount_usd", "op": "gte", "value": 100000} ], "sort": [{"field": "amount_usd", "order": "desc"}], "limit": 20 } ``` */
|
|
630
628
|
structured_query: (body) => post("onchain/query", body),
|
|
631
|
-
/** Returns
|
|
629
|
+
/** Returns the ClickHouse schema catalog (tables, columns, types) for on-chain analytics. Use this to discover available tables before writing SQL with `onchain-sql`. **Included fields:** database name, table name, column names, types, and comments. */
|
|
632
630
|
schema: () => get("onchain/schema"),
|
|
633
631
|
/** Executes a raw SQL SELECT query against blockchain data. All tables live in the **agent** database. Use `GET /v1/onchain/schema` to discover available tables and their columns before writing queries. ## Rules - Only SELECT/WITH statements allowed (read-only) - All table references must be database-qualified: `agent.<table_name>` - Max 10,000 rows (default 1,000), 30s timeout - **Always filter on block_date or block_number** — partition key, without it queries will timeout - Avoid `SELECT *` on large tables — specify only the columns you need **Data refresh:** ~24 hours. ## Example ```sql SELECT block_time, token_pair, amount_usd, taker, tx_hash FROM agent.ethereum_dex_trades WHERE block_date >= today() - 7 AND project = 'uniswap' AND amount_usd > 100000 ORDER BY amount_usd DESC LIMIT 20 ``` */
|
|
634
632
|
sql: (body) => post("onchain/sql", body),
|
|
635
633
|
/** Returns transaction details by hash. All numeric fields are hex-encoded — use parseInt(hex, 16) to convert. **Supported chains:** `ethereum`, `polygon`, `bsc`, `arbitrum`, `optimism`, `base`, `avalanche`, `fantom`, `linea`, `cyber`. Returns 404 if the transaction is not found. */
|
|
636
634
|
tx: (params) => get("onchain/tx", params),
|
|
637
|
-
/** Returns DeFi yield pools ranked by APY or TVL.
|
|
635
|
+
/** Returns individual DeFi yield pools/vaults ranked by APY or TVL, with APY breakdown (base vs reward) and pool contract address. Unlike `project-defi-ranking` which ranks whole protocols, this ranks specific pools within protocols. Filter by protocol name (e.g. `lido`, `aave`). Only pools with TVL >= $100k are included when sorted by APY. */
|
|
638
636
|
yield_ranking: (params) => get("onchain/yield/ranking", params)
|
|
639
637
|
};
|
|
640
638
|
|
|
641
639
|
// src/data/categories/polymarket.ts
|
|
642
640
|
var polymarket = {
|
|
643
|
-
/** Returns trade and redemption activity for a Polymarket wallet. **Data refresh:** ~30 minutes */
|
|
644
|
-
activity: (params) => get("prediction-market/polymarket/activity", params),
|
|
645
641
|
/** Returns Polymarket events with nested markets, optionally filtered by `event_slug`. Each event includes aggregated status, volume, and a list of markets with `side_a`/`side_b` outcomes. **Data refresh:** ~30 minutes */
|
|
646
642
|
events: (params) => get("prediction-market/polymarket/events", params),
|
|
643
|
+
/** Returns a ranked leaderboard of Polymarket traders by realized PnL, volume, or trade count. Sortable by `pnl`, `volume`, or `trade_count`. Each entry includes the wallet address and aggregate trading statistics. **Data refresh:** ~5 minutes. */
|
|
644
|
+
leaderboard: (params) => get("prediction-market/polymarket/leaderboard", params),
|
|
647
645
|
/** Returns Polymarket markets, optionally filtered by `market_slug`. Each market includes `side_a` and `side_b` outcomes. Current prices are available via `/polymarket/prices` using the `condition_id`. **Data refresh:** ~30 minutes */
|
|
648
646
|
markets: (params) => get("prediction-market/polymarket/markets", params),
|
|
649
|
-
/**
|
|
647
|
+
/** Daily open interest time series showing total value locked in a Polymarket market. **Data refresh:** ~30 minutes */
|
|
650
648
|
open_interest: (params) => get("prediction-market/polymarket/open-interest", params),
|
|
651
|
-
/**
|
|
649
|
+
/** Historical orderbook snapshots for a Polymarket token. Returns raw bid/ask depth levels. Timestamps in milliseconds. Data refresh: ~5 minutes */
|
|
650
|
+
orderbooks: (params) => get("prediction-market/polymarket/orderbooks", params),
|
|
651
|
+
/** Given a specific wallet address, returns that wallet's open positions on Polymarket markets. This is a single-wallet lookup — you must provide the wallet `address`. **Not what you need?** - To discover top/smart wallets across all of Polymarket, use `polymarket-smart-money` (view=positioning for aggregate signals, view=trades for individual whale trades). - To find top traders by PnL or volume, use `polymarket-leaderboard`. **Data refresh:** ~30 minutes */
|
|
652
652
|
positions: (params) => get("prediction-market/polymarket/positions", params),
|
|
653
|
-
/**
|
|
653
|
+
/** OHLCV candlestick data for charting a Polymarket market — open, high, low, close, volume per candle. Use this for rendering price charts with candlestick or bar visualizations. For simple price time series (one price per interval), use `prices` instead. Data refresh: ~30 minutes */
|
|
654
|
+
price_ohlcv: (params) => get("prediction-market/polymarket/price-ohlcv/{condition_id}", params),
|
|
655
|
+
/** Simple price time series for a Polymarket market — one price point per interval. Use this for tracking price trends over time. For OHLCV candlestick data (open/high/low/close for charting libraries), use `price-ohlcv` instead. **Data refresh:** ~30 minutes */
|
|
654
656
|
prices: (params) => get("prediction-market/polymarket/prices", params),
|
|
655
|
-
/**
|
|
656
|
-
|
|
657
|
-
/**
|
|
657
|
+
/** Smart wallet analytics for Polymarket markets. view=positioning (default): Aggregate smart wallet direction per market — net bullish/bearish signal and conviction. view=trades: Individual $10K+ trades with wallet address, amount, outcome, price, and wallet age. **Data refresh:** ~5 minutes */
|
|
658
|
+
smart_money: (params) => get("prediction-market/polymarket/smart-money", params),
|
|
659
|
+
/** Trade and activity history for a Polymarket market or wallet. Filter by market (condition_id), wallet (address), outcome (Yes/No), minimum trade size, and time range. Use type=redemption for splits/merges/redemptions, type=all for everything. **Data refresh:** ~5 minutes */
|
|
658
660
|
trades: (params) => get("prediction-market/polymarket/trades", params),
|
|
659
|
-
/**
|
|
661
|
+
/** Volume split by YES/NO outcome sides per interval (hour/day/week), plus total volume and trade count. Use this to see directional volume bias. For aggregate volume without YES/NO breakdown, use `volumes` instead. Data refresh: ~30 minutes */
|
|
662
|
+
volume_split: (params) => get("prediction-market/polymarket/volume-split/{condition_id}", params),
|
|
663
|
+
/** Aggregate trading volume (USD) and trade count as a time series. Use this for volume trend analysis. For YES/NO volume breakdown by outcome side, use `volume-split` instead. **Data refresh:** ~30 minutes */
|
|
660
664
|
volumes: (params) => get("prediction-market/polymarket/volumes", params)
|
|
661
665
|
};
|
|
662
666
|
|
|
663
667
|
// src/data/categories/prediction_market.ts
|
|
664
668
|
var prediction_market = {
|
|
665
|
-
/**
|
|
666
|
-
|
|
669
|
+
/** Trends, top markets, momentum distribution, and per-market momentum signals for prediction markets. **Platform-wide totals:** Omit `category` to get aggregated volume/OI/market-count across the entire prediction market (Polymarket + Kalshi combined). Use `platform` to filter to one exchange. This is the recommended way to answer questions like "What is Polymarket's total volume this week?" or "How does Kalshi volume compare to Polymarket?" **Category drill-down:** Provide `category` to scope all data to one category (e.g. crypto, politics). Combines volume/OI time series, top markets by open interest, momentum summary (price/volume signal distribution), and per-market momentum signals (price changes, volume direction, whale flows). **Note on top_markets:** When both `category` and `platform` are omitted, top markets are ranked globally by open interest. Because Polymarket OI is significantly larger than Kalshi OI, the list will skew heavily toward Polymarket. Use `platform` to get per-platform rankings. **Use `search` instead if** you want to browse/search individual markets. **Data refresh:** ~5 minutes. */
|
|
670
|
+
analytics: (params) => get("prediction-market/analytics", params),
|
|
671
|
+
/** Returns 30-day Pearson price correlation pairs between Polymarket markets within a category. Correlation data covers the top 100 markets by 7-day volume globally; lower-volume markets may not have correlation data. Filter by `condition_id` to find all markets correlated with a specific market, or set `min_correlation` to control the threshold. The `category` parameter is required. **Data refresh:** ~5 minutes. */
|
|
672
|
+
correlations: (params) => get("prediction-market/correlations", params)
|
|
667
673
|
};
|
|
668
674
|
|
|
669
675
|
// src/data/categories/project.ts
|
|
670
676
|
var project = {
|
|
671
|
-
/** Returns time-series DeFi
|
|
677
|
+
/** Returns historical time-series for a single DeFi protocol metric (e.g. daily TVL). Each data point has a Unix timestamp and value. **Available metrics:** `volume`, `fee`, `fees`, `revenue`, `tvl`, `users`. **Lookup:** by UUID (`id`) or name (`q`). Filter by `chain` and date range (`from`/`to`). Returns 404 if the project is not found. **Note:** this endpoint only returns data for DeFi protocol projects (e.g. `aave`, `uniswap`, `lido`, `makerdao`). Use `q` with a DeFi protocol name. */
|
|
672
678
|
defi_metrics: (params) => get("project/defi/metrics", params),
|
|
673
|
-
/** Returns
|
|
679
|
+
/** Returns a DeFi protocol leaderboard (e.g. Aave, Uniswap, Lido) ranked by TVL, fees, revenue, or users. For individual pool/vault yields, use `onchain-yield-ranking` instead. **Available metrics:** `tvl`, `revenue`, `fees`, `volume`, `users`. */
|
|
674
680
|
defi_ranking: (params) => get("project/defi/ranking", params),
|
|
675
|
-
/** Returns
|
|
681
|
+
/** Returns a crypto project's profile with selectable sub-resources: overview (description, chains, exchanges), token_info (price, market cap, supply), tokenomics, funding, team, contracts, social, tge_status. **Available fields** (via `fields`): `overview`, `token_info`, `tokenomics`, `funding`, `team`, `contracts`, `social`, `tge_status`. **Lookup:** accepts project names directly via `q` (e.g. `?q=aave`) — no need to call `/search/project` first. Also accepts UUID via `id`. Returns 404 if not found. For DeFi metrics (TVL, fees, revenue, volume, users) and per-chain breakdown, use `/project/defi/metrics`. */
|
|
676
682
|
detail: (params) => get("project/detail", params)
|
|
677
683
|
};
|
|
678
684
|
|
|
@@ -684,12 +690,14 @@ var search = {
|
|
|
684
690
|
events: (params) => get("search/events", params),
|
|
685
691
|
/** Searches funds by keyword. **Included fields:** name, tier, type, logo, top invested projects. */
|
|
686
692
|
fund: (params) => get("search/fund", params),
|
|
687
|
-
/** Searches Kalshi events by keyword and/or category. **Filters:** - Keyword matching event title, subtitle, or market title - Category At least one of `q` or `category` is required. Returns events with nested markets. **Data refresh:** ~30 minutes */
|
|
693
|
+
/** **[DEPRECATED]** Use `GET /v1/search/prediction-market?platform=kalshi` instead. This endpoint will continue to work but will not receive new features. --- Searches Kalshi events by keyword and/or category. **Filters:** - Keyword matching event title, subtitle, or market title - Category At least one of `q` or `category` is required. Returns events with nested markets. **Data refresh:** ~30 minutes */
|
|
688
694
|
kalshi: (params) => get("search/kalshi", params),
|
|
689
695
|
/** Searches crypto news articles by keyword. Returns top 10 results ranked by relevance with highlighted matching fragments. */
|
|
690
696
|
news: (params) => get("search/news", params),
|
|
691
|
-
/** Searches Polymarket events by keyword, tags, and/or category. **Filters:** - Keyword matching market question, event title, or description - Comma-separated tag labels - Surf-curated category At least one of `q`, `tags`, or `category` is required. Returns events with nested markets ranked by volume. **Data refresh:** ~30 minutes */
|
|
697
|
+
/** **[DEPRECATED]** Use `GET /v1/search/prediction-market?platform=polymarket` instead. This endpoint will continue to work but will not receive new features. --- Searches Polymarket events by keyword, tags, and/or category. **Filters:** - Keyword matching market question, event title, or description - Comma-separated tag labels - Surf-curated category At least one of `q`, `tags`, or `category` is required. Returns events with nested markets ranked by volume. **Data refresh:** ~30 minutes */
|
|
692
698
|
polymarket: (params) => get("search/polymarket", params),
|
|
699
|
+
/** Browse and search prediction markets across all supported platforms. Filter by platform, category, status, keyword search, and smart money direction. Each result includes volume, open interest, trade counts, and smart money signals. Supports single-market lookup via `condition_id` or `market_ticker`. **Data refresh:** ~5 minutes. */
|
|
700
|
+
prediction_market: (params) => get("search/prediction-market", params),
|
|
693
701
|
/** Searches crypto projects by keyword. **Included fields:** name, description, chains, logo. */
|
|
694
702
|
project: (params) => get("search/project", params),
|
|
695
703
|
/** Searches X (Twitter) users by keyword. **Included fields:** handle, display name, bio, follower count, avatar. */
|
|
@@ -704,7 +712,7 @@ var search = {
|
|
|
704
712
|
|
|
705
713
|
// src/data/categories/social.ts
|
|
706
714
|
var social = {
|
|
707
|
-
/** Returns a
|
|
715
|
+
/** Returns Twitter/X analytics for a crypto project: sentiment score, follower geography, and smart follower breakdown (VCs, KOLs, developers). For individual user profiles use `social-user` instead. **Available fields** (via `fields`): `sentiment`, `follower_geo`, `smart_followers`. **Lookup:** by X account ID (`x_id`) or project name (`q`, e.g. `uniswap`, `solana`). The `q` parameter must be a crypto project name, not a personal Twitter handle. Returns 404 if the project has no linked Twitter account. For sentiment **trends over time**, use `/social/mindshare` instead. */
|
|
708
716
|
detail: (params) => get("social/detail", params),
|
|
709
717
|
/** Returns mindshare (social view count) **time-series trend** for a project, aggregated by `interval`. **Intervals:** `5m`, `1h`, `1d`, `7d`. **Filters:** date range with `from`/`to` (Unix seconds). Lookup by name (`q`). Use this for sentiment **trends**, mindshare **over time**, or social momentum changes. For a **point-in-time snapshot** of social analytics (sentiment score, follower geo, smart followers), use `/social/detail` instead. */
|
|
710
718
|
mindshare: (params) => get("social/mindshare", params),
|
|
@@ -716,7 +724,7 @@ var social = {
|
|
|
716
724
|
tweet_replies: (params) => get("social/tweet/replies", params),
|
|
717
725
|
/** Returns X (Twitter) posts by numeric post ID strings. Pass up to 100 comma-separated IDs via the `ids` query parameter. */
|
|
718
726
|
tweets: (params) => get("social/tweets", params),
|
|
719
|
-
/** Returns
|
|
727
|
+
/** Returns a basic X/Twitter profile (name, bio, avatar, follower/following counts) for any handle. For crypto project social analytics (sentiment, smart followers, geo), use `social-detail` instead. **Lookup:** by `handle` (without @). */
|
|
720
728
|
user: (params) => get("social/user", params),
|
|
721
729
|
/** Returns a list of followers for the specified handle on X (Twitter). **Lookup:** by `handle` (without @). */
|
|
722
730
|
user_followers: (params) => get("social/user/followers", params),
|
|
@@ -740,25 +748,11 @@ var token = {
|
|
|
740
748
|
transfers: (params) => get("token/transfers", params)
|
|
741
749
|
};
|
|
742
750
|
|
|
743
|
-
// src/data/categories/v2.ts
|
|
744
|
-
var v2 = {
|
|
745
|
-
/** Historical orderbook snapshots for a Kalshi market. Returns yes-side bid/ask levels. Timestamps in milliseconds, prices in cents. Data refresh: ~5 minutes */
|
|
746
|
-
kalshi_orderbooks: (params) => get("gateway/v2/kalshi/orderbooks", params),
|
|
747
|
-
/** OHLCV candlestick data for a Polymarket market. Prices normalized to YES side. Data refresh: ~30 minutes */
|
|
748
|
-
polymarket_candlesticks: (params) => get("gateway/v2/polymarket/candlesticks/{condition_id}", params),
|
|
749
|
-
/** Cumulative volume time series for a Polymarket token. Data refresh: ~30 minutes */
|
|
750
|
-
polymarket_volume_timeseries: (params) => get("gateway/v2/polymarket/markets/{token_id}/volume", params),
|
|
751
|
-
/** Historical orderbook snapshots for a Polymarket token. Returns raw bid/ask depth levels. Timestamps in milliseconds. Data refresh: ~5 minutes */
|
|
752
|
-
polymarket_orderbooks: (params) => get("gateway/v2/polymarket/orderbooks", params),
|
|
753
|
-
/** Volume breakdown by outcome (YES/NO) for a Polymarket market. Data refresh: ~30 minutes */
|
|
754
|
-
polymarket_volume_chart: (params) => get("gateway/v2/polymarket/volume-chart/{condition_id}", params)
|
|
755
|
-
};
|
|
756
|
-
|
|
757
751
|
// src/data/categories/wallet.ts
|
|
758
752
|
var wallet = {
|
|
759
|
-
/** Returns
|
|
753
|
+
/** Returns a wallet's cross-chain portfolio with selectable sub-resources (balance, tokens, labels, NFTs). Always includes per-chain USD breakdown across 15+ EVM chains. **Available fields** (via `fields`): `balance`, `tokens`, `labels`, `nft`. **Lookup:** by `address`. Partial failures return available fields with per-field error info. Returns 422 if `fields` is invalid. */
|
|
760
754
|
detail: (params) => get("wallet/detail", params),
|
|
761
|
-
/** Returns
|
|
755
|
+
/** Returns all on-chain transactions for a wallet, classified by type (send, receive, swap, approve) with native token value. For ERC-20 token transfers with token identity and USD value, use `wallet-transfers` instead. **Lookup:** by `address`. Filter by `chain` — supports `ethereum`, `polygon`, `bsc`, `arbitrum`, `optimism`, `avalanche`, `fantom`, `base`. */
|
|
762
756
|
history: (params) => get("wallet/history", params),
|
|
763
757
|
/** Returns entity labels for multiple wallet addresses. Pass up to 100 comma-separated addresses via the `addresses` query parameter. **Included fields:** entity name, type, and labels per address. */
|
|
764
758
|
labels_batch: (params) => get("wallet/labels/batch", params),
|
|
@@ -766,7 +760,7 @@ var wallet = {
|
|
|
766
760
|
net_worth: (params) => get("wallet/net-worth", params),
|
|
767
761
|
/** Returns all DeFi protocol positions for a wallet — lending, staking, LP, and farming with token breakdowns and USD values. **Lookup:** by `address`. */
|
|
768
762
|
protocols: (params) => get("wallet/protocols", params),
|
|
769
|
-
/** Returns
|
|
763
|
+
/** Returns ERC-20/SPL token transfers with token identity, USD value, and flow direction (in/out). Unlike `wallet-history` which shows all tx types in native value, this focuses on token-level transfer activity. Pass the **wallet address** in `address` — returns all ERC-20/SPL token transfers where this wallet is the sender or receiver. **Included fields:** token contract, token symbol, amount USD, counterparty, flow direction. Filter by specific token or flow direction (in/out). **Lookup:** `address` (wallet, raw 0x hex or base58 — ENS not supported). Filter by `chain` — supports `ethereum`, `base`, `solana`. **Data refresh:** ~24 hours · **Chains:** Ethereum, Base (Solana uses a different source with no delay) */
|
|
770
764
|
transfers: (params) => get("wallet/transfers", params)
|
|
771
765
|
};
|
|
772
766
|
|
|
@@ -795,7 +789,6 @@ var dataApi = {
|
|
|
795
789
|
search,
|
|
796
790
|
social,
|
|
797
791
|
token,
|
|
798
|
-
v2,
|
|
799
792
|
wallet,
|
|
800
793
|
web
|
|
801
794
|
};
|