n0mad01 / node.bittrex.api

No longer maintained
MIT License
183 stars 187 forks source link

Any way to monitor orders? #34

Open rebers opened 7 years ago

rebers commented 7 years ago

Hi there,

Love this library, really makes stuff straight forward.

Is there any way to retrieve or get notified when an order of mine was filled?

Can't find anything anywhere!

Thanks

dparlevliet commented 7 years ago

getopenorders({ market: code }, (response, err) => { }); getorderhistory({ market: code }, (response, err) => { });

documentation https://bittrex.com/Home/Api

rebers commented 7 years ago

Thanks @dparlevliet but that would mean I have to query them manually, right? Does that mean the websocket API does not support it?

dparlevliet commented 7 years ago

Correct, the Bittrex API is still new and they do not yet support Authentication via the Websockets in-order to receive events, but they are working on it. So, for now you will have to query it. Personally, I query every 15s.

rebers commented 7 years ago

One more question here: The Bittrex API docs say the market is optional. But not providing it always provides null, while e.g. BTC-ETH works. I can only assume this is a bug or am I doing something wrong?

The below examples all return null.

bittrex.getorderhistory(null, (data) => {
  console.log(data);
});

bittrex.getorderhistory({ market: null }, (data) => {
  console.log(data);
});

bittrex.getorderhistory({ market: '' }, (data) => {
  console.log(data);
});

This one works:

bittrex.getorderhistory({ market: 'BTC-ETH' }, (data) => {
  console.log(data);
});

Manually requesting the API works as expected though.

DWboutin commented 7 years ago

All of the above return null for me

dparlevliet commented 7 years ago

The params you send to getorderhistory() are passed directly to Bittrex without intervention from the library so if you want to have no market then you would need to do

bittrex.getorderhistory({}, (data) => {
  console.log(data);
});

The only one I see the ability to compensate for is

bittrex.getorderhistory(null, (data) => {
  console.log(data);
});

The library could provide {} as a default param if null/false/undefined is passed as a parameter. The other two examples are legitimate URL requests.

mirrorps commented 6 years ago

Hi,

I've managed to put buy limit order from API, but It's not listed together with the other orders in the account. How can I see orders made trough API?

Note: Using getorderhistory API the order is not listed again, but using the getorder API the order is returned.

skyl commented 6 years ago

Have you guys figured out GetOrderHistory in v2.0?

denigada commented 6 years ago

@skyl https://github.com/thebotguys/golang-bittrex-api/wiki/Bittrex-API-Reference-(Unofficial)