import { PolyNodeWS } from './ws.js'; import { OrderbookWS } from './orderbook.js'; import type { StatusResponse, ApiKeyResponse, MarketsResponse, MarketDetail, MarketsListResponse, MarketsListParams, SearchResponse, CandlesResponse, CandlesParams, MarketStats, SettlementsResponse, WalletResponse, OrderbookResponse, MidpointResponse, SpreadResponse, LeaderboardResponse, LeaderboardPeriod, LeaderboardSort, TrendingResponse, ActivityResponse, MoversResponse, TraderProfile, TraderPnlResponse, PnlPeriod, EventDetailResponse, EventSearchResponse, MarketsByCategoryResponse } from './types/index.js'; import type { WsOptions } from './types/ws.js'; import type { OrderbookOptions } from './types/orderbook.js'; export interface PolyNodeConfig { apiKey: string; baseUrl?: string; wsUrl?: string; obUrl?: string; rpcUrl?: string; timeout?: number; } export declare class PolyNode { private readonly apiKey; private readonly baseUrl; private readonly wsUrl; private readonly obUrl; private readonly rpcUrl; private readonly timeout; private _ws; private _orderbook; constructor(config: PolyNodeConfig); /** Get the WebSocket client (lazy-initialized). */ get ws(): PolyNodeWS; /** Get the orderbook WebSocket client (lazy-initialized). */ get orderbook(): OrderbookWS; /** Configure WebSocket options before connecting. */ configureWs(options: WsOptions): PolyNodeWS; /** Configure orderbook WebSocket options before connecting. */ configureOrderbook(options: OrderbookOptions): OrderbookWS; private _fetch; /** Liveness probe. Returns "ok" if server is running. No auth required. */ healthz(): Promise; /** Readiness check. Returns 200 if node connected and Redis reachable. No auth required. */ readyz(): Promise; /** System status with metrics. */ status(): Promise; /** Generate a new API key. No auth required. Rate limited to 1/day/IP. */ createKey(name?: string): Promise; /** Top markets sorted by 24h volume. */ markets(params?: { count?: number; }): Promise; /** Market detail by token ID. */ market(tokenId: string): Promise; /** Market detail by URL slug. */ marketBySlug(slug: string): Promise; /** Market detail by condition ID. */ marketByCondition(conditionId: string): Promise; /** Filtered, paginated market listing. */ marketsList(params?: MarketsListParams): Promise; /** Full-text search across market questions. */ search(query: string, params?: { limit?: number; includeInactive?: boolean; }): Promise; /** OHLCV candles for a token. */ candles(tokenId: string, params?: CandlesParams): Promise; /** Market statistics (last price, 24h volume, OHLCV). */ stats(tokenId: string): Promise; /** Most recent decoded settlements. */ recentSettlements(params?: { count?: number; }): Promise; /** Settlements for a specific token ID. */ tokenSettlements(tokenId: string, params?: { count?: number; }): Promise; /** Settlements for a specific wallet address. */ walletSettlements(address: string, params?: { count?: number; }): Promise; /** Wallet activity summary. */ wallet(address: string): Promise; /** Trades for a wallet. Used by the cache for backfill. */ walletTrades(address: string, params?: { limit?: number; offset?: number; }): Promise<{ wallet: string; count: number; trades: Record[]; }>; /** Trades for a market (by condition ID or slug). */ marketTrades(id: string, params?: { limit?: number; offset?: number; side?: string; user?: string; }): Promise<{ condition_id: string; count: number; trades: Record[]; }>; /** Positions for a wallet (proxied from Polymarket data-api). Returns full P&L, current values. */ walletPositions(address: string, params?: { limit?: number; offset?: number; }): Promise<{ wallet: string; count: number; positions: Record[]; }>; /** Onchain positions from the PNL subgraph. Returns ALL positions (open + closed) with accurate realized P&L. */ walletOnchainPositions(address: string): Promise<{ wallet: string; source: string; count: number; open_count: number; closed_count: number; total_realized_pnl: number; positions_with_pnl: number; positions: Array<{ token_id: string; size: number; avg_price: number; realized_pnl: number; total_bought: number; }>; }>; /** Full order book for a token. Returns bids/asks with string prices and sizes. */ orderbookRest(tokenId: string): Promise; /** Midpoint price for a token: (best_bid + best_ask) / 2. Returns string value. */ midpoint(tokenId: string): Promise; /** Bid-ask spread for a token: best_ask - best_bid. Returns string value. */ spread(tokenId: string): Promise; /** Top traders ranked by profit or volume. Rate limited to 1 req/sec. */ leaderboard(params?: { period?: LeaderboardPeriod; sort?: LeaderboardSort; }): Promise; /** Trending markets, hot topics, featured events, and biggest movers. */ trending(): Promise; /** Platform-wide activity feed (50 most recent trades). Refreshes every 60s. */ activity(): Promise; /** Markets with the largest 24-hour price changes. */ movers(): Promise; /** Full profile for a Polymarket trader. */ traderProfile(wallet: string): Promise; /** PnL time series for a trader. */ traderPnl(wallet: string, params?: { period?: PnlPeriod; }): Promise; /** Full event detail with all sub-markets. */ event(slug: string): Promise; /** Search events by text query. Returns events with all sub-markets including tokenIds. */ searchEvents(query: string, params?: { limit?: number; }): Promise; /** Markets by category. */ marketsByCategory(category: string): Promise; /** * Send a JSON-RPC request through the PolyNode RPC endpoint (rpc.polynode.dev). * This is a separate endpoint from the REST API — it's a Polygon JSON-RPC proxy * with priority P2P transaction delivery. */ rpc(method: string, params?: unknown[]): Promise; } //# sourceMappingURL=client.d.ts.map