Class EstimateFeeResponse
-
- All Implemented Interfaces:
-
com.swmansion.starknet.data.types.StarknetResponse
@Serializable() public final class EstimateFeeResponse implements StarknetResponse
-
-
Field Summary
Fields Modifier and Type Field Description private final Uint64
l1GasConsumed
private final Uint128
l1GasPrice
private final Uint64
l2GasConsumed
private final Uint128
l2GasPrice
private final Uint64
l1DataGasConsumed
private final Uint128
l1DataGasPrice
private final Uint128
overallFee
private final PriceUnit
feeUnit
-
Method Summary
Modifier and Type Method Description final Uint64
getL1GasConsumed()
final Uint128
getL1GasPrice()
final Uint64
getL2GasConsumed()
final Uint128
getL2GasPrice()
final Uint64
getL1DataGasConsumed()
final Uint128
getL1DataGasPrice()
final Uint128
getOverallFee()
final PriceUnit
getFeeUnit()
final Felt
toMaxFee(Double multiplier)
Convert estimated fee to max fee with applied multiplier. final Felt
toMaxFee()
Convert estimated fee to max fee with applied multiplier. final ResourceBoundsMapping
toResourceBounds(Double amountMultiplier, Double unitPriceMultiplier)
Convert estimated fee to resource bounds with applied multipliers. final ResourceBoundsMapping
toResourceBounds(Double amountMultiplier)
Convert estimated fee to resource bounds with applied multipliers. final ResourceBoundsMapping
toResourceBounds()
Convert estimated fee to resource bounds with applied multipliers. -
-
Method Detail
-
getL1GasConsumed
final Uint64 getL1GasConsumed()
-
getL1GasPrice
final Uint128 getL1GasPrice()
-
getL2GasConsumed
final Uint64 getL2GasConsumed()
-
getL2GasPrice
final Uint128 getL2GasPrice()
-
getL1DataGasConsumed
final Uint64 getL1DataGasConsumed()
-
getL1DataGasPrice
final Uint128 getL1DataGasPrice()
-
getOverallFee
final 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.
-
-
-
-