anyswap-sdk 1.7.0

Rust client SDK for AnySwap: swaps between Lightning and on-chain Bitcoin or Liquid, with a driver that runs them to completion
Documentation

AnySwap Rust SDK

anyswap-sdk is the Rust client for AnySwap: swaps between Lightning and on-chain Bitcoin or Liquid. Its centrepiece is a driver that runs any number of swaps to completion and verifies everything against the chain, so an integration creates swaps and watches statuses rather than implementing the protocol.

Install

[dependencies]
anyswap-sdk = { version = "1.*", features = ["esplora"] }
Feature Default Adds
client yes HttpClient, the server API over HTTP
ws yes The WebSocket subscription that paces the driver; native only
driver yes The swap driver
esplora no BitcoinEsplora and LiquidEsplora as ready chain backends

Where to go next

  1. Quickstart for one swap, from setup to Completed.
  2. Swaps for the two flows, the statuses they move through, and cancels.
  3. Persistence and recovery for the store, restarts, and rebuilding swaps from the mnemonic alone.
  4. Liquid for the two extra values a Liquid integration needs.
  5. Compared with Boltz if you come from boltz-client or lwk_boltz.
  6. docs.rs for the API reference.

A runnable end-to-end program lives at examples/swaps.rs: it drives any mix of SwapIns and SwapOuts on both chains against a server. examples/advance.rs is the other shape: one swap driven by hand to its outcome over a store on disk, resumable after a restart.