# Typed Coinbase

> A fully typed, validated async client for the Coinbase API.

```python
from typed_coinbase import Coinbase

async with Coinbase.new(public=True) as client:
  product = await client.advanced_trade.products.public.get('BTC-USD')
  print(product['price'])
```

## Why Typed Coinbase?

- **🎯 Precise Types**: every endpoint's inputs and responses are typed, from Coinbase App (v2) wallets to Advanced Trade (v3) order configurations and fee tiers, not `dict`/`Any`.
- **✅ Runtime Validation**: every response is validated against its declared schema by default, across both the v2 and v3 APIs.
- **⚡ Async First**: async HTTP and WebSocket streaming, built for concurrent workflows against `accounts`, `advanced_trade`, and the public/private streams.
- **📚 Full Surface**: every documented Coinbase App and Advanced Trade endpoint, not just the popular ones.

## Installation

```bash
pip install typed-coinbase
```

## How To

- [Fetch Market Data](/typed/coinbase/how-to/fetch-market-data)
- [Manage Account Data](/typed/coinbase/how-to/manage-account-data)
- [Deposits & Withdrawals](/typed/coinbase/how-to/deposits-and-withdrawals)
- [Place & Manage Orders](/typed/coinbase/how-to/place-and-manage-orders)
- [Listen To Streams](/typed/coinbase/how-to/listen-to-streams)
- [Paginate Through Results](/typed/coinbase/how-to/paginate-through-results)

## Reference

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

## Design Philosophy

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

*Details matter. Developer experience matters.*
