Skip to content

Commit 23fcb6c

Browse files
committed
fix orderStatus and cancelOrders
1 parent 0c2877b commit 23fcb6c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

node-binance-api.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3035,7 +3035,7 @@ let api = function Binance( options = {} ) {
30353035
orderStatus: function ( symbol, orderid, callback, flags = {} ) {
30363036
let parameters = Object.assign( { symbol: symbol }, flags );
30373037
if ( orderid ){
3038-
Object.assign( { orderId: orderid }, parameters )
3038+
parameters = Object.assign( { orderId: orderid }, parameters )
30393039
}
30403040

30413041
if ( !callback ) {
@@ -3143,6 +3143,9 @@ let api = function Binance( options = {} ) {
31433143
if ( json.length === 0 ) {
31443144
return callback.call( this, 'No orders present for this symbol', {}, symbol );
31453145
}
3146+
if ( Object.keys( json ).length === 0 ) {
3147+
return callback.call( this, 'No orders present for this symbol', {}, symbol );
3148+
}
31463149
for ( let obj of json ) {
31473150
let quantity = obj.origQty - obj.executedQty;
31483151
Binance.options.log( 'cancel order: ' + obj.side + ' ' + symbol + ' ' + quantity + ' @ ' + obj.price + ' #' + obj.orderId );

0 commit comments

Comments
 (0)