Skip to content

Commit

Permalink
Update operations.py
Browse files Browse the repository at this point in the history
  • Loading branch information
pi314x authored Nov 18, 2023
1 parent 21d6b0d commit 3b0c8bd
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions bitsharesbase/operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -1281,15 +1281,20 @@ def __init__(self, *args, **kwargs):
if len(args) == 1 and len(kwargs) == 0:
kwargs = args[0]

if kwargs.get("new_price"):
new_price = Optional(Price(kwargs["new_price"]))
else:
new_price = Optional(None)

if kwargs.get("delta_amount_to_sell"):
delta_amount_to_sell = Optional(Asset(kwargs["delta_amount_to_sell"]))
else:
delta_amount_to_sell = Optional(None)

if kwargs.get("new_price"):
new_price = Optional(Price(kwargs["new_price"]))
if kwargs.get("new_expiration"):
new_expiration = Optional(PointInTime(kwargs["new_expiration"]))
else:
new_price = Optional(None)
new_expiration = Optional(None)

if kwargs.get("on_fill"):
on_fill = Optional(Array([LimitOrderAutoAction(o) for o in kwargs["on_fill"]])),
Expand All @@ -1304,7 +1309,7 @@ def __init__(self, *args, **kwargs):
("order", ObjectId(kwargs["order"], "limit_order")),
("new_price", new_price),
("delta_amount_to_sell", delta_amount_to_sell),
("new_expiration", Optional(None)),
("new_expiration", new_expiration),
("on_fill", on_fill),
("extensions", Set([])),
]
Expand Down

0 comments on commit 3b0c8bd

Please sign in to comment.