diff --git a/py_order_utils/builders/order_builder.py b/py_order_utils/builders/order_builder.py index 88dec6a..065e2b0 100644 --- a/py_order_utils/builders/order_builder.py +++ b/py_order_utils/builders/order_builder.py @@ -59,7 +59,10 @@ def build_order_signature(self, _order: Order) -> str: """ Signs the order """ - return "0x" + self.sign(self._create_struct_hash(_order)) + sig = self.sign(self._create_struct_hash(_order)) + if len(sig) > 2 and sig[:2] != "0x": + sig = f"0x{sig}" + return sig def build_signed_order(self, data: OrderData) -> SignedOrder: """