n0mad01 / node.bittrex.api

No longer maintained
MIT License
183 stars 187 forks source link

getting openOrders without params returns error #62

Closed mchl18 closed 7 years ago

mchl18 commented 7 years ago

Hello,

my understanding was that getopenorders would return all open orders if not given a param. However, when I call it with a market pair like 'BTC-LTC' I get my open orders for that pair. When I call it without a param it crashes with the following error:

requested from https://bittrex.com/api/v1.1/market/getopenorders?apikey=...&nonce=1503957130 in: 0.236s
/.../node_modules/node.bittrex.api/node.bittrex.api.js:135
              callback(((opts.cleartext) ? body : result), null));
              ^

TypeError: callback is not a function
    at Request._callback (/...node_modules/node.bittrex.api/node.bittrex.api.js:135:15)
    at Request.self.callback (/.../node_modules/request/request.js:188:22)
    at emitTwo (events.js:125:13)
    at Request.emit (events.js:213:7)
    at Request.<anonymous> (/.../node_modules/request/request.js:1171:10)
    at emitOne (events.js:115:13)
    at Request.emit (events.js:210:7)
    at IncomingMessage.<anonymous> (/.../node_modules/request/request.js:1091:12)
    at Object.onceWrapper (events.js:314:30)
    at emitNone (events.js:110:20)

I can catch it by wrapping the return in a try/catch but I can't seem to get all my open orders back. Am I missing anything?

n0mad01 commented 7 years ago

sure, but you still have to pass the options param first (even if it's void) and the callback second.

bittrex.getopenorders( {}, function( data, err ) {});
mchl18 commented 7 years ago

wow, really sorry for this question, please close it :D thanks a lot (still kinda new to node)

mchl18 commented 7 years ago

But you helped me build my own bittrex app, thanks for that :)

n0mad01 commented 7 years ago

np ;)