chore: revert unnecessary get_custom_data changes

This commit is contained in:
Axel-CH
2025-03-17 18:02:04 -04:00
parent 23187f0c41
commit 0c7a2747d3
2 changed files with 2 additions and 7 deletions

View File

@@ -1351,20 +1351,15 @@ class LocalTrade:
"""
CustomDataWrapper.set_custom_data(trade_id=self.id, key=key, value=value)
def get_custom_data(self, key: str, default: Any = None, retrieval_mode: str = "value") -> Any:
def get_custom_data(self, key: str, default: Any = None) -> Any:
"""
Get custom data for this trade.
:param key: key of the custom data
:param default: value to return if no data is found
:param retrieval_mode: 'value' (default) to return the custom data's value,
or 'object' to return the entire custom data object.
"""
data = CustomDataWrapper.get_custom_data(trade_id=self.id, key=key)
if data:
if retrieval_mode == "object":
return data[0]
# default behavior: return only the value
return data[0].value
return default

View File

@@ -1145,7 +1145,7 @@ class RPC:
for trade in trades:
# Depending on whether a specific key is provided, retrieve custom data accordingly.
if key:
data = trade.get_custom_data(key=key, retrieval_mode="object")
data = trade.get_custom_data_entry(key=key)
# If data exists, wrap it in a list so the output remains consistent.
custom_data = [data] if data else []
else: