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 Felt
gasConsumed
private final Felt
gasPrice
private final Felt
dataGasConsumed
private final Felt
dataGasPrice
private final Felt
overallFee
private final PriceUnit
feeUnit
-
Method Summary
Modifier and Type Method Description final Felt
getGasConsumed()
final Felt
getGasPrice()
final Felt
getDataGasConsumed()
final Felt
getDataGasPrice()
final Felt
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
-
getGasConsumed
final Felt getGasConsumed()
-
getGasPrice
final Felt getGasPrice()
-
getDataGasConsumed
final Felt getDataGasConsumed()
-
getDataGasPrice
final Felt getDataGasPrice()
-
getOverallFee
final Felt 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 as maxAmount = overallFee / gasPrice, unless gasPrice is 0, then maxAmount is 0. Calculates max price per unit as maxPricePerUnit = gasPrice. Then multiplies maxAmount by round(amountMultiplier * 100%) and maxPricePerUnit by round(unitPriceMultiplier * 100%) and performs integer division by 100 on both.
- 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 as maxAmount = overallFee / gasPrice, unless gasPrice is 0, then maxAmount is 0. Calculates max price per unit as maxPricePerUnit = gasPrice. Then multiplies maxAmount by round(amountMultiplier * 100%) and maxPricePerUnit by round(unitPriceMultiplier * 100%) and performs integer division by 100 on both.
- 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 as maxAmount = overallFee / gasPrice, unless gasPrice is 0, then maxAmount is 0. Calculates max price per unit as maxPricePerUnit = gasPrice. Then multiplies maxAmount by round(amountMultiplier * 100%) and maxPricePerUnit by round(unitPriceMultiplier * 100%) and performs integer division by 100 on both.
-
-
-
-