binance-exchange/node-binance-api

websocket for the orders? + newClientOrderId?

iBasit opened this issue · 3 comments

How can I set "newClientOrderId" when placing an order?

Also is there any WebSocket for new orders which are coming in (BUY, SELL)? Is https://github.com/jaggedsoft/node-binance-api/blob/master/examples/advanced.md#user-data-account-balance-updates-trade-updates-new-orders-filled-orders-cancelled-orders-via-websocket the link for the WebSocket for orders? would it have "newClientOrderId" id?

I want to track the orders with our system, so we can place it under right sell / buy user.

https://github.com/binance-exchange/binance-official-api-docs/blob/master/user-data-stream.md#order-update
"C": "null", // Original client order ID; This is the ID of the order being canceled
"i": 4293153, // Order ID

It looks like the parameters you want are C and i
I have added the ability to set this parameter, thanks for the suggestion

I haven't cut a full release yet but you can see the code here: jaggedsoft@8f80599

Use with this format: (the 5th optional parameter is a callback)

binance.buy("BNBETH", quantity, price, {newClientOrderId: "testing"});

//with callback:
binance.buy("BNBETH", quantity, price, {newClientOrderId: "testing"}, function(response) {
        console.log(response);
});

When are you planning to release?

Maybe tomorrow, I have been extremely busy lately unfortunately

You might be able to update now with npm install node-binance-api --force --save from your project directory