Skip to content

Commit 3377d85

Browse files
pi314xxeroc
authored andcommitted
Update operations.py
1 parent fb83230 commit 3377d85

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

bitsharesbase/operations.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
Worker_initializer,
4646
isArgsThisClass,
4747
AssertPredicate,
48+
LimitOrderAutoAction,
4849
)
4950
from .operationids import operations
5051

@@ -1283,15 +1284,20 @@ def __init__(self, *args, **kwargs):
12831284
if len(args) == 1 and len(kwargs) == 0:
12841285
kwargs = args[0]
12851286

1287+
if kwargs.get("delta_amount_to_sell"):
1288+
delta_amount_to_sell = Optional(Asset(kwargs["delta_amount_to_sell"]))
1289+
else:
1290+
delta_amount_to_sell = Optional(None)
1291+
12861292
if kwargs.get("new_price"):
12871293
new_price = Optional(Price(kwargs["new_price"]))
12881294
else:
1289-
new_price = Optional(None)
1295+
new_price = Optional(None)
12901296

1291-
if kwargs.get("delta_amount_to_sell"):
1292-
delta_amount_to_sell = Optional(Asset(kwargs["delta_amount_to_sell"]))
1297+
if kwargs.get("on_fill"):
1298+
on_fill = Optional(Array([LimitOrderAutoAction(o) for o in kwargs["on_fill"]])),
12931299
else:
1294-
delta_amount_to_sell = Optional(None)
1300+
on_fill = Optional(None)
12951301

12961302
super().__init__(
12971303
OrderedDict(
@@ -1302,7 +1308,7 @@ def __init__(self, *args, **kwargs):
13021308
("new_price", new_price),
13031309
("delta_amount_to_sell", delta_amount_to_sell),
13041310
("new_expiration", Optional(None)),
1305-
("on_fill", Optional(None)),
1311+
("on_fill", on_fill),
13061312
("extensions", Set([])),
13071313
]
13081314
)

0 commit comments

Comments
 (0)