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.

0.x release — defaults to the production API api.hashlock.markets; set the base URL to target another deployment. The API may change before the stable 1.0.

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, quote_amount, hashlock=hashlock)  # the price you read; refused if it moved

# 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

Metadata

Release files for hashlock-sdk 0.6.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.6.0
File Size Uploaded
hashlock_sdk-0.6.0.tar.gz 6.6 kB Details

Built distribution (wheel)

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

Total release size: 15.3 kB

Release files / hashlock_sdk-0.6.0.tar.gz

Download URL hashlock_sdk-0.6.0.tar.gz
Size 6.6 kB
Tags Source
SHA-256 checksum
How to use checksums
1832aaaae1feb3ced41497d83e07c3b39284d022966f5c11fa9fa2f187813b14
BLAKE2b-256 checksum
How to use checksums
b9f67ff5eb889cf70c854925b68f58ec0380c4765f5a808c1ecdd71e80dc7564
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 Oct 12, 2026.

Transparency log

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

Download URL hashlock_sdk-0.6.0-py3-none-any.whl
Size 8.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9609700929333457538c2bbc44e51e9fbc2e779ace68a59e5dd74fc08c5b85a0
BLAKE2b-256 checksum
How to use checksums
e0ed2feee78b604a512927b787a3e8358d5ded2875c84ded4a7818507e1cb894
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 Oct 12, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.6.0 This release

2 release files

0.5.0

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