trd-utils 0.0.38__py3-none-any.whl → 0.0.40__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.38"
2
+ __version__ = "0.0.40"
3
3
 
@@ -922,6 +922,9 @@ class BXUltraClient(ExchangeBase, IPriceFetcher):
922
922
  ) -> UnifiedTraderPositions:
923
923
  perp_positions = []
924
924
  std_positions = []
925
+ perp_ex: str = None
926
+ std_ex: str = None
927
+
925
928
  try:
926
929
  result = await self.get_unified_trader_positions_perp(
927
930
  uid=uid,
@@ -930,7 +933,7 @@ class BXUltraClient(ExchangeBase, IPriceFetcher):
930
933
  perp_positions = result.positions
931
934
  except Exception as ex:
932
935
  if not no_warn:
933
- logger.warning(f"Failed to fetch perp positions of {uid}: {ex}")
936
+ perp_ex = f"{ex}"
934
937
 
935
938
  try:
936
939
  result = await self.get_unified_trader_positions_std(
@@ -939,7 +942,13 @@ class BXUltraClient(ExchangeBase, IPriceFetcher):
939
942
  std_positions = result.positions
940
943
  except Exception as ex:
941
944
  if not no_warn:
942
- logger.warning(f"Failed to fetch std positions of {uid}: {ex}")
945
+ std_ex = f"{ex}"
946
+
947
+ if not perp_positions and not std_positions:
948
+ if perp_ex:
949
+ logger.warning(f"Failed to fetch perp positions of {uid}: {perp_ex}")
950
+ if std_ex:
951
+ logger.warning(f"Failed to fetch std positions of {uid}: {std_ex}")
943
952
 
944
953
  unified_result = UnifiedTraderPositions()
945
954
  unified_result.positions = perp_positions + std_positions
@@ -1054,7 +1063,7 @@ class BXUltraClient(ExchangeBase, IPriceFetcher):
1054
1063
 
1055
1064
  unified_result.positions.append(unified_pos)
1056
1065
 
1057
- if result.data.total_str.find("+") == -1:
1066
+ if not result.data.total_str or result.data.total_str.find("+") == -1:
1058
1067
  # all is done
1059
1068
  return unified_result
1060
1069
  await asyncio.sleep(delay_amount)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: trd_utils
3
- Version: 0.0.38
3
+ Version: 0.0.40
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=lzE4YiavKv3llT5SHWvoplczINHqQzeBGtR2uujP0x4,25
1
+ trd_utils/__init__.py,sha256=ZRTONPZ09FvKvmWnvFvV0MPwkjZYpvKJIOR6OMxJ6GQ,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
@@ -12,7 +12,7 @@ trd_utils/exchanges/blofin/blofin_client.py,sha256=LAAbwXbA7nDxJZFwbXtaNsIZCayEy
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=91SRavPKyEKT0Y-LQkBUCgZbkgu97Ck66S61QBXbHJE,39838
15
+ trd_utils/exchanges/bx_ultra/bx_ultra_client.py,sha256=SKDak_Yb5FyE8or78--7bUiEi4qZfo7lgpK2j9yIjhI,40100
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
18
  trd_utils/exchanges/exchange_base.py,sha256=Zn5y4bymK53ENVLjYnQadS61SZKs8BGoZ4jfsY4GOcE,7835
@@ -31,7 +31,7 @@ trd_utils/tradingview/tradingview_client.py,sha256=g_eWYaCRQAL8Kvd-r6AnAdbH7Jha6
31
31
  trd_utils/tradingview/tradingview_types.py,sha256=z21MXPVdWHAduEl3gSeMIRhxtBN9yK-jPYHfZSMIbSA,6144
32
32
  trd_utils/types_helper/__init__.py,sha256=lLbUiW1jUV1gjzTMFLthwkvF0hwauH-F_J2JZq--1U0,67
33
33
  trd_utils/types_helper/base_model.py,sha256=dknzoq6iAUOb0n_yhI5mU3So-F_8d5ykGk3EbrERLnM,11763
34
- trd_utils-0.0.38.dist-info/LICENSE,sha256=J1EP2xt87RjjmsTV1jTjHDQMLIM9FjdwEftTpw8hyv4,1067
35
- trd_utils-0.0.38.dist-info/METADATA,sha256=1gOH-y_BZA28RAIOYf6Hn6TMBp03jUmeIBcYTDEJHSY,1179
36
- trd_utils-0.0.38.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
37
- trd_utils-0.0.38.dist-info/RECORD,,
34
+ trd_utils-0.0.40.dist-info/LICENSE,sha256=J1EP2xt87RjjmsTV1jTjHDQMLIM9FjdwEftTpw8hyv4,1067
35
+ trd_utils-0.0.40.dist-info/METADATA,sha256=ehMTpIDjp71E0O0N-SWS-E2e-YGsJvNW7EK0jIkPc_Y,1179
36
+ trd_utils-0.0.40.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
37
+ trd_utils-0.0.40.dist-info/RECORD,,