3838 PayoutFilter ,
3939)
4040from human_protocol_sdk .utils import (
41+ SubgraphRetryConfig ,
4142 get_data_from_subgraph ,
4243)
4344
@@ -219,10 +220,12 @@ class EscrowUtils:
219220 @staticmethod
220221 def get_escrows (
221222 filter : EscrowFilter ,
223+ retry_config : Optional [SubgraphRetryConfig ] = None ,
222224 ) -> List [EscrowData ]:
223225 """Get an array of escrow addresses based on the specified filter parameters.
224226
225227 :param filter: Object containing all the necessary parameters to filter
228+ :param retry_config: Optional retry behaviour for subgraph requests
226229
227230 :return: List of escrows
228231
@@ -283,6 +286,7 @@ def get_escrows(
283286 "skip" : filter .skip ,
284287 "orderDirection" : filter .order_direction .value ,
285288 },
289+ retry_config = retry_config ,
286290 )
287291
288292 if (
@@ -334,11 +338,13 @@ def get_escrows(
334338 def get_escrow (
335339 chain_id : ChainId ,
336340 escrow_address : str ,
341+ retry_config : Optional [SubgraphRetryConfig ] = None ,
337342 ) -> Optional [EscrowData ]:
338343 """Returns the escrow for a given address.
339344
340345 :param chain_id: Network in which the escrow has been deployed
341346 :param escrow_address: Address of the escrow
347+ :param retry_config: Optional retry behaviour for subgraph requests
342348
343349 :return: Escrow data
344350
@@ -373,6 +379,7 @@ def get_escrow(
373379 params = {
374380 "escrowAddress" : escrow_address .lower (),
375381 },
382+ retry_config = retry_config ,
376383 )
377384
378385 if (
@@ -414,11 +421,15 @@ def get_escrow(
414421 )
415422
416423 @staticmethod
417- def get_status_events (filter : StatusEventFilter ) -> List [StatusEvent ]:
424+ def get_status_events (
425+ filter : StatusEventFilter ,
426+ retry_config : Optional [SubgraphRetryConfig ] = None ,
427+ ) -> List [StatusEvent ]:
418428 """
419429 Retrieve status events for specified networks and statuses within a date range.
420430
421431 :param filter: Object containing all the necessary parameters to filter status events.
432+ :param retry_config: Optional retry behaviour for subgraph requests
422433
423434 :return List[StatusEvent]: List of status events matching the query parameters.
424435
@@ -447,6 +458,7 @@ def get_status_events(filter: StatusEventFilter) -> List[StatusEvent]:
447458 "skip" : filter .skip ,
448459 "orderDirection" : filter .order_direction .value ,
449460 },
461+ retry_config = retry_config ,
450462 )
451463
452464 if (
@@ -472,11 +484,15 @@ def get_status_events(filter: StatusEventFilter) -> List[StatusEvent]:
472484 return events_with_chain_id
473485
474486 @staticmethod
475- def get_payouts (filter : PayoutFilter ) -> List [Payout ]:
487+ def get_payouts (
488+ filter : PayoutFilter ,
489+ retry_config : Optional [SubgraphRetryConfig ] = None ,
490+ ) -> List [Payout ]:
476491 """
477492 Fetch payouts from the subgraph based on the provided filter.
478493
479494 :param filter: Object containing all the necessary parameters to filter payouts.
495+ :param retry_config: Optional retry behaviour for subgraph requests
480496
481497 :return List[Payout]: List of payouts matching the query parameters.
482498
@@ -508,6 +524,7 @@ def get_payouts(filter: PayoutFilter) -> List[Payout]:
508524 "skip" : filter .skip ,
509525 "orderDirection" : filter .order_direction .value ,
510526 },
527+ retry_config = retry_config ,
511528 )
512529
513530 if (
@@ -536,11 +553,13 @@ def get_payouts(filter: PayoutFilter) -> List[Payout]:
536553 @staticmethod
537554 def get_cancellation_refunds (
538555 filter : CancellationRefundFilter ,
556+ retry_config : Optional [SubgraphRetryConfig ] = None ,
539557 ) -> List [CancellationRefund ]:
540558 """
541559 Fetch cancellation refunds from the subgraph based on the provided filter.
542560
543561 :param filter: Object containing all the necessary parameters to filter cancellation refunds.
562+ :param retry_config: Optional retry behaviour for subgraph requests
544563
545564 :return List[CancellationRefund]: List of cancellation refunds matching the query parameters.
546565
@@ -572,6 +591,7 @@ def get_cancellation_refunds(
572591 "skip" : filter .skip ,
573592 "orderDirection" : filter .order_direction .value ,
574593 },
594+ retry_config = retry_config ,
575595 )
576596
577597 if (
@@ -601,13 +621,16 @@ def get_cancellation_refunds(
601621
602622 @staticmethod
603623 def get_cancellation_refund (
604- chain_id : ChainId , escrow_address : str
624+ chain_id : ChainId ,
625+ escrow_address : str ,
626+ retry_config : Optional [SubgraphRetryConfig ] = None ,
605627 ) -> CancellationRefund :
606628 """
607629 Returns the cancellation refund for a given escrow address.
608630
609631 :param chain_id: Network in which the escrow has been deployed
610632 :param escrow_address: Address of the escrow
633+ :param retry_config: Optional retry behaviour for subgraph requests
611634
612635 :return: CancellationRefund data or None
613636
@@ -641,6 +664,7 @@ def get_cancellation_refund(
641664 {
642665 "escrowAddress" : escrow_address .lower (),
643666 },
667+ retry_config = retry_config ,
644668 )
645669
646670 if (
0 commit comments