Skip to content

Commit

Permalink
(uJhin#54) feat: add side
Browse files Browse the repository at this point in the history
  • Loading branch information
seunggabi committed May 13, 2023
1 parent 0e2defd commit 85bdbba
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions client/python/upbit/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -523,12 +523,18 @@ def Order_cancel(self, **kwargs) -> dict:
future = self.__client.Order.Order_cancel(**kwargs)
return HTTPFutureExtractor.future_extraction(future)

def Order_cancel_all(self) -> dict:
result = []
def Order_cancel_all(self, side: str = None) -> dict:
args = {
"state": "wait"
}

if side:
args["side"] = side

result = []
while True:
waits = HTTPFutureExtractor.future_extraction(
self.__client.Order.Order_info_all(state="wait")
self.__client.Order.Order_info_all(**args)
)["result"]

if len(waits) == 0:
Expand Down

0 comments on commit 85bdbba

Please sign in to comment.