trd-utils 0.0.44__py3-none-any.whl → 0.0.46__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.44"
2
+ __version__ = "0.0.46"
3
3
 
@@ -323,7 +323,6 @@ class BlofinClient(ExchangeBase):
323
323
  async def get_unified_trader_positions(
324
324
  self,
325
325
  uid: int | str,
326
- no_warn: bool = False,
327
326
  min_margin: Decimal = 0,
328
327
  ) -> UnifiedTraderPositions:
329
328
  result = await self.get_copy_trader_all_order_list(
@@ -77,8 +77,6 @@ logger = logging.getLogger(__name__)
77
77
  # specific to the current session that is fetching them,
78
78
  user_api_identity_cache: dict[int, int] = {}
79
79
 
80
- __positions_hidden_warn_map: dict[str, bool] = {}
81
-
82
80
 
83
81
  class BXUltraClient(ExchangeBase, IPriceFetcher):
84
82
  ###########################################################
@@ -921,9 +919,9 @@ class BXUltraClient(ExchangeBase, IPriceFetcher):
921
919
  self,
922
920
  uid: int | str,
923
921
  api_identity: int | str | None = None,
924
- no_warn: bool = False,
925
922
  min_margin: Decimal = 0,
926
923
  ) -> UnifiedTraderPositions:
924
+ global _positions_hidden_warn_map
927
925
  perp_positions = []
928
926
  std_positions = []
929
927
  perp_ex: str = None
@@ -940,13 +938,6 @@ class BXUltraClient(ExchangeBase, IPriceFetcher):
940
938
  err_str = f"{ex}"
941
939
  if err_str.find("as the client has been closed") != -1:
942
940
  raise ex
943
-
944
- if not no_warn:
945
- if err_str.find("positions hidden") != -1:
946
- warn_key = f"perp_{uid}"
947
- if not __positions_hidden_warn_map.get(warn_key, False):
948
- __positions_hidden_warn_map[warn_key] = True
949
- logger.warning(f"Failed to fetch perp positions of {uid}: {ex}")
950
941
  perp_ex = ex
951
942
 
952
943
  try:
@@ -959,13 +950,6 @@ class BXUltraClient(ExchangeBase, IPriceFetcher):
959
950
  err_str = f"{ex}"
960
951
  if err_str.find("as the client has been closed") != -1:
961
952
  raise ex
962
-
963
- if not no_warn:
964
- if err_str.find("positions hidden") != -1:
965
- warn_key = f"std_{uid}"
966
- if not __positions_hidden_warn_map.get(warn_key, False):
967
- __positions_hidden_warn_map[warn_key] = True
968
- logger.warning(f"Failed to fetch std positions of {uid}: {ex}")
969
953
  std_ex = ex
970
954
 
971
955
  if not perp_positions and not std_positions:
@@ -84,7 +84,6 @@ class ExchangeBase(ABC):
84
84
  async def get_unified_trader_positions(
85
85
  self,
86
86
  uid: int | str,
87
- no_warn: bool = False,
88
87
  min_margin: Decimal = 0,
89
88
  ) -> UnifiedTraderPositions:
