Skip to content

kaleidoswap/kaleido-sdk

Repository files navigation

Kaleidoswap SDK

npm PyPI License: MIT

Official multi-language SDK for Kaleidoswap — a decentralized exchange for Bitcoin and RGB assets on the Lightning Network.

Beta Software — Use at Your Own Risk

This SDK is under active development and currently intended for testnet/signet use only. It is not considered safe for mainnet or production environments. APIs may change without notice. The authors assume no responsibility for any loss of funds or damages arising from the use of this software. Use it at your own risk.

Overview

The SDK provides two sub-clients for interacting with the Kaleidoswap protocol:

Sub-client What it does
client.maker Kaleidoswap market API — assets, pairs, quotes, swap orders, LSP
client.rln RGB Lightning Node — wallet, channels, payments, RGB asset operations

SDKs

Language Package Status Docs
TypeScript kaleido-sdk npm README
Python kaleido-sdk PyPI README

Quick Start

TypeScript

npm install kaleido-sdk
import { KaleidoClient } from 'kaleido-sdk';

const client = KaleidoClient.create({
  baseUrl: 'https://api.signet.kaleidoswap.com',
});

const assets = await client.maker.listAssets();
const pairs  = await client.maker.listPairs();

Python

pip install kaleido-sdk
from kaleido_sdk import KaleidoClient

client = KaleidoClient.create(base_url="https://api.signet.kaleidoswap.com")

assets = await client.maker.list_assets()
pairs  = await client.maker.list_pairs()

RLN (RGB Lightning Node) access

import { RlnClient } from 'kaleido-sdk/rln';

// Standalone
const rln = new RlnClient({ nodeUrl: 'http://localhost:3001' });
const info = await rln.getNodeInfo();

// Or via KaleidoClient
const client = KaleidoClient.create({
  baseUrl: 'https://api.signet.kaleidoswap.com',
  nodeUrl: 'http://localhost:3001',
});
const channels = await client.rln.listChannels();

Architecture

specs/kaleidoswap.json
specs/rgb-lightning-node.yaml
          |
          +--> scripts/generate_python_sdk_models.sh --> python-sdk/kaleido_sdk/_generated/
          |
          +--> scripts/generate_typescript_types.sh  --> typescript-sdk/src/generated/

Each SDK is implemented natively in its language and consumes generated types/models from the same OpenAPI source of truth. Never edit the generated files directly — regenerate them from the specs instead.

Development

Prerequisites

  • Python 3.10+
  • Node.js 18+
  • pnpm
  • uv

Build

make build               # Build all SDKs
make build-typescript     # TypeScript only
make build-python-sdk     # Python only

Test

make test                 # Run all tests
make test-typescript      # TypeScript only
make test-python-sdk      # Python only

Code Quality

make check                # Format, lint, and typecheck all SDKs
make fix                  # Auto-fix format and lint issues
make pre-commit           # Same checks as CI

Regenerate Types

make generate-models      # Regenerate all models from specs
make regenerate           # Download latest specs + regenerate

Version Sync

make versions                       # Show current SDK versions
make sync-version VERSION=0.2.0     # Sync version across all SDKs

Roadmap

  • Python SDK
  • TypeScript SDK
  • OpenAPI-driven model generation
  • WebSocket support
  • Rust SDK (kaleidoswap-core — WIP)
  • Swift SDK for iOS/macOS
  • Kotlin SDK for Android

License

MIT License. See LICENSE.

Resources

About

Open-source SDK for building on KaleidoSwap's atomic swap infrastructure. TypeScript and Python clients for the RFQ engine, Wrapped HODL Invoice swaps, and RGB Lightning on test networks. More backends incoming.

Topics

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors