Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix orderStatus with orderid #716

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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

@@ -3025,7 +3025,7 @@ let api = function Binance( options = {} ) {
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 )
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

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.

None yet

6 participants