Skip to content
This repository has been archived by the owner on Jul 20, 2020. It is now read-only.

Auth handler #28

Closed
alexeykarnachev opened this issue Aug 23, 2017 · 6 comments
Closed

Auth handler #28

alexeykarnachev opened this issue Aug 23, 2017 · 6 comments
Assignees

Comments

@alexeykarnachev
Copy link
Contributor

Hi
It looks like QueueProcessor has no auth handler, is it so? And does it mean, that currently I can not obtain auth data: my open orders, wallet and so on?

@deepbrook
Copy link
Collaborator

Not quite - the handler for data which is received after authenticating is handled by the _handle_account() method, but this was indeed not yet called in the main routine of the queue processor. I've added it now - however, I cannot currently test it, since Im on vacation.
Perhaps you could confirm it does ?

@deepbrook deepbrook self-assigned this Aug 24, 2017
@alexeykarnachev
Copy link
Contributor Author

alexeykarnachev commented Aug 24, 2017

Yes, sure I can test it.
How can I achieve this? Should you commit version with _handle_account() in main queue processor routine and then I'll test it? Or should I add this handling by myself?

UPD:
Oh, okay now I see the commit. I'll check it, thank you

@alexeykarnachev
Copy link
Contributor Author

Ok, what I've realized at this moment:

_handle_account(self, dtype, data, ts) method has dtype argument, but in main queue processor routine it is called only with two arguments. dtype actually is not using now, so for my debug purposes I just removed this argument from method

some channels need to be added into self.account_channel_names dict.
For example, when I want to receive my new orders ('on' channel which is not presented yet in account_channel_names) I faced with this Exception
{KeyError}: 'on'
at self.account_channel_names[data[0]] (270 line in queue_processor.py)

If I understood your code and idea correctly, new account_channel_name should be added, for example:
self.account_channel_names = {....
'on': 'Order New'}
and then new property should be added to the client:
@Property
def new_orders(self):
"""
:return: Queue()
"""
return self.queue_processor.account['Order New']

something like this. Am I right?

@deepbrook
Copy link
Collaborator

Yes, that's spot on.
And removing the dtype parameter is the way to go - it's not needed, and thus should have been removed by me anyway.
Don't forget to submit a pull request if you've managed to fix it!
Appreciate the help!

@alexeykarnachev
Copy link
Contributor Author

alexeykarnachev commented Aug 25, 2017

Hi
Just tried to do a pull request in dev branch, but it's failed with error code 403:

Push failed: unable to access 'https://github.com/nlsdfnbch/btfxwss.git/': The requested URL returned error: 403

I'm trying to do it within Pycharm. What am I doing wrong?

UPD:
Oh, okay, it needs to be forked first.

@jcranney
Copy link

pull request #30 seems to have fixed it. Cheers @alexeykarnachev

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants