1+ from typing import Optional , Any , Union
12from hiero_sdk_python .hapi .services import query_header_pb2 , transaction_get_record_pb2 , query_pb2
23from hiero_sdk_python .query .query import Query
34from hiero_sdk_python .response_code import ResponseCode
@@ -15,12 +16,12 @@ class TransactionRecordQuery(Query):
1516 Represents a query for a transaction record on the Hedera network.
1617 """
1718
18- def __init__ (self , transaction_id : TransactionId = None ):
19+ def __init__ (self , transaction_id : Optional [ TransactionId ] = None ):
1920 """
2021 Initializes the TransactionRecordQuery with the provided transaction ID.
2122 """
2223 super ().__init__ ()
23- self .transaction_id : TransactionId = transaction_id
24+ self .transaction_id : Optional [ TransactionId ] = transaction_id
2425
2526 def set_transaction_id (self , transaction_id : TransactionId ):
2627 """
@@ -86,7 +87,7 @@ def _get_method(self, channel: _Channel) -> _Method:
8687 query_func = channel .crypto .getTxRecordByTxID
8788 )
8889
89- def _should_retry (self , response ) :
90+ def _should_retry (self , response : Any ) -> _ExecutionState :
9091 """
9192 Determines whether the query should be retried based on the response.
9293
@@ -128,7 +129,7 @@ def _should_retry(self, response):
128129 else :
129130 return _ExecutionState .ERROR
130131
131- def _map_status_error (self , response ) :
132+ def _map_status_error (self , response : Any ) -> Union [ PrecheckError , ReceiptStatusError ] :
132133 """
133134 Maps a response status code to an appropriate error object.
134135
@@ -158,7 +159,7 @@ def _map_status_error(self, response):
158159 receipt = response .transactionGetRecord .transactionRecord .receipt
159160
160161 return ReceiptStatusError (status , self .transaction_id , TransactionReceipt ._from_proto (receipt ))
161-
162+
162163 def execute (self , client ):
163164 """
164165 Executes the transaction record query.
@@ -184,7 +185,7 @@ def execute(self, client):
184185
185186 return TransactionRecord ._from_proto (response .transactionGetRecord .transactionRecord , self .transaction_id )
186187
187- def _get_query_response (self , response ):
188+ def _get_query_response (self , response : Any ):
188189 """
189190 Extracts the transaction record response from the full response.
190191
0 commit comments