cripsy_binary_api/broker/
extras.rs1use async_trait::async_trait;
9
10use crate::broker::error::BrokerError;
11use crate::broker::trait_::Broker;
12use crate::domain::{
13 AssetProfile, BuyBlitzRequest, BuyDigitalRequest, OrderId, TechnicalIndicators,
14};
15
16#[async_trait]
21pub trait IqOptionExtras: Broker {
22 async fn get_technical_indicators(
24 &self,
25 symbol: &str,
26 ) -> Result<TechnicalIndicators, BrokerError>;
27
28 async fn get_asset_profile(&self, symbol: &str) -> Result<AssetProfile, BrokerError>;
30
31 async fn subscribe_live_deals(&self, symbol: &str) -> Result<(), BrokerError>;
33
34 async fn subscribe_commission_changes(&self) -> Result<(), BrokerError>;
36
37 async fn buy_blitz(&self, req: BuyBlitzRequest) -> Result<OrderId, BrokerError>;
39
40 async fn buy_digital_spot(&self, req: BuyDigitalRequest) -> Result<OrderId, BrokerError>;
42}
43
44use crate::broker::iq_option::IqOptionBroker;
45
46#[async_trait]
47impl IqOptionExtras for IqOptionBroker {
48 async fn get_technical_indicators(
49 &self,
50 symbol: &str,
51 ) -> Result<TechnicalIndicators, BrokerError> {
52 self.get_technical_indicators(symbol).await
53 }
54
55 async fn get_asset_profile(&self, symbol: &str) -> Result<AssetProfile, BrokerError> {
56 self.get_asset_profile(symbol).await
57 }
58
59 async fn subscribe_live_deals(&self, symbol: &str) -> Result<(), BrokerError> {
60 self.subscribe_live_deals(symbol).await
61 }
62
63 async fn subscribe_commission_changes(&self) -> Result<(), BrokerError> {
64 self.subscribe_commission_changes().await
65 }
66
67 async fn buy_blitz(&self, req: BuyBlitzRequest) -> Result<OrderId, BrokerError> {
68 self.buy_blitz(req).await
69 }
70
71 async fn buy_digital_spot(&self, req: BuyDigitalRequest) -> Result<OrderId, BrokerError> {
72 self.buy_digital_spot(req).await
73 }
74}