# Typed Kraken

> A fully typed, validated async client for the Kraken Spot API -- REST and WebSocket v2.

```python
from typed_kraken import Kraken

async with Kraken.new(public=True) as client:
  ticker = await client.spot.market_data.ticker(pair='XBTUSD')
  print(ticker)
```

## Why Typed Kraken?

- **🎯 Precise Types**: every `client.spot`, `client.streams`, and `client.trading_ws`
  parameter and response is typed, down to `TypedDict`s and `Literal`s for Kraken's own
  field names.
- **✅ Runtime Validation**: REST and WebSocket v2 responses are validated against their
  schema before you see them, not just typed on paper.
- **⚡ Async First**: async REST calls and long-lived WebSocket v2 subscriptions, built for
  concurrent trading workflows.
- **📚 Full Surface**: market data, account, trading, funding, and earn -- every documented
  Kraken Spot endpoint, not just the popular ones.

## Installation

```bash
pip install typed-kraken
```

## How To

- [Fetch Market Data](/typed/kraken/how-to/fetch-market-data)
- [Listen To Streams](/typed/kraken/how-to/listen-to-streams)
- [Place & Manage Orders](/typed/kraken/how-to/place-and-manage-orders)
- [Fetch Account Data](/typed/kraken/how-to/fetch-account-data)
- [Query & Manage Earn Instruments](/typed/kraken/how-to/query-and-manage-earn)
- [Deposits & Withdrawals](/typed/kraken/how-to/deposits-and-withdrawals)

## Reference

- [API Keys Setup](/typed/kraken/api-keys)
- [Async Usage](/typed/kraken/reference/async-usage)
- [Error Handling](/typed/kraken/reference/error-handling)
- [Environment Variables](/typed/kraken/reference/env-vars)
- [Timestamps](/typed/kraken/reference/timestamps)

## Design Philosophy

Typed Kraken follows the principles outlined in [this blog post](https://tribulnation.com/blog/clients).

*Details matter. Developer experience matters.*
