@@ -656,26 +656,30 @@ class EstimatedFee:
656
656
overall_fee : int
657
657
unit : PriceUnit
658
658
659
- def to_resource_bounds (self ) -> ResourceBoundsMapping :
659
+ def to_resource_bounds (
660
+ self , amount_multiplier = 1.5 , unit_price_multiplier = 1.5
661
+ ) -> ResourceBoundsMapping :
660
662
"""
661
663
Converts estimated fee to resource bounds with applied multipliers.
662
664
665
+ :param amount_multiplier: Multiplier for max amount, defaults to 1.5.
666
+ :param unit_price_multiplier: Multiplier for max price per unit, defaults to 1.5.
663
667
:return: Resource bounds with applied multipliers.
664
668
"""
665
669
666
670
l1_resource_bounds = ResourceBounds (
667
- max_amount = self .l1_gas_consumed ,
668
- max_price_per_unit = self .l1_gas_price ,
671
+ max_amount = int ( self .l1_gas_consumed * amount_multiplier ) ,
672
+ max_price_per_unit = int ( self .l1_gas_price * unit_price_multiplier ) ,
669
673
)
670
674
671
675
l2_resource_bounds = ResourceBounds (
672
- max_amount = self .l2_gas_consumed ,
673
- max_price_per_unit = self .l2_gas_price ,
676
+ max_amount = int ( self .l2_gas_consumed * amount_multiplier ) ,
677
+ max_price_per_unit = int ( self .l2_gas_price * unit_price_multiplier ) ,
674
678
)
675
679
676
680
l1_data_resource_bounds = ResourceBounds (
677
- max_amount = self .l1_data_gas_consumed ,
678
- max_price_per_unit = self .l1_data_gas_price ,
681
+ max_amount = int ( self .l1_data_gas_consumed * amount_multiplier ) ,
682
+ max_price_per_unit = int ( self .l1_data_gas_price * unit_price_multiplier ) ,
679
683
)
680
684
681
685
return ResourceBoundsMapping (
0 commit comments