File tree Expand file tree Collapse file tree 3 files changed +8
-5
lines changed
Expand file tree Collapse file tree 3 files changed +8
-5
lines changed Original file line number Diff line number Diff line change 11use std:: env;
22
33use v_exchanges:: { binance:: Binance , core:: Exchange } ;
4- use v_exchanges_adapters:: binance:: { self , BinanceHttpUrl , BinanceOption } ;
4+ use v_exchanges_adapters:: binance:: { BinanceHttpUrl , BinanceOption } ;
55
66#[ tokio:: main]
77async fn main ( ) {
@@ -17,8 +17,7 @@ async fn main() {
1717 dbg ! ( & klines, price) ;
1818
1919 if let ( Ok ( key) , Ok ( secret) ) = ( env:: var ( "BINANCE_TIGER_READ_KEY" ) , env:: var ( "BINANCE_TIGER_READ_SECRET" ) ) {
20- b. update_default_option ( BinanceOption :: Key ( key) ) ;
21- b. update_default_option ( BinanceOption :: Secret ( secret) ) ;
20+ b. auth ( key, secret) ;
2221 let balance = b. futures_asset_balance ( "USDT" . into ( ) ) . await . unwrap ( ) ;
2322 dbg ! ( & balance) ;
2423 } else {
Original file line number Diff line number Diff line change @@ -22,8 +22,7 @@ async fn main() {
2222 dbg ! ( & price) ;
2323
2424 if let ( Ok ( key) , Ok ( secret) ) = ( env:: var ( "BYBIT_TIGER_READ_KEY" ) , env:: var ( "BYBIT_TIGER_READ_SECRET" ) ) {
25- bb. update_default_option ( BybitOption :: Key ( key) ) ;
26- bb. update_default_option ( BybitOption :: Secret ( secret) ) ;
25+ bb. auth ( key, secret) ;
2726 private ( & mut bb) . await ;
2827 } else {
2928 eprintln ! ( "BYBIT_TIGER_READ_KEY or BYBIT_TIGER_READ_SECRET is missing, skipping private API methods." ) ;
Original file line number Diff line number Diff line change @@ -89,6 +89,11 @@ impl From<u32> for KlinesRequestRange {
8989 KlinesRequestRange :: Limit ( value)
9090 }
9191}
92+ impl From < i32 > for KlinesRequestRange {
93+ fn from ( value : i32 ) -> Self {
94+ KlinesRequestRange :: Limit ( value as u32 )
95+ }
96+ }
9297impl From < u16 > for KlinesRequestRange {
9398 fn from ( value : u16 ) -> Self {
9499 KlinesRequestRange :: Limit ( value as u32 )
You can’t perform that action at this time.
0 commit comments