Open tchit opened 4 years ago
Hi, alternative would be to update the packages.
1- Update dependencies package.json
"dependencies": { "node-binance-api": "^0.10.3", "node-telegram-bot-api": "^0.40.0", }
2-Update bitprophet.js
on line 11 remove const binance = require("node-binance-api")
on the start line 260 remove binance.options({ "APIKEY": vars.options.binance.key, "APISECRET": vars.options.binance.secret, useServerTime: true, reconnect: false })
and add binance = exchUtils.init()
3-Update exchange_utils.js
on line 2 remove const binance = require("node-binance-api")
and add const Binance = require("node-binance-api") const binance = new Binance()
add new method init: function() { binance.options({ "APIKEY": vars.options.binance.key, "APISECRET": vars.options.binance.secret, useServerTime: true, reconnect: false }) return binance }
it worked for me.
Thanks!
Thank you so much for helping! I tried those changes but I get this error: SyntaxError: Unexpected token 'const' I guess it's because I'm not a coder and I didn't update exchange_utils.js correctly to add the new method.. Would you mind sharing the file? Again, thanks a lot :)
sorry a detail was missing, follows the two points of changes.....
after that, you will have to add the margin methods
Thanks @asokimoto I can’t wait to try this. When you say « after that, you will have to add the margin methods you need », do you mean changing the commands in exchange_utils? Like binance.mgOrderstatus instead of binance.orderstatus? Or maybe using binance.websockets.userMarginData(margin_balance_update, margin_execution_update); ?
Sorry, I’m feeling so dumb right now, I feel like I really don’t have sufficient knowledge to even ask this kind of stuff on Github. I will understand if you find this annoying! Thanks for your help anyway :)
exactly, you will need to adapt the parameters in each method call. Need to know how the binance api works :(
See the difference between calls https://github.com/binance-exchange/binance-official-api-docs/blob/master/margin-api.md#margin-account-new-order-trade
Thanks @asokimoto I can’t wait to try this. When you say « after that, you will have to add the margin methods you need », do you mean changing the commands in exchange_utils? Like binance.mgOrderstatus instead of binance.orderstatus? Or maybe using binance.websockets.userMarginData(margin_balance_update, margin_execution_update); ?
Sorry, I’m feeling so dumb right now, I feel like I really don’t have sufficient knowledge to even ask this kind of stuff on Github. I will understand if you find this annoying! Thanks for your help anyway :)
hey @tchit did you manage this or found another solution for margin trade? share please thanks a lot
Hi,
I'd like to add support to Binance Margin accounts only to get notified of trades, but I'm not sure what I have to change. This has been implemented in node-binance-api: https://github.com/jaggedsoft/node-binance-api/blob/master/README.md
Thanks!