90
89
  """
@@ -156,7 +156,6 @@ class HyperLiquidClient(ExchangeBase):
156
156
  async def get_unified_trader_positions(
157
157
  self,
158
158
  uid: int | str,
159
- no_warn: bool = False,
160
159
  min_margin: Decimal = 0,
161
160
  ) -> UnifiedTraderPositions:
162
161
  result = await self.get_trader_positions_info(
@@ -170,7 +170,6 @@ class OkxClient(ExchangeBase):
170
170
  async def get_unified_trader_positions(
171
171
  self,
172
172
  uid: int | str,
173
- no_warn: bool = False,
174
173
  min_margin: Decimal = 0,
175
174
  ) -> UnifiedTraderPositions:
176
175
  result = await self.get_trader_positions(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: trd_utils
3
- Version: 0.0.44
3
+ Version: 0.0.46
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=tbiVO2iKTOuxM7n8BiQ6erJJoUjaUk2uF19lQjsONoQ,25
1
+ trd_utils/__init__.py,sha256=wLcWARA4_ZeM1KZ-X6E-axb1IuqweiU-ZE_9aEEk83k,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
@@ -8,20 +8,20 @@ trd_utils/exchanges/README.md,sha256=8egE4IPUQ3_UtiGP6GaCg50xq_dp43aGY_X1lKcO6ok
8
8
  trd_utils/exchanges/__init__.py,sha256=sZRyp24q0KyMYASshAfsP-AfvsCADTYqqefxiRulPKE,484
9
9
  trd_utils/exchanges/base_types.py,sha256=MVZvmxmYWgYh4URGVYaalNgY57l0VJX1GC8U18tB0rE,4964
10
10
  trd_utils/exchanges/blofin/__init__.py,sha256=X4r9o4Nyjla4UeOBG8lrgtnGYO2aErFMKaJ7yQrFasE,76
11
- trd_utils/exchanges/blofin/blofin_client.py,sha256=JVimaxGHRVviQHZbPY1gek8ICPl8-yS2AM-PRMa4_RA,13322
11
+ trd_utils/exchanges/blofin/blofin_client.py,sha256=Htxu_e82GVCSE0Z43FatYKIE8DU22-MS--m1LPz75_o,13291
12
12
  trd_utils/exchanges/blofin/blofin_types.py,sha256=bQx0opCgHwcuC-5TxiVA4VQr17A1x7u7QIMdcIrROAg,4315
13
13
  trd_utils/exchanges/bx_ultra/__init__.py,sha256=8Ssy-eOemQR32Nv1-FoPHm87nRqRO4Fm2PU5GHEFKfQ,80
14
14
  trd_utils/exchanges/bx_ultra/bx_types.py,sha256=7Ga6IYHQNRDbhWXmS1J0NxpcR9HUJ8ZwQGh-1EvNRqM,36687
15
- trd_utils/exchanges/bx_ultra/bx_ultra_client.py,sha256=iYePP32gSAnBuFWAyr5f_MkE4i8zPMNTsIdBom8iGVs,41534
15
+ trd_utils/exchanges/bx_ultra/bx_ultra_client.py,sha256=0aYgIhuVNKc9AlvQeRDifW88lgsPzkHw5hZdTVdWtXs,40764
16
16
  trd_utils/exchanges/bx_ultra/bx_utils.py,sha256=PwapomwDW33arVmKIDj6cL-aP0ptu4BYy_lOCqSAPOo,1392
17
17
  trd_utils/exchanges/errors.py,sha256=P_NTuc389XL7rFegomP59BydWmHv8ckiGyNU-_l5qNQ,167
18
- trd_utils/exchanges/exchange_base.py,sha256=eAORzCci78b2-IrslkQnMIbzVJGb6YYzNzniCUHG-jg,7891
18
+ trd_utils/exchanges/exchange_base.py,sha256=cdLoeiIe3FdqQZNyGBcUda_W4rBmWmt9BUYPgxWbuwU,7860
19
19
  trd_utils/exchanges/hyperliquid/README.md,sha256=-qaxmDt_9NTus2xRuzyFGkKgYDWgWk7ufHVTSkyn3t4,105
20
20
  trd_utils/exchanges/hyperliquid/__init__.py,sha256=QhwGRcneGFHREM-MMdYpbcx-aWdsWsu2WznHzx7LaUM,92
21
- trd_utils/exchanges/hyperliquid/hyperliquid_client.py,sha256=J1NjslRkyuAiqg9xvD8Mn7n0qxHtzDWibYU-mYgeG2s,7270
21
+ trd_utils/exchanges/hyperliquid/hyperliquid_client.py,sha256=rc1TPtyMo9K1udISVwfWGN51Di783QbNiAFcPBmgpcY,7239
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=13RZzBbosc0M_VYIRlOneCrWI8xzg3n_a6_MvZRNuqo,7440
24
+ trd_utils/exchanges/okx/okx_client.py,sha256=P_DnIBk0086XJSXuSNDRc6woayiJmPEC5avbgDZsFt4,7409
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.44.dist-info/LICENSE,sha256=J1EP2xt87RjjmsTV1jTjHDQMLIM9FjdwEftTpw8hyv4,1067
39
- trd_utils-0.0.44.dist-info/METADATA,sha256=_wauWPTsKhQ-QX8rSbCP9FRRxWFCoYnU7L8dETQSEQ4,1179
40
- trd_utils-0.0.44.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
41
- trd_utils-0.0.44.dist-info/RECORD,,
38
+ trd_utils-0.0.46.dist-info/LICENSE,sha256=J1EP2xt87RjjmsTV1jTjHDQMLIM9FjdwEftTpw8hyv4,1067
39
+ trd_utils-0.0.46.dist-info/METADATA,sha256=TOK9FOBw1qYtyRKUTH3lOJsa2ZqpmQVm_hDDRTE4iEI,1179
40
+ trd_utils-0.0.46.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
41
+ trd_utils-0.0.46.dist-info/RECORD,,