Skip to content

Commit a4e4596

Browse files
committed
removed: verbose sidecar api logging
1 parent 1bca002 commit a4e4596

1 file changed

Lines changed: 17 additions & 17 deletions

File tree

sdks/python/pmxt/client.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ def fetch_markets(self, query: Optional[str] = None, **kwargs) -> List[UnifiedMa
336336
data = self._handle_response(response.to_dict())
337337
return [_convert_market(m) for m in data]
338338
except ApiException as e:
339-
raise Exception(f"Failed to fetch markets: {self._extract_api_error(e)}")
339+
raise Exception(f"Failed to fetch markets: {self._extract_api_error(e)}") from None
340340

341341
def fetch_events(self, query: Optional[str] = None, **kwargs) -> List[UnifiedEvent]:
342342
"""
@@ -383,7 +383,7 @@ def fetch_events(self, query: Optional[str] = None, **kwargs) -> List[UnifiedEve
383383
data = self._handle_response(response.to_dict())
384384
return [_convert_event(e) for e in data]
385385
except ApiException as e:
386-
raise Exception(f"Failed to fetch events: {self._extract_api_error(e)}")
386+
raise Exception(f"Failed to fetch events: {self._extract_api_error(e)}") from None
387387

388388
# ----------------------------------------------------------------------------
389389
# Filtering Methods
@@ -664,7 +664,7 @@ def fetch_ohlcv(
664664
data = self._handle_response(response.to_dict())
665665
return [_convert_candle(c) for c in data]
666666
except ApiException as e:
667-
raise Exception(f"Failed to fetch OHLCV: {self._extract_api_error(e)}")
667+
raise Exception(f"Failed to fetch OHLCV: {self._extract_api_error(e)}") from None
668668

669669
def fetch_order_book(self, outcome_id: str) -> OrderBook:
670670
"""
@@ -693,7 +693,7 @@ def fetch_order_book(self, outcome_id: str) -> OrderBook:
693693
data = self._handle_response(response.to_dict())
694694
return _convert_order_book(data)
695695
except ApiException as e:
696-
raise Exception(f"Failed to fetch order book: {self._extract_api_error(e)}")
696+
raise Exception(f"Failed to fetch order book: {self._extract_api_error(e)}") from None
697697

698698
def fetch_trades(
699699
self,
@@ -742,7 +742,7 @@ def fetch_trades(
742742
data = self._handle_response(response.to_dict())
743743
return [_convert_trade(t) for t in data]
744744
except ApiException as e:
745-
raise Exception(f"Failed to fetch trades: {self._extract_api_error(e)}")
745+
raise Exception(f"Failed to fetch trades: {self._extract_api_error(e)}") from None
746746

747747
# WebSocket Streaming Methods
748748

@@ -789,7 +789,7 @@ def watch_order_book(self, outcome_id: str, limit: Optional[int] = None) -> Orde
789789
data = self._handle_response(response.to_dict())
790790
return _convert_order_book(data)
791791
except ApiException as e:
792-
raise Exception(f"Failed to watch order book: {self._extract_api_error(e)}")
792+
raise Exception(f"Failed to watch order book: {self._extract_api_error(e)}") from None
793793

794794
def watch_trades(
795795
self,
@@ -842,7 +842,7 @@ def watch_trades(
842842
data = self._handle_response(response.to_dict())
843843
return [_convert_trade(t) for t in data]
844844
except ApiException as e:
845-
raise Exception(f"Failed to watch trades: {self._extract_api_error(e)}")
845+
raise Exception(f"Failed to watch trades: {self._extract_api_error(e)}") from None
846846

847847
def watch_prices(self, market_address: str, callback: Optional[Any] = None) -> Any:
848848
"""
@@ -872,7 +872,7 @@ def watch_prices(self, market_address: str, callback: Optional[Any] = None) -> A
872872

873873
return self._handle_response(response.to_dict())
874874
except ApiException as e:
875-
raise Exception(f"Failed to watch prices: {self._extract_api_error(e)}")
875+
raise Exception(f"Failed to watch prices: {self._extract_api_error(e)}") from None
876876

877877
def watch_user_positions(self, callback: Optional[Any] = None) -> List[Position]:
878878
"""
@@ -903,7 +903,7 @@ def watch_user_positions(self, callback: Optional[Any] = None) -> List[Position]
903903
data = self._handle_response(response.to_dict())
904904
return [_convert_position(p) for p in data]
905905
except ApiException as e:
906-
raise Exception(f"Failed to watch user positions: {self._extract_api_error(e)}")
906+
raise Exception(f"Failed to watch user positions: {self._extract_api_error(e)}") from None
907907

908908
def watch_user_transactions(self, callback: Optional[Any] = None) -> Any:
909909
"""
@@ -933,7 +933,7 @@ def watch_user_transactions(self, callback: Optional[Any] = None) -> Any:
933933

934934
return self._handle_response(response.to_dict())
935935
except ApiException as e:
936-
raise Exception(f"Failed to watch user transactions: {self._extract_api_error(e)}")
936+
raise Exception(f"Failed to watch user transactions: {self._extract_api_error(e)}") from None
937937

938938
# Trading Methods (require authentication)
939939

@@ -1002,7 +1002,7 @@ def create_order(
10021002
data = self._handle_response(response.to_dict())
10031003
return _convert_order(data)
10041004
except ApiException as e:
1005-
raise Exception(f"Failed to create order: {self._extract_api_error(e)}")
1005+
raise Exception(f"Failed to create order: {self._extract_api_error(e)}") from None
10061006

10071007
def cancel_order(self, order_id: str) -> Order:
10081008
"""
@@ -1032,7 +1032,7 @@ def cancel_order(self, order_id: str) -> Order:
10321032
data = self._handle_response(response.to_dict())
10331033
return _convert_order(data)
10341034
except ApiException as e:
1035-
raise Exception(f"Failed to cancel order: {self._extract_api_error(e)}")
1035+
raise Exception(f"Failed to cancel order: {self._extract_api_error(e)}") from None
10361036

10371037
def fetch_order(self, order_id: str) -> Order:
10381038
"""
@@ -1062,7 +1062,7 @@ def fetch_order(self, order_id: str) -> Order:
10621062
data = self._handle_response(response.to_dict())
10631063
return _convert_order(data)
10641064
except ApiException as e:
1065-
raise Exception(f"Failed to fetch order: {self._extract_api_error(e)}")
1065+
raise Exception(f"Failed to fetch order: {self._extract_api_error(e)}") from None
10661066

10671067
def fetch_open_orders(self, market_id: Optional[str] = None) -> List[Order]:
10681068
"""
@@ -1096,7 +1096,7 @@ def fetch_open_orders(self, market_id: Optional[str] = None) -> List[Order]:
10961096
data = self._handle_response(response.to_dict())
10971097
return [_convert_order(o) for o in data]
10981098
except ApiException as e:
1099-
raise Exception(f"Failed to fetch open orders: {self._extract_api_error(e)}")
1099+
raise Exception(f"Failed to fetch open orders: {self._extract_api_error(e)}") from None
11001100

11011101
# Account Methods
11021102

@@ -1125,7 +1125,7 @@ def fetch_positions(self) -> List[Position]:
11251125
data = self._handle_response(response.to_dict())
11261126
return [_convert_position(p) for p in data]
11271127
except ApiException as e:
1128-
raise Exception(f"Failed to fetch positions: {self._extract_api_error(e)}")
1128+
raise Exception(f"Failed to fetch positions: {self._extract_api_error(e)}") from None
11291129

11301130
def fetch_balance(self) -> List[Balance]:
11311131
"""
@@ -1154,7 +1154,7 @@ def fetch_balance(self) -> List[Balance]:
11541154
data = self._handle_response(response.to_dict())
11551155
return [_convert_balance(b) for b in data]
11561156
except ApiException as e:
1157-
raise Exception(f"Failed to fetch balance: {self._extract_api_error(e)}")
1157+
raise Exception(f"Failed to fetch balance: {self._extract_api_error(e)}") from None
11581158

11591159
def get_execution_price(
11601160
self,
@@ -1225,7 +1225,7 @@ def get_execution_price_detailed(
12251225
data = self._handle_response(data_json)
12261226
return _convert_execution_result(data)
12271227
except Exception as e:
1228-
raise Exception(f"Failed to get execution price: {self._extract_api_error(e)}")
1228+
raise Exception(f"Failed to get execution price: {self._extract_api_error(e)}") from None
12291229

12301230

12311231
class Polymarket(Exchange):

0 commit comments

Comments
 (0)