From 68d03d578c5f3aff498321b5673962bf48c160fb Mon Sep 17 00:00:00 2001 From: JonathanAmenechi <7217608+JonathanAmenechi@users.noreply.github.com> Date: Wed, 23 Feb 2022 12:37:06 -0500 Subject: [PATCH] fix: updated market order builder --- py_order_utils/builders/market_order_builder.py | 8 ++++---- py_order_utils/model/model.py | 4 ++-- setup.py | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/py_order_utils/builders/market_order_builder.py b/py_order_utils/builders/market_order_builder.py index 30bbbe0..cad3ac4 100644 --- a/py_order_utils/builders/market_order_builder.py +++ b/py_order_utils/builders/market_order_builder.py @@ -18,8 +18,8 @@ def build_market_order(self, data: MarketOrderData)-> MarketOrder: if not self._validate_inputs(data): raise ValidationException("Invalid market order inputs") - maker_asset_id = data.maker_asset_id if data.maker_asset_id is not None else "-1" - taker_asset_id = data.taker_asset_id if data.taker_asset_id is not None else "-1" + maker_asset_id = data.maker_asset_id if data.maker_asset_id is not None else -1 + taker_asset_id = data.taker_asset_id if data.taker_asset_id is not None else -1 signer = data.signer if data.signer is not None else data.maker_address @@ -64,9 +64,9 @@ def _normalize(self, mkt_order: MarketOrder): maker = mkt_order["maker"], makerAsset = mkt_order["makerAsset"], makerAmount = mkt_order["makerAmount"], - makerAssetID = mkt_order["makerAssetID"] if mkt_order["makerAssetID"] != "-1" else "0", + makerAssetID = mkt_order["makerAssetID"] if mkt_order["makerAssetID"] >= 0 else 0, takerAsset = mkt_order["takerAsset"], - takerAssetID = mkt_order["takerAssetID"] if mkt_order["takerAssetID"] != "-1" else "0", + takerAssetID = mkt_order["takerAssetID"] if mkt_order["takerAssetID"] >= 0 else 0, signer= mkt_order["signer"], sigType = mkt_order["sigType"] ) diff --git a/py_order_utils/model/model.py b/py_order_utils/model/model.py index e340d3b..549ab9d 100644 --- a/py_order_utils/model/model.py +++ b/py_order_utils/model/model.py @@ -71,9 +71,9 @@ class MarketOrderData: salt: int = None exchange_address: str = None maker_asset_address: str = None - maker_asset_id: str = None + maker_asset_id: int = None taker_asset_address: str = None - taker_asset_id: str = None + taker_asset_id: int = None maker_address: str = None maker_amount: int = None signer: str = None diff --git a/setup.py b/setup.py index 383c8f1..1163109 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setuptools.setup( name="py_order_utils", - version="0.0.10", + version="0.0.11", author="Jonathan Amenechi", author_email="jonathanamenechi@gmail.com", description="Python utilities used to generate and sign limit and market orders on Polymarket's CLOB",