-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
user.get_trade_volume() says it supports multiple currencies as a list, but it does not seem to. #115
Comments
Note:
|
I'm not sure which version you use, but in v1.3.0 there is no problem when passing a list to the pair parameter, since this decorator ensures that all passed lists will be transformed into a string like "elem1,elem2,elem3", see kraken/spot/user/init.py#L766. I will check out why some functions are hidden in the documentation. Thanks for that note. |
I found out that the documentation for functions that use a custom decorator are missing, since decorators modify the signature of the underlaying function which will confuse the sphinx doc building tool. This will be fixed in #106. |
I am using 1.3.0 now, straight from this repo. Can you switch to 1.3.0 and try |
print(User("KEY", "SECRET").get_trade_volume(pair=["1INCHEUR"])) It results in (using v1.3.0): {
"currency": "ZUSD",
"volume": "654.3318",
"fees": {
"1INCHEUR": {
"fee": "0.2600",
"minfee": "0.1000",
"maxfee": "0.2600",
"nextfee": "0.2400",
"tiervolume": "0.0000",
"nextvolume": "50000.0000"
}
},
"fees_maker": {
"1INCHEUR": {
"fee": "0.1600",
"minfee": "0.0000",
"maxfee": "0.1600",
"nextfee": "0.1400",
"tiervolume": "0.0000",
"nextvolume": "50000.0000"
}
}
} |
Thank you for sharing that! Looks like that's another work-around. But here's the thing. Even keyword arguments can usually be used as positional arguments if you get them in the right order. Since |
If through some inspection thing, @ensure_string could accept just the name and it would look up the position, that would be even less work for the maintainers. But from a user perspective, having the desired behavior when the function is used either way is what matters. Thanks again for your great work on this library! It's just what I needed. |
I can understand if a solution like the one you propose is considered desirable. Python does allow regular arguments to be addressed both by position and by keyword. It may be my personal bias, but for compatibility and ease of refactoring, it is always best to use arguments by name. This way, for example, unwanted behavior can be avoided if the order of the arguments changes or new ones are added. Within the python-kraken-sdk, the names of the arguments are always specified as well - this does not mean, of course, that the users have to adapt this in their code, but when deviating from the given norm, individual solutions must be found. PEP 3102 introduces keyword-only arguments. This would be a consideration to avoid the behavior you found here. I will try that out. Thank you for your contribution! |
Ok, a couple issues here.
user.get_trade_volume()
says: the acceptable pair types include a list of strings:pair: Optional[Union[str, List[str]]] = None,
Yet, check out the following pdb session:
It seems like this is not supported yet.
I'm trying to get the trade_volume for all currency pairs at once so I do not have to use so many API requests (which affect my rate limit) to get them.
The text was updated successfully, but these errors were encountered: