diff --git a/src/fees/compute_fees.py b/src/fees/compute_fees.py index 3a8de0e..fae00d7 100644 --- a/src/fees/compute_fees.py +++ b/src/fees/compute_fees.py @@ -316,7 +316,7 @@ def get_all_data(self, tx_hash: HexBytes) -> SettlementData: for address, price in winning_sol["clearingPrices"].items() } native_prices = { - address: int(endpoint_data["auction"]["prices"][address.hex()]) + address: int(endpoint_data["auction"]["prices"][address.to_0x_hex()]) for address, _ in clearing_prices.items() } trades = [] @@ -364,7 +364,7 @@ def get_auction_data(self, tx_hash: HexBytes): for environment, url in self.orderbook_urls.items(): try: response = requests.get( - url + f"solver_competition/by_tx_hash/{tx_hash.hex()}", + url + f"solver_competition/by_tx_hash/{tx_hash.to_0x_hex()}", timeout=REQUEST_TIMEOUT, ) response.raise_for_status() @@ -373,11 +373,13 @@ def get_auction_data(self, tx_hash: HexBytes): except requests.exceptions.HTTPError as err: if err.response.status_code == 404: pass - raise ConnectionError(f"Error fetching off-chain data for tx {tx_hash.hex()}") + raise ConnectionError( + f"Error fetching off-chain data for tx {tx_hash.to_0x_hex()}" + ) def get_order_data(self, uid: HexBytes, environment: str): prefix = self.orderbook_urls[environment] - url = prefix + f"orders/{uid.hex()}" + url = prefix + f"orders/{uid.to_0x_hex()}" response = requests.get( url, timeout=REQUEST_TIMEOUT, @@ -390,7 +392,7 @@ def get_order_data(self, uid: HexBytes, environment: str): def get_trade_data(self, uid: HexBytes, tx_hash: HexBytes, environment: str): prefix = self.orderbook_urls[environment] - url = prefix + f"trades?orderUid={uid.hex()}" + url = prefix + f"trades?orderUid={uid.to_0x_hex()}" response = requests.get(url) trade_data_temp = response.json() for t in trade_data_temp: