2020-11-25 21:55:56 -05:00
|
|
|
//! Run an XMR/BTC swap in the role of Alice.
|
|
|
|
//! Alice holds XMR and wishes receive BTC.
|
2021-03-03 19:28:58 -05:00
|
|
|
use crate::database::Database;
|
2021-03-16 23:55:42 -04:00
|
|
|
use crate::env::Config;
|
2021-03-03 19:28:58 -05:00
|
|
|
use crate::{bitcoin, monero};
|
2021-02-07 22:21:54 -05:00
|
|
|
use std::sync::Arc;
|
2021-01-13 21:23:03 -05:00
|
|
|
use uuid::Uuid;
|
2020-11-25 21:55:56 -05:00
|
|
|
|
2021-03-03 19:28:58 -05:00
|
|
|
pub use self::behaviour::{Behaviour, OutEvent};
|
|
|
|
pub use self::event_loop::{EventLoop, EventLoopHandle};
|
2021-04-28 02:13:04 -04:00
|
|
|
pub use self::recovery::cancel::cancel;
|
|
|
|
pub use self::recovery::punish::punish;
|
|
|
|
pub use self::recovery::redeem::redeem;
|
|
|
|
pub use self::recovery::refund::refund;
|
|
|
|
pub use self::recovery::safely_abort::safely_abort;
|
|
|
|
pub use self::recovery::{cancel, punish, redeem, refund, safely_abort};
|
2021-03-03 19:28:58 -05:00
|
|
|
pub use self::state::*;
|
|
|
|
pub use self::swap::{run, run_until};
|
2021-02-03 19:39:15 -05:00
|
|
|
|
2021-02-07 23:14:22 -05:00
|
|
|
mod behaviour;
|
2020-12-09 21:19:18 -05:00
|
|
|
pub mod event_loop;
|
2021-04-28 02:13:04 -04:00
|
|
|
mod recovery;
|
2021-01-04 22:08:36 -05:00
|
|
|
pub mod state;
|
2020-11-26 19:30:07 -05:00
|
|
|
pub mod swap;
|
2021-06-23 23:54:26 -04:00
|
|
|
pub mod swap_setup;
|
2020-11-15 18:21:17 -05:00
|
|
|
|
2021-01-18 03:56:43 -05:00
|
|
|
pub struct Swap {
|
|
|
|
pub state: AliceState,
|
|
|
|
pub event_loop_handle: EventLoopHandle,
|
|
|
|
pub bitcoin_wallet: Arc<bitcoin::Wallet>,
|
|
|
|
pub monero_wallet: Arc<monero::Wallet>,
|
2021-03-16 23:55:42 -04:00
|
|
|
pub env_config: Config,
|
2021-01-18 03:56:43 -05:00
|
|
|
pub swap_id: Uuid,
|
2021-02-08 19:15:55 -05:00
|
|
|
pub db: Arc<Database>,
|
2021-01-18 03:56:43 -05:00
|
|
|
}
|