Fix orderStatus with orderid
Hey tried your fix but It's still not working
Are you sure? It works for me. What kind of error do you get?
Thanks for your answer, Here's the error: {"code":-1102,"msg":"Param 'origClientOrderId' or 'orderId' must be sent, but both were empty/null!"}
The code: (The id Is a valid id)
client.orderStatus('ETHUSD', "507439843", (error, orderStatus, symbol) => {
if (error != null) { return functions.logger.error("An error occured while checking order status: ", error['body'])}
functions.logger.log(orderStatus)
});
Binance code:
orderStatus: function ( symbol, orderid, callback, flags = {} ) {
let parameters = Object.assign( { symbol: symbol }, flags );
if (orderid){
Object.assign( { orderId: orderid }, parameters )
parameters = Object.assign( { orderId: orderid }, parameters )
}
if ( !callback ) {
return new Promise( ( resolve, reject ) => {
callback = ( error, response ) => {
if ( error ) {
reject( error );
} else {
resolve( response );
}
}
signedRequest( base + 'v3/order', parameters, function ( error, data ) {
return callback.call( this, error, data, symbol );
} );
} )
} else {
signedRequest( base + 'v3/order', parameters, function ( error, data ) {
return callback.call( this, error, data, symbol );
} );
}
},
Any help would be appreciated!
@pawelangelow
orderStatus: function ( symbol, orderid, callback, flags = {} ) { let parameters = Object.assign( { symbol: symbol }, flags ); if (orderid){ Object.assign( { orderId: orderid }, parameters ) parameters = Object.assign( { orderId: orderid }, parameters ) }
Looks like you didn't remove the line here like in the PR, though it shouldn't really matter.
Removing it doesnt fix it. What should I do?
Can you console.log the parameters?
@hkjersem I finally got it working. I had to fork your repo and install the repo via npm
Why isn't this merged ? It is a critical issue
more correct fix https://github.com/jaggedsoft/node-binance-api/pull/742
Any updates?
I'm stuck in Param 'origClientOrderId' or 'orderId' must be sent, but both were empty/null!