@surf-ai/sdk 1.0.0-alpha.9 → 1.0.2
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 +2 -2
- package/dist/db/index.d.cts +21 -13
- package/dist/db/index.d.ts +21 -13
- 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/server/index.js
CHANGED
|
@@ -512,7 +512,7 @@ var exchange = {
|
|
|
512
512
|
long_short_ratio: (params) => get("exchange/long-short-ratio", params),
|
|
513
513
|
/** 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. */
|
|
514
514
|
markets: (params) => get("exchange/markets", params),
|
|
515
|
-
/** Returns a
|
|
515
|
+
/** 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. */
|
|
516
516
|
perp: (params) => get("exchange/perp", params),
|
|
517
517
|
/** 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`. */
|
|
518
518
|
price: (params) => get("exchange/price", params)
|
|
@@ -520,11 +520,11 @@ var exchange = {
|
|
|
520
520
|
|
|
521
521
|
// src/data/categories/fund.ts
|
|
522
522
|
var fund = {
|
|
523
|
-
/** Returns a fund's
|
|
523
|
+
/** 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. */
|
|
524
524
|
detail: (params) => get("fund/detail", params),
|
|
525
525
|
/** 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`). */
|
|
526
526
|
portfolio: (params) => get("fund/portfolio", params),
|
|
527
|
-
/** Returns top
|
|
527
|
+
/** Returns top crypto VC funds ranked by tier or portfolio count. **Available metrics:** `tier` (lower is better), `portfolio_count` (number of invested projects). */
|
|
528
528
|
ranking: (params) => get("fund/ranking", params)
|
|
529
529
|
};
|
|
530
530
|
|
|
@@ -534,15 +534,15 @@ var kalshi = {
|
|
|
534
534
|
events: (params) => get("prediction-market/kalshi/events", params),
|
|
535
535
|
/** Returns Kalshi markets, optionally filtered by `market_ticker`. Each market includes price, volume, and status. **Data refresh:** ~30 minutes */
|
|
536
536
|
markets: (params) => get("prediction-market/kalshi/markets", params),
|
|
537
|
-
/**
|
|
537
|
+
/** Daily open interest time series for a Kalshi market. **Data refresh:** ~30 minutes */
|
|
538
538
|
open_interest: (params) => get("prediction-market/kalshi/open-interest", params),
|
|
539
|
-
/**
|
|
539
|
+
/** Historical orderbook snapshots for a Kalshi market. Returns yes-side bid/ask levels. Timestamps in milliseconds, prices in cents. Data refresh: ~5 minutes */
|
|
540
|
+
orderbooks: (params) => get("prediction-market/kalshi/orderbooks", params),
|
|
541
|
+
/** Price time series for a Kalshi market with daily or hourly OHLC data, or latest price from recent trades. **Data refresh:** ~30 minutes */
|
|
540
542
|
prices: (params) => get("prediction-market/kalshi/prices", params),
|
|
541
|
-
/** Returns top-ranked Kalshi markets by last day's `notional_volume_usd` or `open_interest`. **Filters:** `status`. **Data refresh:** ~30 minutes */
|
|
542
|
-
ranking: (params) => get("prediction-market/kalshi/ranking", params),
|
|
543
543
|
/** 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 */
|
|
544
544
|
trades: (params) => get("prediction-market/kalshi/trades", params),
|
|
545
|
-
/**
|
|
545
|
+
/** Daily trading volume time series for a Kalshi market. **Data refresh:** ~30 minutes */
|
|
546
546
|
volumes: (params) => get("prediction-market/kalshi/volumes", params)
|
|
547
547
|
};
|
|
548
548
|
|
|
@@ -568,17 +568,15 @@ var market = {
|
|
|
568
568
|
price: (params) => get("market/price", params),
|
|
569
569
|
/** 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`. */
|
|
570
570
|
price_indicator: (params) => get("market/price-indicator", params),
|
|
571
|
-
/** Returns
|
|
571
|
+
/** 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`. */
|
|
572
572
|
ranking: (params) => get("market/ranking", params)
|
|
573
573
|
};
|
|
574
574
|
|
|
575
575
|
// src/data/categories/matching.ts
|
|
576
576
|
var matching = {
|
|
577
|
-
/** Returns daily volume and open interest comparison for a specific matched
|
|
577
|
+
/** 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. */
|
|
578
578
|
market_daily: (params) => get("prediction-market/matching/daily", params),
|
|
579
|
-
/**
|
|
580
|
-
market_find: (params) => get("prediction-market/matching/find", params),
|
|
581
|
-
/** 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. */
|
|
579
|
+
/** 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 */
|
|
582
580
|
market_pairs: (params) => get("prediction-market/matching/pairs", params)
|
|
583
581
|
};
|
|
584
582
|
|
|
@@ -598,51 +596,59 @@ var onchain = {
|
|
|
598
596
|
gas_price: (params) => get("onchain/gas-price", params),
|
|
599
597
|
/** 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 } ``` */
|
|
600
598
|
structured_query: (body) => post("onchain/query", body),
|
|
601
|
-
/** Returns
|
|
599
|
+
/** 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. */
|
|
602
600
|
schema: () => get("onchain/schema"),
|
|
603
601
|
/** 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 ``` */
|
|
604
602
|
sql: (body) => post("onchain/sql", body),
|
|
605
603
|
/** 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. */
|
|
606
604
|
tx: (params) => get("onchain/tx", params),
|
|
607
|
-
/** Returns DeFi yield pools ranked by APY or TVL.
|
|
605
|
+
/** 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. */
|
|
608
606
|
yield_ranking: (params) => get("onchain/yield/ranking", params)
|
|
609
607
|
};
|
|
610
608
|
|
|
611
609
|
// src/data/categories/polymarket.ts
|
|
612
610
|
var polymarket = {
|
|
613
|
-
/** Returns trade and redemption activity for a Polymarket wallet. **Data refresh:** ~30 minutes */
|
|
614
|
-
activity: (params) => get("prediction-market/polymarket/activity", params),
|
|
615
611
|
/** 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 */
|
|
616
612
|
events: (params) => get("prediction-market/polymarket/events", params),
|
|
613
|
+
/** 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. */
|
|
614
|
+
leaderboard: (params) => get("prediction-market/polymarket/leaderboard", params),
|
|
617
615
|
/** 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 */
|
|
618
616
|
markets: (params) => get("prediction-market/polymarket/markets", params),
|
|
619
|
-
/**
|
|
617
|
+
/** Daily open interest time series showing total value locked in a Polymarket market. **Data refresh:** ~30 minutes */
|
|
620
618
|
open_interest: (params) => get("prediction-market/polymarket/open-interest", params),
|
|
621
|
-
/**
|
|
619
|
+
/** Historical orderbook snapshots for a Polymarket token. Returns raw bid/ask depth levels. Timestamps in milliseconds. Data refresh: ~5 minutes */
|
|
620
|
+
orderbooks: (params) => get("prediction-market/polymarket/orderbooks", params),
|
|
621
|
+
/** 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 */
|
|
622
622
|
positions: (params) => get("prediction-market/polymarket/positions", params),
|
|
623
|
-
/**
|
|
623
|
+
/** 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 */
|
|
624
|
+
price_ohlcv: (params) => get("prediction-market/polymarket/price-ohlcv/{condition_id}", params),
|
|
625
|
+
/** 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 */
|
|
624
626
|
prices: (params) => get("prediction-market/polymarket/prices", params),
|
|
625
|
-
/**
|
|
626
|
-
|
|
627
|
-
/**
|
|
627
|
+
/** 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 */
|
|
628
|
+
smart_money: (params) => get("prediction-market/polymarket/smart-money", params),
|
|
629
|
+
/** 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 */
|
|
628
630
|
trades: (params) => get("prediction-market/polymarket/trades", params),
|
|
629
|
-
/**
|
|
631
|
+
/** 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 */
|
|
632
|
+
volume_split: (params) => get("prediction-market/polymarket/volume-split/{condition_id}", params),
|
|
633
|
+
/** 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 */
|
|
630
634
|
volumes: (params) => get("prediction-market/polymarket/volumes", params)
|
|
631
635
|
};
|
|
632
636
|
|
|
633
637
|
// src/data/categories/prediction_market.ts
|
|
634
638
|
var prediction_market = {
|
|
635
|
-
/**
|
|
636
|
-
|
|
639
|
+
/** 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. */
|
|
640
|
+
analytics: (params) => get("prediction-market/analytics", params),
|
|
641
|
+
/** 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. */
|
|
642
|
+
correlations: (params) => get("prediction-market/correlations", params)
|
|
637
643
|
};
|
|
638
644
|
|
|
639
645
|
// src/data/categories/project.ts
|
|
640
646
|
var project = {
|
|
641
|
-
/** Returns time-series DeFi
|
|
647
|
+
/** 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. */
|
|
642
648
|
defi_metrics: (params) => get("project/defi/metrics", params),
|
|
643
|
-
/** Returns
|
|
649
|
+
/** 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`. */
|
|
644
650
|
defi_ranking: (params) => get("project/defi/ranking", params),
|
|
645
|
-
/** Returns
|
|
651
|
+
/** 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`. */
|
|
646
652
|
detail: (params) => get("project/detail", params)
|
|
647
653
|
};
|
|
648
654
|
|
|
@@ -654,12 +660,14 @@ var search = {
|
|
|
654
660
|
events: (params) => get("search/events", params),
|
|
655
661
|
/** Searches funds by keyword. **Included fields:** name, tier, type, logo, top invested projects. */
|
|
656
662
|
fund: (params) => get("search/fund", params),
|
|
657
|
-
/** 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 */
|
|
663
|
+
/** **[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 */
|
|
658
664
|
kalshi: (params) => get("search/kalshi", params),
|
|
659
665
|
/** Searches crypto news articles by keyword. Returns top 10 results ranked by relevance with highlighted matching fragments. */
|
|
660
666
|
news: (params) => get("search/news", params),
|
|
661
|
-
/** 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 */
|
|
667
|
+
/** **[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 */
|
|
662
668
|
polymarket: (params) => get("search/polymarket", params),
|
|
669
|
+
/** 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. */
|
|
670
|
+
prediction_market: (params) => get("search/prediction-market", params),
|
|
663
671
|
/** Searches crypto projects by keyword. **Included fields:** name, description, chains, logo. */
|
|
664
672
|
project: (params) => get("search/project", params),
|
|
665
673
|
/** Searches X (Twitter) users by keyword. **Included fields:** handle, display name, bio, follower count, avatar. */
|
|
@@ -674,7 +682,7 @@ var search = {
|
|
|
674
682
|
|
|
675
683
|
// src/data/categories/social.ts
|
|
676
684
|
var social = {
|
|
677
|
-
/** Returns a
|
|
685
|
+
/** 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. */
|
|
678
686
|
detail: (params) => get("social/detail", params),
|
|
679
687
|
/** 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. */
|
|
680
688
|
mindshare: (params) => get("social/mindshare", params),
|
|
@@ -686,7 +694,7 @@ var social = {
|
|
|
686
694
|
tweet_replies: (params) => get("social/tweet/replies", params),
|
|
687
695
|
/** Returns X (Twitter) posts by numeric post ID strings. Pass up to 100 comma-separated IDs via the `ids` query parameter. */
|
|
688
696
|
tweets: (params) => get("social/tweets", params),
|
|
689
|
-
/** Returns
|
|
697
|
+
/** 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 @). */
|
|
690
698
|
user: (params) => get("social/user", params),
|
|
691
699
|
/** Returns a list of followers for the specified handle on X (Twitter). **Lookup:** by `handle` (without @). */
|
|
692
700
|
user_followers: (params) => get("social/user/followers", params),
|
|
@@ -710,25 +718,11 @@ var token = {
|
|
|
710
718
|
transfers: (params) => get("token/transfers", params)
|
|
711
719
|
};
|
|
712
720
|
|
|
713
|
-
// src/data/categories/v2.ts
|
|
714
|
-
var v2 = {
|
|
715
|
-
/** Historical orderbook snapshots for a Kalshi market. Returns yes-side bid/ask levels. Timestamps in milliseconds, prices in cents. Data refresh: ~5 minutes */
|
|
716
|
-
kalshi_orderbooks: (params) => get("gateway/v2/kalshi/orderbooks", params),
|
|
717
|
-
/** OHLCV candlestick data for a Polymarket market. Prices normalized to YES side. Data refresh: ~30 minutes */
|
|
718
|
-
polymarket_candlesticks: (params) => get("gateway/v2/polymarket/candlesticks/{condition_id}", params),
|
|
719
|
-
/** Cumulative volume time series for a Polymarket token. Data refresh: ~30 minutes */
|
|
720
|
-
polymarket_volume_timeseries: (params) => get("gateway/v2/polymarket/markets/{token_id}/volume", params),
|
|
721
|
-
/** Historical orderbook snapshots for a Polymarket token. Returns raw bid/ask depth levels. Timestamps in milliseconds. Data refresh: ~5 minutes */
|
|
722
|
-
polymarket_orderbooks: (params) => get("gateway/v2/polymarket/orderbooks", params),
|
|
723
|
-
/** Volume breakdown by outcome (YES/NO) for a Polymarket market. Data refresh: ~30 minutes */
|
|
724
|
-
polymarket_volume_chart: (params) => get("gateway/v2/polymarket/volume-chart/{condition_id}", params)
|
|
725
|
-
};
|
|
726
|
-
|
|
727
721
|
// src/data/categories/wallet.ts
|
|
728
722
|
var wallet = {
|
|
729
|
-
/** Returns
|
|
723
|
+
/** 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. */
|
|
730
724
|
detail: (params) => get("wallet/detail", params),
|
|
731
|
-
/** Returns
|
|
725
|
+
/** 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`. */
|
|
732
726
|
history: (params) => get("wallet/history", params),
|
|
733
727
|
/** 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. */
|
|
734
728
|
labels_batch: (params) => get("wallet/labels/batch", params),
|
|
@@ -736,7 +730,7 @@ var wallet = {
|
|
|
736
730
|
net_worth: (params) => get("wallet/net-worth", params),
|
|
737
731
|
/** Returns all DeFi protocol positions for a wallet — lending, staking, LP, and farming with token breakdowns and USD values. **Lookup:** by `address`. */
|
|
738
732
|
protocols: (params) => get("wallet/protocols", params),
|
|
739
|
-
/** Returns
|
|
733
|
+
/** 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) */
|
|
740
734
|
transfers: (params) => get("wallet/transfers", params)
|
|
741
735
|
};
|
|
742
736
|
|
|
@@ -765,7 +759,6 @@ var dataApi = {
|
|
|
765
759
|
search,
|
|
766
760
|
social,
|
|
767
761
|
token,
|
|
768
|
-
v2,
|
|
769
762
|
wallet,
|
|
770
763
|
web
|
|
771
764
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@surf-ai/sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Surf platform SDK — data API client, server runtime, and database helpers",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -28,7 +28,8 @@
|
|
|
28
28
|
"express": "^4.22.0",
|
|
29
29
|
"cors": "^2.8.5",
|
|
30
30
|
"croner": "^9.0.0",
|
|
31
|
-
"drizzle-orm": "^0.44.0"
|
|
31
|
+
"drizzle-orm": "^0.44.0",
|
|
32
|
+
"drizzle-kit": "^0.31.0"
|
|
32
33
|
},
|
|
33
34
|
"devDependencies": {
|
|
34
35
|
"tsup": "^8.0.0",
|