Skip to content

Commit

Permalink
Merge pull request #16 from Polymarket/fix/struct-changes
Browse files Browse the repository at this point in the history
Fix: updated market order builder
  • Loading branch information
JonathanAmenechi authored Feb 23, 2022
2 parents 08f066b + 68d03d5 commit 728ac37
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions py_order_utils/builders/market_order_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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"]
)
Expand Down
4 changes: 2 additions & 2 deletions py_order_utils/model/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="py_order_utils",
version="0.0.10",
version="0.0.11",
author="Jonathan Amenechi",
author_email="[email protected]",
description="Python utilities used to generate and sign limit and market orders on Polymarket's CLOB",
Expand Down

0 comments on commit 728ac37

Please sign in to comment.