Skip to content

Commit

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

def Order_cancel_all(self, **kwargs) -> list:
l = []

while True:
future = self.__client.Order.Order_info_all(state="wait")
waits = HTTPFutureExtractor.future_extraction(future)

if len(waits) == 0:
break

l.append(waits)

for w in waits:
future = self.__client.Order.Order_cancel(uuid=w["uuid"])

return l


class Trade:
"""
Expand Down

0 comments on commit 72af47e

Please sign in to comment.