node-binance-api
node-binance-api copied to clipboard
orderStatus contains bug when building parameters.
Hi! 👋
Firstly, thanks for your work on this project! 🙂
Today I used patch-package to patch [email protected]
for the project I'm working on.
When fetching the orderStatus, the API responds always with: Param 'origClientOrderId' or 'orderId' must be sent, but both were empty/null!
After digging in the source code, I have figured out, that you have a bug when creating the parameters.
Here is the diff that solved my problem:
diff --git a/node_modules/node-binance-api/node-binance-api.js b/node_modules/node-binance-api/node-binance-api.js
index 6da6165..9b877a0 100644
--- a/node_modules/node-binance-api/node-binance-api.js
+++ b/node_modules/node-binance-api/node-binance-api.js
@@ -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 )
}
if ( !callback ) {
This issue body was partially generated by patch-package.
You forgot the save the return value in parameters
, therefore the order id is never appended in the query.
Tested this change on my local - works great! 🙏🏽
This worked for me, thanks :) Any ideas on when the fix will be applied in the official repository?
I found the same problem and the same solution. When it will be applied to the repo?