# Installation

Install the Rust SDK and verify connectivity to Polyester devnet.

Install the SDK from crates.io, then verify a public devnet request.

## Install the package

```toml
[dependencies]
polyester-sdk = "0.1.0-alpha.30"
tokio = { version = "1", features = ["full"] }
```

Private git pins remain supported when you need a specific commit:

```toml
polyester-sdk = { git = "https://github.com/Fabric-Labs/polyester-sdk-rust", tag = "v0.1.0a30" }
```

The package is named `polyester-sdk`, but its library target is named `polyester`. Code therefore imports it with `use polyester::...`, exactly as the examples show. No Cargo rename is required.

**MSRV:** Rust 1.88+. Realtime and on-chain Funding helpers are always included. Pin Connect/`buffa` **0.8.x** as required by the crate.

crates.io: [polyester-sdk](https://crates.io/crates/polyester-sdk). Source (access required): [Fabric-Labs/polyester-sdk-rust](https://github.com/Fabric-Labs/polyester-sdk-rust).

> **Alpha**
>
> The SDK is pre-1.0. Pin an exact version in production. Version `0.1.0-alpha.30` (git tag `v0.1.0a30`) is the current API-key-only release. Outbound requests send `User-Agent: polyester-sdk-rust/<version>`. It supports signed unary calls, binary realtime subscriptions with handshake-before-return, and opaque pagination tokens for complete trigger list/event scans. Breaking public API changes are called out in the repository changelog.

## Default endpoints

With no override, the client targets Polyester **devnet**:

| Setting   | Default                           |
| --------- | --------------------------------- |
| API       | `https://api-devnet.polyester.ai` |
| WebSocket | `wss://api-devnet.polyester.ai`   |

Override with `Config` fields, or (scripts only) `POLYESTER_API_URL` / `POLYESTER_WS_URL` via `Client::from_env()`.

## Verify the install

Public market data needs no credentials:

```rust
use polyester::{Client, Config};

let client = Client::new(Config::default())?; // public market data only
```

```rust
use polyester::services::ListMarketOverviewOptions;

let overview = client.market_overview.list(ListMarketOverviewOptions {
    limit: Some(5),
    ..Default::default()
}).await?;
for market in overview.markets {
    println!("{} {:?}", market.symbol, market.last_price.as_ref().map(|p| p.as_ticks()));
}
```

If that prints a few markets, you are connected. Next: [Quickstart](https://testnet.polyester.com/docs/sdk/rust/get-started/quickstart).

## Contributor live harness (strict)

CI runs unit, compile-fail, strict-harness, and deterministic local HTTP/WebSocket hardening tests. Live integration under `tests/integration/` (and the `a7_strict_live` harness that shells out to it) remains a separate credentialed release gate. Those paths are **excluded from the crates.io package** — run them from a git checkout of this repository, not from a crates.io download.

```bash
cargo test --lib
cargo test --test integration -- --test-threads=1
```

Public smoke needs no keys (soft-skips when offline). Credentialed runs need `POLYESTER_API_KEY_ID` / `POLYESTER_API_PRIVATE_KEY` (usually `POLYESTER_ACCOUNT_ID`). Optional gates: `POLYESTER_TEST_MUTATION=1`, `POLYESTER_TEST_FUNDED=1`. Set `POLYESTER_TEST_STRICT_LIVE=1` for release certification so any `skip:` path fails instead of reporting green.
