Skip to content

Fix orderStatus with orderid#716

Closed
hkjersem wants to merge 1 commit into
ccxt:masterfrom
hkjersem:patch-1
Closed

Fix orderStatus with orderid#716
hkjersem wants to merge 1 commit into
ccxt:masterfrom
hkjersem:patch-1

Conversation

@hkjersem

Copy link
Copy Markdown

No description provided.

@Jkurbs

Jkurbs commented Oct 8, 2021

Copy link
Copy Markdown

Hey tried your fix but It's still not working

@hkjersem

hkjersem commented Oct 9, 2021

Copy link
Copy Markdown
Author

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

@Jkurbs

Jkurbs commented Oct 9, 2021

Copy link
Copy Markdown

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

Jkurbs commented Oct 9, 2021

Copy link
Copy Markdown

Any help would be appreciated!

@Jkurbs

Jkurbs commented Oct 13, 2021

Copy link
Copy Markdown

@pawelangelow

@hkjersem

Copy link
Copy Markdown
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

Jkurbs commented Oct 13, 2021

Copy link
Copy Markdown

Removing it doesnt fix it. What should I do?

@hkjersem

Copy link
Copy Markdown
Author

Can you console.log the parameters?

@Jkurbs

Jkurbs commented Oct 14, 2021

Copy link
Copy Markdown

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

@all2pie

all2pie commented Oct 14, 2021

Copy link
Copy Markdown

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

Comment thread node-binance-api.js
let parameters = Object.assign( { symbol: symbol }, flags );
if (orderid){
Object.assign( { orderId: orderid }, parameters )
parameters = Object.assign( { orderId: orderid }, parameters )

Copy link
Copy Markdown

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

swznd commented Nov 5, 2021

Copy link
Copy Markdown

more correct fix #742

@herenickname

herenickname commented Dec 8, 2021

Copy link
Copy Markdown

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

@kkjf02 kkjf02 left a comment

Copy link
Copy Markdown

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