TypeScript SDK — REST API Reference
Complete reference for every REST namespace on the client returned by createClient(). Each namespace groups related operations and is accessed as a property on the client instance.
Namespace map
| Accessor | Operations | Description |
|---|---|---|
client.marketData | 16 | Public and authenticated market data — tickers, order books, candles, symbols, trades, fee promos, next funding timestamps, and funding-amount reports |
client.trading | 12 | Order lifecycle, active/past order queries, trade history, volume stats, session heartbeat, and wrapped orders |
client.predictions | 31 | Prediction market events, orders, positions, combos, volume, liquidity rewards, and maker rebates |
client.perpetuals | 6 | Perpetual-contract positions, margin, risk stats, and funding payment history |
client.margin | 3 | Margin account details, borrow rates, and order previews |
client.clearing | 8 | OTC clearing workflows, counterparty orders, broker orders, and clearing trade history |
client.instant | 2 | Instant-execution quote requests and order executions |
client.account | 16 | Balances, account details, roles, subaccounts, banking, deposit and approved-address management, and OAuth revocation |
client.staking | 6 | Staking balances, rates, rewards, event history, stake, and unstake |
client.transfers | 6 | Withdrawals, internal transfers, transfer and transaction history, custody-fee transfers, and gas-fee estimates |
| Total | 106 |
Conventions
100% Flat Unified Parameter Objects
All SDK methods accept a single flat parameter object containing all path parameters, query parameters, and request body fields combined:
Code
You never need nested path, query, or body wrapper objects. All parameters are flat, fully typed, and validated.
Transport fields are handled automatically
You never pass nonce or request — the SDK injects transport authentication parameters automatically for authenticated requests.
RequestOptions
Every method accepts an optional RequestOptions parameter as the last argument:
Code
Retry policy
- GET operations (public or authenticated) automatically retry on
429,502,503, and504with exponential backoff. - POST mutations are never retried by the SDK — a failed mutation could have been applied server-side. Handle retries in your own code if idempotency is guaranteed.
Client-side validation
Some operations validate the request body locally before sending. If validation fails, the SDK throws a ValidationError synchronously — no network request is made. Validated methods are marked on their individual reference pages. See the Request Validation deep dive for details.
Prices and quantities are strings
Most prices, amounts, and quantities in both requests and responses are decimal strings (e.g. "50000.00"), never floating-point numbers. However, some fields use plain number — notably Balance.amount, Balance.available, FxRate.rate, and candle OHLCV values. Some IDs and timestamps are bigint. See Data Types for the complete list.
Full request/response schemas
This reference documents method signatures, HTTP details, and usage patterns. For the complete request and response JSON schemas, see the API Specifications.
Reference pages
- Market Data — Symbols & Pricing · Books, Trades & Candles · Networks & Derivatives
- Trading — Order Lifecycle · History & Volume
- Predictions — Events & Discovery · Order Management · Positions & Terms · Combos · Volume & Metrics · Rewards & Rebates
- Perpetuals — Perpetuals
- Margin — Margin
- Clearing — Clearing Orders · Instant Orders
- Account — Balances & Account · Addresses & Deposits · Banking · OAuth
- Staking — Staking
- Transfers — Withdrawals & Transfers
- WebSocket — WebSocket Reference
Related guides
- Authentication — API key setup and auth strategies
- Error Handling — error types, retry guidance, and error metadata
- Patterns — pagination, streaming, and common workflows