Skip to main content
The KaleidoSDK (kaleido-sdk) lets wallet builders integrate non-custodial atomic swaps across Bitcoin, Lightning, and RGB. It powers the KaleidoSwap non-custodial DEX and ships in TypeScript and Python.

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: KaleidoSDK Architecture Your application connects through KaleidoClient, which provides two sub-clients: MakerClient for market operations (quotes, atomic swaps, LSPS1 channel orders) and RlnClient for RGB Lightning Node operations (wallets, channels, invoices). Both use HTTP clients internally, with optional WebSocket support for real-time streaming.

Two API Surfaces

Maker API (client.maker) Connect to KaleidoSwap’s maker APIs for:
  • Getting quotes for asset pairs
  • Initializing and executing HTLC atomic swaps
  • Streaming real-time quotes via WebSocket
  • LSPS1 channel ordering
RLN (RGB Lightning Node) Operations (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
For what KaleidoSwap is as a protocol, see What’s KaleidoSwap.

Key Features

  • Sub-client Architecture: Organized API access via client.maker and client.rln
  • Type Safety: Auto-generated types from OpenAPI specs — full TypeScript types and Python Pydantic models
  • Consistent API: Identical structure across TypeScript and Python
  • WebSocket Support: Real-time quote streaming with automatic reconnection
  • Error Handling: Comprehensive exception hierarchy across both SDKs
  • RGB Asset Trading: Full support for trading RGB assets on Lightning and on-chain
  • Atomic Swaps: HTLC-based swaps with no trust in the maker

Support

Need help? Check out our: