Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.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

Where to go next

  1. Integration overview for what the driver does, what it trusts, and the setup every integration shares.
  2. Running swaps for the two flows, the statuses they move through, cancels, refunds, and the configuration knobs.
  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. Boltz: comparison and migration if you come from boltz-client or lwk_boltz.
  6. cargo doc -p anyswap-sdk --open 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 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.

About

No description, website, or topics provided.

Resources

Stars

11 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages