Skip to content

Commit

Permalink
2.1.13
Browse files Browse the repository at this point in the history
  • Loading branch information
DogsTailFarmer committed Jun 26, 2024
1 parent 38017da commit f1e1ee5
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 25 deletions.
11 changes: 9 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## 2.1.13 2024-06-26
### Fix
* `HTX`: WSS missed account change event

### Update
* Dependency

## 2.1.12 2024-04-30
### Fix
* `Docker`: [#49 ImportError: cannot import name 'version' from 'exchanges_wrapper'](https://github.com/DogsTailFarmer/exchanges-wrapper/issues/49#issue-2272432093)
Expand Down Expand Up @@ -31,14 +38,14 @@

## 2.1.6 2024-03-29
### Fix
* Bybit: `on_balance_update`: missed event during transfer from API
* `Bybit`: `on_balance_update`: missed event during transfer from API

### Update
* Dependency: Up requirements for crypto-ws-api==2.0.8

## 2.1.5 2024-03-25
### Fix
* Bybit: `on_balance_update`: duplication during transfer from web-interface
* `Bybit`: `on_balance_update`: duplication during transfer from web-interface
* Some exception handling

### Update
Expand Down
2 changes: 1 addition & 1 deletion exchanges_wrapper/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
__contact__ = "https://github.com/DogsTailFarmer"
__email__ = "[email protected]"
__credits__ = ["https://github.com/DanyaSWorlD"]
__version__ = "2.1.12"
__version__ = "2.1.13"

from pathlib import Path
import shutil
Expand Down
31 changes: 15 additions & 16 deletions exchanges_wrapper/web_sockets.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,23 +408,22 @@ async def start_wss(self):

async def _handle_event(self, msg_data, *args):
content = None
_ch = msg_data['ch']
_data = msg_data.get('data')
if _data.get('symbol') == self.symbol.lower():
if msg_data['ch'] == 'accounts.update#2':
content = hbp.on_funds_update(_data)
elif (msg_data['ch'] == f"orders#{self.symbol.lower()}"
and _data['eventType'] in ('creation', 'cancellation')):
order_id = _data['orderId']
self.client.active_order(order_id, quantity=_data['orderSize'])
if _data.get('eventType') == 'cancellation':
self.client.active_orders[order_id]['cancelled'] = True
elif msg_data['ch'] == f"trade.clearing#{self.symbol.lower()}#0":
order_id = _data['orderId']
self.client.active_order(order_id, last_event=_data)
if _data['tradeId'] not in self.client.active_orders[order_id]["eventIds"]:
self.client.active_orders[order_id]["eventIds"].append(_data['tradeId'])
self.client.active_orders[order_id]['executedQty'] += Decimal(_data['tradeVolume'])
content = hbp.on_order_update(self.client.active_orders[order_id])
if _ch == 'accounts.update#2' and _data.get('currency') in self.symbol.lower():
content = hbp.on_funds_update(_data)
elif _ch == f"orders#{self.symbol.lower()}" and _data['eventType'] in ('creation', 'cancellation'):
order_id = _data['orderId']
self.client.active_order(order_id, quantity=_data['orderSize'])
if _data.get('eventType') == 'cancellation':
self.client.active_orders[order_id]['cancelled'] = True
elif _ch == f"trade.clearing#{self.symbol.lower()}#0":
order_id = _data['orderId']
self.client.active_order(order_id, last_event=_data)
if _data['tradeId'] not in self.client.active_orders[order_id]["eventIds"]:
self.client.active_orders[order_id]["eventIds"].append(_data['tradeId'])
self.client.active_orders[order_id]['executedQty'] += Decimal(_data['tradeVolume'])
content = hbp.on_order_update(self.client.active_orders[order_id])

if content:
logger.debug(f"HTXPrivateEvents.content: {content}")
Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ dynamic = ["version", "description"]
requires-python = ">=3.9"

dependencies = [
"crypto-ws-api==2.0.11",
"crypto-ws-api==2.0.12",
"grpcio==1.62.0",
"pyotp~=2.9.0",
"simplejson==3.19.2",
"aiohttp==3.9.3",
"aiohttp==3.9.5",
"Pympler~=1.0.1",
"websockets~=12.0",
"expiringdict~=1.2.2",
"ujson~=5.9.0",
"ujson~=5.10.0",
"betterproto==2.0.0b6",
"grpclib~=0.4.7"
]
Expand Down
6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
crypto-ws-api==2.0.11
crypto-ws-api==2.0.12
pyotp==2.9.0
simplejson==3.19.2
toml~=0.10.2
aiohttp~=3.9.0
aiohttp~=3.9.5
Pympler~=1.0.1
websockets==12.0
expiringdict~=1.2.2
ujson~=5.9.0
ujson~=5.10.0
betterproto==2.0.0b6
grpclib~=0.4.7

0 comments on commit f1e1ee5

Please sign in to comment.