Class PayingForFeeCalculationModel
java.lang.Object
com.kryptokrauts.aeternity.sdk.service.transaction.fee.impl.PayingForFeeCalculationModel
- All Implemented Interfaces:
FeeCalculationModel
public class PayingForFeeCalculationModel extends java.lang.Object implements FeeCalculationModel
The fee is calculated according to the following formula
(BASE_GAS / 5 + byte_size(PayingForTx) - byte_size(InnerTx)) * GasPerByte
-
Constructor Summary
Constructors Constructor Description PayingForFeeCalculationModel()
-
Method Summary
Modifier and Type Method Description java.math.BigInteger
calculateFee(int tx_byte_size, long minimalGasPrice, AbstractTransaction<?> transaction)
Calculates the fee based on the calculation model if the calculation needs informations from the transaction object, they need to be passed via constructor of the fee calculation model implementation classMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
PayingForFeeCalculationModel
public PayingForFeeCalculationModel()
-
-
Method Details
-
calculateFee
public java.math.BigInteger calculateFee(int tx_byte_size, long minimalGasPrice, AbstractTransaction<?> transaction)Description copied from interface:FeeCalculationModel
Calculates the fee based on the calculation model if the calculation needs informations from the transaction object, they need to be passed via constructor of the fee calculation model implementation class- Specified by:
calculateFee
in interfaceFeeCalculationModel
- Parameters:
tx_byte_size
- transaction size in bytesminimalGasPrice
- minimal gas pricetransaction
- the tx-object- Returns:
- the actual fee
-