1use crate::{client::Client, error::Error, payload, proto::common::*};
18
19impl Client {
20 pub async fn get_cash_flow_history(
33 &self,
34 ctid_trader_account_id: i64,
35 from_timestamp: i64,
36 to_timestamp: i64,
37 ) -> Result<ProtoOaCashFlowHistoryListRes, Error> {
38 let req = ProtoOaCashFlowHistoryListReq {
39 payload_type: Some(payload::OA_CASH_FLOW_HISTORY_LIST_REQ as i32),
40 ctid_trader_account_id,
41 from_timestamp,
42 to_timestamp,
43 };
44 self.command(
45 payload::OA_CASH_FLOW_HISTORY_LIST_REQ,
46 req,
47 payload::OA_CASH_FLOW_HISTORY_LIST_RES,
48 )
49 .await
50 }
51
52 pub async fn get_dynamic_leverage(
67 &self,
68 ctid_trader_account_id: i64,
69 leverage_id: i64,
70 ) -> Result<ProtoOaGetDynamicLeverageByIdRes, Error> {
71 let req = ProtoOaGetDynamicLeverageByIdReq {
72 payload_type: Some(payload::OA_GET_DYNAMIC_LEVERAGE_REQ as i32),
73 ctid_trader_account_id,
74 leverage_id,
75 };
76 self.command(
77 payload::OA_GET_DYNAMIC_LEVERAGE_REQ,
78 req,
79 payload::OA_GET_DYNAMIC_LEVERAGE_RES,
80 )
81 .await
82 }
83}
84
85#[cfg(test)]
86mod tests {
87
88 #[async_std::test]
89 async fn test() {}
90}