Metadata-Version: 2.4
Name: maxy-labs
Version: 1.1.5
Summary: Python client for the Maxy API: quotes, orders, status, webhooks and statements for native Bitcoin swaps.
Author: Maxy Labs
License-Expression: MIT
Project-URL: Homepage, https://maxy.co/docs
Project-URL: Documentation, https://maxy.co/docs/react-and-python
Project-URL: Source, https://maxy.co/sdk
Project-URL: Signing key, https://maxy.co/docs/security-checks
Project-URL: Issues, https://maxy.co/docs/security-and-compliance
Keywords: bitcoin,btc,swap,maxy
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: httpx>=0.27
Provides-Extra: models
Requires-Dist: pydantic>=2.5; extra == "models"
Dynamic: license-file

# maxy-labs (Python)

The Maxy API from Python 3.10 or later: the same resources and method names as the TypeScript SDK, in snake_case. One dependency,
`httpx`. MIT licence (see `LICENSE`). It installs as `maxy-labs` and imports as `maxy`; the types are inline (`py.typed`).

```sh
pip install maxy-labs
export MAXY_API_KEY=$(curl -s -X POST https://openapi.maxy.co/v1/sandbox/keys | jq -r .secretKey)
```

```python
from maxy import Maxy, MaxyError

maxy = Maxy()  # reads MAXY_API_KEY
price = maxy.prices.get("ETH on base", "BTC", "0.01")
quote = maxy.quotes.get("ETH on base", "BTC", "0.01", from_address=wallet, to_address="bc1q…")

signature = your_signer.sign_typed_data(quote["signing"]["payloads"][0]["typedData"])
placed = maxy.orders.create(quote["order"], signature=signature, external_id="inv-42")

for state in maxy.orders.watch(placed["orderId"]):
    print(state["state"], state.get("btcTxId"))
```

| Resource | Methods |
| --- | --- |
| `prices` | `get` |
| `pairs` | `list` |
| `quotes` | `get`, `batch`, `seconds_until_expiry` |
| `orders` | `create`, `submit_signature`, `submit`, `get`, `list`, `iterate`, `export_csv`, `cancel`, `events`, `refund`, `deposit`, `claim`, `steps`, `follow`, `watch`, `resume` |
| `status` | `by_tx_hash`, `by_intent_hash`, `by_bitcoin_txid` |
| `addresses` | `validate` |
| `limits`, `health`, `key` | `get` |
| `webhooks` | `verify`, `create`, `list`, `remove`, `test`, `events`, `replay` |
| `sandbox_controls` | `advance`, `scenarios` |

`AsyncMaxy` is the same client, awaited; `orders.watch` and `orders.iterate` are async iterators.

Every failure is a `MaxyError` subclass with `code`, `status`, `request_id`, `retryable`, `details` and `docs_url`: the same names and
classes as TypeScript. Reads, and calls carrying an idempotency key, retry twice on 429, 502, 503, 504 or a dropped connection,
honouring `Retry-After`. `orders.create` sets its key from the order id.

Flow helpers that need a browser wallet stay in TypeScript. Answers are plain dicts with `.meta`; there are no generated models.

Release signing key (ed25519, namespace `maxy-sdk`): `SHA256:TYUfXuFNZbCUxy2c0P3mWnJjZhpEurFU0ZkuSJgAxfo`. It signs https://maxy.co/sdk/SHA256SUMS, which lists this wheel's SHA-256; how to check: https://maxy.co/docs/security-checks
