@@ -27,18 +27,18 @@ impl Exchange for Binance {
2727 self . update_default_option ( BinanceOption :: Secret ( secret) ) ;
2828 }
2929
30- fn set_recv_window ( & mut self , recv_window : u16 ) {
30+ fn set_recv_window ( & mut self , recv_window : std :: time :: Duration ) {
3131 self . update_default_option ( BinanceOption :: RecvWindow ( recv_window) ) ;
3232 }
3333
34- async fn exchange_info ( & self , instrument : Instrument , recv_window : Option < u16 > ) -> ExchangeResult < ExchangeInfo > {
34+ async fn exchange_info ( & self , instrument : Instrument , recv_window : Option < std :: time :: Duration > ) -> ExchangeResult < ExchangeInfo > {
3535 match instrument {
3636 Instrument :: Perp => perp:: general:: exchange_info ( self , recv_window) . await ,
3737 _ => unimplemented ! ( ) ,
3838 }
3939 }
4040
41- async fn klines ( & self , symbol : Symbol , tf : Timeframe , range : RequestRange , recv_window : Option < u16 > ) -> ExchangeResult < Klines > {
41+ async fn klines ( & self , symbol : Symbol , tf : Timeframe , range : RequestRange , recv_window : Option < std :: time :: Duration > ) -> ExchangeResult < Klines > {
4242 match symbol. instrument {
4343 Instrument :: Spot | Instrument :: Margin => market:: klines ( self , symbol, tf. try_into ( ) ?, range, recv_window) . await ,
4444 Instrument :: Perp => market:: klines ( self , symbol, tf. try_into ( ) ?, range, recv_window) . await ,
@@ -49,15 +49,15 @@ impl Exchange for Binance {
4949 }
5050 }
5151
52- async fn prices ( & self , pairs : Option < Vec < Pair > > , instrument : Instrument , recv_window : Option < u16 > ) -> ExchangeResult < BTreeMap < Pair , f64 > > {
52+ async fn prices ( & self , pairs : Option < Vec < Pair > > , instrument : Instrument , recv_window : Option < std :: time :: Duration > ) -> ExchangeResult < BTreeMap < Pair , f64 > > {
5353 match instrument {
5454 Instrument :: Spot | Instrument :: Margin => spot:: market:: prices ( self , pairs, recv_window) . await ,
5555 Instrument :: Perp => perp:: market:: prices ( self , pairs, recv_window) . await ,
5656 _ => Err ( ExchangeError :: Method ( MethodError :: MethodNotImplemented { exchange : self . name ( ) , instrument } ) ) ,
5757 }
5858 }
5959
60- async fn price ( & self , symbol : Symbol , recv_window : Option < u16 > ) -> ExchangeResult < f64 > {
60+ async fn price ( & self , symbol : Symbol , recv_window : Option < std :: time :: Duration > ) -> ExchangeResult < f64 > {
6161 match symbol. instrument {
6262 Instrument :: Spot | Instrument :: Margin => spot:: market:: price ( self , symbol. pair , recv_window) . await ,
6363 Instrument :: Perp => perp:: market:: price ( self , symbol. pair , recv_window) . await ,
@@ -68,7 +68,7 @@ impl Exchange for Binance {
6868 }
6969 }
7070
71- async fn open_interest ( & self , symbol : Symbol , tf : Timeframe , range : RequestRange , recv_window : Option < u16 > ) -> ExchangeResult < Vec < crate :: core:: OpenInterest > > {
71+ async fn open_interest ( & self , symbol : Symbol , tf : Timeframe , range : RequestRange , recv_window : Option < std :: time :: Duration > ) -> ExchangeResult < Vec < crate :: core:: OpenInterest > > {
7272 match symbol. instrument {
7373 Instrument :: Perp => market:: open_interest ( self , symbol, tf. try_into ( ) ?, range, recv_window) . await ,
7474 _ => Err ( ExchangeError :: Method ( MethodError :: MethodNotSupported {
@@ -78,14 +78,14 @@ impl Exchange for Binance {
7878 }
7979 }
8080
81- async fn asset_balance ( & self , asset : Asset , instrument : Instrument , recv_window : Option < u16 > ) -> ExchangeResult < AssetBalance > {
81+ async fn asset_balance ( & self , asset : Asset , instrument : Instrument , recv_window : Option < std :: time :: Duration > ) -> ExchangeResult < AssetBalance > {
8282 match instrument {
8383 Instrument :: Perp => perp:: account:: asset_balance ( self , asset, recv_window) . await ,
8484 _ => unimplemented ! ( ) ,
8585 }
8686 }
8787
88- async fn balances ( & self , instrument : Instrument , recv_window : Option < u16 > ) -> ExchangeResult < Balances > {
88+ async fn balances ( & self , instrument : Instrument , recv_window : Option < std :: time :: Duration > ) -> ExchangeResult < Balances > {
8989 match instrument {
9090 Instrument :: Perp => {
9191 let prices = self . prices ( None , instrument, recv_window) . await ?;
0 commit comments