-
Notifications
You must be signed in to change notification settings - Fork 283
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
various cleanup #104
Merged
Merged
various cleanup #104
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
from .bittrex import * | ||
from .bittrex import * # noqa |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,10 +8,8 @@ | |
|
||
try: | ||
from urllib import urlencode | ||
from urlparse import urljoin | ||
except ImportError: | ||
from urllib.parse import urlencode | ||
from urllib.parse import urljoin | ||
|
||
try: | ||
from Crypto.Cipher import AES | ||
|
@@ -154,7 +152,7 @@ def _api_query(self, protection=None, path_dict=None, options=None): | |
|
||
return self.dispatch(request_url, apisign) | ||
|
||
except: | ||
except Exception: | ||
return { | ||
'success': False, | ||
'message': 'NO_API_RESPONSE', | ||
|
@@ -167,7 +165,7 @@ def get_markets(self): | |
at Bittrex along with other meta data. | ||
|
||
1.1 Endpoint: /public/getmarkets | ||
2.0 Endpoint: /pub/Markets/GetMarkets | ||
2.0 NO Equivalent | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am not so sure that these endpoints are permanently gone... but they are definitely broken now. If they come back we can re-enable this functionality. |
||
|
||
Example :: | ||
{'success': True, | ||
|
@@ -192,7 +190,6 @@ def get_markets(self): | |
""" | ||
return self._api_query(path_dict={ | ||
API_V1_1: '/public/getmarkets', | ||
API_V2_0: '/pub/Markets/GetMarkets' | ||
}, protection=PROTECTION_PUB) | ||
|
||
def get_currencies(self): | ||
|
@@ -295,7 +292,7 @@ def get_market_history(self, market): | |
|
||
Endpoint: | ||
1.1 /market/getmarkethistory | ||
2.0 /pub/Market/GetMarketHistory | ||
2.0 NO Equivalent | ||
|
||
Example :: | ||
{'success': True, | ||
|
@@ -318,7 +315,6 @@ def get_market_history(self, market): | |
""" | ||
return self._api_query(path_dict={ | ||
API_V1_1: '/public/getmarkethistory', | ||
API_V2_0: '/pub/Market/GetMarketHistory' | ||
}, options={'market': market, 'marketname': market}, protection=PROTECTION_PUB) | ||
|
||
def buy_limit(self, market, quantity, rate): | ||
|
@@ -514,18 +510,24 @@ def get_order_history(self, market=None): | |
|
||
Endpoint: | ||
1.1 /account/getorderhistory | ||
2.0 /key/orders/getorderhistory | ||
2.0 /key/orders/getorderhistory or /key/market/GetOrderHistory | ||
|
||
:param market: optional a string literal for the market (ie. BTC-LTC). | ||
If omitted, will return for all markets | ||
:type market: str | ||
:return: order history in JSON | ||
:rtype : dict | ||
""" | ||
return self._api_query(path_dict={ | ||
API_V1_1: '/account/getorderhistory', | ||
API_V2_0: '/key/orders/getorderhistory' | ||
}, options={'market': market, 'marketname': market} if market else None, protection=PROTECTION_PRV) | ||
if market: | ||
return self._api_query(path_dict={ | ||
API_V1_1: '/account/getorderhistory', | ||
API_V2_0: '/key/market/GetOrderHistory' | ||
}, options={'market': market, 'marketname': market}, protection=PROTECTION_PRV) | ||
else: | ||
return self._api_query(path_dict={ | ||
API_V1_1: '/account/getorderhistory', | ||
API_V2_0: '/key/orders/getorderhistory' | ||
}, protection=PROTECTION_PRV) | ||
|
||
def get_order(self, uuid): | ||
""" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does
from bittrex import Bittrex
not work? I thought the import in the__init__.py
would make it work. Seems like a nicer way to import versusfrom bittrex.bittrex import Bittrex