I am using the websockets API of Bittrex.
I have no problem getting the market summaries.
Also, invoking the hub method "SubscribeToExchangeDeltas", gets me the requested exchange deltas.
However, when I try to invoke the hub method "QueryExchangeState" to get the order history of some market, nothing happens, I don't even get an error so the method apparently has been called.
Does anyone know more about this, have experience with this, or gets this to work? Please let me know!
The code below is what I am using. It gives me the summary updates and the exchange deltas for 'ETC-MEME'.
But how to get the order history for specific markets ('ETC-MEME' in this example)?
import pprint
from requests import Session # pip install requests
from signalr import Connection # pip install signalr-client
def handle_received(*args, **kwargs):
print('\nreceived')
print('\nargs:')
pprint.pprint(args)
print('\nkwargs:')
pprint.pprint(kwargs)
def print_error(error):
print('error: ', error)
def main():
with Session() as session:
connection = Connection("https://www.bittrex.com/signalR/", session)
chat = connection.register_hub('corehub')
connection.start()
# Handle any pushed data from the socket
connection.received += handle_received
connection.error += print_error
for market in ["BTC-MEME"]:
chat.server.invoke('SubscribeToExchangeDeltas', market)
chat.server.invoke('QueryExchangeState', market)
pass
while True:
connection.wait(1)
if __name__ == "__main__":
main()