Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Installation
### for most recent stable release
`pip install python-bittrex-aio`

### for bleeding edge development
### for bleeding edge development
`pip install git+https://github.com/BlockHub/python-bittrex-aio.git`

API Documentation
Expand All @@ -29,10 +29,10 @@ Example Usage for Bittrex API
-------------

```python
from aiobittrex.bittrex import Bittrex, API_V2_0
from aiobittrex.bittrex import Bittrex, API_V1_1
import asyncio

my_bittrex = Bittrex(None, None, api_version=API_V2_0) # or defaulting to v1.1 as Bittrex(None, None)
my_bittrex = Bittrex(None, None, api_version=API_V1_1) # or defaulting to v1.1 as Bittrex(None, None)
tasks = [my_bittrex.get_markets()]

loop = asyncio.get_event_loop()
Expand All @@ -47,10 +47,10 @@ This call to get_markets returns an object such as the following:

API_V2_0 and API_V1_1 are constants that can be imported from Bittrex.

To access account methods, an API key for your account is required and can be
generated on the `Settings` then `API Keys` page.
Make sure you save the secret, as it will not be visible
after navigating away from the page.
To access account methods, an API key for your account is required and can be
generated on the `Settings` then `API Keys` page.
Make sure you save the secret, as it will not be visible
after navigating away from the page.

```python
from aiobittrex.bittrex import *
Expand All @@ -68,9 +68,9 @@ res = loop.run_until_complete(asyncio.gather(*tasks))[0]
This call to get_balance returns an object such as the following:

```python
{'success': True,
{'success': True,
'message': '',
'result': {'Currency': 'ETH', 'Balance': 0.0, 'Available': 0.0,
'result': {'Currency': 'ETH', 'Balance': 0.0, 'Available': 0.0,
'Pending': 0.0, 'CryptoAddress': None}
}
```
Expand Down
10 changes: 5 additions & 5 deletions aiobittrex/bittrex.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,11 @@ def __init__(self, api_key, api_secret, calls_per_second=1, api_version=API_V1_1
self.call_rate = 1.0 / calls_per_second
self.last_call = None
self.api_version = api_version
self.session = aiohttp.ClientSession()
self._session = aiohttp.ClientSession()

async def dispatch(self, url, apisign):
async with async_timeout.timeout(10):
async with self.session.get(url, headers={"apisign": apisign}) as response:
async def _dispatch(self, url, apisign):
with async_timeout.timeout(10):
async with self._session.get(url, headers={"apisign": apisign}) as response:
return await response.json()

def decrypt(self):
Expand Down Expand Up @@ -147,7 +147,7 @@ async def _api_query(self, protection=None, path_dict=None, options=None):
request_url.encode(),
hashlib.sha512).hexdigest()

return await self.dispatch(request_url, apisign)
return await self._dispatch(request_url, apisign)

except Exception as e:
return {
Expand Down