|
1 | 1 | # |
2 | | -from typing import List |
| 2 | +from typing import List, Literal |
3 | 3 |
|
4 | 4 | from sidan_gin import Asset, UTxO |
5 | 5 |
|
6 | 6 | from deltadefi.api import API |
7 | 7 | from deltadefi.lib.utils import check_required_parameter, check_required_parameters |
| 8 | +from deltadefi.models.models import OrderStatusType |
8 | 9 | from deltadefi.responses import ( |
9 | 10 | BuildDepositTransactionResponse, |
10 | 11 | BuildWithdrawalTransactionResponse, |
@@ -71,15 +72,26 @@ def get_withdrawal_records(self, **kwargs) -> GetWithdrawalRecordsResponse: |
71 | 72 | url_path = "/withdrawal-records" |
72 | 73 | return self.send_request("GET", self.group_url_path + url_path, kwargs) |
73 | 74 |
|
74 | | - def get_order_records(self, **kwargs) -> GetOrderRecordResponse: |
| 75 | + def get_order_records( |
| 76 | + self, status: OrderStatusType, **kwargs |
| 77 | + ) -> GetOrderRecordResponse: |
75 | 78 | """ |
76 | 79 | Get order records. |
77 | 80 |
|
| 81 | + Args: |
| 82 | + status: The status of the order records to retrieve. It can be "openOrder", |
| 83 | + "orderHistory", or "tradingHistory". |
| 84 | + limit: Optional; The maximum number of records to return. Defaults to 10, max 250. |
| 85 | + page: Optional; The page number for pagination. Defaults to 1. |
| 86 | +
|
78 | 87 | Returns: |
79 | 88 | A GetOrderRecordResponse object containing the order records. |
80 | 89 | """ |
| 90 | + check_required_parameter(status, "status") |
| 91 | + payload = {"status": status, **kwargs} |
| 92 | + |
81 | 93 | url_path = "/order-records" |
82 | | - return self.send_request("GET", self.group_url_path + url_path, kwargs) |
| 94 | + return self.send_request("GET", self.group_url_path + url_path, payload) |
83 | 95 |
|
84 | 96 | def get_account_balance(self, **kwargs) -> GetAccountBalanceResponse: |
85 | 97 | """ |
|
0 commit comments