KaleidoSwap SDK Python Bindings
Python bindings for the KaleidoSwap SDK: atomic swaps (Boltz protocol) between Bitcoin, Lightning, and Liquid.
Installation
python -m pip install kaleidorg_swap_sdk
Python 3.10+ is supported. Prebuilt wheels cover Linux x86_64/aarch64, macOS x86_64/arm64, and Windows x86_64; other platforms build the published source distribution and need a Rust 1.88+ toolchain.
Quick Start
⚠️ WARNING: All examples are only to be used in REGTEST.
import kaleidorg_swap_sdk
import asyncio
async def main():
# Initialize for regtest (do NOT use this example in production)
network = kaleidorg_swap_sdk.Network.REGTEST
boltz_api = kaleidorg_swap_sdk.BoltzApiClientV2.default(network)
# Example: Create a submarine swap (Lightning → Bitcoin)
key_pair = kaleidorg_swap_sdk.KeyPair()
btc_chain = kaleidorg_swap_sdk.btc_chain_from_network(network)
invoice = "lightning-invoice-to-pay"
request = kaleidorg_swap_sdk.CreateSubmarineRequest(
_from=btc_chain,
to=btc_chain,
invoice=invoice,
refund_public_key=key_pair.public(),
)
swap = await boltz_api.create_swap(request)
print(f"Send {swap.expected_amount} sats to {swap.address}")
asyncio.run(main())
Swap Types
- Submarine swaps - Lightning → On-chain Bitcoin/Liquid
- Reverse swaps - On-chain Bitcoin/Liquid → Lightning
- Chain swaps - Bitcoin ↔ Liquid atomic swaps
Examples
Complete working examples are available in the examples/ directory:
reverse.py- Lightning to Bitcoinsubmarine.py- Bitcoin to Lightningchain.py- Bitcoin to Liquid (and vice versa)
Release files for kaleidorg-swap-sdk 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| kaleidorg_swap_sdk-0.2.0.tar.gz | 173.1 kB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| kaleidorg_swap_sdk-0.2.0-py3-none-win_amd64.whl | Python 3 | none | Windows x86-64 | Details |
| kaleidorg_swap_sdk-0.2.0-py3-none-manylinux_2_28_x86_64.whl | Python 3 | none | Linux glibc 2.28+ x86-64 | Details |
| kaleidorg_swap_sdk-0.2.0-py3-none-manylinux_2_28_aarch64.whl | Python 3 | none | Linux glibc 2.28+ ARM64 | Details |
| kaleidorg_swap_sdk-0.2.0-py3-none-macosx_11_0_arm64.whl | Python 3 | none | macOS 11.0+ ARM64 | Details |
| kaleidorg_swap_sdk-0.2.0-py3-none-macosx_10_12_x86_64.whl | Python 3 | none | macOS 10.12+ x86-64 | Details |
Total release size: 26.0 MB
Release files / kaleidorg_swap_sdk-0.2.0.tar.gz
| Download URL | kaleidorg_swap_sdk-0.2.0.tar.gz |
|---|---|
| Size | 173.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
00e8fd8f8a5eb58da183653df2f52ac0ec122e48032363fc08c3f19952920d08
|
|
BLAKE2b-256 checksum How to use checksums |
2b3d06bdf8997f8efc149a83fc1afd2b2b951fa60995de529d1814d66f3b8a70
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
Release files / kaleidorg_swap_sdk-0.2.0-py3-none-win_amd64.whl
| Download URL | kaleidorg_swap_sdk-0.2.0-py3-none-win_amd64.whl |
|---|---|
| Size | 5.1 MB |
| Tags | Python 3 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
81f415203af7eff4980173fbb65d32f4a7bbc729ccaf3bc77139734695c3b0dd
|
|
BLAKE2b-256 checksum How to use checksums |
19158815d084a3da0589dbac57112e8e712e98ec6ba6eb0face11cc2fed04633
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
Release files / kaleidorg_swap_sdk-0.2.0-py3-none-manylinux_2_28_x86_64.whl
| Download URL | kaleidorg_swap_sdk-0.2.0-py3-none-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 5.3 MB |
| Tags | Linux glibc 2.28+ x86-64 Python 3 |
|
SHA-256 checksum How to use checksums |
d35a4679b9d48bf8407f40ee87ba59f5b61a40fd96e0f2625ee45f8347d787d5
|
|
BLAKE2b-256 checksum How to use checksums |
af824e9893ec0e26594ba89b703f33e07feb66ed3c62ecee91c1c68c24f04cd2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
Release files / kaleidorg_swap_sdk-0.2.0-py3-none-manylinux_2_28_aarch64.whl
| Download URL | kaleidorg_swap_sdk-0.2.0-py3-none-manylinux_2_28_aarch64.whl |
|---|---|
| Size | 5.3 MB |
| Tags | Linux glibc 2.28+ ARM64 Python 3 |
|
SHA-256 checksum How to use checksums |
950871a9b4076b727c488d19048917403fa78d50b85c8a09d08b4a4f1cef4aaf
|
|
BLAKE2b-256 checksum How to use checksums |
67c433dd9cbca288b046acacd8de523b32aeb8608c4c5bf8ff18681adad2c115
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
Release files / kaleidorg_swap_sdk-0.2.0-py3-none-macosx_11_0_arm64.whl
| Download URL | kaleidorg_swap_sdk-0.2.0-py3-none-macosx_11_0_arm64.whl |
|---|---|
| Size | 5.1 MB |
| Tags | Python 3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
1211ff35fcede824a138e68bf19359cb6706fe02bfd59917784cca8497c20d99
|
|
BLAKE2b-256 checksum How to use checksums |
039b709fc80bc69d8fc1fbc55d77c3bab9a3a38162b9b80c751809a9eea72794
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
Release files / kaleidorg_swap_sdk-0.2.0-py3-none-macosx_10_12_x86_64.whl
| Download URL | kaleidorg_swap_sdk-0.2.0-py3-none-macosx_10_12_x86_64.whl |
|---|---|
| Size | 5.1 MB |
| Tags | Python 3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
16809a7b9dc66f9daa4b6f468ffec348e66d4b0a3821190824ba5eddaf90c189
|
|
BLAKE2b-256 checksum How to use checksums |
318bada76a32a0279ea7d9e0a7da95e30cc2e3bf55fcb7eaff3530aa7cb2337c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|