Skip to main content
The swap-sdk repository ships runnable programs. Each binding keeps them in two folders:
  • simple/ uses the high-level KaleidoSwap API: you name what you pay and what you receive, and the SDK prices the route, checks the maker’s response, persists the swap, and claims or refunds on its own. Start here.
  • advanced/ drives the swap engine step by step: pair cards, create requests, scripts, claim and refund transactions. Use it when you own those steps yourself, or for a route the high-level API does not serve yet (L-USDT, the Arkade corridor, RGB, atomic swaps).
The high-level API and the simple/ examples are on trunk and not yet in a published release (the latest is v0.13.0). The commands below build the SDK from source, so they run either way.

TypeScript

Node 22+ runs the .ts files directly. Start with advanced/01-pairs.ts. If it prints a table, the SDK, its WebAssembly binary, and the maker are all reachable. Each example lists the environment variables it needs at the top of the file. The examples README covers configuration and the swap mnemonic.

Python

bindings/python/examples/ has:
  • simple/submarine.py and simple/reverse.py: the high-level API against the signet maker.
  • advanced/: submarine.py, reverse.py, chain.py, corridor_quote.py, and rgb_spend.py on the swap engine. They target the regtest harness; do not run them against real funds.

Rust

examples/ has:
  • simple/submarine.rs and simple/reverse.rs (simple_submarine, simple_reverse): the high-level API against the signet maker.
  • advanced/submarine.rs and advanced/reverse.rs (advanced_submarine, advanced_reverse): the same BTC swaps step by step on the engine.
  • advanced/lusdt_submarine.rs and advanced/lusdt_reverse.rs: the full L-USDT ↔ BTC workflow, including the caller-funded PSET claim.
  • advanced/corridor_quote.rs: an Arkade corridor quote.
  • advanced/signet_smoke.rs: a read-only check of the signet maker and chain access.
  • rgb-regtest/: live USDT-RGB swaps with real rgb-lib wallets on regtest.
Each example runs by its name in Cargo.toml: