Official SDKs
KaleidoSwap provides official SDKs for both TypeScript and Python. Both are standalone implementations that auto-generate types from the same OpenAPI specifications, ensuring full type safety and consistent API design.Architecture
Both SDKs share the same API design and are built independently:
KaleidoClient, which provides two sub-clients: MakerClient for market operations (quotes, orders, swaps) and RlnClient for RGB Lightning Node operations (wallets, channels, invoices). Both use HTTP clients internally, with optional WebSocket support for real-time streaming.
Key Benefits
- Type Safety: Auto-generated types from OpenAPI specs in both languages
- Consistent API: Identical structure across TypeScript and Python
- Sub-client Design: Organized access via
client.makerandclient.rln - WebSocket Support: Real-time quote streaming with automatic reconnection
What is KaleidoSwap?
KaleidoSwap is a decentralized exchange protocol for Bitcoin and RGB assets. It enables trading of digital assets through order-based swaps on the Lightning Network and on-chain Bitcoin transactions.SDK Dual Purpose
Our SDK serves two primary functions: Maker API Integration (client.maker)
Connect to KaleidoSwap’s maker APIs for:
- Getting quotes for asset pairs
- Creating and managing swap orders
- Streaming real-time quotes via WebSocket
- LSPS1 channel ordering
client.rln)
Direct interaction with RGB Lightning Nodes for:
- Wallet management and RGB asset operations
- Lightning channel management
- Invoice creation and payment
- Node-to-node swap coordination
Key Features
- Sub-client Architecture: Organized API access via
client.makerandclient.rln - Type Safety: Full TypeScript types and Python Pydantic models
- WebSocket Support: Real-time quote streaming with automatic reconnection
- Error Handling: Comprehensive exception hierarchy across both SDKs
- Dual API Support: Seamlessly work with both Maker APIs and RLN node operations
- RGB Asset Trading: Full support for trading RGB assets on Lightning and on-chain
- Order-Based Swaps: Create swap orders, pay deposits, and track execution
Get Started
Getting Started
Install the SDK, configure your client, and make your first API call
Examples
End-to-end code for market data, swaps, WebSocket streaming, and node ops
Client Reference
Full method reference for MakerClient and RlnClient
Swap Protocol
Understand atomic vs. order-based swap models before integrating