File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -70,22 +70,26 @@ eventEmitter.on('sell', () => {
70
70
}
71
71
72
72
else {
73
- let btcBalance = balances . BTC . available ;
74
- binance . marketSell ( symbol , btcBalance ) ;
73
+
74
+ binance . marketSell ( symbol , balances . BTC . available ) ;
75
75
}
76
+ console . log ( balances . BTC . available ) ;
76
77
} ) // binance.balance
77
78
} ) // end eventemitter.on('sell')
78
79
79
80
// S T O P
80
81
eventEmitter . on ( 'stop' , ( ) => {
81
-
82
+
82
83
binance . balance ( ( error , balances ) => {
83
-
84
84
if ( error ) return console . error ( error ) ;
85
85
86
- let btcBalance = balances . BTC . available ;
87
- binance . marketSell ( symbol , btcBalance ) ;
86
+ if ( balances . BTC . available > 0 ) {
87
+ btcBalance = parseFloat ( balances . BTC . available ) ;
88
+ console . log ( btcBalance ) ;
89
+ binance . marketSell ( symbol , btcBalance ) ;
90
+ }
88
91
} ) // binance.balance
92
+
89
93
} ) // end eventemitter.on('stop')
90
94
91
95
const server = http . createServer ( ( req , res ) => {
You can’t perform that action at this time.
0 commit comments