n0mad01 / node.bittrex.api

No longer maintained
MIT License
183 stars 187 forks source link

TypeError: callback is not a function #41

Closed treidio closed 7 years ago

treidio commented 7 years ago
   account.bittrex.buylimit( {market:currencyPair, quantity: account.staking/values.wa5min , rate : values.wa5min * 1.02}, (res, err) => {
            if (err) {
                    console.log(err);
            } else if (res) {
                   console.log(res);

occasionally yields

/home/ubuntu/node_modules/node.bittrex.api/node.bittrex.api.js:131 Aug 13 09:56:47 ip-172-31-40-182 bot_USDT-NEO[972]: callback(null, result)); Aug 13 09:56:47 ip-172-31-40-182 bot_USDT-NEO[972]: ^ Aug 13 09:56:47 ip-172-31-40-182 bot_USDT-NEO[972]: TypeError: callback is not a function Aug 13 09:56:47 ip-172-31-40-182 bot_USDT-NEO[972]: at Request._callback (/home/ubuntu/node_modules/node.bittrex.api/node.bittrex.api.js:131:17) Aug 13 09:56:47 ip-172-31-40-182 bot_USDT-NEO[972]: at Request.self.callback (/home/ubuntu/node_modules/request/request.js:188:22) Aug 13 09:56:47 ip-172-31-40-182 bot_USDT-NEO[972]: at emitTwo (events.js:87:13) Aug 13 09:56:47 ip-172-31-40-182 bot_USDT-NEO[972]: at Request.emit (events.js:172:7) Aug 13 09:56:47 ip-172-31-40-182 bot_USDT-NEO[972]: at Request. (/home/ubuntu/node_modules/request/request.js:1171:10) Aug 13 09:56:47 ip-172-31-40-182 bot_USDT-NEO[972]: at emitOne (events.js:77:13) Aug 13 09:56:47 ip-172-31-40-182 bot_USDT-NEO[972]: at Request.emit (events.js:169:7) Aug 13 09:56:47 ip-172-31-40-182 bot_USDT-NEO[972]: at IncomingMessage. (/home/ubuntu/node_modules/request/request.js:1091:12) Aug 13 09:56:47 ip-172-31-40-182 bot_USDT-NEO[972]: at IncomingMessage.g (events.js:260:16) Aug 13 09:56:47 ip-172-31-40-182 bot_USDT-NEO[972]: at emitNone (events.js:72:20)

this results in my code not acknowledging a buy order

best regards :)

n0mad01 commented 7 years ago

this looks as if the arrow callback function is somehow not handed over correctly or the function itself is not properly assembled before it's handed over.

can you check which type the function is (typeof) before the call and also what type you get back (in case of the incorrect ones)?

treidio commented 7 years ago

I think I found it.

    if (account.sellOrderNo != 0){
            account.bittrex.cancel({uuid : account.sellOrderNo});
            account.sellOrderNo = 0;
    };

/home/ubuntu/node_modules/node.bittrex.api/node.bittrex.api.js:131 callback(null, result)); ^ TypeError: callback is not a function

but there is no callback. so thats true..

On Sun, Aug 13, 2017 at 11:17 AM, Adrian Soluch notifications@github.com wrote:

this looks as if the arrow callback function is somehow not handed over correctly or the function itself is not properly assembled before it's handed over.

can you check which type the function is (typeof) before the call and also what type you get back (in case of the incorrect ones)?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/n0mad01/node.bittrex.api/issues/41#issuecomment-322035940, or mute the thread https://github.com/notifications/unsubscribe-auth/ASqmogdgUkUcxJBR8fETxEtRVb1wCyFxks5sXtszgaJpZM4O1p6j .

n0mad01 commented 7 years ago

could you solve that for you? can you share your solution (and some insights why this happened in the first place)?

treidio commented 7 years ago

I just added an empty function to the call..

On Sat, Aug 19, 2017 at 10:58 AM, Adrian Soluch notifications@github.com wrote:

could you solve that for you? can you share your solution?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/n0mad01/node.bittrex.api/issues/41#issuecomment-323516317, or mute the thread https://github.com/notifications/unsubscribe-auth/ASqmovzJhgwXKFwX5ngIowPLghkZS0VOks5sZr_VgaJpZM4O1p6j .

n0mad01 commented 7 years ago

ok, thanks