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.3.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.3.0.tar.gz | 176.2 kB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| kaleidorg_swap_sdk-0.3.0-py3-none-win_amd64.whl | Python 3 | none | Windows x86-64 | Details |
| kaleidorg_swap_sdk-0.3.0-py3-none-manylinux_2_28_x86_64.whl | Python 3 | none | Linux glibc 2.28+ x86-64 | Details |
| kaleidorg_swap_sdk-0.3.0-py3-none-manylinux_2_28_aarch64.whl | Python 3 | none | Linux glibc 2.28+ ARM64 | Details |
| kaleidorg_swap_sdk-0.3.0-py3-none-macosx_11_0_arm64.whl | Python 3 | none | macOS 11.0+ ARM64 | Details |
| kaleidorg_swap_sdk-0.3.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.3.0.tar.gz
| Download URL | kaleidorg_swap_sdk-0.3.0.tar.gz |
|---|---|
| Size | 176.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3acf260fa2a1bd95e856eb70ee4daca3fed6e11ad3009a27b08dc4c97807bdeb
|
|
BLAKE2b-256 checksum How to use checksums |
d7c6db8b1636752bbf4c17ea26c8e1741714805fdb4e8e69a9d80fa61c8aa67c
|
| 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.3.0-py3-none-win_amd64.whl
| Download URL | kaleidorg_swap_sdk-0.3.0-py3-none-win_amd64.whl |
|---|---|
| Size | 5.1 MB |
| Tags | Python 3 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
b964d9b2dcab43fa30be7e0389b0a1335d067ea1c3f3df7860d244e0bb9f2d54
|
|
BLAKE2b-256 checksum How to use checksums |
100e7afa0a49ebccbdf197fb4635cb7db0b0f99cc790444ad0cd703ae2475d26
|
| 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.3.0-py3-none-manylinux_2_28_x86_64.whl
| Download URL | kaleidorg_swap_sdk-0.3.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 |
628846aa84c28f471e81478fdc7c656fc0bb1f473d0dafc7e928ce24f360c4d3
|
|
BLAKE2b-256 checksum How to use checksums |
9ec04ad0a1f60ef68c1e2d2e2062eba92ddc182b68988c6f652c0a9837be80d0
|
| 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.3.0-py3-none-manylinux_2_28_aarch64.whl
| Download URL | kaleidorg_swap_sdk-0.3.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 |
0178a1e64b570aa000ec6ae372784c5f40a199e3b5e093d090ca19d186e8e608
|
|
BLAKE2b-256 checksum How to use checksums |
c05ac667991d5fb47f1b953cdaa820fd818691647144b66e20d3d99798a4ebcf
|
| 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.3.0-py3-none-macosx_11_0_arm64.whl
| Download URL | kaleidorg_swap_sdk-0.3.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 |
b4ce7df44f225857409aeeb12a843c808cb03bef2405e9c3534c96ba52194b3d
|
|
BLAKE2b-256 checksum How to use checksums |
f0598cadac4e2f686ea521b7fb2f8cc930c8bd1aeb1ee34887425907f0363d99
|
| 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.3.0-py3-none-macosx_10_12_x86_64.whl
| Download URL | kaleidorg_swap_sdk-0.3.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 |
29aea5ce6b7f0245de1404ee56de5f0bcf187b387b3659825d42b64299314b5d
|
|
BLAKE2b-256 checksum How to use checksums |
3ab81a1ecf9a69bf6e47c41bdbc03b5cc50b3993d822cffb630b45c66c9e5aca
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|