Skip to content

Conversation

@hkjersem
Copy link

No description provided.

@Jkurbs
Copy link

Jkurbs commented Oct 8, 2021

Hey tried your fix but It's still not working

@hkjersem
Copy link
Author

hkjersem commented Oct 9, 2021

Are you sure? It works for me. What kind of error do you get?

@Jkurbs
Copy link

Jkurbs commented Oct 9, 2021

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 );
             } );
         }
     },

@Jkurbs
Copy link

Jkurbs commented Oct 9, 2021

Any help would be appreciated!

@Jkurbs
Copy link

Jkurbs commented Oct 13, 2021

@pawelangelow

@hkjersem
Copy link
Author

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.

@Jkurbs
Copy link

Jkurbs commented Oct 13, 2021

Removing it doesnt fix it. What should I do?

@hkjersem
Copy link
Author

Can you console.log the parameters?

@Jkurbs
Copy link

Jkurbs commented Oct 14, 2021

@hkjersem I finally got it working. I had to fork your repo and install the repo via npm

@all2pie
Copy link

all2pie commented Oct 14, 2021

Why isn't this merged ?
It is a critical issue

let parameters = Object.assign( { symbol: symbol }, flags );
if (orderid){
Object.assign( { orderId: orderid }, parameters )
parameters = Object.assign( { orderId: orderid }, parameters )
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The parameters order was wrong, correct order is:
Object.assign( parameters, { orderId: orderid } )

@swznd
Copy link

swznd commented Nov 5, 2021

more correct fix #742

@herenickname
Copy link

herenickname commented Dec 8, 2021

Any updates?
I'm stuck in Param 'origClientOrderId' or 'orderId' must be sent, but both were empty/null!

Copy link

@kkjf02 kkjf02 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works

@hkjersem hkjersem closed this Oct 8, 2024
@hkjersem hkjersem deleted the patch-1 branch October 8, 2024 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants