2020-11-26 02:55:56 +00:00
|
|
|
//! Run an XMR/BTC swap in the role of Alice.
|
|
|
|
//! Alice holds XMR and wishes receive BTC.
|
2021-03-17 03:55:42 +00:00
|
|
|
use crate::env::Config;
|
2021-09-28 00:15:31 +00:00
|
|
|
use crate::protocol::Database;
|
2021-06-25 03:40:33 +00:00
|
|
|
use crate::{asb, bitcoin, monero};
|
2021-02-08 03:21:54 +00:00
|
|
|
use std::sync::Arc;
|
2021-01-14 02:23:03 +00:00
|
|
|
use uuid::Uuid;
|
2020-11-26 02:55:56 +00:00
|
|
|
|
2021-03-04 00:28:58 +00:00
|
|
|
pub use self::state::*;
|
|
|
|
pub use self::swap::{run, run_until};
|
2021-02-04 00:39:15 +00:00
|
|
|
|
2021-01-05 03:08:36 +00:00
|
|
|
pub mod state;
|
2020-11-27 00:30:07 +00:00
|
|
|
pub mod swap;
|
2020-11-15 23:21:17 +00:00
|
|
|
|
2021-01-18 08:56:43 +00:00
|
|
|
pub struct Swap {
|
|
|
|
pub state: AliceState,
|
2021-06-25 03:40:33 +00:00
|
|
|
pub event_loop_handle: asb::EventLoopHandle,
|
2021-01-18 08:56:43 +00:00
|
|
|
pub bitcoin_wallet: Arc<bitcoin::Wallet>,
|
|
|
|
pub monero_wallet: Arc<monero::Wallet>,
|
2021-03-17 03:55:42 +00:00
|
|
|
pub env_config: Config,
|
2021-01-18 08:56:43 +00:00
|
|
|
pub swap_id: Uuid,
|
2021-09-28 00:15:31 +00:00
|
|
|
pub db: Arc<dyn Database + Send + Sync>,
|
2021-01-18 08:56:43 +00:00
|
|
|
}
|