|
@ -17,64 +17,32 @@ use xtra::prelude::*; |
|
|
|
|
|
|
|
|
pub struct Initialized(pub Address<MakerIncConnectionsActor>); |
|
|
pub struct Initialized(pub Address<MakerIncConnectionsActor>); |
|
|
|
|
|
|
|
|
impl Message for Initialized { |
|
|
|
|
|
type Result = (); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
pub struct TakeOrder { |
|
|
pub struct TakeOrder { |
|
|
pub taker_id: TakerId, |
|
|
pub taker_id: TakerId, |
|
|
pub order_id: OrderId, |
|
|
pub order_id: OrderId, |
|
|
pub quantity: Usd, |
|
|
pub quantity: Usd, |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
impl Message for TakeOrder { |
|
|
|
|
|
type Result = (); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
pub struct NewOrder(pub Order); |
|
|
pub struct NewOrder(pub Order); |
|
|
|
|
|
|
|
|
impl Message for NewOrder { |
|
|
|
|
|
type Result = (); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
pub struct StartContractSetup { |
|
|
pub struct StartContractSetup { |
|
|
pub taker_id: TakerId, |
|
|
pub taker_id: TakerId, |
|
|
pub order_id: OrderId, |
|
|
pub order_id: OrderId, |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
impl Message for StartContractSetup { |
|
|
|
|
|
type Result = (); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
pub struct NewTakerOnline { |
|
|
pub struct NewTakerOnline { |
|
|
pub id: TakerId, |
|
|
pub id: TakerId, |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
impl Message for NewTakerOnline { |
|
|
|
|
|
type Result = (); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
pub struct IncProtocolMsg(pub SetupMsg); |
|
|
pub struct IncProtocolMsg(pub SetupMsg); |
|
|
|
|
|
|
|
|
impl Message for IncProtocolMsg { |
|
|
|
|
|
type Result = (); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
pub struct CfdSetupCompleted { |
|
|
pub struct CfdSetupCompleted { |
|
|
pub order_id: OrderId, |
|
|
pub order_id: OrderId, |
|
|
pub dlc: Dlc, |
|
|
pub dlc: Dlc, |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
impl Message for CfdSetupCompleted { |
|
|
|
|
|
type Result = (); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
pub struct SyncWallet; |
|
|
pub struct SyncWallet; |
|
|
|
|
|
|
|
|
impl Message for SyncWallet { |
|
|
|
|
|
type Result = (); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
pub struct MakerCfdActor { |
|
|
pub struct MakerCfdActor { |
|
|
db: sqlx::SqlitePool, |
|
|
db: sqlx::SqlitePool, |
|
|
wallet: Wallet, |
|
|
wallet: Wallet, |
|
@ -90,8 +58,6 @@ pub struct MakerCfdActor { |
|
|
contract_setup_message_buffer: Vec<SetupMsg>, |
|
|
contract_setup_message_buffer: Vec<SetupMsg>, |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
impl xtra::Actor for MakerCfdActor {} |
|
|
|
|
|
|
|
|
|
|
|
impl MakerCfdActor { |
|
|
impl MakerCfdActor { |
|
|
pub async fn new( |
|
|
pub async fn new( |
|
|
db: sqlx::SqlitePool, |
|
|
db: sqlx::SqlitePool, |
|
@ -421,3 +387,37 @@ impl Handler<SyncWallet> for MakerCfdActor { |
|
|
log_error!(self.handle_sync_wallet()); |
|
|
log_error!(self.handle_sync_wallet()); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
impl Message for Initialized { |
|
|
|
|
|
type Result = (); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
impl Message for TakeOrder { |
|
|
|
|
|
type Result = (); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
impl Message for NewOrder { |
|
|
|
|
|
type Result = (); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
impl Message for StartContractSetup { |
|
|
|
|
|
type Result = (); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
impl Message for NewTakerOnline { |
|
|
|
|
|
type Result = (); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
impl Message for IncProtocolMsg { |
|
|
|
|
|
type Result = (); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
impl Message for CfdSetupCompleted { |
|
|
|
|
|
type Result = (); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
impl Message for SyncWallet { |
|
|
|
|
|
type Result = (); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
impl xtra::Actor for MakerCfdActor {} |
|
|