Skip to content

Commit

Permalink
Merge pull request #2 from seunggabi/feature/#54_cancel_all
Browse files Browse the repository at this point in the history
(uJhin#54) feat: add side
  • Loading branch information
seunggabi authored May 13, 2023
2 parents e0e9fe9 + 85bdbba commit 435610c
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 435610c

Please sign in to comment.