Skip to content

fix naming of trade history public command#114

Merged
s4w3d0ff merged 1 commit intos4w3d0ff:devfrom
cyzanfar:trade-hist-command
May 17, 2017
Merged

fix naming of trade history public command#114
s4w3d0ff merged 1 commit intos4w3d0ff:devfrom
cyzanfar:trade-hist-command

Conversation

@cyzanfar
Copy link
Copy Markdown
Contributor

returnTradeHistory duplicate command in public and private. Changed it to marketTradeHist as it is the method that returns the past trade history for a given market (Public command).

@s4w3d0ff
Copy link
Copy Markdown
Owner

This won't change anything, the PUBLIC_COMMANDS and PRIVATE_COMMANDS lists are all the possible commands that poloniex provides. marketTradeHist already has its own 'special' method to work around the duplicate names: https://github.com/s4w3d0ff/python-poloniex/blob/master/poloniex/__init__.py#L225

Changing the name in the PRIVATE_COMMANDS list will not change anything because that method doesn't use that list to determine what command to use.

The __call__ method (https://github.com/s4w3d0ff/python-poloniex/blob/master/poloniex/__init__.py#L137) uses the PUBLIC_COMMANDS and PRIVATE_COMMANDS lists to determine if the command is valid, and what api to use (public or private).

I could remove the command string from the PUBLIC_COMMANDS and 'Poloniex.marketTradeHist()' would still work.

@cyzanfar
Copy link
Copy Markdown
Contributor Author

It was more for clarifying the confusion. From my point of view, a user might be calling Poloniex. returnTradeHistory() thinking it's the public method when in reality its 'Poloniex.marketTradeHist().

I definitely think that should be clarified.

Thanks a lot for taking the time to respond 👍

@s4w3d0ff
Copy link
Copy Markdown
Owner

Unfortunately, the only problem with this workaround is that you can't access the public trade history using Poloniex('returnTradeHistory, args) (it defaults to the private version), you have to use Poloniex.marketTradeHist().

I'll try to remember to add a wiki page and update the docstrings to try and reduce confusion.

@cyzanfar
Copy link
Copy Markdown
Contributor Author

Awesome thanks a bunch 👍

@s4w3d0ff s4w3d0ff changed the base branch from master to dev May 17, 2017 19:39
@s4w3d0ff s4w3d0ff merged commit ae8ba19 into s4w3d0ff:dev May 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants