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.
[dependencies]
anyswap-sdk = { version = "1.2.0-rc.2", 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 |
- Integration overview for what the driver does, what it trusts, and the setup every integration shares.
- Running swaps for the two flows, the statuses they move through, cancels, refunds, and the configuration knobs.
- Persistence and recovery for the store, restarts, and rebuilding swaps from the mnemonic alone.
- Liquid for the two extra values a Liquid integration needs.
- Boltz: comparison and migration if you come from
boltz-clientorlwk_boltz. cargo doc -p anyswap-sdk --openfor 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 regtest
deployment. examples/advance.rs is the other shape: one swap
driven by hand to its outcome over a store on disk, resumable after a
restart.