TESTNET
Markets
Trade
Lending Vaults
More
User Docs Developer Docs Sdk API Docs Help
Overview
Overview
Architecture
Authentication
Client configuration
Overview
Environments
Installation
Market data
Market data services
Authentication model
Quickstart
Trading
Trading services
Account services
Catalog & precision
Streaming
Accounts & balances
Funding services
Deposits & withdrawals
Realtime client
Errors
Server-side usage
Error handling
  1. Typescript
  2. /
  3. Installation

Installation

Install the package

npm install @polyester/sdk
# or
bun add @polyester/sdk
# or
pnpm add @polyester/sdk
Pre-release package name
The SDK is not yet published to npm. These docs use @polyester/sdk as the package name; until the first public release, consume the package from a repository checkout.

Requirements

  • Runtime — any modern JavaScript runtime with the fetch and WebCrypto globals: Node.js 20+, Bun, Deno, Cloudflare Workers, and evergreen browsers all work.
  • Module system — the package is ESM-only ("type": "module").
  • TypeScript — TypeScript 5+ with "moduleResolution": "bundler" (or "nodenext") so the subpath exports (@polyester/sdk/account-signer, …) resolve.

The SDK talks to the API over ConnectRPC (HTTP) and Centrifugo (WebSocket). Realtime subscriptions are browser/long-lived-process features — see Streaming for the server-side caveats.

Verify the install

The testnet environment ships with the SDK, and market data needs no credentials:

import { PolyesterClient, POLYESTER_TESTNET_ENVIRONMENT } from "@polyester/sdk";

const client = new PolyesterClient({ environment: POLYESTER_TESTNET_ENVIRONMENT });

const { markets } = await client.marketOverview.list({ limit: 5 });
for (const market of markets) {
	console.log(market.symbol, market.lastPrice);
}

If this prints a handful of markets and prices, you are connected. Next: Quickstart takes you through authentication and your first order.

Previous

Environments

Next

Market data

  • Install the package
  • Requirements
  • Verify the install