TypeScript SDK — REST API Reference
Complete reference for every REST namespace on the GeminiMarkets client. Each namespace groups related operations and is accessed as a property on the client instance.
Namespace map
| Accessor | Operations | Description |
|---|---|---|
client.marketData | 15 | Public and authenticated market data — tickers, order books, candles, symbols, trades, fee promos, 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.clearingInstant | 10 | OTC clearing workflows, broker orders, instant-execution quotes, and clearing trade history |
client.accountServices | 28 | Balances, transfers, deposits, withdrawals, staking, approved addresses, payment methods, and account management |
| Total | 105 |
Conventions
Path parameters are fields, not URL segments
URL path parameters like /v1/book/{symbol} become fields in the first argument. For simple GET endpoints the path fields are top-level:
Code
For authenticated POST endpoints that have both path and body parameters, the SDK uses an input object with path and body keys:
Code
Transport fields are stripped
You never pass nonce or request — the SDK adds those 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 Services — Balances & Account · Addresses & Deposits · Withdrawals & Transfers · Banking · Staking · OAuth
- 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