maxy-labs 1.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Maxy Labs
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,63 @@
1
+ Metadata-Version: 2.4
2
+ Name: maxy-labs
3
+ Version: 1.1.0
4
+ Summary: Python client for the Maxy API: quotes, orders, status, webhooks and statements for native Bitcoin swaps.
5
+ Author: Maxy Labs
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://maxy.co/docs
8
+ Project-URL: Documentation, https://maxy.co/docs/react-and-python
9
+ Project-URL: Source, https://maxy.co/sdk
10
+ Keywords: bitcoin,btc,swap,maxy
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Operating System :: OS Independent
13
+ Requires-Python: >=3.10
14
+ Description-Content-Type: text/markdown
15
+ License-File: LICENSE
16
+ Requires-Dist: httpx>=0.27
17
+ Provides-Extra: models
18
+ Requires-Dist: pydantic>=2.5; extra == "models"
19
+ Dynamic: license-file
20
+
21
+ # maxy (Python)
22
+
23
+ The Maxy API from Python 3.10 or later: the same resources and method names as the TypeScript SDK, in snake_case. One dependency,
24
+ `httpx`. MIT licence (see `LICENSE`).
25
+
26
+ ```sh
27
+ pip install https://maxy.co/sdk/maxy-latest.tar.gz
28
+ export MAXY_API_KEY=$(curl -s -X POST https://openapi.maxy.co/v1/sandbox/keys | jq -r .secretKey) # a test key: nothing real can move
29
+ ```
30
+
31
+ ```python
32
+ from maxy import Maxy, MaxyError
33
+
34
+ maxy = Maxy() # reads MAXY_API_KEY
35
+ price = maxy.prices.get("ETH on base", "BTC", "0.01")
36
+ quote = maxy.quotes.get("ETH on base", "BTC", "0.01", from_address=wallet, to_address="bc1q…")
37
+
38
+ signature = your_signer.sign_typed_data(quote["signing"]["payloads"][0]["typedData"])
39
+ placed = maxy.orders.create(quote["order"], signature=signature, external_id="inv-42")
40
+
41
+ for state in maxy.orders.watch(placed["orderId"]):
42
+ print(state["state"], state.get("btcTxId"))
43
+ ```
44
+
45
+ | Resource | Methods |
46
+ | --- | --- |
47
+ | `prices` | `get` |
48
+ | `pairs` | `list` |
49
+ | `quotes` | `get`, `batch`, `seconds_until_expiry` |
50
+ | `orders` | `create`, `submit_signature`, `submit`, `get`, `list`, `iterate`, `export_csv`, `cancel`, `events`, `refund`, `deposit`, `claim`, `steps`, `follow`, `watch`, `resume` |
51
+ | `status` | `by_tx_hash`, `by_intent_hash`, `by_bitcoin_txid` |
52
+ | `addresses` | `validate` |
53
+ | `limits`, `health`, `key` | `get` |
54
+ | `webhooks` | `verify`, `create`, `list`, `remove`, `test`, `events`, `replay` |
55
+ | `sandbox_controls` | `advance`, `scenarios` |
56
+
57
+ `AsyncMaxy` is the same client, awaited; `orders.watch` and `orders.iterate` are async iterators.
58
+
59
+ Every failure is a `MaxyError` subclass with `code`, `status`, `request_id`, `retryable`, `details` and `docs_url`: the same names and
60
+ classes as TypeScript. Reads, and calls carrying an idempotency key, retry twice on 429, 502, 503, 504 or a dropped connection,
61
+ honouring `Retry-After`. `orders.create` sets its key from the order id.
62
+
63
+ Flow helpers that need a browser wallet stay in TypeScript. Answers are plain dicts with `.meta`; there are no generated models.
@@ -0,0 +1,43 @@
1
+ # maxy (Python)
2
+
3
+ The Maxy API from Python 3.10 or later: the same resources and method names as the TypeScript SDK, in snake_case. One dependency,
4
+ `httpx`. MIT licence (see `LICENSE`).
5
+
6
+ ```sh
7
+ pip install https://maxy.co/sdk/maxy-latest.tar.gz
8
+ export MAXY_API_KEY=$(curl -s -X POST https://openapi.maxy.co/v1/sandbox/keys | jq -r .secretKey) # a test key: nothing real can move
9
+ ```
10
+
11
+ ```python
12
+ from maxy import Maxy, MaxyError
13
+
14
+ maxy = Maxy() # reads MAXY_API_KEY
15
+ price = maxy.prices.get("ETH on base", "BTC", "0.01")
16
+ quote = maxy.quotes.get("ETH on base", "BTC", "0.01", from_address=wallet, to_address="bc1q…")
17
+
18
+ signature = your_signer.sign_typed_data(quote["signing"]["payloads"][0]["typedData"])
19
+ placed = maxy.orders.create(quote["order"], signature=signature, external_id="inv-42")
20
+
21
+ for state in maxy.orders.watch(placed["orderId"]):
22
+ print(state["state"], state.get("btcTxId"))
23
+ ```
24
+
25
+ | Resource | Methods |
26
+ | --- | --- |
27
+ | `prices` | `get` |
28
+ | `pairs` | `list` |
29
+ | `quotes` | `get`, `batch`, `seconds_until_expiry` |
30
+ | `orders` | `create`, `submit_signature`, `submit`, `get`, `list`, `iterate`, `export_csv`, `cancel`, `events`, `refund`, `deposit`, `claim`, `steps`, `follow`, `watch`, `resume` |
31
+ | `status` | `by_tx_hash`, `by_intent_hash`, `by_bitcoin_txid` |
32
+ | `addresses` | `validate` |
33
+ | `limits`, `health`, `key` | `get` |
34
+ | `webhooks` | `verify`, `create`, `list`, `remove`, `test`, `events`, `replay` |
35
+ | `sandbox_controls` | `advance`, `scenarios` |
36
+
37
+ `AsyncMaxy` is the same client, awaited; `orders.watch` and `orders.iterate` are async iterators.
38
+
39
+ Every failure is a `MaxyError` subclass with `code`, `status`, `request_id`, `retryable`, `details` and `docs_url`: the same names and
40
+ classes as TypeScript. Reads, and calls carrying an idempotency key, retry twice on 429, 502, 503, 504 or a dropped connection,
41
+ honouring `Retry-After`. `orders.create` sets its key from the order id.
42
+
43
+ Flow helpers that need a browser wallet stay in TypeScript. Answers are plain dicts with `.meta`; there are no generated models.
@@ -0,0 +1,23 @@
1
+ """The Maxy API from Python. See README.md."""
2
+
3
+ from .client import AsyncMaxy, Maxy, __version__
4
+ from .errors import (
5
+ AmountOutOfRangeError,
6
+ AuthError,
7
+ ChainError,
8
+ MaxyError,
9
+ NetworkError,
10
+ OpenSellsLimitError,
11
+ DeclinedError,
12
+ OrderStateError,
13
+ QuoteExpiredError,
14
+ RateLimitError,
15
+ ServerError,
16
+ TimeoutError,
17
+ UnfillableError,
18
+ ValidationError,
19
+ WebhookSignatureError,
20
+ )
21
+ from . import webhooks
22
+
23
+ __all__ = ["AsyncMaxy", "Maxy", "__version__", "webhooks", "MaxyError", "AuthError", "RateLimitError", "ValidationError", "AmountOutOfRangeError", "UnfillableError", "QuoteExpiredError", "OrderStateError", "OpenSellsLimitError", "DeclinedError", "ChainError", "NetworkError", "TimeoutError", "ServerError", "WebhookSignatureError"]