> ## Documentation Index
> Fetch the complete documentation index at: https://docs.polynode.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# TypeScript V3 API

> Use typed TypeScript helpers or execute any of the 120 registered V3 operations.

TypeScript 0.14.2 exposes the complete shared V3 operation registry at `pn.v3.operations`. Typed helpers cover common reads; `execute()` covers every registered route, including combos, credits, webhooks, and perps.

## Discover the registry

```typescript theme={null}
import { PolyNode, V3_OPERATION_COUNT } from 'polynode-sdk';

const apiKey = process.env.POLYNODE_API_KEY;
if (!apiKey) throw new Error('Set POLYNODE_API_KEY');

const pn = new PolyNode({ apiKey });
console.log(V3_OPERATION_COUNT); // 120 in 0.14.2

for (const operation of pn.v3.operations) {
  console.log(operation.method, operation.path, operation.domain);
}
```

## Typed reads

```typescript theme={null}
const address = '0xa9857c7bcb9bcfafd2c132ab053f34f678610058';

const summary = await pn.v3.wallet(address);
const positions = await pn.v3.walletPositions(address, {
  status: 'open',
  limit: 25,
});
const trades = await pn.v3.walletTrades(address, {
  groupBy: 'order_hash',
  sortBy: 'order_hash',
  limit: 50,
});

console.log({ summary, positions, trades });
```

## Any registered route

Use the exact operation name from the registry. Path parameters and query parameters are encoded separately:

```typescript theme={null}
const comboSummary = await pn.v3.execute(
  'GET /v3/wallets/{address}/combos/summary',
  { pathParams: { address } },
);

const globalTrades = await pn.v3.execute('GET /v3/trades', {
  query: {
    limit: 50,
    sort_by: 'order_hash',
    group_by: 'order_hash',
  },
});
```

## Perps REST data

```typescript theme={null}
const ticker = await pn.v3.execute(
  'GET /v3/perps/tickers/{instrument}',
  { pathParams: { instrument: 'BTC-USD' } },
);
console.log(ticker);
```

## Retry and error behavior

Safe reads retry transient failures and respect `Retry-After` within the configured ceiling. Mutations are never retried automatically. A mutation timeout can have an ambiguous result, so inspect the resource before retrying it.

```typescript theme={null}
import { ApiError } from 'polynode-sdk';

try {
  await pn.v3.stats();
} catch (error) {
  if (error instanceof ApiError) {
    console.error({
      status: error.status,
      code: error.code,
      requestId: error.requestId,
      retryAfter: error.retryAfter,
      url: error.safeUrl,
    });
  }
  throw error;
}
```

Keep exact decimals and large integers in their wire representation. See the [complete V3 guide](/sdks/v3-api) and [V3 endpoint reference](/data/overview).
