Skip to main content

hashlock-sdk (Python)

Python SDK for the Hashlock Markets developer API — non-custodial cross-chain atomic swaps (BTC ↔ EVM/TRON/Solana). 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.

pip install hashlock-sdk          # add [ws] for the maker WebSocket feed: hashlock-sdk[ws]
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) and broadcast(...). See the root README for the full swap lifecycle.

MIT

Release files for hashlock-sdk 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hashlock-sdk 0.5.0
File Size Uploaded
hashlock_sdk-0.5.0.tar.gz 6.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for hashlock-sdk 0.5.0
File Interpreter ABI Platform
hashlock_sdk-0.5.0-py3-none-any.whl Python 3 none any Details

Total release size: 14.5 kB

Release files / hashlock_sdk-0.5.0.tar.gz

Download URL hashlock_sdk-0.5.0.tar.gz
Size 6.3 kB
Tags Source
SHA-256 checksum
How to use checksums
91ac2813e3d4dbf6af38d14bb5484d0e5000a720657633214a8c9d1fcaaa8944
BLAKE2b-256 checksum
How to use checksums
fdda9b07b57c9389604c6bd20ddcac9b8ba0d163c21a7d51eeb1b6148c0ee671
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 15, 2026.

Transparency log

Release files / hashlock_sdk-0.5.0-py3-none-any.whl

Download URL hashlock_sdk-0.5.0-py3-none-any.whl
Size 8.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
78177d9c3b08420ea938c2c6f211d29154588b06fd05debd460218728a6f1e9f
BLAKE2b-256 checksum
How to use checksums
17d410b8876c6c7ada976c53ba56e5790a209d8ac28775f7f63f3a230910c743
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 15, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.5.0 This release

2 release files

0.4.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page