Metadata-Version: 2.4
Name: typed-mexc
Version: 1.2.4
Summary: A fully typed, validated async client for the MEXC APIs.
Author-email: Marcel Claramunt <marcel@tribulnation.com>
License-Expression: MIT
Project-URL: Repository, https://github.com/tribulnation/typed
Project-URL: Documentation, https://tribulnation.com/typed/mexc
Project-URL: Website, https://tribulnation.com/typed
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Typing :: Typed
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: typed-core>=0.2.0
Requires-Dist: betterproto2==0.9.*
Requires-Dist: httpx
Requires-Dist: lazy-loader
Requires-Dist: orjson
Requires-Dist: pydantic
Requires-Dist: typing-extensions
Requires-Dist: websockets
Dynamic: license-file

<p align="center">
  <a href="https://tribulnation.com/typed/mexc">
    <picture>
      <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/tribulnation/typed/refs/heads/main/packages/mexc/media/mexc-dark.svg">
      <source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/tribulnation/typed/refs/heads/main/packages/mexc/media/mexc-light.svg">
      <img alt="Typed MEXC" src="https://raw.githubusercontent.com/tribulnation/typed/refs/heads/main/packages/mexc/media/mexc-light.svg" width="520">
    </picture>
  </a>
</p>

<p align="center">
  <em>A fully typed, validated async client for the MEXC spot and futures APIs.</em>
</p>

<p align="center">
  <a href="https://pypi.org/project/typed-mexc/">
    <img src="https://img.shields.io/pypi/v/typed-mexc.svg" alt="PyPI version">
  </a>
  <a href="https://pypi.org/project/typed-mexc/">
    <img src="https://img.shields.io/pypi/pyversions/typed-mexc.svg" alt="Python versions">
  </a>
  <a href="https://tribulnation.com/typed/mexc">
    <img src="https://img.shields.io/badge/docs-live-black" alt="Docs">
  </a>
  <a href="LICENSE">
    <img src="https://img.shields.io/pypi/l/typed-mexc.svg" alt="License">
  </a>
</p>

---

- **Documentation**: [https://tribulnation.com/typed/mexc](https://tribulnation.com/typed/mexc)
- **Source Code**: [https://github.com/tribulnation/typed/tree/main/packages/mexc](https://github.com/tribulnation/typed/tree/main/packages/mexc)

---

```python
from mexc import MEXC

async with MEXC.public() as client:
  candles = await client.spot.market.candles(symbol='BTCUSDT', interval='1m', limit=5)
  stream = await client.futures.streams.market.ticker('BTC_USDT')
  print(candles[-1][4])

  async for ticker in stream:
    print(ticker.get('lastPrice'))
    break
```

## Why Typed MEXC?

- **🎯 Precise Types**: Typed endpoint inputs and responses.
- **✅ Runtime Validation**: Validated responses by default.
- **⚡ Async First**: HTTP and WebSocket subscriptions.
- **📚 Full API Surface**: `client.spot`, `client.futures`, and
  stream groups for both spot and futures.

## Installation

```bash
pip install typed-mexc
```

## How To

- [API Keys Setup](https://tribulnation.com/typed/mexc/api-keys)
- [Fetch Market Data](https://tribulnation.com/typed/mexc/how-to/fetch-market-data)
- [Place & Manage Orders](https://tribulnation.com/typed/mexc/how-to/place-and-manage-orders)
- [Fetch Balances, Positions & History](https://tribulnation.com/typed/mexc/how-to/fetch-balances-positions-and-history)
- [Manage Deposits & Withdrawals](https://tribulnation.com/typed/mexc/how-to/manage-deposits-and-withdrawals)
- [Listen To Streams](https://tribulnation.com/typed/mexc/how-to/listen-to-streams)

## Reference

- [Async Usage](https://tribulnation.com/typed/mexc/reference/async-usage)
- [Error Handling](https://tribulnation.com/typed/mexc/reference/error-handling)
- [Environment Variables](https://tribulnation.com/typed/mexc/reference/env-vars)
- [Timestamps](https://tribulnation.com/typed/mexc/reference/timestamps)

## Design Philosophy

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

*Details matter. Developer experience matters.*

## License

MIT — see [LICENSE](LICENSE).
