Skip to main content
Every REST endpoint has a typed method with full request/response types.

Markets

const markets = await pn.markets({ count: 10 });
const detail = await pn.market(tokenId);
const bySlug = await pn.marketBySlug('bitcoin-100k');
const byCondition = await pn.marketByCondition(conditionId);
const list = await pn.marketsList({ count: 20, sort: 'volume' });
const results = await pn.search('ethereum', { limit: 5 });

Pricing

const candles = await pn.candles(tokenId, { resolution: '1h', limit: 100 });
const stats = await pn.stats(tokenId);

Settlements

const recent = await pn.recentSettlements({ count: 20 });
const token = await pn.tokenSettlements(tokenId, { count: 10 });
const wallet = await pn.walletSettlements(address, { count: 10 });

Wallets & System

const wallet = await pn.wallet(address);
const status = await pn.status();
const key = await pn.createKey('my-bot');

Enriched Data

// Leaderboard — top 20 traders by profit or volume
const lb = await pn.leaderboard({ period: 'monthly', sort: 'profit' });

// Trending — carousel, breaking, hot topics, movers
const trending = await pn.trending();

// Activity feed — 50 most recent trades platform-wide
const feed = await pn.activity();

// Biggest movers — largest 24h price changes
const movers = await pn.movers();

// Trader profile — full stats for any wallet
const profile = await pn.traderProfile('0xc2e7...');

// Trader PnL series — cumulative PnL over time
const pnl = await pn.traderPnl('0xc2e7...', { period: '1W' });

// Event detail — all sub-markets for an event
const event = await pn.event('fed-decision-in-april');

// Markets by category
const crypto = await pn.marketsByCategory('crypto');
Enriched endpoints are rate limited to 1 request per second per API key with 1-3 minute caching.

Error Handling

import { ApiError } from 'polynode-sdk';

try {
  await pn.market('invalid-id');
} catch (err) {
  if (err instanceof ApiError) {
    console.log(err.status, err.message);  // 404, "Market not found"
  }
}