calculateMinFee method

Coin calculateMinFee({
  1. required ShelleyTransaction tx,
  2. Coin minFee = 0,
})

Because transaction size effects fees, this method should be called last, after all other ShelleyTransactionBody properties are set. if minFee is set, then this determines the lower minimum fee bound.

Implementation

Coin calculateMinFee({required ShelleyTransaction tx, Coin minFee = 0}) {
  Coin calculatedFee =
      _minFeeFunction(transaction: tx, linearFee: _linearFee);
  final fee = (calculatedFee < minFee) ? minFee : calculatedFee;
  return fee;
}