Metadata-Version: 2.4
Name: hashlock-sdk
Version: 0.4.0
Summary: Python SDK for the Hashlock Markets developer API — non-custodial cross-chain atomic swaps (BTC <-> EVM/TRON) over sealed RFQ + HTLC.
Project-URL: Homepage, https://github.com/Hashlock-Tech/hashlock-sdk
License: MIT
Keywords: atomic-swap,bitcoin,cross-chain,defi,hashlock,htlc,otc
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Financial and Insurance Industry
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Office/Business :: Financial
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.9
Requires-Dist: httpx>=0.24
Provides-Extra: ws
Requires-Dist: websockets>=12; extra == 'ws'
Description-Content-Type: text/markdown

# hashlock-sdk (Python)

Python SDK for the [Hashlock Markets](https://github.com/Hashlock-Tech/hashlock-sdk) developer API —
non-custodial cross-chain atomic swaps (BTC ↔ EVM/TRON). Python 3.9+, built on `httpx`.

> ⚠️ **Sandbox / testnet preview (0.x)** — defaults to `api-dev.hashlock.markets`, testnets only,
> pre-mainnet. The API may change before the stable `1.0`. Not for mainnet funds.

```bash
pip install hashlock-sdk          # add [ws] for the maker WebSocket feed: hashlock-sdk[ws]
```

```python
from hashlock import HashlockClient, new_secret, verify_webhook

client = HashlockClient(api_key=os.environ["HASHLOCK_API_KEY"])
client.me()

# cursor pagination — page or auto-iterate
page = client.list_swaps(limit=20)
for swap in client.swaps():
    ...

# initiator: secret stays private; submit only the hashlock
secret, hashlock = new_secret()
client.accept_terms(thread_id, hashlock=hashlock)

# webhooks: verify a delivery against the raw body
ok = verify_webhook(secret, raw_body, request.headers.get("x-hashlock-signature"), request.headers.get("x-hashlock-timestamp"))
```

Settlement is custody-agnostic: `build_fund` / `build_claim` / `build_refund` return unsigned transactions —
sign with your wallet or HSM (see [`../examples/fireblocks`](../examples/fireblocks)) and `broadcast(...)`.
See the [root README](../README.md) for the full swap lifecycle.

MIT
