trd-utils 0.0.42__py3-none-any.whl → 0.0.43__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of trd-utils might be problematic. Click here for more details.

trd_utils/__init__.py CHANGED
@@ -1,3 +1,3 @@
1
1
 
2
- __version__ = "0.0.42"
2
+ __version__ = "0.0.43"
3
3
 
@@ -1,3 +1,4 @@
1
+ from decimal import Decimal
1
2
  import json
2
3
  import logging
3
4
  import time
@@ -169,6 +170,8 @@ class OkxClient(ExchangeBase):
169
170
  async def get_unified_trader_positions(
170
171
  self,
171
172
  uid: int | str,
173
+ no_warn: bool = False,
174
+ min_margin: Decimal = 0,
172
175
  ) -> UnifiedTraderPositions:
173
176
  result = await self.get_trader_positions(
174
177
  uid=uid,
@@ -176,6 +179,8 @@ class OkxClient(ExchangeBase):
176
179
  unified_result = UnifiedTraderPositions()
177
180
  unified_result.positions = []
178
181
  for position in result.data[0].pos_data:
182
+ if min_margin and (not position.margin or position.margin < min_margin):
183
+ continue
179
184
  unified_pos = UnifiedPositionInfo()
180
185
  unified_pos.position_id = position.pos_id
181
186
  unified_pos.position_pnl = round(position.realized_pnl, 3)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: trd_utils
3
- Version: 0.0.42
3
+ Version: 0.0.43
4
4
  Summary: Common Basic Utils for Python3. By ALiwoto.
5
5
  Keywords: utils,trd_utils,basic-utils,common-utils
6
6
  Author: ALiwoto
@@ -1,4 +1,4 @@
1
- trd_utils/__init__.py,sha256=FTqI9urUdadYKumV6MlrQz3u1hDU-E2PPZzSEvKr-Wg,25
1
+ trd_utils/__init__.py,sha256=YC89Mx1v3gz-7VhKQu7nPtcr3B3Ib7hi9gT_vVHu4gw,25
2
2
  trd_utils/cipher/__init__.py,sha256=V05KNuzQwCic-ihMVHlC8sENaJGc3I8MCb4pg4849X8,1765
3
3
  trd_utils/common_utils/float_utils.py,sha256=aYPwJ005LmrRhXAngojwvdDdtRgeb1FfR6hKeQ5ndMU,470
4
4
  trd_utils/common_utils/wallet_utils.py,sha256=OX9q2fymP0VfIWTRIRBP8W33cfyjLXimxMgPOsZe-3g,727
@@ -21,7 +21,7 @@ trd_utils/exchanges/hyperliquid/__init__.py,sha256=QhwGRcneGFHREM-MMdYpbcx-aWdsW
21
21
  trd_utils/exchanges/hyperliquid/hyperliquid_client.py,sha256=J1NjslRkyuAiqg9xvD8Mn7n0qxHtzDWibYU-mYgeG2s,7270
22
22
  trd_utils/exchanges/hyperliquid/hyperliquid_types.py,sha256=MiGG5fRU7wHqOMtCzQXD1fwwbeUK1HEcQwW5rl-9D4c,2678
23
23
  trd_utils/exchanges/okx/__init__.py,sha256=OjVpvcwB9mrCTofLt14JRHV2-fMAzGz9-YkJAMwl6dM,67
24
- trd_utils/exchanges/okx/okx_client.py,sha256=3gvpF0xAGNNpYGfMeOy81yo8O2Eo-CM1BUqMibKkga8,7238
24
+ trd_utils/exchanges/okx/okx_client.py,sha256=13RZzBbosc0M_VYIRlOneCrWI8xzg3n_a6_MvZRNuqo,7440
25
25
  trd_utils/exchanges/okx/okx_types.py,sha256=IkFOfgivcvvIw950jyGHAVfFFGbGqfZcYGfZLWfNLvc,5013
26
26
  trd_utils/exchanges/price_fetcher.py,sha256=YHLkM6sCvHGFS_4t188Sl3DczqrarK-1ivGwZEVsom4,1320
27
27
  trd_utils/html_utils/__init__.py,sha256=1WWs8C7JszRjTkmzIRLHpxWECHur_DrulTPGIeX88oM,426
@@ -35,7 +35,7 @@ trd_utils/types_helper/decorators.py,sha256=ziQGDKV0RnhMG6gBPAz244Ug3j6ayr0iKXeu
35
35
  trd_utils/types_helper/model_config.py,sha256=uvyhdGHQZ1A_I5RUbCgzlDk6MxWL6RLV8r0cdVi6nBk,60
36
36
  trd_utils/types_helper/ultra_list.py,sha256=01WQSkx0G7lD9O9XcXccexniNwyuQ9LwVOeixxr4tWQ,1178
37
37
  trd_utils/types_helper/utils.py,sha256=Xq4SZG4NkkGzJyOBs9huAvzl2YcCZ7ZRjfOHol3o-Kc,569
38
- trd_utils-0.0.42.dist-info/LICENSE,sha256=J1EP2xt87RjjmsTV1jTjHDQMLIM9FjdwEftTpw8hyv4,1067
39
- trd_utils-0.0.42.dist-info/METADATA,sha256=MdFK7xoEWa1ft1BpEwzRkyGrJNiyb-6Aw4lvYkiRzoQ,1179
40
- trd_utils-0.0.42.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
41
- trd_utils-0.0.42.dist-info/RECORD,,
38
+ trd_utils-0.0.43.dist-info/LICENSE,sha256=J1EP2xt87RjjmsTV1jTjHDQMLIM9FjdwEftTpw8hyv4,1067
39
+ trd_utils-0.0.43.dist-info/METADATA,sha256=6Ub6sEAtTQ1Cg0fDS1wX88w3uQtE6rUDi4JH60wtgH8,1179
40
+ trd_utils-0.0.43.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
41
+ trd_utils-0.0.43.dist-info/RECORD,,