Class EstimateFeeResponse
-
- All Implemented Interfaces:
-
com.swmansion.starknet.data.types.StarknetResponse
@Serializable() public final class EstimateFeeResponse extends EstimateFeeCommon implements StarknetResponse
-
-
Field Summary
Fields Modifier and Type Field Description private final Uint64l1GasConsumedprivate final Uint128l1GasPriceprivate final Uint64l2GasConsumedprivate final Uint128l2GasPriceprivate final Uint64l1DataGasConsumedprivate final Uint128l1DataGasPriceprivate final Uint128overallFeeprivate final PriceUnitfeeUnit
-
Method Summary
Modifier and Type Method Description Uint64getL1GasConsumed()Uint128getL1GasPrice()Uint64getL2GasConsumed()Uint128getL2GasPrice()Uint64getL1DataGasConsumed()Uint128getL1DataGasPrice()Uint128getOverallFee()final PriceUnitgetFeeUnit()final FelttoMaxFee(Double multiplier)Convert estimated fee to max fee with applied multiplier. final FelttoMaxFee()Convert estimated fee to max fee with applied multiplier. final ResourceBoundsMappingtoResourceBounds(Double amountMultiplier, Double unitPriceMultiplier)Convert estimated fee to resource bounds with applied multipliers. final ResourceBoundsMappingtoResourceBounds(Double amountMultiplier)Convert estimated fee to resource bounds with applied multipliers. final ResourceBoundsMappingtoResourceBounds()Convert estimated fee to resource bounds with applied multipliers. -
-
Method Detail
-
getL1GasConsumed
Uint64 getL1GasConsumed()
-
getL1GasPrice
Uint128 getL1GasPrice()
-
getL2GasConsumed
Uint64 getL2GasConsumed()
-
getL2GasPrice
Uint128 getL2GasPrice()
-
getL1DataGasConsumed
Uint64 getL1DataGasConsumed()
-
getL1DataGasPrice
Uint128 getL1DataGasPrice()
-
getOverallFee
Uint128 getOverallFee()
-
getFeeUnit
final PriceUnit getFeeUnit()
-
toMaxFee
@JvmOverloads() final Felt toMaxFee(Double multiplier)
Convert estimated fee to max fee with applied multiplier.
Multiplies overallFee by round(multiplier * 100%) and performs integer division by 100.
- Parameters:
multiplier- Multiplier for max fee, defaults to 1.5.
-
toMaxFee
@JvmOverloads() final Felt toMaxFee()
Convert estimated fee to max fee with applied multiplier.
Multiplies overallFee by round(multiplier * 100%) and performs integer division by 100.
-
toResourceBounds
@JvmOverloads() final ResourceBoundsMapping toResourceBounds(Double amountMultiplier, Double unitPriceMultiplier)
Convert estimated fee to resource bounds with applied multipliers.
Calculates max amount of l1 gas as l1GasConsumed * amountMultiplier and max price per unit as l1GasPrice * unitPriceMultiplier. Calculates max amount of l2 gas as l2GasConsumed * amountMultiplier and max price per unit as l2GasPrice * unitPriceMultiplier. Calculates max amount of l1 data gas as l1DataGasConsumed * amountMultiplier and max price per unit as l1DataGasPrice * unitPriceMultiplier.
- Parameters:
amountMultiplier- Multiplier for max amount, defaults to 1.5.unitPriceMultiplier- Multiplier for max price per unit, defaults to 1.5.
-
toResourceBounds
@JvmOverloads() final ResourceBoundsMapping toResourceBounds(Double amountMultiplier)
Convert estimated fee to resource bounds with applied multipliers.
Calculates max amount of l1 gas as l1GasConsumed * amountMultiplier and max price per unit as l1GasPrice * unitPriceMultiplier. Calculates max amount of l2 gas as l2GasConsumed * amountMultiplier and max price per unit as l2GasPrice * unitPriceMultiplier. Calculates max amount of l1 data gas as l1DataGasConsumed * amountMultiplier and max price per unit as l1DataGasPrice * unitPriceMultiplier.
- Parameters:
amountMultiplier- Multiplier for max amount, defaults to 1.5.
-
toResourceBounds
@JvmOverloads() final ResourceBoundsMapping toResourceBounds()
Convert estimated fee to resource bounds with applied multipliers.
Calculates max amount of l1 gas as l1GasConsumed * amountMultiplier and max price per unit as l1GasPrice * unitPriceMultiplier. Calculates max amount of l2 gas as l2GasConsumed * amountMultiplier and max price per unit as l2GasPrice * unitPriceMultiplier. Calculates max amount of l1 data gas as l1DataGasConsumed * amountMultiplier and max price per unit as l1DataGasPrice * unitPriceMultiplier.
-
-
-
-