11#
2+ from typing import cast
23
34from sidan_gin import Asset , UTxO
45
@@ -43,7 +44,10 @@ def get_operation_key(self, **kwargs) -> GetOperationKeyResponse:
4344 """
4445
4546 url_path = "/operation-key"
46- return self .send_request ("GET" , self .group_url_path + url_path , kwargs )
47+ return cast (
48+ "GetOperationKeyResponse" ,
49+ self .send_request ("GET" , self .group_url_path + url_path , kwargs ),
50+ )
4751
4852 def create_new_api_key (self , ** kwargs ) -> CreateNewAPIKeyResponse :
4953 """
@@ -54,7 +58,10 @@ def create_new_api_key(self, **kwargs) -> CreateNewAPIKeyResponse:
5458 """
5559
5660 url_path = "/new-api-key"
57- return self .send_request ("GET" , self .group_url_path + url_path , kwargs )
61+ return cast (
62+ "CreateNewAPIKeyResponse" ,
63+ self .send_request ("GET" , self .group_url_path + url_path , kwargs ),
64+ )
5865
5966 def get_deposit_records (self , ** kwargs ) -> GetDepositRecordsResponse :
6067 """
@@ -64,7 +71,10 @@ def get_deposit_records(self, **kwargs) -> GetDepositRecordsResponse:
6471 A GetDepositRecordsResponse object containing the deposit records.
6572 """
6673 url_path = "/deposit-records"
67- return self .send_request ("GET" , self .group_url_path + url_path , kwargs )
74+ return cast (
75+ "GetDepositRecordsResponse" ,
76+ self .send_request ("GET" , self .group_url_path + url_path , kwargs ),
77+ )
6878
6979 def get_withdrawal_records (self , ** kwargs ) -> GetWithdrawalRecordsResponse :
7080 """
@@ -74,7 +84,10 @@ def get_withdrawal_records(self, **kwargs) -> GetWithdrawalRecordsResponse:
7484 A GetWithdrawalRecordsResponse object containing the withdrawal records.
7585 """
7686 url_path = "/withdrawal-records"
77- return self .send_request ("GET" , self .group_url_path + url_path , kwargs )
87+ return cast (
88+ "GetWithdrawalRecordsResponse" ,
89+ self .send_request ("GET" , self .group_url_path + url_path , kwargs ),
90+ )
7891
7992 def get_order_records (
8093 self , status : OrderStatusType , ** kwargs
@@ -95,7 +108,10 @@ def get_order_records(
95108 payload = {"status" : status , ** kwargs }
96109
97110 url_path = "/order-records"
98- return self .send_request ("GET" , self .group_url_path + url_path , payload )
111+ return cast (
112+ "GetOrderRecordsResponse" ,
113+ self .send_request ("GET" , self .group_url_path + url_path , payload ),
114+ )
99115
100116 def get_order_record (self , order_id : str , ** kwargs ) -> GetOrderRecordResponse :
101117 """
@@ -110,7 +126,10 @@ def get_order_record(self, order_id: str, **kwargs) -> GetOrderRecordResponse:
110126 check_required_parameter (order_id , "order_id" )
111127
112128 url_path = f"/order/{ order_id } "
113- return self .send_request ("GET" , self .group_url_path + url_path , kwargs )
129+ return cast (
130+ "GetOrderRecordResponse" ,
131+ self .send_request ("GET" , self .group_url_path + url_path , kwargs ),
132+ )
114133
115134 def get_account_balance (self , ** kwargs ) -> GetAccountBalanceResponse :
116135 """
@@ -120,7 +139,10 @@ def get_account_balance(self, **kwargs) -> GetAccountBalanceResponse:
120139 A GetAccountBalanceResponse object containing the account balance.
121140 """
122141 url_path = "/balance"
123- return self .send_request ("GET" , self .group_url_path + url_path , kwargs )
142+ return cast (
143+ "GetAccountBalanceResponse" ,
144+ self .send_request ("GET" , self .group_url_path + url_path , kwargs ),
145+ )
124146
125147 def build_deposit_transaction (
126148 self , deposit_amount : list [Asset ], input_utxos : list [UTxO ], ** kwargs
@@ -145,7 +167,10 @@ def build_deposit_transaction(
145167 }
146168
147169 url_path = "/deposit/build"
148- return self .send_request ("POST" , self .group_url_path + url_path , payload )
170+ return cast (
171+ "BuildDepositTransactionResponse" ,
172+ self .send_request ("POST" , self .group_url_path + url_path , payload ),
173+ )
149174
150175 def build_withdrawal_transaction (
151176 self , withdrawal_amount : list [Asset ], ** kwargs
@@ -164,7 +189,10 @@ def build_withdrawal_transaction(
164189 payload = {"withdrawal_amount" : withdrawal_amount , ** kwargs }
165190
166191 url_path = "/withdrawal/build"
167- return self .send_request ("POST" , self .group_url_path + url_path , payload )
192+ return cast (
193+ "BuildWithdrawalTransactionResponse" ,
194+ self .send_request ("POST" , self .group_url_path + url_path , payload ),
195+ )
168196
169197 def build_transferal_transaction (
170198 self , transferal_amount : list [Asset ], to_address : str , ** kwargs
@@ -179,8 +207,8 @@ def build_transferal_transaction(
179207 A BuildTransferalTransactionResponse object containing the built transferal transaction.
180208 """
181209
182- check_required_parameter (
183- transferal_amount , "transferal_amount" , to_address , "to_address"
210+ check_required_parameters (
211+ [[ transferal_amount , "transferal_amount" ], [ to_address , "to_address" ]]
184212 )
185213 payload = {
186214 "transferal_amount" : transferal_amount ,
@@ -189,7 +217,10 @@ def build_transferal_transaction(
189217 }
190218
191219 url_path = "/transferal/build"
192- return self .send_request ("POST" , self .group_url_path + url_path , payload )
220+ return cast (
221+ "BuildTransferalTransactionResponse" ,
222+ self .send_request ("POST" , self .group_url_path + url_path , payload ),
223+ )
193224
194225 def submit_deposit_transaction (
195226 self , signed_tx : str , ** kwargs
@@ -208,7 +239,10 @@ def submit_deposit_transaction(
208239 payload = {"signed_tx" : signed_tx , ** kwargs }
209240
210241 url_path = "/deposit/submit"
211- return self .send_request ("POST" , self .group_url_path + url_path , payload )
242+ return cast (
243+ "SubmitDepositTransactionResponse" ,
244+ self .send_request ("POST" , self .group_url_path + url_path , payload ),
245+ )
212246
213247 def submit_withdrawal_transaction (
214248 self , signed_tx : str , ** kwargs
@@ -227,7 +261,10 @@ def submit_withdrawal_transaction(
227261 payload = {"signed_tx" : signed_tx , ** kwargs }
228262
229263 url_path = "/withdrawal/submit"
230- return self .send_request ("POST" , self .group_url_path + url_path , payload )
264+ return cast (
265+ "SubmitWithdrawalTransactionResponse" ,
266+ self .send_request ("POST" , self .group_url_path + url_path , payload ),
267+ )
231268
232269 def submit_transferal_transaction (
233270 self , signed_tx : str , ** kwargs
@@ -246,4 +283,7 @@ def submit_transferal_transaction(
246283 payload = {"signed_tx" : signed_tx , ** kwargs }
247284
248285 url_path = "/transferal/submit"
249- return self .send_request ("POST" , self .group_url_path + url_path , payload )
286+ return cast (
287+ "SubmitTransferalTransactionResponse" ,
288+ self .send_request ("POST" , self .group_url_path + url_path , payload ),
289+ )
0 commit comments