xmr-btc-swap/swap/src/protocol/alice.rs

36 lines
1021 B
Rust
Raw Normal View History

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.
use crate::database::Database;
use crate::env::Config;
use crate::{bitcoin, monero};
use std::sync::Arc;
use uuid::Uuid;
2020-11-25 21:55:56 -05:00
pub use self::behaviour::{Behaviour, OutEvent};
pub use self::event_loop::{EventLoop, EventLoopHandle};
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};
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;
mod recovery;
pub mod state;
pub mod swap;
pub mod swap_setup;
pub struct Swap {
pub state: AliceState,
pub event_loop_handle: EventLoopHandle,
pub bitcoin_wallet: Arc<bitcoin::Wallet>,
pub monero_wallet: Arc<monero::Wallet>,
pub env_config: Config,
pub swap_id: Uuid,
pub db: Arc<Database>,
}