Skip to content

maicoin 🪙

Python client for the MaiCoin MAX exchange. Provides a typed REST v3 client and a WebSocket stream client built on httpx, websockets, and pydantic.

✨ Highlights

  • 🌐 REST v3 — typed wrappers over public and private MAX endpoints, with a raw request() escape hatch.
  • 📡 WebSocket — subscription-based stream client with Pydantic-validated responses.
  • 🔐 Auth helpers — nonce, payload encoding, and signature utilities for MAX private endpoints.
  • 🐍 Modern Python — Python 3.12+, full type hints, ships py.typed.

🚀 Quick start

uv add maicoin
# or
pip install maicoin
from maicoin.v3 import Client

async with Client() as client:
    print(await client.ticker("btctwd"))
from maicoin.ws import Channel, Stream, Subscription

stream = Stream()
stream.subscribe([Subscription(channel=Channel.TICKER, market="btcusdt")])
stream.add_handler(lambda r: print(r.model_dump(exclude_none=True)))
stream.run()

See the REST guide, the WebSocket guide, and the API reference.

📚 References

📄 License

MIT