Skip to content
This repository was archived by the owner on Apr 26, 2026. It is now read-only.

Commit 7f76426

Browse files
Copilottheshadow76
andcommitted
Fix check_order_result to prioritize completed orders and fix get_active_orders example
Co-authored-by: theshadow76 <59869868+theshadow76@users.noreply.github.com>
1 parent 89e245f commit 7f76426

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

examples/get_active_orders.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ async def main():
99
if orders:
1010
print("Active Orders:")
1111
for order in orders:
12-
print(f"Order ID: {order['id']}, Amount: {order['amount']}, Status: {order['status']}")
12+
print(f"Order ID: {order.order_id}, Amount: {order.amount}, Status: {order.status}")
1313
else:
1414
print("No active orders found.")
1515

pocketoptionapi_async/client.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -565,14 +565,14 @@ async def check_order_result(self, order_id: str) -> Optional[OrderResult]:
565565
Returns:
566566
OrderResult: Order result or None if not found
567567
"""
568-
# First check active orders
569-
if order_id in self._active_orders:
570-
return self._active_orders[order_id]
571-
572-
# Then check completed orders
568+
# First check completed orders (prioritize final results over active orders)
573569
if order_id in self._order_results:
574570
return self._order_results[order_id]
575571

572+
# Then check active orders
573+
if order_id in self._active_orders:
574+
return self._active_orders[order_id]
575+
576576
# Not found
577577
return None
578578

0 commit comments

Comments
 (0)