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

35 lines
875 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::{bitcoin, database::Database, execution_params::ExecutionParams, monero};
use std::sync::Arc;
use uuid::Uuid;
2020-11-25 21:55:56 -05:00
2021-02-03 19:39:15 -05:00
pub use self::{
behaviour::{Behaviour, OutEvent},
2021-02-03 19:39:15 -05:00
event_loop::{EventLoop, EventLoopHandle},
2021-02-03 19:56:58 -05:00
execution_setup::Message1,
2021-02-03 19:39:15 -05:00
state::*,
swap::{run, run_until},
transfer_proof::TransferProof,
};
pub use execution_setup::Message3;
2021-02-03 19:39:15 -05:00
2021-02-07 23:14:22 -05:00
mod behaviour;
2021-01-26 22:14:20 -05:00
mod encrypted_signature;
2020-12-09 21:19:18 -05:00
pub mod event_loop;
mod execution_setup;
pub mod state;
mod steps;
pub mod swap;
2021-01-26 22:14:20 -05:00
mod transfer_proof;
pub struct Swap {
pub state: AliceState,
pub event_loop_handle: EventLoopHandle,
pub bitcoin_wallet: Arc<bitcoin::Wallet>,
pub monero_wallet: Arc<monero::Wallet>,
pub execution_params: ExecutionParams,
pub swap_id: Uuid,
pub db: Arc<Database>,
}